Skip to main content
Version: V1.0.0

SCN_TO_TIMESTAMP

Syntax

SCN_TO_TIMESTAMP(number)

Description

The SCN_TO_TIMESTAMP() function converts a specified SCN to a timestamp. The return value is of the DATETIME type.

Examples

SELECT MAX_SCN, SCN_TO_TIMESTAMP(MAX_SCN) FROM oceanbase.gv$ob_log_stat;
+---------------------+----------------------------+
| MAX_SCN | SCN_TO_TIMESTAMP(MAX_SCN) |
+---------------------+----------------------------+
| 1766126752210029000 | 2025-12-19 14:45:52.210029 |
+---------------------+----------------------------+
1 row in set (0.001 sec)
info

The oceanbase.gv$ob_log_stat view is an internal view that displays the log synchronization status of a log stream. The max_scn field in this view is of the SCN type, and the SCN_TO_TIMESTAMP() function is used to convert the SCN to a timestamp.