Syntax statement
SCN_TO_TIMESTAMP(number)
Description
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 log synchronization status of log streams. Its max_scn field is of type SCN, which is converted to a timestamp using the SCN_TO_TIMESTAMP() function.