Home » SQL & PL/SQL » SQL & PL/SQL » How can i get recent commit scn?
How can i get recent commit scn? [message #381069] Thu, 15 January 2009 02:45 Go to next message
dgtianpu
Messages: 2
Registered: January 2009
Junior Member
hi,
How can I get recent commit scn?Despite throught inquiry x$ktuqqry ,but x$ktuqqry is so large that I cant get the recent commit scn right now (10 minutes or so).
how can i spend a little time on getting recent commit scn ?thanks a lot
Re: How can i get recent commit scn? [message #381070 is a reply to message #381069] Thu, 15 January 2009 02:47 Go to previous messageGo to next message
Michel Cadot
Messages: 64132
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
v$database.current_scn
dbms_flashback.get_system_change_number

Regards
Michel
Re: How can i get recent commit scn? [message #381152 is a reply to message #381069] Thu, 15 January 2009 07:55 Go to previous messageGo to next message
dgtianpu
Messages: 2
Registered: January 2009
Junior Member
Thanks for Michel Cadot's reply!yet dbms_flashback.get_system_change_number、v$database.CURRENT_SCN is not a commit scn of a transaction but a current scn ;I want to inquery a commit scn when I have committed a recent transaction.the commit scn must be writen in redo file,how can i get it from a view or v$table?recent commit scn in particular?
Re: How can i get recent commit scn? [message #381154 is a reply to message #381152] Thu, 15 January 2009 07:59 Go to previous messageGo to next message
Michel Cadot
Messages: 64132
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
These are the only information you can get.

Regards
Michel
Re: How can i get recent commit scn? [message #381182 is a reply to message #381152] Thu, 15 January 2009 10:05 Go to previous messageGo to next message
JRowbottom
Messages: 5933
Registered: June 2006
Location: Sunny North Yorkshire, ho...
Senior Member
If you like undocumented features, you could use userenv('commitscn') whose many peculiarities are detailed here

If you want the most recent SCN to affect a row in a table, you can use ORA_ROWSCN (detailed here

If you just want the most recent SCN, you can get it from v$database: SELECT CURRENT_SCN FROM V$DATABASE;

Re: How can i get recent commit scn? [message #381308 is a reply to message #381182] Fri, 16 January 2009 04:33 Go to previous message
JRowbottom
Messages: 5933
Registered: June 2006
Location: Sunny North Yorkshire, ho...
Senior Member
Actually, can you describe what a non-commit SCN would be?

From the Concepts manual:
Quote:
system change number (SCN)

A stamp that defines a committed version of a database at a point in time. Oracle assigns every committed transaction a unique SCN.
Previous Topic: how to get latest row if the two or more rows have the same Id
Next Topic: Oracle Queues
Goto Forum:
  


Current Time: Thu Dec 08 00:37:46 CST 2016

Total time taken to generate the page: 0.11229 seconds