为了验证当前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, 感谢原作者分享。

The steps for upgrading MySQL database include: 1. Backup the database, 2. Stop the current MySQL service, 3. Install the new version of MySQL, 4. Start the new version of MySQL service, 5. Recover the database. Compatibility issues are required during the upgrade process, and advanced tools such as PerconaToolkit can be used for testing and optimization.

MySQL backup policies include logical backup, physical backup, incremental backup, replication-based backup, and cloud backup. 1. Logical backup uses mysqldump to export database structure and data, which is suitable for small databases and version migrations. 2. Physical backups are fast and comprehensive by copying data files, but require database consistency. 3. Incremental backup uses binary logging to record changes, which is suitable for large databases. 4. Replication-based backup reduces the impact on the production system by backing up from the server. 5. Cloud backups such as AmazonRDS provide automation solutions, but costs and control need to be considered. When selecting a policy, database size, downtime tolerance, recovery time, and recovery point goals should be considered.

MySQLclusteringenhancesdatabaserobustnessandscalabilitybydistributingdataacrossmultiplenodes.ItusestheNDBenginefordatareplicationandfaulttolerance,ensuringhighavailability.Setupinvolvesconfiguringmanagement,data,andSQLnodes,withcarefulmonitoringandpe

Optimizing database schema design in MySQL can improve performance through the following steps: 1. Index optimization: Create indexes on common query columns, balancing the overhead of query and inserting updates. 2. Table structure optimization: Reduce data redundancy through normalization or anti-normalization and improve access efficiency. 3. Data type selection: Use appropriate data types, such as INT instead of VARCHAR, to reduce storage space. 4. Partitioning and sub-table: For large data volumes, use partitioning and sub-table to disperse data to improve query and maintenance efficiency.

TooptimizeMySQLperformance,followthesesteps:1)Implementproperindexingtospeedupqueries,2)UseEXPLAINtoanalyzeandoptimizequeryperformance,3)Adjustserverconfigurationsettingslikeinnodb_buffer_pool_sizeandmax_connections,4)Usepartitioningforlargetablestoi

MySQL functions can be used for data processing and calculation. 1. Basic usage includes string processing, date calculation and mathematical operations. 2. Advanced usage involves combining multiple functions to implement complex operations. 3. Performance optimization requires avoiding the use of functions in the WHERE clause and using GROUPBY and temporary tables.

Efficient methods for batch inserting data in MySQL include: 1. Using INSERTINTO...VALUES syntax, 2. Using LOADDATAINFILE command, 3. Using transaction processing, 4. Adjust batch size, 5. Disable indexing, 6. Using INSERTIGNORE or INSERT...ONDUPLICATEKEYUPDATE, these methods can significantly improve database operation efficiency.

In MySQL, add fields using ALTERTABLEtable_nameADDCOLUMNnew_columnVARCHAR(255)AFTERexisting_column, delete fields using ALTERTABLEtable_nameDROPCOLUMNcolumn_to_drop. When adding fields, you need to specify a location to optimize query performance and data structure; before deleting fields, you need to confirm that the operation is irreversible; modifying table structure using online DDL, backup data, test environment, and low-load time periods is performance optimization and best practice.


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

SAP NetWeaver Server Adapter for Eclipse
Integrate Eclipse with SAP NetWeaver application server.

Atom editor mac version download
The most popular open source editor

SecLists
SecLists is the ultimate security tester's companion. It is a collection of various types of lists that are frequently used during security assessments, all in one place. SecLists helps make security testing more efficient and productive by conveniently providing all the lists a security tester might need. List types include usernames, passwords, URLs, fuzzing payloads, sensitive data patterns, web shells, and more. The tester can simply pull this repository onto a new test machine and he will have access to every type of list he needs.

Zend Studio 13.0.1
Powerful PHP integrated development environment

EditPlus Chinese cracked version
Small size, syntax highlighting, does not support code prompt function
