Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Mailing Lists -> Oracle-L -> Re: Current SCN number.

Re: Current SCN number.

From: Tanel Põder <tanel.poder.003_at_mail.ee>
Date: Fri, 12 May 2006 22:30:48 +0800
Message-ID: <027c01c675d0$abfb7a70$6f01a8c0@porgand>

In 8i where there's no dbms_flashback nor v$database.current_scn info, one could read the current SCN ouf from SGA memory directly. The following example displays SCN with all three mentioned techniques on a 32bit environment. )In 64bit environment the script would be even simpler as all 8 bytes of SCN are accessible on one word-size line from X$KSMMEM).

SQL> select ksmfsadr from x$ksmfsv where ksmfsnam = 'kcsgscn_';

KSMFSADR



20009104

SQL> l
  1 select dbms_flashback.get_system_change_number flashback_scn,

  2         current_scn,
  3         (select to_number(ksmmmval,'XXXXXXXX')
  4         from x$ksmmem where addr = hextoraw('20009104')) * power(2,32) +
  5         (select to_number(ksmmmval,'XXXXXXXX')
  6         from x$ksmmem where addr = hextoraw('20009108')) direct_scn
  7* from v$database
SQL> / FLASHBACK_SCN CURRENT_SCN DIRECT_SCN
------------- ----------- ----------

      2633692 2633692 2633692

The SCN lives in fixed part of SGA, thus its location doesn't change over instance bounces or SGA size changes. It might change only if you relink Oracle binary or change SGA mapped base address.

Tanel.

> current_scn in V$DATABASE in 10g?
>
>
>
> On 5/11/06, Jared Still <jkstill_at_gmail.com> wrote:
>> http://www.google.com/search?hl=en&q=get+current+scn&btnG=Google+Search
>>
>>
>> On 5/11/06, Prabhu, K <prabhu_adam_at_hotmail.com> wrote:
>> >
>> >
>> >
>> >
>> > List,
>> >
>> >
>> >
>> > How to get current SCN number other than using dbms_flashback package.
>> >
>> >
>> >
>> > Thanks for your advice.
>> >
>> >
>> >
>> > Thanks
>> >
>> >
>> > Prabhu.
>> >
>> >
>> >
>> > ________________________________
>> Express yourself instantly with MSN Messenger! MSN Messenger
>> >
>> >
>>
>>
>>
>> --
>> Jared Still
>> Certifiable Oracle DBA and Part Time Perl Evangelist
>>
>
>
> --
> Niall Litchfield
> Oracle DBA
> http://www.orawin.info
> --
> http://www.freelists.org/webpage/oracle-l
>
>

--
http://www.freelists.org/webpage/oracle-l
Received on Fri May 12 2006 - 09:30:48 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US