Purpose
The SCN_TO_TIMESTAMP() function takes an SCN as input and returns the timestamp associated with that SCN. The return value is of the TIMESTAMP data type.
Syntax
SCN_TO_TIMESTAMP(number)
Examples
obclient> SELECT MAX_SCN, SCN_TO_TIMESTAMP(MAX_SCN) FROM gv$ob_log_stat;
+---------------------+---------------------------------+
| MAX_SCN | SCN_TO_TIMESTAMP(MAX_SCN) |
+---------------------+---------------------------------+
| 1676966094432030402 | 21-FEB-23 03.54.54.432030402 PM |
| 1676966094299077583 | 21-FEB-23 03.54.54.299077583 PM |
+---------------------+---------------------------------+
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 is used to convert the SCN to a timestamp.
