问题:
ORA-00600: 内部错误代码, 参数: [kcratr_nab_less_than_odr], [1], [196495], [39399], [39460], [], [], [], [], [], [], []
导致原因:可能是由于服务器宕机,控制文件的缺失,或者在线日志文件在实例恢复时不完整
1、数据库未归档,未备份,没法rman还原
2、数据库可以起到mount状态
3、trace日志 alert_orcl.log日志
根据日志找到 orcl_ora_7268.trc文件日志
Trace file e:\app\administrator\diag\rdbms\orcl\orcl\trace\orcl_ora_7268.trc
Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
Windows NT Version V6.1 Service Pack 1
CPU : 24 - type 8664, 12 Physical Cores
Process Affinity : 0x0x0000000000000000
Memory (Avail/Total): Ph:14226M/16354M, Ph+PgF:26550M/32707M
Instance name: orcl
Redo thread mounted by this instance: 1
Oracle process number: 21
Windows thread id: 7268, image: ORACLE.EXE (SHAD)
*** 2022-12-28 20:49:48.722
*** SESSION ID:(1072.34821) 2022-12-28 20:49:48.722
*** CLIENT ID:() 2022-12-28 20:49:48.722
*** SERVICE NAME:() 2022-12-28 20:49:48.722
*** MODULE NAME:(sqlplus.exe) 2022-12-28 20:49:48.722
*** ACTION NAME:() 2022-12-28 20:49:48.722
2022-12-28 20:49:48.707: [ default]ut_read_reg:2:ocr registry key SOFTWARE\Oracle\olr cannot be opened. error 2
2022-12-28 20:49:48.722: [ default]ut_read_reg:2:ocr registry key SOFTWARE\Oracle\ocr cannot be opened. error 2
*** 2022-12-28 20:50:22.590
Successfully allocated 23 recovery slaves
Using 7 overflow buffers per recovery slave
Thread 1 checkpoint: logseq 196495, block 2, scn 21013327794
cache-low rba: logseq 196495, block 29949
on-disk rba: logseq 196495, block 39460, scn 21014230409
start recovery at logseq 196495, block 29949, scn 0
*** 2022-12-28 20:50:22.949
Started writing zeroblks thread 1 seq 196495 blocks 39399-39406
*** 2022-12-28 20:50:22.949
Completed writing zeroblks thread 1 seq 196495
==== Redo read statistics for thread 1 ====
Total physical reads (from disk and memory): 8192Kb
-- Redo read_disk statistics --
Read rate (ASYNC): 4725Kb in 0.14s => 32.96 Mb/sec
Longest record: 8Kb, moves: 0/8541 (0%)
Change moves: 1/63 (1%), moved: 0Mb
Longest LWN: 28Kb, moves: 0/3386 (0%), moved: 0Mb
Last redo scn: 0x0004.e48b8db6 (21014220214)
----------------------------------------------
----- Recovery Hash Table Statistics ---------
Hash table buckets = 32768
Longest hash chain = 1
Average hash chain = 253/253 = 1.0
Max compares per lookup = 1
Avg compares per lookup = 21675/22051 = 1.0
----------------------------------------------
WARNING! Crash recovery of thread 1 seq 196495 is
ending at redo block 39399 but should not have ended before
redo block 39460
Incident 105441 created, dump file: e:\app\administrator\diag\rdbms\orcl\orcl\incident\incdir_105441\orcl_ora_7268_i105441.trc
ORA-00600: 内部错误代码, 参数: [kcratr_nab_less_than_odr], [1], [196495], [39399], [39460], [], [], [], [], [], [], []
*** 2022-12-28 20:50:26.272
ORA-00600: 内部错误代码, 参数: [kcratr_nab_less_than_odr], [1], [196495], [39399], [39460], [], [], [], [], [], [], []
ORA-00600: 内部错误代码, 参数: [kcratr_nab_less_than_odr], [1], [196495], [39399], [39460], [], [], [], [], [], [], []
解决:重建控制文件
SQL> Show parameter control_files
Keep this location handy.
SQL> oradebug setmypid
SQL> Alter session set tracefile_identifier='controlfilerecreate' ;
SQL> Alter database backup controlfile to trace noresetlogs;
SQL> oradebug tracefile_name ;
此时会生成一个脚本文件
Trace file e:\app\administrator\diag\rdbms\orcl\orcl\trace\orcl_ora_7528_controlfilerecreate.trc
Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
Windows NT Version V6.1 Service Pack 1
CPU : 24 - type 8664, 12 Physical Cores
Process Affinity : 0x0x0000000000000000
Memory (Avail/Total): Ph:14129M/16354M, Ph+PgF:26416M/32707M
Instance name: orcl
Redo thread mounted by this instance: 1
Oracle process number: 21
Windows thread id: 7528, image: ORACLE.EXE (SHAD)
*** 2022-12-28 21:11:20.140
*** SESSION ID:(1072.425) 2022-12-28 21:11:20.140
*** CLIENT ID:() 2022-12-28 21:11:20.140
*** SERVICE NAME:() 2022-12-28 21:11:20.140
*** MODULE NAME:(sqlplus.exe) 2022-12-28 21:11:20.140
*** ACTION NAME:() 2022-12-28 21:11:20.140
*** TRACE CONTINUED FROM FILE e:\app\administrator\diag\rdbms\orcl\orcl\trace\orcl_ora_7528.trc ***
*** 2022-12-28 21:11:20.140
-- The following are current System-scope REDO Log Archival related
-- parameters and can be included in the database initialization file.
--
-- LOG_ARCHIVE_DEST=''
-- LOG_ARCHIVE_DUPLEX_DEST=''
--
-- LOG_ARCHIVE_FORMAT=ARC%S_%R.%T
--
-- DB_UNIQUE_NAME="orcl"
--
-- LOG_ARCHIVE_CONFIG='SEND, RECEIVE, NODG_CONFIG'
-- LOG_ARCHIVE_MAX_PROCESSES=4
-- STANDBY_FILE_MANAGEMENT=MANUAL
-- STANDBY_ARCHIVE_DEST=%ORACLE_HOME%\RDBMS
-- FAL_CLIENT=''
-- FAL_SERVER=''
--
-- LOG_ARCHIVE_DEST_1='LOCATION=USE_DB_RECOVERY_FILE_DEST'
-- LOG_ARCHIVE_DEST_1='MANDATORY NOREOPEN NODELAY'
-- LOG_ARCHIVE_DEST_1='ARCH NOAFFIRM EXPEDITE NOVERIFY SYNC'
-- LOG_ARCHIVE_DEST_1='NOREGISTER NOALTERNATE NODEPENDENCY'
-- LOG_ARCHIVE_DEST_1='NOMAX_FAILURE NOQUOTA_SIZE NOQUOTA_USED NODB_UNIQUE_NAME'
-- LOG_ARCHIVE_DEST_1='VALID_FOR=(PRIMARY_ROLE,ONLINE_LOGFILES)'
-- LOG_ARCHIVE_DEST_STATE_1=ENABLE
--
-- The following commands will create a new control file and use it
-- to open the database.
-- Data used by Recovery Manager will be lost.
-- Additional logs may be required for media recovery of offline
-- Use this only if the current versions of all online logs are
-- available.
-- After mounting the created controlfile, the following SQL
-- statement will place the database in the appropriate
-- protection mode:
-- ALTER DATABASE SET STANDBY DATABASE TO MAXIMIZE PERFORMANCE
STARTUP NOMOUNT
CREATE CONTROLFILE REUSE DATABASE "ORCL" NORESETLOGS NOARCHIVELOG
MAXLOGFILES 16
MAXLOGMEMBERS 3
MAXDATAFILES 100
MAXINSTANCES 8
MAXLOGHISTORY 9344
LOGFILE
GROUP 1 'E:\APP\ADMINISTRATOR\ORADATA\ORCL\REDO01.LOG' SIZE 50M BLOCKSIZE 512,
GROUP 2 'E:\APP\ADMINISTRATOR\ORADATA\ORCL\REDO02.LOG' SIZE 50M BLOCKSIZE 512,
GROUP 3 'E:\APP\ADMINISTRATOR\ORADATA\ORCL\REDO03.LOG' SIZE 50M BLOCKSIZE 512
-- STANDBY LOGFILE
DATAFILE
'E:\APP\ADMINISTRATOR\ORADATA\ORCL\SYSTEM01.DBF',
'E:\APP\ADMINISTRATOR\ORADATA\ORCL\SYSAUX01.DBF',
'E:\APP\ADMINISTRATOR\ORADATA\ORCL\UNDOTBS01.DBF',
'E:\APP\ADMINISTRATOR\ORADATA\ORCL\USERS01.DBF',
'E:\APP\ADMINISTRATOR\ORADATA\ORCL\EXAMPLE01.DBF',
'E:\APP\ADMINISTRATOR\ORADATA\ORCL\TS_DB_DATA01.DBF',
'E:\APP\ADMINISTRATOR\ORADATA\ORCL\TS_DB_DATA02.DBF',
'E:\APP\ADMINISTRATOR\ORADATA\ORCL\TS_DB_DATA03.DBF',
'E:\APP\ADMINISTRATOR\ORADATA\ORCL\TS_DB_DATA04.DBF',
'E:\APP\ADMINISTRATOR\ORADATA\ORCL\TS_DB_DATA05.DBF',
'E:\APP\ADMINISTRATOR\ORADATA\ORCL\TS_DB_DATA06.DBF',
'E:\APP\ADMINISTRATOR\ORADATA\ORCL\TS_DB_DATA07.DBF',
'E:\APP\ADMINISTRATOR\ORADATA\ORCL\TS_DB_DATA08.DBF',
'E:\APP\ADMINISTRATOR\ORADATA\ORCL\TS_DB_DATA09.DBF',
'E:\APP\ADMINISTRATOR\ORADATA\ORCL\TS_DB_DATA10.DBF',
'E:\APP\ADMINISTRATOR\ORADATA\ORCL\USERS02.DBF',
'E:\APP\ADMINISTRATOR\ORADATA\ORCL\USERS002.DBF',
'E:\APP\ADMINISTRATOR\ORADATA\ORCL\USERS03.DBF',
'E:\APP\ADMINISTRATOR\ORADATA\ORCL\USERS04.DBF',
'E:\APP\ADMINISTRATOR\ORADATA\ORCL\USERS05.DBF',
'E:\APP\ADMINISTRATOR\ORADATA\ORCL\USERS06.DBF',
'E:\APP\ADMINISTRATOR\ORADATA\ORCL\USERS07.DBF',
'E:\APP\ADMINISTRATOR\ORADATA\ORCL\USERS08.DBF',
'E:\APP\ADMINISTRATOR\ORADATA\ORCL\TS_DB_DATA11.DBF',
'E:\APP\ADMINISTRATOR\ORADATA\ORCL\TS_DB_DATA12.DBF',
'E:\APP\ADMINISTRATOR\ORADATA\ORCL\TS_DB_DATA13.DBF',
'E:\APP\ADMINISTRATOR\ORADATA\ORCL\TS_DB_DATA14.DBF',
'E:\APP\ADMINISTRATOR\ORADATA\ORCL\USERS09.DBF',
'E:\APP\ADMINISTRATOR\ORADATA\ORCL\USERS10.DBF',
'E:\APP\ADMINISTRATOR\ORADATA\ORCL\USERS11.DBF',
'E:\APP\ADMINISTRATOR\ORADATA\ORCL\USERS12.DBF',
'E:\APP\ADMINISTRATOR\ORADATA\ORCL\USERS13.DBF',
'E:\APP\ADMINISTRATOR\ORADATA\ORCL\TS_DB_DATA15.DBF'
CHARACTER SET ZHS16GBK
;
-- Commands to re-create incarnation table
-- Below log names MUST be changed to existing filenames on
-- disk. Any one log file from each branch can be used to
-- re-create incarnation records.
-- ALTER DATABASE REGISTER LOGFILE 'E:\APP\ADMINISTRATOR\FLASH_RECOVERY_AREA\ORCL\ARCHIVELOG\2022_12_28\O1_MF_1_1_%U_.ARC';
-- ALTER DATABASE REGISTER LOGFILE 'E:\APP\ADMINISTRATOR\FLASH_RECOVERY_AREA\ORCL\ARCHIVELOG\2022_12_28\O1_MF_1_1_%U_.ARC';
-- Recovery is required if any of the datafiles are restored backups,
-- or if the last shutdown was not normal or immediate.
RECOVER DATABASE
-- Database can now be opened normally.
ALTER DATABASE OPEN;
-- Commands to add tempfiles to temporary tablespaces.
-- Online tempfiles have complete space information.
-- Other tempfiles may require adjustment.
ALTER TABLESPACE TEMP ADD TEMPFILE 'E:\APP\ADMINISTRATOR\ORADATA\ORCL\TEMP01.DBF' REUSE;
-- End of tempfile additions.
--
*** 2022-12-28 21:11:24.913
Processing Oradebug command 'tracefile_name '
*** 2022-12-28 21:11:24.913
Oradebug command 'tracefile_name ' console output:
e:\app\administrator\diag\rdbms\orcl\orcl\trace\orcl_ora_7528_controlfilerecreate.trc
按步骤执行脚本
控制文件重建完成
测试数据库正常