Syntax
SCN_TO_TIMESTAMP(number)
Purpose
SCN_TO_TIMESTAMP() returns the timestamp associated with a system change number (SCN), which is the input argument of this function. 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 synchronization status of log streams. The max_scn field in the table is of the SCN type. You can call the SCN_TO_TIMESTAMP() function to convert the SCN to a timestamp.