_max_reasonable_scn_rate
: select instVal.ksppstvl instance_value from x$ksppi param join x$ksppsv instVal on param.indx = instVal.indx and param.inst_id = instVal.inst_id where param.inst_id = userenv('instance') and param.ksppinm = '_max_reasonable_scn_rate';
_low_scn_headroom_warning_threshold_days
(low SCN headroom warning threshold in days) seems to indicate that is possible to be warned when head room becomes tight. v$…
) and the data dictionary, the columns that store SCNs seem to have the form %CHANGE%#
. Thus, they can be queried with select distinct viw.view_name, viw.column_name, -- viw.table_name, com.comments from ( select col.owner, regexp_replace( regexp_replace( regexp_replace(col.table_name, '^AWR_[CP]DB_', 'AWR_xDB_') , '^G?V_\$' , 'V$' ) , '^(DBA|CDB)_' , 'DBA_' ) view_name, col.table_name, col.column_name from dba_tab_columns col join dba_objects obj on col.owner = obj.owner and col.table_name = obj.Object_name where obj.object_type not in ('SYNONYM') and col.column_name like '%CHANGE%#' ) viw left join dba_col_comments com on viw.owner = com.owner and viw.table_name = com.table_name and viw.column_name = com.column_name order by viw.view_name, viw.column_name
select dbms_flashback.get_system_change_number from dual;
current_scn
in gv$database
. This view also provides some other interesting events that are associated with an SCN: select db_unique_name, dbid, current_scn, checkpoint_change#, archive_change#, controlfile_change#, archivelog_change# from gv$database;
x$ksmfsv
exhibits a list of pointers that point to values. We're interested in kcsgscn_
: select addr addr_of_pointer, ksmfsadr addr_of_SCN_value_hex, to_number(ksmfsadr, rpad('x', 16, 'x')) addr_of_SCN_value_int, ksmfssiz, ksmfstyp from x$ksmfsv fixed_variables where ksmfsnam = 'kcsgscn_' -- SCN ;
x$ksmmem
, a fixed table which gives direct access to the memory of the fixed SGA: select to_number(ksmmmval, 'XXXXXXXXXXXXXXXX') as current_scn from x$ksmmem where addr=hextoraw('00007FF718801D20');
select
statements but the join crashed the session. x$kccdi
(kernel cache database information?), the same fixed table that also v$database
queries from: select dicur_scn as current_SCN from x$kccdi;
flashback database
allows to rewind a database to a given SCN. scn_to_timestamp
returns the approximate timestamp at which an SCN was generated. sys.smon_scn_time
(and potentially MOS note 837812.1). ora_rowscn
.