Oracle 12c SCN推进之EVENT
1,查看当前SCN
SQL> select current_scn from v$database;CURRENT_SCN----------- 5100732SQL> shutdown immediateDatabase closed.Database dismounted.ORACLE instance shut down.SQL> quitDisconnected from Oracle Database 12c Enterprise Edition Release 12.2.0.1.0 - 64bit Production |
2,修改pfile,添加参数
[oracle@devin-enmo script]$ vi /u01/app/oracle/product/12.2/dbhome_1/dbs/inithkora.ora _allow_resetlogs_corruption=true*.event="21307096 trace name context forever, level 5"--event推进是以百万位单位推进,这里level 5即SCN推进500W |
3,PFILE启动
--重新从pfile启动数据库,并用resetlogs方式open:[oracle@devin-enmo script]$ sqlplus / as sysdbaSQL*Plus: Release 12.2.0.1.0 Production on Mon Feb 1 14:17:21 2021Copyright (c) 1982, 2016, Oracle. All rights reserved.Connected to an idle instance.SQL> startup mount pfile='/u01/app/oracle/product/12.2/dbhome_1/dbs/inithkora.ora'ORACLE instance started.Total System Global Area 268435456 bytesFixed Size 8619496 bytesVariable Size 201329176 bytesDatabase Buffers 50331648 bytesRedo Buffers 8155136 bytesDatabase mounted.SQL> recover database using backup controlfile until cancel;ORA-00279: change 5106151 generated at 02/01/2021 14:16:20 needed for thread 1ORA-00289: suggestion : /u01/app/oracle/fast_recovery_area/1_1_1063364001.dbfORA-00280: change 5106151 for thread 1 is in sequence #1Specify log: {<RET>=suggested | filename | AUTO | CANCEL}cancelMedia recovery cancelled.SQL> alter database open resetlogs;Database altered.--OPEN过程会耗时比较长,level的级别越高,耗时约长,具体计算方法见文末。 |
4,验证
SQL> select current_scn from v$database;CURRENT_SCN----------- 10106627--推进了约500W |
根据LEVEL值不一样,数据库OPEN耗时也不一样,计算公式:
level 1 Elapsed: 00:01:02.35 level 2 Elapsed: 00:02:16.23 level 6 Elapsed: 00:06:08.05 In general: based on a 16k per second scn rate (16K/sec) , the open resetlogs timewould be at least (event level * 1000000 / 16000) seconds. Then level 1 would be at least 62+ seconds and level 4095 would be 71+ hours !. |
来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/69992224/viewspace-2755290/
------道不行,乘桴浮于海!------
------欲讷于言,而敏于行!-------

浙公网安备 33010602011771号