Catalog method for Rman backup and recovery example _oracle

Source: Internet
Author: User
Tags knowledge base oracle database

Note: The catalog directory needs to specifically create a database for recovery

First, catalog backup
1. Create a table space

Copy Code code as follows:

Sql>create tablespace rman datafile ' C:\oracle\product\10.2.0\oradata\orcl\rman01.dbf ' size 50M
Extent management local uniform size 128K;

2. Create user
Copy Code code as follows:

Sql>create user Rman identified by Rman
Default Tablespace Rman
Temporary tablespace temp #临时表空间
Quota Unlimited on Rman;

3. Authorization
Copy Code code as follows:

Sql>grant Connect,resource,recovery_catalog_owner to Rman;

4. Create a recovery directory
Copy Code code as follows:

C:\>rman Catalog Rman/rman
Rman>create Catalog;

5. Register a database to be backed up "the registration database needs to be connected to both target and directory (catalog) databases simultaneously"
Copy Code code as follows:

C:\>rman Catalog Rman/rman Target SYS/ORCL
Rman>register database;

To unregister a registered database:
Copy Code code as follows:

Rman>unregister database;

6, use the catalog database to backup the target database
Copy Code code as follows:

C:\>rman Catalog Rman/rman Target SYS/ORCL
Rman>create Script fullbk{#创建备份脚本
Backup full tag ' sys ' database
Include current Controlfile
Format ' c:\backup\sysfull_%d_%T_%s '
Plus Archivelog
Format ' c:\backup\sysarch_%d_T_%s '
Delete all input;
}
Rman>run{execute script FULLBK;} #调用脚本

To delete a script:
Copy Code code as follows:

Rman>delete script FULLBK;

Ii. Recovery of Catalog
1,

Copy Code code as follows:

C:\>rman Catalog Rman/rman Target SYS/ORCL

2, next reference to Ben Boven "Rman recovery program and the different machine recovery"

Three, catalog and nocatalog difference
1, Nocatalog Way: With control file as a catalog, every backup to the controlling document to write a lot of backup information, control files will have more and more backup information, That is, Rman's backup information is written in the local control file.
2, Catalog way: You must first create a directory backup database (catalog, also known as the Knowledge Base), set up a recovery directory, that is, the database backup information written to the recovery directory.
3, when the Oracle database is backed up through an Rman nocatalog, Oracle uses Controlfile to store the Rman backup information. Therefore, when backing up a database using the Rman Nocatalog method, be sure to back up the controlfile. The
initialization parameter Control_file__record_keep_time sets the time to save the backup information and automatically clears the previous backup information at the specified time:
sql> alter SYSEM set Control_file_ Record_keep_time=7 Scope=spfile;

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.