Restore the Oracle database by manual backup:
Although the Rman tool is already available
But restoring Oracle manually will give you a deeper understanding of Oracle Database
Database consistent boot conditions:
Data file SCN, control file Scn,redo SCN consistent
Control file Record:
SCN to which data files should arrive
Current Redo
Physical structure information of the data
Archive information
Prerequisites:
Archive Log On
Data files are backed up
Control file has backup
Backup data:
Data file Backup:
Data file into backup mode:
Select ' Alter tablespace ' | | tablespace_name| | ' begin backup; ' from dba_tablespaces where tablespace_name does like '%temp% ';
Confirm access to Backup status:
The operating system performs the physical copy command:
CP *.dbf/home/oracle/sg_backup_dbf/
Copy complete, exit Backup mode:
Data file backup complete!!!
Backup complete switch several times archive (multiple switching)
alter system switch logfile;
Control file Backup:
Backup into binary form:
Sql>alter database backup Controlfile to '/home/oracle/backup_ctl/prod4_ctl_20170703 ';
To back up a logical file:
sql> ALTER DATABASE backup Controlfile to trace as '/home/oracle/backup_ctl/prod4.ctl ';
One, table space data file deletion recovery:
Restart data error:
Follow the prompts to view the data file no longer exists (deleted)
Restore by copying a previously backed up data file:
cp/home/oracle/sg_backup_dbf/*.
View SCN number: (Inconsistent status)
Data recovery by executing recover database ()
Start the database:
sql> ALTER DATABASE open;
#恢复完成!
Second, the control file is deleted:
To restart the database:
Recover from old version data file:
cp/home/oracle/backup_ctl/prod4_ctl_20170703./control01.ctl
cp/home/oracle/backup_ctl/prod4_ctl_20170703./control02.ctl
Restart again:
Perform recovery:
sql> Recover database using Backup controlfile until cancel;
#auto mode
Error:
(The old control file does not know the situation of redo)
Perform the recovery again:
sql> Recover database using Backup controlfile until cancel;
#Specify log: {<ret>=suggested | AUTO | CANCEL}
#/u01/app/oracle/oradata/prod4/prod4/redo01.log #使用指定的redo文件恢复 (enter this line manually)
Boot:
sql> altr database open resetlogs;
Recovery complete!
Control file corruption requires a full standby after recovery
Use ALTR database open resetlogs; When booting, Redolog is reinitialized,
Archive log, backup of previous data files is all invalid
Delete Useless archive log
Third, the current redo damage
Restarting the database does not boot
Recovery:
Delete a data file
Recovering a data file using an old backup
The recovery is similar to the previous mentioned:
Restore command:
Recover database using Backup controlfile until cancel;
#auto
Recover database using Backup controlfile until cancel;
#cancel
Delete a control file
Close the database
Use Backup logic to control File Recovery control files (Find a section similar to the following, directly executed)
(A data file is required to recover the control file, but it is not possible to use the current data file, which is why the data file was deleted before it was recovered)
Perform power on:
ALTER DATABASE open resetlogs;
Fully prepared
Delete Useless archive log
Summarize:
The principle of consistent boot
SCN number
Steps to boot
Required files for boot
Restore Oracle database by manual Backup