调高SCN的方法

有的时候出于恢复或其他目的的需要,需要将现有的SCN提升。

在10g以前,一般使用event的方式:

SQL> ALTER SESSION SET events '10015 trace name adjust_scn level 1'; 
SESSION altered.

在MOUNT状态下运行上面的SQL,可以根据调整SCN的需要设置不同的LEVEL。此外还存在类似的方法:

ALTER system SET events 'immediate trace name adjust_scn level 10;

除了EVENT的设置外,还有一个隐藏参数也可以轻易的达到目标。使用_minimum_giga_scn参数,可以将SCN提高1G的倍数:

SQL> SELECT current_scn FROM v$database;
CURRENT_SCN
-----------
    5310856
SQL> ALTER system SET "_minimum_giga_scn" = 1 scope = spfile;
System altered.
SQL> shutdown immediate
DATABASE closed.
DATABASE dismounted.
ORACLE instance shut down.
SQL> startup
ORACLE instance started.
Total System Global Area  524288000 bytes
Fixed SIZE                  2097560 bytes
Variable SIZE             150998632 bytes
DATABASE Buffers          369098752 bytes
Redo Buffers                2093056 bytes
DATABASE mounted.
DATABASE opened.
SQL> SELECT current_scn FROM v$database;
CURRENT_SCN
-----------
 1073741909
SQL> SELECT * FROM v$version;
BANNER
----------------------------------------------------------------
Oracle DATABASE 10g Enterprise Edition Release 10.2.0.5.0 - 64bi
PL/SQL Release 10.2.0.5.0 - Production
CORE    10.2.0.5.0      Production
TNS FOR Linux: Version 10.2.0.5.0 - Production
NLSRTL Version 10.2.0.5.0 - Production

使用这种方法,就可以轻易的提升SCN到指定大小。

This entry was posted in NEWS and tagged , , , . Bookmark the permalink.

Leave a Reply

Your email address will not be published. Required fields are marked *