Home » RDBMS Server » Server Administration » Where I can get the current system change number?
Where I can get the current system change number? [message #50311] Mon, 11 March 2002 03:21 Go to next message
Anatol
Messages: 15
Registered: January 2002
Junior Member
I need the scn - where possible to get him?
Re: Where I can get the current system change number? [message #50319 is a reply to message #50311] Mon, 11 March 2002 09:10 Go to previous message
Mahesh Rajendran
Messages: 10707
Registered: March 2002
Location: oracleDocoVille
Senior Member
Account Moderator
to get the 'current' scn, issue the following query:

select max(start_scnb) from v$transaction;

which returns the highest SCN as of the start of any active transaction (this however ignores the overflow column 'start_scnw')

to get the current session's scn, issue the following query:

select
s.sid
, t.start_scnb
, t.start_scnw
from
v$session s
, v$transaction t
where
s.saddr = t.ses_addr
and
s.sid = ( select distinct sid from v$mystat );

i'm not sure if the current session id is visible in any other V$ views (which may improve on using a subquery and select distinct to retrieve it)
Previous Topic: Re: CAN U PLZ TELL ME FULL FORM OF ORACLE
Next Topic: How do I get rid of a DEFAULT value on a column
Goto Forum:
  


Current Time: Mon Jul 08 11:04:10 CDT 2024