使用旧的控制文件恢复
在做resetlogs启数据库也会因为数据文件内部一致而中止,需要恢复
备份控制文件
alter database backup controlfileto '/bk/ctl.bk';
SQL> alter system switch logfile;
alter system switch logfile
*
ERROR at line 1:
ORA-03113: end-of-file on communication channel
SQL> conn /as sysdba
Connected to an idle instance.
SQL> startup
Oracle instance started.
Total System Global Area 314572800 bytes
Fixed Size 1219136 bytes
Variable Size 100664768 bytes
Database Buffers 205520896 bytes
Redo Buffers 7168000 bytes
ORA-00205: error in identifying control file, checkalert log for more info
SQL> ! /bk/ctl.bk/u01/tiger/oradata/orcl2/control02.ctl
/bin/bash: /bk/ctl.bk: ????
SQL> ! cp /bk/ctl.bk/u01/tiger/oradata/orcl2/control02.ctl
SQL> ! cp /bk/ctl.bk/u01/tiger/oradata/orcl2/control03.ctl
SQL> ! cp /bk/ctl.bk/u01/tiger/oradata/orcl2/control01.ctl
SQL> alter database mount;
Database altered.
SQL> alter database open;
alter database open
*
ERROR at line 1:
ORA-01589: must use RESETLOGS or NORESETLOGS option fordatabase open
需要恢复
SQL> alter database open resetlogs;
alter database open resetlogs
*
ERROR at line 1:
ORA-01194: file 1 needs more recovery to beconsistent
ORA-01110: data file 1: '/u01/tiger/oradata/orcl2/system01.dbf'
SQL> recover database;
ORA-00283: recovery session canceled due to errors
ORA-01610: recovery using the BACKUP CONTROLFILE option mustbe done
数据库检测控制文件和数据文件的SCN的对比,,发现控制文件是老的
SQL> recover database using backupcontrolfile;
ORA-00279: change 458762 generated at 09/03/201214:28:45 needed for thread 1
ORA-00289: suggestion :/u01/tiger/flash_recovery_area/ORCL2/archivelog/2012_09_03/o1_mf_1_2_%u_.arc
ORA-00280: change 458762 for thread 1 is insequence #2
Specify log: {
auto
ORA-00279: change 458780 generated at 09/03/201214:50:27 needed for thread 1
ORA-00289: suggestion :/u01/tiger/flash_recovery_area/ORCL2/archivelog/2012_09_03/o1_mf_1_3_%u_.arc
ORA-00280: change 458780 for thread 1 is insequence #3
ORA-00278: log file'/u01/tiger/flash_recovery_area/ORCL2/archivelog/2012_09_03/o1_mf_1_2_848nst62_.arc'no longer
needed for this recovery
ORA-00279: change 458785 generated at 09/03/201214:50:35 needed for thread 1
ORA-00289: suggestion : /u01/tiger/flash_recovery_area/ORCL2/archivelog/2012_09_03/o1_mf_1_4_%u_.arc
ORA-00280: change 458785 for thread 1 is insequence #4
ORA-00278: log file'/u01/tiger/flash_recovery_area/ORCL2/archivelog/2012_09_03/o1_mf_1_3_848nsvk0_.arc'no longer
needed for this recovery
ORA-00279: change 458791 generated at 09/03/201214:50:42 needed for thread 1
ORA-00289: suggestion :/u01/tiger/flash_recovery_area/ORCL2/archivelog/2012_09_03/o1_mf_1_5_%u_.arc
ORA-00280: change 458791 for thread 1 is insequence #5
ORA-00278: log file'/u01/tiger/flash_recovery_area/ORCL2/archivelog/2012_09_03/o1_mf_1_4_848nt295_.arc'no longer
needed for this recovery
ORA-00308: cannot open archived log'/u01/tiger/flash_recovery_area/ORCL2/archivelog/2012_09_03/o1_mf_1_5_%u_.arc'
ORA-27037: unable to obtain file status
Linux Error: 2: No such file or directory
Additional information: 3
给它一组组尝试
SQL> recover database using backupcontrolfile;
ORA-00279: change 458791 generated at 09/03/201214:50:42 needed for thread 1
ORA-00289: suggestion : /u01/tiger/flash_recovery_area/ORCL2/archivelog/2012_09_03/o1_mf_1_5_%u_.arc
ORA-00280: change 458791 for thread 1 is insequence #5
Specify log: {
/u01/tiger/oradata/orcl2/redo01.log
Log applied.
Media recovery complete.
SQL> alter database openresetlogs;
Database altered.
SQL>

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



MySQL is an open source relational database management system, mainly used to store and retrieve data quickly and reliably. Its working principle includes client requests, query resolution, execution of queries and return results. Examples of usage include creating tables, inserting and querying data, and advanced features such as JOIN operations. Common errors involve SQL syntax, data types, and permissions, and optimization suggestions include the use of indexes, optimized queries, and partitioning of tables.

MySQL is chosen for its performance, reliability, ease of use, and community support. 1.MySQL provides efficient data storage and retrieval functions, supporting multiple data types and advanced query operations. 2. Adopt client-server architecture and multiple storage engines to support transaction and query optimization. 3. Easy to use, supports a variety of operating systems and programming languages. 4. Have strong community support and provide rich resources and solutions.

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.

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.

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

An AWR report is a report that displays database performance and activity snapshots. The interpretation steps include: identifying the date and time of the activity snapshot. View an overview of activities and resource consumption. Analyze session activities to find session types, resource consumption, and waiting events. Find potential performance bottlenecks such as slow SQL statements, resource contention, and I/O issues. View waiting events, identify and resolve them for performance. Analyze latch and memory usage patterns to identify memory issues that are causing performance issues.
