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

AI Hentai Generator
Generate AI Hentai for free.

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



To query the Oracle tablespace size, follow the following steps: Determine the tablespace name by running the query: SELECT tablespace_name FROM dba_tablespaces; Query the tablespace size by running the query: SELECT sum(bytes) AS total_size, sum(bytes_free) AS available_space, sum(bytes) - sum(bytes_free) AS used_space FROM dba_data_files WHERE tablespace_

Oracle View Encryption allows you to encrypt data in the view, thereby enhancing the security of sensitive information. The steps include: 1) creating the master encryption key (MEk); 2) creating an encrypted view, specifying the view and MEk to be encrypted; 3) authorizing users to access the encrypted view. How encrypted views work: When a user querys for an encrypted view, Oracle uses MEk to decrypt data, ensuring that only authorized users can access readable data.

There are three ways to view instance names in Oracle: use the "sqlplus" and "select instance_name from v$instance;" commands on the command line. Use the "show instance_name;" command in SQL*Plus. Check environment variables (ORACLE_SID on Linux) through the operating system's Task Manager, Oracle Enterprise Manager, or through the operating system.

Uninstall method for Oracle installation failure: Close Oracle service, delete Oracle program files and registry keys, uninstall Oracle environment variables, and restart the computer. If the uninstall fails, you can uninstall manually using the Oracle Universal Uninstall Tool.

Data import method: 1. Use the SQLLoader utility: prepare data files, create control files, and run SQLLoader; 2. Use the IMP/EXP tool: export data, import data. Tip: 1. Recommended SQL*Loader for big data sets; 2. The target table should exist and the column definition matches; 3. After importing, data integrity needs to be verified.

There are the following methods to get time in Oracle: CURRENT_TIMESTAMP: Returns the current system time, accurate to seconds. SYSTIMESTAMP: More accurate than CURRENT_TIMESTAMP, to nanoseconds. SYSDATE: Returns the current system date, excluding the time part. TO_CHAR(SYSDATE, 'YYY-MM-DD HH24:MI:SS'): Converts the current system date and time to a specific format. EXTRACT: Extracts a specific part from a time value, such as a year, month, or hour.

To create a user in Oracle, follow these steps: Create a new user using the CREATE USER statement. Grant the necessary permissions using the GRANT statement. Optional: Use the RESOURCE statement to set the quota. Configure other options such as default roles and temporary tablespaces.

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.
