[20181123]快速提升scn注意.txt
[20181123]快速提升scn注意.txt
--//有時候修復oracle資料庫,需要提升scn號,現在許多方法不能再用,最快的方式適用oradebug修改kcsgscn_地址內容.
--//今天做這方面測試遇到一些問題,應該引起注意,特別scn_wrap>0的情況下.做一個記錄.
1.環境:
SYS@book> @ ver1
PORT_STRING VERSION BANNER
------------------------------ -------------- --------------------------------------------------------------------------------
x86_64/Linux 2.4.xx 11.2.0.4.0 Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production
SYS@book> set numw 12
SYS@book> select current_scn from v$database ;
CURRENT_SCN
------------
13813808388
SYS@book> @ tx 13813808388 32
select 13813808388,trunc(13813808388/power(2,32)) scn_wrap,mod(13813808388,power(2,32)) scn_base from dual
13813808388 SCN_WRAP SCN_BASE SCN_WRAP16 SCN_BASE16
------------ ------------ ------------ ---------- ----------
13813808388 3 928906500 3 375dfd04
SYS@book> oradebug setmypid
Statement processed.
SYS@book> oradebug DUMPvar SGA kcsgscn_
kcslf kcsgscn_ [06001AE70, 06001AEA0) = 375DFD2F 00000003 00000000 00000000 00000063 00000000 00000000 00000000 00000000 00000000 6001AB50 00000000
--//scn_wrap=3
2.千萬不要一次修改完成.
--//實際上scn佔48位.
SYS@book> shutdown immediate ;
Database closed.
Database dismounted.
ORACLE instance shut down.
SYS@book> startup mount
ORACLE instance started.
Total System Global Area 643084288 bytes
Fixed Size 2255872 bytes
Variable Size 205521920 bytes
Database Buffers 427819008 bytes
Redo Buffers 7487488 bytes
Database mounted.
SYS@book> oradebug setmypid
Statement processed.
SYS@book> oradebug DUMPvar SGA kcsgscn_
kcslf kcsgscn_ [06001AE70, 06001AEA0) = 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 6001AB50 00000000
--//在mount狀態看到是0.如果這樣修改:
SYS@book> oradebug poke 0x06001AE70 8 0x375DFD2F00000003
BEFORE: [06001AE70, 06001AE78) = 00000000 00000000
AFTER: [06001AE70, 06001AE78) = 00000003 375DFD2F
SYS@book> oradebug DUMPvar SGA kcsgscn_
kcslf kcsgscn_ [06001AE70, 06001AEA0) = 00000003 375DFD2F 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 6001AB50 00000000
--//對比前面,可以發現實際上scn_wrap=0xFD2F,scn_base=0x00000003.這樣scn提升太快了.
SYS@book> alter database open ;
alter database open
*
ERROR at line 1:
ORA-03113: end-of-file on communication channel
Process ID: 54638
Session ID: 274 Serial number: 3
--//資料庫根本無法開啟.alert.log報如下錯誤:
Completed: ALTER DATABASE MOUNT
Fri Nov 23 10:41:19 2018
alter database open
Fri Nov 23 10:41:19 2018
LGWR: STARTING ARCH PROCESSES
Fri Nov 23 10:41:19 2018
ARC0 started with pid=22, OS id=54655
ARC0: Archival started
LGWR: STARTING ARCH PROCESSES COMPLETE
ARC0: STARTING ARCH PROCESSES
Fri Nov 23 10:41:20 2018
ARC1 started with pid=23, OS id=54657
Errors in file /u01/app/oracle/diag/rdbms/book/book/trace/book_lgwr_54618.trc (incident=2281965):
ORA-00600: internal error code, arguments: [2252], [64815], [4], [3787], [3407085568], [], [], [], [], [], [], []
Incident details in: /u01/app/oracle/diag/rdbms/book/book/incident/incdir_2281965/book_lgwr_54618_i2281965.trc
Use ADRCI or Support Workbench to package the incident.
See Note 411.1 at My Oracle Support for error and packaging details.
Errors in file /u01/app/oracle/diag/rdbms/book/book/trace/book_lgwr_54618.trc:
ORA-00600: internal error code, arguments: [2252], [64815], [4], [3787], [3407085568], [], [], [], [], [], [], []
LGWR (ospid: 54618): terminating the instance due to error 470
Fri Nov 23 10:41:20 2018
System state dump requested by (instance=1, osid=54618 (LGWR)), summary=[abnormal instance termination].
System State dumped to trace file /u01/app/oracle/diag/rdbms/book/book/trace/book_diag_54604_20181123104120.trc
Dumping diagnostic data in directory=[cdmp_20181123104120], requested by (instance=1, osid=54618 (LGWR)), summary=[abnormal instance termination].
Instance terminated by LGWR, pid = 54618
3.必須分2次完成修改:
SYS@book> startup mount
ORACLE instance started.
Total System Global Area 643084288 bytes
Fixed Size 2255872 bytes
Variable Size 205521920 bytes
Database Buffers 427819008 bytes
Redo Buffers 7487488 bytes
Database mounted.
SYS@book> oradebug setmypid
Statement processed.
SYS@book> oradebug DUMPvar SGA kcsgscn_
kcslf kcsgscn_ [06001AE70, 06001AEA0) = 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 6001AB50 00000000
SYS@book> oradebug poke 0x06001AE70 4 0x376DFD2F
BEFORE: [06001AE70, 06001AE74) = 00000000
AFTER: [06001AE70, 06001AE74) = 376DFD2F
SYS@book> oradebug poke 0x06001AE74 2 0x0003
BEFORE: [06001AE74, 06001AE78) = 00000000
AFTER: [06001AE74, 06001AE78) = 00000003
SYS@book> oradebug DUMPvar SGA kcsgscn_
kcslf kcsgscn_ [06001AE70, 06001AEA0) = 376DFD2F 00000003 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 6001AB50 00000000
--//如下修改1個位元組也可以.
SYS@book> oradebug poke 0x06001AE74 1 0x03
BEFORE: [06001AE74, 06001AE78) = 00000003
AFTER: [06001AE74, 06001AE78) = 00000003
SYS@book> oradebug DUMPvar SGA kcsgscn_
kcslf kcsgscn_ [06001AE70, 06001AEA0) = 376DFD2F 00000003 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 6001AB50 00000000
--//你可以發現等號後面實際上反過來排列,估計與intel endian有關.
--//補充一些測試:
SYS@book> oradebug poke 0x06001AE77 1 0x03
BEFORE: [06001AE74, 06001AE78) = 00000003
AFTER: [06001AE74, 06001AE78) = 03000003
SYS@book> oradebug DUMPvar SGA kcsgscn_
kcslf kcsgscn_ [06001AE70, 06001AEA0) = 376DFD2F 03000003 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 6001AB50 00000000
--//你可以發現0x06001AE77地址的內容,顯示實際上開頭.
SYS@book> oradebug poke 0x06001AE77 1 0x00
BEFORE: [06001AE74, 06001AE78) = 03000003
AFTER: [06001AE74, 06001AE78) = 00000003
SYS@book> oradebug DUMPvar SGA kcsgscn_
kcslf kcsgscn_ [06001AE70, 06001AEA0) = 376DFD2F 00000003 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 6001AB50 00000000
SYS@book> alter database open ;
Database altered.
SYS@book> set numw 12
SYS@book> select current_scn from v$database ;
CURRENT_SCN
------------
13814857318
--//實際上修改後仔細再看看,這些細節錯誤都很容易避免.
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/267265/viewspace-2221324/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- [20181123]模擬ora-01555.txt
- [20181123]關於降序索引問題.txt索引
- [20210409]關於X$KCCDI的scn資訊.txt
- [20220121]windows使用grep注意.txtWindows
- [20210408]使用linux find注意.txtLinux
- 【SCN】Oracle SCN 詳細介紹Oracle
- 【SCN】Oracle推薦scn命令參考Oracle
- 【SCN】Oracle檢查scn值指令碼Oracle指令碼
- [20190430]注意sql hint寫法.txtSQL
- Oracle:SCNOracle
- 每週分享第 3 期(20181123)
- [20190314]使用strace注意的問題.txt
- 快速匯出requestment.txt
- [20230130]toad看執行計劃注意.txt
- [20200718]注意sql hint寫法2.txtSQL
- [20180529]克隆資料庫與dblinks注意.txt資料庫
- UI小白如何快速提升自己UI
- Oracle SCN詳解Oracle
- ORACLE -詳解SCNOracle
- 透過修改控制檔案scn推進資料庫scn資料庫
- [20191230]注意設定SYNC_HWCLOCK=yes.txt
- [20210330]bash使用source or ..呼叫shell指令碼注意txt指令碼
- [20190107]12c以上版本配置dg注意.txt
- 如何快速提升自己硬實力
- Oracle的DBMS_SCN修正以及SCN的auto-rollover新特性Oracle
- oracle的scn及sequenceOracle
- 深入瞭解SCN(轉)
- [20190510]快速建立執行指令碼.txt指令碼
- [20190403]linux快速進入目錄.txtLinux
- [20230425]注意snapshot standby與activate standby的區別.txt
- [20190527]注意表與索引的並行屬性.txt索引並行
- 如何快速提升你的技術能力
- 如何使用 CatBoost 進行快速梯度提升梯度
- [20190815]索引快速全掃描的成本.txt索引
- [20201218]快速替代查詢dba_extents.txt
- [20210107]快速進入目錄2.txt
- [20190523]修改引數後一些細節注意.txt
- 【等待事件】standby query scn advance事件