Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

Introduction and configuration of catalog recovery catalog

2025-02-25 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >

Share

Shulou(Shulou.com)06/01 Report--

2.1introduction to nocatalog

Nocatalog way is to use control file as catalog, each backup has to write a lot of backup information to the control file, there will be more and more backup information in the control file. Therefore, when using rman nocatalog mode backup, backing up controlfile is very important.

Since controlfile is used to store backup information during nocatalog, it is recommended to increase the control_file_record_keep_ time value in the oracle parameter file (default is 7 days). The parameter is in $oracle_home/dbs/initsid.ora. This parameter control_file__record_keep_time sets the backup information storage time, and the previous backup information is automatically cleared at the specified time.

Sql > show parameter control

Sql > select name,value,issys_modifiable from v$parameter where name='control_file_record_keep_time'

2.2.The introduction of catalog

The catalog recovery catalog stores metadata related to rman backups. In a sense, the recovery catalog can be seen as a copy of the relevant information needed to save rman backups and restores.

We can create a recovery directory in user mode in the oracle database, which is just a few packets, tables, indexes, and views.

The resynchronization command in rman causes the contents of the target database control file to refresh the data in these tables. The difference, of course, is that the recovery directory can contain information about all databases in the enterprise, while the control file contains only information about its own database.

2.3.The configuration process of catalog recovery directory

See the demo for details.

01. Create the tablespaces required for catalog

Sql > create tablespace tbs_rman datafile'/ oradata/ocm/tbs_rman01.dbf' size 20m

02. Create rman users and authorize

Sql > create user rman identified by rman default tablespace tbs_rman quota unlimited on tbs_rman

Sql > grant connect,resource,recovery_catalog_owner to rman

03. Create a recovery directory

Oracle > rman catalog rman/rman

Rman > create catalog tablespace tbs_rman

04. Configure the tnsnames.ora of the target database

Rman =

(description =

(address_list =

(address = (protocol = tcp) (host = 10.53.110.181) (port = 1521))

)

(connect_data =

(sid = ocm)

)

)

05. Register the target database

$rman target / catalog rman/rman@itpuxdb

Rman > register database

06. Check the catalog recovery directory

Display target database registration information

Rman > report schema

Display backup information

Rman > list backup

The command explains:

Report schema report shema means to find schema in the database.

List backup reads information from control

07. Add rman backup to the recovery directory

If you have already performed rman backups without a recovery directory, and you want to add those backups to the recovery directory later, you can use the catalog command. You can add copies of data files, backup slices, archive log backups, and even entire backup directories to the directory. Examples are as follows:

Rman > catalog datafilecopy'/ ggs/arch_log/system01.dbf'

Rman > catalog archivelog'/ ggs/arch_log/arch_20.arc'

Rman > catalog backuppiece'/ ggs/arch_log/backup_031.bkp'

Rman > catalog start with'/ ggs/arch_log/'

Rman > catalog recovery area

Note: to use the catalog start with command cautiously, you must add a backslash suffix at the end of the directory path. If not, all combinations under the directory will be traversed. For example, / oradata/ocm/ocm-old.

08. Upgrade problem

Upgrade catalog

09. About the database counterpart

When you open the database, if you use the resetlogs parameter, a new counterpart is created. If this is done in RMAN, the recovery directory will be updated correctly, but if you manually execute the resetlogs command (such as sqlplus), you must reset the database counterpart in the recovery directory.

Rman > reset database to incarnation 5

Restore the deletion of directory records

Only a few records will be deleted from the recovery directory, and if not maintained, the backup with the status of deleted will always reside in the recovery directory. To solve this problem, Oracle provides a $ORACLE_HOME/rdbms/admin/prgmanc.sql script to delete all records in the recovery directory with a status of deleted. It is recommended that you execute this script periodically to control the size of the file recovery directory.

If you want to delete old counterpart records from the recovery catalog, you must delete them from the DBINC table. You can use the RC_DATABASE_INCARNATION view to identify the counterpart to delete and record the DBINC_ key value of each counterpart you want to delete. Then execute the delete command in sqlplus, such as:

SQL > select * from rc_database_incarnation

SQL > delete from dbinc where dbinc_key=4

1 line has been deleted.

10. Manually synchronize the recovery directory

10. Manually resynchronize the recovery directory (resync catalog)

When RMAN uses the recovery directory, it uses the synchronization process to ensure that the control files of the recovery directory and the target database are consistent. Typically, Oracle synchronizes the database after the RMAN operation (backup and restore), so that the recovery directory does not have to be synchronized frequently. One instance of the recovery directory that needs to be resynchronized is that sometimes the recovery directory is used and sometimes the recovery directory is not used. At this point, you can use the resync catalog command to manually resynchronize the recovery directory with Oracle.

Rman > resync catalog

When Oracle synchronizes the recovery directory, it first creates a snapshot control file and compares the file with the recovery directory. After completing the comparison, Oracle updates the recovery directory so that the recovery directory is synchronized with the database control file.

Restore the backup of the directory

RMAN

Exp/export

12. Cancel registration of the database 10

Unregister database

Unregister database itpuxdb

13. Restore the deletion of the directory

Drop catalog

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Database

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report