本文主要是介绍cdb数据库强起流程,希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!
环境模拟
因为手头没有19.3的环境,用了一个centos 7.9下的18.3的cdb环境,开启了归档
在pdb中创建表,模拟构造数据
然后删除redo log来模拟损坏
模拟插入的过程,及错误时的报错
SQL> create table t(x int); Table created. SQL> begin for i in 1..1000000 loop insert into t values(i); commit; end loop; end; 2 3 4 5 6 7 / ^Cbegin * ERROR at line 1: ORA-12152: TNS:unable to send break message |
大致流程
- 配置参数、事件启动
- Alter database open [resetlogs];+alter database recover usning bakcup controlfle;
- Undo使用manual
- 处理undo表空间
- 其他强起的伴生问题处理
针对性错误
ORA-00313
SQL> startup ORACLE instance started. Total System Global Area 1593835440 bytes Fixed Size 8896432 bytes Variable Size 956301312 bytes Database Buffers 620756992 bytes Redo Buffers 7880704 bytes Database mounted. ORA-00313: open failed for members of log group 2 of thread 1 ORA-00312: online log 2 thread 1: '/opt/oracle/oradata/ORCLCDB/redo02.log' ORA-27037: unable to obtain file status Linux-x86_64 Error: 2: No such file or directory Additional information: 7 |
解决办法
*._allow_resetlogs_corruption=true
create pfile from spfile; vi /opt/oracle/product/18c/dbhome_1/dbs/initORCLCDB.ora *._allow_resetlogs_corruption=true startup mount pfile='/opt/oracle/product/18c/dbhome_1/dbs/initORCLCDB.ora' |
ORA-00600: [kcbzib_kcrsds_1]
SQL> alter database open resetlogs; alter database open resetlogs * ERROR at line 1: ORA-00603: ORACLE server session terminated by fatal error ORA-01092: ORACLE instance terminated. Disconnection forced ORA-00704: bootstrap process failure ORA-00704: bootstrap process failure ORA-00600: internal error code, arguments: [kcbzib_kcrsds_1], [], [], [], [], [], [], [], [], [], [], [] Process ID: 5529 Session ID: 237 Serial number: 37189 |
解决办法
’ *.event='21307096 trace name context forever, level 3'
vi /opt/oracle/product/18c/dbhome_1/dbs/initORCLCDB.ora *._allow_resetlogs_corruption=true *.event='21307096 trace name context forever, level 3' |
ORA-00600: [4194]
【4193】【4194】【4197】都是同类undo问题
SQL> alter database open ; alter database open * ERROR at line 1: ORA-00603: ORACLE server session terminated by fatal error ORA-01092: ORACLE instance terminated. Disconnection forced ORA-00600: internal error code, arguments: [4194], [13], [16], [], [], [], [], [], [], [], [], [] Process ID: 6121 Session ID: 237 Serial number: 52596 |
解决办法
*.undo_management=manual
vi /opt/oracle/product/18c/dbhome_1/dbs/initORCLCDB.ora *._allow_resetlogs_corruption=true *.event='21307096 trace name context forever, level 3' *.undo_management=manual |
后续收尾
重建undotbs
SQL> startup mount pfile='/opt/oracle/product/18c/dbhome_1/dbs/initORCLCDB.ora'; ORACLE instance started. Total System Global Area 1593835440 bytes Fixed Size 8896432 bytes Variable Size 956301312 bytes Database Buffers 620756992 bytes Redo Buffers 7880704 bytes Database mounted. SQL> alter database open; SQL> show pdbs; CON_ID CON_NAME OPEN MODE RESTRICTED ---------- ------------------------------ ---------- ---------- 2 PDB$SEED READ ONLY NO 3 ORCLPDB1 MOUNTED 4 TEST MOUNTED Database altered. SQL> alter pluggable database test open; Pluggable database altered. SQL> alter session set container=test; Session altered. SQL> select * from t; select * from t * ERROR at line 1: ORA-00942: table or view does not exist |
表t完全丢失了
检查undo段情况,这次模拟运气不好,没有损坏的undo段,这种时候直接替换undotbs就可以了
SQL> select SEGMENT_ID,SEGMENT_NAME,STATUS,TABLESPACE_NAME from dba_rollback_segs where status not in('ONLINE','OFFLINE'); no rows selected SQL> SQL> SQL> select KTUXEUSN,KTUXESLT,KTUXESTA,KTUXECFL,KTUXESIZ from x$ktuxe where KTUXESTA='ACTIVE' and KTUXECFL='DEAD'; no rows selected SQL> drop tablespace UNDOTBS1; Tablespace dropped. SQL> create undo tablespace UNDOTBS1 datafile '/opt/oracle/oradata/ORCLCDB/undotbs1.dbf' size 1g autoextend on; Tablespace created. |
如果有undo段损坏,使用参数
*._corrupted_rollback_segments=(_SYSSMU4_xxxxxxx$)
重启,然后舍弃undotbs1,再重建
伴生的错误ORA-00600:[kdsgrp1]
Alert日志中,关闭sqlplus时会出现
ORA-00600: internal error code, arguments: [kdsgrp1], [], [], [], [], [], [], [], [], [], [], [] ORA-06512: at "SYS.DBMS_SPD_INTERNAL", line 134 ORA-06512: at "SYS.DBMS_SPD", line 257 ORA-06512: at "SYS.DBMS_SPD", line 333 ORA-06512: at line 1 |
排查完是sys.COL_USAGE$有损坏。影响不大。正常流程这个应该是将强起的库导出再重建。毕竟内置的很多表损坏不可知。
总结
流程上11g的强起区别不大,ora600[2662]、[2663]变成[kcbzib_kcrsds_1],本质还是一致性问题,还是需要推scn。
核心事件
event=21307096 这个事件包含整个12c的生命周期了。从12.1-19都能用。
参考:
Force Open Database after applying Patch 21307096 (Doc ID 2674196.1)
Step by step to resolve ORA-600 4194 4193 4197 on database crash (Doc ID 1428786.1)
这篇关于cdb数据库强起流程的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!