RMAN restoration related concepts, spfile, controlfile Restoration

Source: Internet
Author: User

1. restore refers to accessing the previously generated backup set, obtaining one or more objects, and then restoring these objects at a location on the disk.
Recovery is an actual process that allows a database to be opened at a given time point, this process is usually done through application Redo (including online redo logs and archived redo logs.
2. To open an Oracle database, the database must be in the same status as the given time.
3. Oracle checks whether the current SCN in each data file header is consistent with the current SCN in the control file to determine whether the database is consistent.
4. If the database is found to be inconsistent, Oracle needs to determine whether the database can be restored based on online redo logs, or whether to archive and redo logs to restore the database. If you can use online redo logs to perform a recovery operation, it will perform a disaster recovery (or perform an instance recovery operation in the RAC Environment). If not, it will stop the startup process, media recovery is also required.
5. Use RMAN (without FRA) to restore spfile from automatic backup
Restore spfile from autobackup
By default, Oracle searches for a backup set of the control file created in the past 10 days. If the backup set of the control file created in the specified period is not found, an error is generated.
You can use the maxseq and maxdays parameters of the restore command to modify RMAN to find the time period for automatic backup of control files.
Recovery Example 1
Set oracle_sid = recover
Rman target sys/robert
Set DBID = 2359725638;
Startup nomount;
Restore spfile from autobackup;
Shutdown immediate;
Recovery Example 2 (path specified)
Set oracle_sid = recover
Rman target sys/robert
Set DBID = 2359725638;
Startup nomount;
Run
{
Set controlfile autobackup format for device type disk to 'C: \ oracle \ backup \ % F ';
Allocate channel c1 device type disk;
Restore spfile from autobackup;
}
Shutdown immediate;
Recovery Example 3 (using maxseq and maxdays)
Set oracle_sid = recover
Rman target sys/robert
Set DBID = 2359725638;
Startup nomount;
Run
{
Set controlfile autobackup format for device type disk to 'C: \ oracle \ backup \ % F ';
Allocate channel c1 device type disk;
Restore spfile from autobackup maxseq 200 maxdays 100;
}
Shutdown immediate;
2. Use RMAN and FRA to restore spfile from automatic backup
No DBID or channel allocation is required when FRA is used.
Set oracle_sid = recover
Rman target sys/robert
Startup nomount;
Restore spfile from autobackup;
Shutdown immediate;
3. Restore spfile from a specific backup set
Set oracle_sid = recover
Rman target sys/robert
Set DBID = 2359725638;
Startup nomount;
Run
{
Allocate channel c1 device type disk;
Restore spfile from 'd: \ backup \ recover \ C-2359725638-20131118-00 ';
}
Shutdown immediate;
4. Use the recovery directory to restore spfile
Set oracle_sid = recover
Rman target sys/robert catalog rcat_manager/password @ robt
Startup nomount;
Restore spfile from autobackup;
Shutdown immediate;
5. Restore to pfile
Restore spfile to pfile 'd: \ backup \ test. ora ';
6. Restore the control file (not much different from restoring the spfile)
Recovery Example 1
Set oracle_sid = recover
Rman target sys/robert
Set DBID = 2359725638;
Startup nomount;
Restore controlfile from autobackup;
Shutdown immediate;
Restore Example 2 (restore the backup of an earlier control file. In addition to using maxseq and maxdays, you can also use until time in the same way as restoring the spfile)
Restore controlfile from autobackup until time "to_date ('2014/1/2 13:00:00 ', 'Mm/DD/YYYY HH24: MI: ss ')";
You can use list backup of controlfile;
7. Open the database after restoring the control file
Recovery Example 1 (assuming it runs in noarchivelog Mode)
Set oracle_sid = recover
Rman target sys/robert
Set DBID = 2359725638;
Startup nomount;
Restore database noredo;
Alter database open resetlogs;
Recovery Example 2 (run in archivelog Mode)
Set oracle_sid = recover
Rman target sys/robert
Set DBID = 2359725638;
Startup nomount;
Restore database;
Alter database open resetlogs;
8. Use the catalog command to register and restore related files in the control file
Use the recovery area and db_recovery_file_dest keywords to write the directory for the entire FRA.
Catalog recovery area;
If FRA is not used, start with is used.
Catalog start with 'C: \ oracle \ backups \ testoem ';
9. Restore the backup to another location (set newname for datafile and switch command)
Startup nomount
Restore controlfile from autobackup;
Alter database mount;
Run
{
Set newname for datafile ''to '';
Restore database;
Recover database noredo;
Switch datafile all;
Alter database open resetlogs;
}
10. The recovery operations for spfile and controlfile are the same regardless of whether they are running in archivelog mode.
11. fault point recovery (full recovery) requires online redo logs to be complete, and requires a complete controlfile.
12. Online tablespace recovery
SQL 'alter tablespace users offline ';
Restore tablespace users;
Recover tablespace users;
SQL 'alter tablespace users online ';

Recommended reading:

RMAN: Configure an archive log deletion policy

Basic Oracle tutorial-copying a database through RMAN

Reference for RMAN backup policy formulation

RMAN backup learning notes

Oracle Database Backup encryption RMAN Encryption

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.