Syntax
SCN_TO_TIMESTAMP(number)
Purpose
The SCN_TO_TIMESTAMP() function takes an SCN as a parameter and returns the timestamp associated with that SCN. The return value is of the DATETIME type.
Examples
obclient [oceanbase]> SELECT MAX_SCN, SCN_TO_TIMESTAMP(MAX_SCN) FROM gv$ob_log_stat;
+---------------------+----------------------------+
| MAX_SCN | SCN_TO_TIMESTAMP(MAX_SCN) |
+---------------------+----------------------------+
| 1676966395664862550 | 2023-02-21 15:59:55.664862 |
| 1676966395664862550 | 2023-02-21 15:59:55.664862 |
+---------------------+----------------------------+
2 rows in set
Note
gv$ob_log_stat is an internal table that displays the status of log stream synchronization. The max_scn field is of the SCN type, and the SCN_TO_TIMESTAMP() function converts the SCN to a timestamp.
