Home PC Games Linux Windows Database Network Programming Server Mobile  
           
  Home \ Database \ Oracle database online redo logs are several methods of recovery of deleted     - Oracle archive log summary (Database)

- iOS development -Launch Image and Launchscreen (Programming)

- Linux find command to find files (Linux)

- Shell Scripting Interview Questions (Programming)

- RPM package fabrication method (Linux)

- linux network security experience (Linux)

- CentOS 6.5 using Virtualenv under development environment to build Python3 (Linux)

- mysqldump issue a note (Database)

- Ten linux version of the system (Linux)

- C language macro definition #define Usage (Programming)

- Nginx Performance Tuning Guidelines (Server)

- How to install and configure a VNC server on CentOS 7.0 (Server)

- CentOS6 MongoDB connection solution can not break 1000 (Database)

- exp / imp Export Import version of the problem and the ORA-6550 error (Database)

- Summary Linux operating system some tips to prevent attacks (Linux)

- Java coding conventions (Programming)

- Based Docker build stand-alone high-availability cluster Hadoop2.7.1 Spark1.7 (Server)

- Linux iptables firewall settings to use (Linux)

- Git uses a standard process (Linux)

- Linux virtual memory and physical memory (Linux)

 
         
  Oracle database online redo logs are several methods of recovery of deleted
     
  Add Date : 2016-09-26      
         
         
         
  Oracle database online redo log contains a record of all operations of the data in the database, we can use the redo logs do many operations, such as log mining.

Sometimes, for whatever reason, our online log is accidentally deleted or accidental damage people out, how do we recover it, is actually very simple, look at the following elements:

We remove the online logs log simulation accidentally deleted situation:

[Oracle @ test orcl] $ rm redo *
[Oracle @ test orcl] $ ls -l redo *
ls: can not access the redo *: No such file or directory
[Oracle @ test orcl] $ sqlplus / as sysdba
SQL> startup mount
ORACLE instance started.
. . .
Database loading is completed.

Because we are just missing online redo logs, the database can start to mount state, the state will only open the database mount the control file, and will not go to check the status of each data file, verification operation will be carried out in the open stage .

SQL> alter database open;
alter database open
*
Line 1 Error:
ORA-03113: end of the communication channel file
Process ID: 4607
Session ID: 125 SEQ ID NO: 5

Open the database, it will be given, and the database will be forced to close

Here we use resetlogs Attempts to open the database:

SQL> recover database until cancel;
Complete media recovery.
SQL> alter database open;
alter database open
*
Line 1 Error:
ORA-01589: To open a database, you must use RESETLOGS option or NORESETLOGS
SQL> alter database open resetlogs;
Database has changed.

resetlogs open database must only be used after the database is not fully recovered, and after incomplete recovery must use RESETLOGS option or NORESETLOGS

In addition to this method, we can open the database by clearing the logfile method, as follows:

First, start to mount the database state

Query v $ log view:

SQL> select * from v $ log;
    GROUP # THREAD # SEQUENCE # BYTES BLOCKSIZE MEMBERS ARC STATUS FIRST_CHANGE # FIRST_TIME NEXT_CHANGE # NEXT_TIME
---------- ---------- ---------- ---------- ---------- ---------- --- ---------------- ------------- -------- ----------- ------------ -------------------
 1 1 1 134217728 5121 NO CURRENT 984719 2015-09-16 16:04:30 2.8147E + 14
 3 1 0 134217728 5121 YES UNUSED 0 0
 2 1 0 134217728 5121 YES UNUSED 0 0

If ARCHIVED field is YES, then we can

alter database clear logfile command to clear, if it is No, then we can
alter database clear unarchived logfile forcibly cleared
SQL> alter database clear logfile group 2;
Database has changed.
SQL> alter database clear logfile group 3;
Database has changed.
SQL> alter database clear unarchived logfile group 1;
alter database clear unarchived logfile group 1
*
Line 1 Error:
ORA-01624: log 1 is an emergency restore instance orcl (thread 1) required
ORA-00312: online log 1 thread 1: '/app/oradata/orcl/redo01.log'

However, because group 1 is the current online log, shutdown plus I was using before the abort to shut down the database

Data files in an inconsistent state, you need to use the current log for instance recovery, it can not be cleared by clearing the log command

If the database file is in a consistent state, so that here we can open command to open the database by alter database, but if you encounter such a situation inconsistent, but also open the database through resetlogs, as follows:

SQL> recover database until cancel;
ORA-00279: Change 984 722 (generated at 09/16/2015 16:04:43) is required for the thread 1
ORA-00289: Recommendation: /app/archivelog/orcl_1_1_890582670.dbf
ORA-00280: Change 984 722 (for thread 1) in the sequence # 1
Specify the log: { = suggested | filename | AUTO | CANCEL}
AUTO
ORA-00308: can not open archived log '/app/archivelog/orcl_1_1_890582670.dbf'
ORA-27037: unable to obtain file status
Linux-x86_64 Error: 2: No such file or directory
Additional information: 3
ORA-00308: can not open archived log '/app/archivelog/orcl_1_1_890582670.dbf'
ORA-27037: unable to obtain file status
Linux-x86_64 Error: 2: No such file or directory
Additional information: 3
ORA-01547: warning: RECOVER succeeded but OPEN RESETLOGS would get error below
ORA-01194: file 1 needs more recovery to be consistent
ORA-01110: data file 1: '/app/oradata/orcl/system01.dbf'
SQL> recover database until cancel
ORA-00279: Change 984 722 (generated at 09/16/2015 16:04:43) is required for the thread 1
ORA-00289: Recommendation: /app/archivelog/orcl_1_1_890582670.dbf
ORA-00280: Change 984 722 (for thread 1) in the sequence # 1
Specify the log: { = suggested | filename | AUTO | CANCEL}
CANCEL
ORA-01547: warning: RECOVER succeeded but OPEN RESETLOGS would get error below
ORA-01194: file 1 needs more recovery to be consistent
ORA-01110: data file 1: '/app/oradata/orcl/system01.dbf'
ORA-01112: media recovery not started
SQL> alter database open resetlogs;
alter database open resetlogs
*
Line 1 Error:
ORA-01194: file 1 needs more recovery to maintain consistency
ORA-01110: data file 1: '/app/oradata/orcl/system01.dbf'

However, we found incomplete recovery failed, this time by resetlogs open the database is not possible, then we can only through the application of hidden parameters, by making the implicit parameter to open a database in an inconsistent state, as follows:

SQL> create pfile = '/ home / oracle / p2.ora' from spfile;
In pfile which increased * ._ allow_resetlogs_corruption = TRUE
echo "* ._ allow_resetlogs_corruption = TRUE" >> p2.ora
Then open the database to mount state through our new pfile:
SQL> startup mount pfile = '/ home / oracle / p2.ora'
ORACLE instance started.
Total System Global Area 334036992 bytes
Fixed Size 2253024 bytes
Variable Size 171970336 bytes
Database Buffers 155189248 bytes
Redo Buffers 4624384 bytes
Database loading is completed.
Then open the database by resetlogs method
SQL> alter database open resetlogs;
Database has changed.

Because we use our temporary generated pfile to start, it is also the final step, you can restart the database

Well, the database is open, but because our database recover from exceptional cases, there may be a problem, it is proposed to make a backup to prevent data loss.
     
         
         
         
  More:      
 
- Introduction to Linux system process monitoring tools (Linux)
- OpenSSL to generate public and private key (Linux)
- MySQL to recover the data through binlog (Database)
- vector C ++ sequence containers (Programming)
- Sublime Text - Opens the current file in a browser (Linux)
- How do you prevent other users from accessing your home directory in Linux (Linux)
- Configuring xdebug debugging environment in Ubuntu 14.04 under the PhpStorm (Linux)
- Under Ubuntu on how to use iptables firewall (Linux)
- Iptables Instructions (Linux)
- Oracle 11g RMAN cross-platform transfer table space (Database)
- How to restart after a crash Cinnamon (Linux)
- SecureCRT remote connection Ubuntu fails to solve the case (Linux)
- You need to know 12 Git High Command (Linux)
- Go constructed using an interpreted language (Programming)
- xCAT install and update software (Linux)
- Ubuntu 14.10 Install Ubuntu Touch Music App 2.0 (Linux)
- Oracle restrict certain IP, the malicious user actions on important table (Database)
- MySQL database to open a remote connection method (Database)
- Installation of JDK and Tomcat under Linux (CentOS) (Linux)
- To access an Oracle database using Instant Client (Database)
     
           
     
  CopyRight 2002-2022 newfreesoft.com, All Rights Reserved.