Oracle重做日志文件版本不一致问题处理
早上在启动测试数据库时,发现如下问题:数据库版本是11.2.0.3SQLgt; startupOracle instance started. Total System Global Ar
早上在启动测试数据库时,发现如下问题:
数据库版本是11.2.0.3
SQL> startup
Oracle instance started.
Total System Global Area 1653518336 bytes
Fixed Size 2228904 bytes
Variable Size 1140854104 bytes
Database Buffers 503316480 bytes
Redo Buffers 7118848 bytes
Database mounted.
ORA-03113: end-of-file on communication channel
Process ID: 8264
Session ID: 191 Serial number: 3
检查告警日志文件信息如下:
Fri Aug 24 09:52:27 2012
Completed: ALTER DATABASE MOUNT
Fri Aug 24 09:52:27 2012
ALTER DATABASE OPEN
Fri Aug 24 09:52:33 2012
Errors in file /u01/app/oracle/diag/rdbms/enmot2/enmot2/trace/enmot2_lgwr_8222.trc:
ORA-00322: log 2 of thread 1 is not current copy
ORA-00312: online log 2 thread 1: '/u01/app/oracle/oradata/enmot2/redo02b.log'
ORA-00322: log 2 of thread 1 is not current copy
ORA-00312: online log 2 thread 1: '/u01/app/oracle/oradata/enmot2/redo02a.log'
Errors in file /u01/app/oracle/diag/rdbms/enmot2/enmot2/trace/enmot2_lgwr_8222.trc:
ORA-00322: log 2 of thread 1 is not current copy
ORA-00312: online log 2 thread 1: '/u01/app/oracle/oradata/enmot2/redo02b.log'
ORA-00322: log 2 of thread 1 is not current copy
ORA-00312: online log 2 thread 1: '/u01/app/oracle/oradata/enmot2/redo02a.log'
Errors in file /u01/app/oracle/diag/rdbms/enmot2/enmot2/trace/enmot2_ora_8264.trc:
ORA-00322: log 1 of thread is not current copy
ORA-00312: online log 2 thread 1: '/u01/app/oracle/oradata/enmot2/redo02a.log'
ORA-00312: online log 2 thread 1: '/u01/app/oracle/oradata/enmot2/redo02b.log'
USER (ospid: 8264): terminating the instance due to error 322
Fri Aug 24 09:52:34 2012
System state dump requested by (instance=1, osid=8264), summary=[abnormal instance termination].
System State dumped to trace file /u01/app/oracle/diag/rdbms/enmot2/enmot2/trace/enmot2_diag_8212.trc
Dumping diagnostic data in directory=[cdmp_20120824095234], requested by (instance=1, osid=8264), summary=[abnormal instance termination].
Instance terminated by USER, pid = 8264
问题比较明显,日志镜像存在问题,由于测试库可以通过resetlog方式打开:
SQL> alter system set "_allow_resetlogs_corruption"=true scope=spfile;
System altered.
SQL> startup mount
ORACLE instance started.
Total System Global Area 1653518336 bytes
Fixed Size 2228904 bytes
Variable Size 1140854104 bytes
Database Buffers 503316480 bytes
Redo Buffers 7118848 bytes
Database mounted.
SQL> recover database until cancel;
Media recovery complete.
SQL> alter database open resetlogs;
Database altered.
此时告警日志信息如下:
Fri Aug 24 09:53:56 2012
alter database open resetlogs
ORA-1139 signalled during: alter database open resetlogs...
Fri Aug 24 09:54:27 2012
ALTER DATABASE RECOVER database until cancel
Media Recovery Start
started logmerger process
Parallel Media Recovery started with 4 slaves
Media Recovery Not Required
Completed: ALTER DATABASE RECOVER database until cancel
alter database open resetlogs
RESETLOGS is being done without consistancy checks. This may result
in a corrupted database. The database should be recreated.
RESETLOGS after incomplete recovery UNTIL CHANGE 1427077
Resetting resetlogs activation ID 1296798128 (0x4d4b91b0)
Fri Aug 24 09:56:11 2012
Setting recovery target incarnation to 2
Fri Aug 24 09:56:12 2012
Assigning activation ID 1297978010 (0x4d5d929a)
Thread 1 opened at log sequence 1
Current log# 1 seq# 1 mem# 0: /u01/app/oracle/oradata/enmot2/redo01a.log
Current log# 1 seq# 1 mem# 1: /u01/app/oracle/oradata/enmot2/redo01b.log
Successful open of redo thread 1
Fri Aug 24 09:56:15 2012
MTTR advisory is disabled because FAST_START_MTTR_TARGET is not set
Fri Aug 24 09:56:15 2012
SMON: enabling cache recovery
[8371] Successfully onlined Undo Tablespace 2.
Undo initialization finished serial:0 start:68627054 end:68628914 diff:1860 (18 seconds)
Dictionary check beginning
Fri Aug 24 09:56:26 2012
Dictionary check complete
Verifying file header compatibility for 11g tablespace encryption..
Verifying 11g file header compatibility for tablespace encryption completed
Fri Aug 24 09:56:26 2012
SMON: enabling tx recovery
Database Characterset is ZHS16GBK
No Resource Manager plan active
replication_dependency_tracking turned off (no async multimaster replication found)
Starting background process QMNC
Fri Aug 24 09:56:36 2012
QMNC started with pid=20, OS id=8383
LOGSTDBY: Validating controlfile with logical metadata
Fri Aug 24 09:56:37 2012
LOGSTDBY: Validation complete
Fri Aug 24 09:56:47 2012
Completed: alter database open resetlogs
以上就是整个处理过程。

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

Full table scanning may be faster in MySQL than using indexes. Specific cases include: 1) the data volume is small; 2) when the query returns a large amount of data; 3) when the index column is not highly selective; 4) when the complex query. By analyzing query plans, optimizing indexes, avoiding over-index and regularly maintaining tables, you can make the best choices in practical applications.

InnoDB's full-text search capabilities are very powerful, which can significantly improve database query efficiency and ability to process large amounts of text data. 1) InnoDB implements full-text search through inverted indexing, supporting basic and advanced search queries. 2) Use MATCH and AGAINST keywords to search, support Boolean mode and phrase search. 3) Optimization methods include using word segmentation technology, periodic rebuilding of indexes and adjusting cache size to improve performance and accuracy.

Yes, MySQL can be installed on Windows 7, and although Microsoft has stopped supporting Windows 7, MySQL is still compatible with it. However, the following points should be noted during the installation process: Download the MySQL installer for Windows. Select the appropriate version of MySQL (community or enterprise). Select the appropriate installation directory and character set during the installation process. Set the root user password and keep it properly. Connect to the database for testing. Note the compatibility and security issues on Windows 7, and it is recommended to upgrade to a supported operating system.

MySQL is an open source relational database management system. 1) Create database and tables: Use the CREATEDATABASE and CREATETABLE commands. 2) Basic operations: INSERT, UPDATE, DELETE and SELECT. 3) Advanced operations: JOIN, subquery and transaction processing. 4) Debugging skills: Check syntax, data type and permissions. 5) Optimization suggestions: Use indexes, avoid SELECT* and use transactions.

The difference between clustered index and non-clustered index is: 1. Clustered index stores data rows in the index structure, which is suitable for querying by primary key and range. 2. The non-clustered index stores index key values and pointers to data rows, and is suitable for non-primary key column queries.

In MySQL database, the relationship between the user and the database is defined by permissions and tables. The user has a username and password to access the database. Permissions are granted through the GRANT command, while the table is created by the CREATE TABLE command. To establish a relationship between a user and a database, you need to create a database, create a user, and then grant permissions.

MySQL and MariaDB can coexist, but need to be configured with caution. The key is to allocate different port numbers and data directories to each database, and adjust parameters such as memory allocation and cache size. Connection pooling, application configuration, and version differences also need to be considered and need to be carefully tested and planned to avoid pitfalls. Running two databases simultaneously can cause performance problems in situations where resources are limited.

MySQL supports four index types: B-Tree, Hash, Full-text, and Spatial. 1.B-Tree index is suitable for equal value search, range query and sorting. 2. Hash index is suitable for equal value searches, but does not support range query and sorting. 3. Full-text index is used for full-text search and is suitable for processing large amounts of text data. 4. Spatial index is used for geospatial data query and is suitable for GIS applications.
