Home PC Games Linux Windows Database Network Programming Server Mobile  
           
  Home \ Database \ Oracle database online redo logs are several methods of recovery of deleted     - Safety testing Unix and Linux server entry succinctly (Linux)

- The practical application of Oracle synonyms + dblink (Database)

- After reloading the cinder-volume OpenStack not start properly (Server)

- MongoDB Study Notes (1) - Install MongoDB on Windows systems (Database)

- Linux data recovery software efficiently practical application extundelete (Linux)

- MySQL appears data too long for column 'name' at row 1 to solve (Database)

- Python developer of time-saving method (Programming)

- Ubuntu how to install and use Objective-C (Linux)

- MySQL 5.6.26 source install (Database)

- The difference between statement and preparedStatement of the jdbc (Database)

- To build Spring RestTemplate use HttpClient4 (Programming)

- Go constructed using an interpreted language (Programming)

- gzip, bzip2, xz, tar, zip compression, archive Detailed (Linux)

- Not safe procedure under Linux (Linux)

- GRUB and Linux system repair (Linux)

- Sublime Text 3 practical functions and shortcut keys used to collect (Linux)

- Install the Red Hat Container Development Kit on OSX (Server)

- MyEclipse configuration necessary (Linux)

- Tmux Getting Start (Linux)

- Linux Command study manual - GPG command (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:      
 
- Using shell users or virtual users to login to pureftpd (Linux)
- How to monitor Nginx (Database)
- linux server security (Linux)
- Android custom ViewPager create kaleidoscopic image transition effects (Programming)
- Linux into single user mode to modify the administrator password (Linux)
- Linux User Management (Linux)
- Customize own small private Linux system (Linux)
- SendMail version of Java implementation with attachments (Programming)
- How to determine whether the Linux server was hacked (Linux)
- Apache2.4.7 make an error [exports.lo] Error 1 Solution (Server)
- ogg Oracle to SQL Server 2005 to achieve synchronization (Database)
- Copy Recovery using RMAN repository development environment (Database)
- To create and manage virtual machines on Ubuntu Redhat (Linux)
- OpenGL Superb Learning Notes - Fragment Shader (Programming)
- How to install and use the malware detection tool LMD and ClamAV antivirus engine on Linux (Linux)
- ORA-28000 the account is locked fault simulation (Database)
- Hard disk encryption to protect data security (Linux)
- MySQL full-index scan bug (Database)
- C ++ based foundation: the difference between C and C ++ (Programming)
- sudoers file parsing (Linux)
     
           
     
  CopyRight 2002-2020 newfreesoft.com, All Rights Reserved.