ORACLE 12C redo异常恢复测试—部分pdb未正常open
为了验证当前redo丢失的情况下ORACLE 12C CDB数据库恢复的情况,做了一个小实验,三个会话,分别操作为在root pdb中执行一个delete 不提交;另外一个会话在user pdb中delete记录不提交;最后一个会话中直接abort数据库,然后进行数据库恢复,验证数据库是否可
为了验证当前redo丢失的情况下ORACLE 12C CDB数据库恢复的情况,做了一个小实验,三个会话,分别操作为在root pdb中执行一个delete 不提交;另外一个会话在user pdb中delete记录不提交;最后一个会话中直接abort数据库,然后进行数据库恢复,验证数据库是否可以都正常open(所有pdb)
会话1(root pdb中操作)
CDB_CDB$ROOT@SYS> show pdbs; CON_ID CON_NAME OPEN MODE RESTRICTED ---------- ------------------------------ ---------- ---------- 2 PDB$SEED READ ONLY NO 3 PDB READ WRITE NO CDB_CDB$ROOT@SYS> show con_name CON_NAME ------------------------------ CDB$ROOT CDB_CDB$ROOT@SYS> create table t_xifenfei as select * from dba_objects; 表已创建。 CDB_CDB$ROOT@SYS> delete from t_xifenfei; 已删除 91032 行。 CDB_CDB$ROOT@SYS>
会话2(user pdb中操作)
CDB_CDB$ROOT@SYS> show con_name CON_NAME ------------------------------ PDB CDB_CDB$ROOT@SYS> drop table t_xifenfei purge; 表已删除。 CDB_CDB$ROOT@SYS> create table t_xifenfei as select * from dba_objects; 表已创建。 CDB_CDB$ROOT@SYS> delete from t_xifenfei; 已删除 91144 行。
会话3(直接abort数据库)
CDB_CDB$ROOT@SYS> shutdown abort; ORACLE 例程已经关闭。
删除数据库联机日志
E:\app\XIFENFEI\oradata\cdb>dir redo*.log 驱动器 E 中的卷是 本地磁盘 卷的序列号是 000C-3B41 E:\app\XIFENFEI\oradata\cdb 的目录 2013-08-07 01:41 52,429,312 REDO01.LOG 2013-08-07 01:40 52,429,312 REDO02.LOG 2013-08-07 01:40 52,429,312 REDO03.LOG 2014-03-20 22:47 52,432,896 REDO04.LOG 2014-03-20 22:47 52,432,896 REDO05.LOG 2014-03-20 22:47 52,432,896 REDO06.LOG 6 个文件 314,586,624 字节 0 个目录 21,359,374,336 可用字节 E:\app\XIFENFEI\oradata\cdb>del redo*.log E:\app\XIFENFEI\oradata\cdb>dir redo*.log 驱动器 E 中的卷是 本地磁盘 卷的序列号是 000C-3B41 E:\app\XIFENFEI\oradata\cdb 的目录 找不到文件
启动数据库报ORA-00313错误
idle> startup ORACLE 例程已经启动。 Total System Global Area 521936896 bytes Fixed Size 2404552 bytes Variable Size 205524792 bytes Database Buffers 306184192 bytes Redo Buffers 7823360 bytes 数据库装载完毕。 ORA-00313: 无法打开日志组 6 (用于线程 1) 的成员 ORA-00312: 联机日志 6 线程 1: 'E:\APP\XIFENFEI\ORADATA\CDB\REDO06.LOG' ORA-27041: 无法打开文件 OSD-04002: 无法打开文件 O/S-Error: (OS 2) 系统找不到指定的文件。
使用_allow_resetlogs_corruption参数尝试open数据库
idle> shutdown abort ORACLE 例程已经关闭。 idle> startup pfile='d:/pfile.txt' mount ORACLE 例程已经启动。 Total System Global Area 521936896 bytes Fixed Size 2404552 bytes Variable Size 205524792 bytes Database Buffers 306184192 bytes Redo Buffers 7823360 bytes 数据库装载完毕。 idle> show parameter resetlogs; NAME TYPE VALUE ------------------------------------ ----------- ------------------------------ _allow_resetlogs_corruption boolean TRUE idle> recover database until cancel; ORA-00279: 更改 12696935641735 (在 03/20/2014 22:38:52 生成) 对于线程 1 是必需的 ORA-00289: 建议: E:\APP\XIFENFEI\FAST_RECOVERY_AREA\CDB\ARCHIVELOG\2014_03_20\O1_MF_1_872_9LOZSK9 X_.ARC ORA-00280: 更改 12696935641735 (用于线程 1) 在序列 #872 中 指定日志: {=suggested | filename | AUTO | CANCEL} cancel ORA-01547: 警告: RECOVER 成功但 OPEN RESETLOGS 将出现如下错误 ORA-01194: 文件 1 需要更多的恢复来保持一致性 ORA-01110: 数据文件 1: 'E:\APP\XIFENFEI\ORADATA\CDB\SYSTEM01.DBF' ORA-01112: 未启动介质恢复 idle> alter database open resetlogs; alter database open resetlogs * 第 1 行出现错误: ORA-00603: ORACLE server session terminated by fatal error ORA-00600: internal error code, arguments: [2662], [2956], [1012314778], [2956], [1012314903], [268435600], [], [], [], [], [], [] ORA-00600: internal error code, arguments: [2662], [2956], [1012314777], [2956], [1012314903], [268435600], [], [], [], [], [], [] ORA-01092: ORACLE instance terminated. Disconnection forced ORA-00600: internal error code, arguments: [2662], [2956], [1012314768], [2956], [1012314903], [268435600], [], [], [], [], [], [] 进程 ID: 9268 会话 ID: 92 序列号: 3
ora-600[2662]很熟悉,文件头的scn小于文件中某个block的csn,通过bbed等工具修改文件scn,尝试启动数据库
CDB_CDB$ROOT@SYS> SHUTDOWN ABORT ORACLE 例程已经关闭。 CDB_CDB$ROOT@SYS> STARTUP ORACLE 例程已经启动。 Total System Global Area 521936896 bytes Fixed Size 2404552 bytes Variable Size 205524792 bytes Database Buffers 306184192 bytes Redo Buffers 7823360 bytes 数据库装载完毕。 数据库已经打开。
尝试open user pdb
CDB_CDB$ROOT@SYS> alter session set container=pdb; 会话已更改。 CDB_CDB$ROOT@SYS> alter database open; alter database open * 第 1 行出现错误: ORA-00600: 内部错误代码, 参数: [kcvfdb_pdb_set_clean_scn: cleanckpt], [3], [2956], [1012312995], [2956], [1012334778], [2], [], [], [], [], []
查询mos得到结论:
Bug 16784143 ORA-600 [kcvfdb_pdb_set_clean_scn: cleanckpt] with PDBs
在12.2/12.1.0.2/12.1.0.1.1中修复,后续尝试打patch,来进一步恢复.
测试结果证明
1.root pdb的open过程和以前版本数据库无大差异,但是scn推进比较费劲,以前的event和隐含参数方法无效
2.user pdb再是看是因为bug无法open,后续继续验证
3.12.1的base 版本可能确实问题很多,生产使用慎重
- ORACLE 12C redo异常恢复测试—打上patch恢复完全
- ORACLE 12C 控制文件异常恢复
- ORACLE 12C Windows-Linux 部署DATAGURAD
- 通过修改控制文件scn推进数据库scn
- 记录8.0.5数据库恢复过程
- 异常断电导致current redo损坏处理
- pdb正常运行丢失数据文件相关恢复
- 当前联机日志损坏恢复
原文地址:ORACLE 12C redo异常恢复测试—部分pdb未正常open, 感谢原作者分享。

Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

Video Face Swap
Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Article

Hot Tools

Notepad++7.3.1
Easy-to-use and free code editor

SublimeText3 Chinese version
Chinese version, very easy to use

Zend Studio 13.0.1
Powerful PHP integrated development environment

Dreamweaver CS6
Visual web development tools

SublimeText3 Mac version
God-level code editing software (SublimeText3)

Hot Topics

Solutions to Oracle cannot be opened include: 1. Start the database service; 2. Start the listener; 3. Check port conflicts; 4. Set environment variables correctly; 5. Make sure the firewall or antivirus software does not block the connection; 6. Check whether the server is closed; 7. Use RMAN to recover corrupt files; 8. Check whether the TNS service name is correct; 9. Check network connection; 10. Reinstall Oracle software.

The method to solve the Oracle cursor closure problem includes: explicitly closing the cursor using the CLOSE statement. Declare the cursor in the FOR UPDATE clause so that it automatically closes after the scope is ended. Declare the cursor in the USING clause so that it automatically closes when the associated PL/SQL variable is closed. Use exception handling to ensure that the cursor is closed in any exception situation. Use the connection pool to automatically close the cursor. Disable automatic submission and delay cursor closing.

In Oracle, the FOR LOOP loop can create cursors dynamically. The steps are: 1. Define the cursor type; 2. Create the loop; 3. Create the cursor dynamically; 4. Execute the cursor; 5. Close the cursor. Example: A cursor can be created cycle-by-circuit to display the names and salaries of the top 10 employees.

To stop an Oracle database, perform the following steps: 1. Connect to the database; 2. Shutdown immediately; 3. Shutdown abort completely.

Building a Hadoop Distributed File System (HDFS) on a CentOS system requires multiple steps. This article provides a brief configuration guide. 1. Prepare to install JDK in the early stage: Install JavaDevelopmentKit (JDK) on all nodes, and the version must be compatible with Hadoop. The installation package can be downloaded from the Oracle official website. Environment variable configuration: Edit /etc/profile file, set Java and Hadoop environment variables, so that the system can find the installation path of JDK and Hadoop. 2. Security configuration: SSH password-free login to generate SSH key: Use the ssh-keygen command on each node

Oracle is not only a database company, but also a leader in cloud computing and ERP systems. 1. Oracle provides comprehensive solutions from database to cloud services and ERP systems. 2. OracleCloud challenges AWS and Azure, providing IaaS, PaaS and SaaS services. 3. Oracle's ERP systems such as E-BusinessSuite and FusionApplications help enterprises optimize operations.

When Oracle log files are full, the following solutions can be adopted: 1) Clean old log files; 2) Increase the log file size; 3) Increase the log file group; 4) Set up automatic log management; 5) Reinitialize the database. Before implementing any solution, it is recommended to back up the database to prevent data loss.

SQL statements can be created and executed based on runtime input by using Oracle's dynamic SQL. The steps include: preparing an empty string variable to store dynamically generated SQL statements. Use the EXECUTE IMMEDIATE or PREPARE statement to compile and execute dynamic SQL statements. Use bind variable to pass user input or other dynamic values to dynamic SQL. Use EXECUTE IMMEDIATE or EXECUTE to execute dynamic SQL statements.
