A concise tutorial of Rman VII-the use of recovery catalogs and recovery catalogs

Source: Internet
Author: User
Tags db2

Oracle version 9 because of the automatic backup of control files, the recovery directory is not required to use, but the recovery directory also has the following benefits
• Some commands are only restored to the directory support (for 9i, that is, specifically to operate the recovery directory of statements)
• Retention of more historical backup information
• A recovery directory to manage and back up multiple target databases
• Loss of control files without recovery directory will be difficult to recover if 9i
• If there is no recovery directory and structural changes occur, point-in-time recovery needs to be handled with care
• Scripts that can store backup and recovery
As you can see, it is possible to keep more backup information and manage multiple target databases conveniently, which can be considered in the case of many target databases.

First, create a recovery directory
Note that the recovery directory should not be on the same machine as the target database, and that the size requirement is relatively small.
Sql> create user RMAN identified by RMAN
2 temporary tablespace TEMP
3 Default Tablespace Rcvcat
4 Quota unlimited on rcvcat;
Sql> Grant Recovery_catalog_owner to RMAN;
rman> Create Catalog
rman> Register database;
The recovery directory can be upgraded and deleted with the following command
Rman> UPGRADE CATALOG;
Rman> DROP CATALOG;
second, restore directory management
The recovery directory supports the following commands
{create| upgrade| DROP} CATALOG
{create| delete| replace| PRINT} SCRIPT
LIST incarnation
REGISTER DATABASE
The In time
RESET DATABASE
RESYNC CATALOG
1, Resync command
Resync can synchronize the information between the database and the recovery directory, and in practice, Rman can generally synchronize automatically.
Synchronization is required in the following situations
• Changes in the physical structure of the database
• Increase or change the size of the data file
• Table Space Deletion
• Rollback segment Creation and deletion
• 10 archived logs per generation
2. Reset Order
After the target database resetlogs, the recovery directory needs to be reset. Reset command is used to reset the recovery directory.
Third, restore catalog view
The recovery directory itself has a set of views that hold the target database and backup information, such as the associated view of the recovery directory
Rc_database
Rc_datafile
Rc_stored_script 20
Rc_stored_script_line
Rc_tablespace
You can view related information by using the following command
SELECT * from Rc_database;
Four, storage scripts
Storing Scripts

rman> Creata Script level0backp{
Backup
Incremental Level 0
Format '/u01/db01/backup/%u '
Filesperset 5
Database plus archivelog Delete input;
SQL ' ALTER DATABASE archive log current ';
}
Execute Script
Rman> Run {execute script level0backup;}
Update Scripts
rman> Replace script level0backup{
......
}
Delete Script
rman> Delete Script level0backup;
Viewing Scripts
rman> Print Script level0backup;

A utility script that includes a shell script that backs up the RAC database with the archive log
[Oracle@db worksh]$ more rmanback.sh
#!/bin/sh
#set env
Export oracle_home=/opt/oracle/product/9.2
Export Oracle_sid=db2in1
Export nls_lang= "AMERICAN_AMERICA.ZHS16GBK"
Export path= $PATH: $ORACLE _home/bin:/sbin:/usr/sbin

echo "-----------------------------start-----------------------------";d ate
#backup start
$ORACLE _home/bin/rman <<eof
Connect target
Delete NoPrompt obsolete;
Backup database include current controlfile format '/rmanback/db2/%u_%s.bak ' Filesperset = 2;

run{
ALLOCATE CHANNEL node_c1 DEVICE TYPE DISK CONNECT ' sys/pass@db1in1 ';
ALLOCATE CHANNEL node_c2 DEVICE TYPE DISK CONNECT ' sys/pass@db2in2 ';
SQL ' ALTER SYSTEM ARCHIVE LOG current ';
Backup Archivelog All Delete input format '/rmanback/db2/%u_%s.bak ' filesperset = 5;
}

List backup;
Exit
Eof
echo "------------------------------end------------------------------";d ate

Oracle Community PDM Chinese Network: Http://www.pdmcn.com/bbs,

Oracle expert QQ Group: 60632593, 60618621

Oracle Technical Data: Oracle 9i Rman Reference Manual, oracle10g backup and restore,Oracle Database 10gRMAN Backup and Recovery

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.