Oracle backup using RMAN

Source: Internet
Author: User

There are many methods for Oracle backup. The following describes how to back up an Oracle database by using the RMAN backup and recovery manager. This method is for your reference, hope to help you.

I. Use RMAN for backup

Recovery managerRMAN) is a DBA tool provided by ORACLE to manage backup and Recovery operations. RMAN can only be used in ORACLE8 or later versions. It can back up the entire database or database parts, including tablespaces, data files, control files, and archive files. RMAN can access and perform backup and recovery as required.

RMAN backup has the following advantages:
☆Online hot backup is supported
☆Supports multi-level Incremental Backup
☆Support parallel backup and recovery
☆Reduce the required backup volume
☆Simple backup and recovery

It is important to use the recovery manager to allow you to perform incremental data block-level Oracle backup, which is different from the Export/Import incremental ). Incremental RMAN backup is effective in time and space because they only back up those data blocks that have changed since the last backup. Another space-effective RMAN feature is that it only backs up data blocks used in data files and ignores empty and unused data blocks. This is of great benefit to the tablespaces in pre-allocated space. From 9i, we have also increased the data block-level recovery of RMAN, which can further reduce the database recovery time.

RMAN supports the following types of backups:

FULL database FULL backup, including all data blocks
INCREMENTAL Backup: Only data blocks modified since the last INCREMENTAL Backup are backed up. A zero-level increment is required as the basis for the increment. It can support 5-level increments.
OPEN is used when the database is opened
CLOSED backs up data when the database is installed (mounted) but not turned on. Closing the backup can be of the CONSISTENT or in consistent type.
CONSISTENT is used when the database is installed. If it is not opened, and the database is permanently closed before installation, it is not damaged or unexpectedly exited. CONSISTENT backup can be simply restored (RESTORE) rather than restored (RECOVER)
INCONSISTENT is used when the database is opened or installed but not opened. After the database is shut down or crashed normally, the INCONSISTENT backup needs to be restored.

Understand the BACKUP, RESTORE, and RECOVER commands. These are the three most basic RMAN commands that can be used to back up, RESTORE, and RECOVER databases. Understand the recovery directory. RMAN can run in the NOCATALOG directory. At this time, the backup information is saved in the control file. The backup information stored in the control file is very dangerous. If the control file is damaged, the backup information will be lost and the recovery will fail, and there is no recovery directory, many RMAN commands will not be supported. For important databases, we recommend that you create a recovery directory. The recovery directory is also a database, but this database is used to save backup information. A recovery directory can be used to back up multiple databases.

Create the RMAN directory. The following steps describe the process of trying to create the RMAN directory in a database.

A. Create a separate tablespace SQL> Create tablespace tools datafile 'fieldname' size 50 m;
B. Create RMAN user SQL> Create user RMAN identified by RMAN default tablespace tools temporary tablespace temp;
C. Grant RMAN permissions SQL> Grant connect, resource, recovery_catalog_owner to rman;
D. Open RMAN $> RMAN
E. connect to the database RMAN> connect catalog rman/rman
F. Create recovery directory RMAN> Create catalog tablespace rman

Register the target database. After the recovery directory is created, you can register the target database. The target database is the database to be backed up. You can register multiple target databases in one recovery directory, run the following command to Register the target database: $> RMAN target internal/password catalog rman/rman @ rcdb; RMAN> Register database; after the database is registered, RMAN can be used for Oracle backup, for more commands, see ORACLE online manual or ORACLE8i backup and recovery manual.

RMAN uses scripts to back up databases. The following are examples of RMAN backup.
A. Back up the entire database backup full tag 'basicdb' format'/bak/oradata/full _ % u _ % s _ % P' database;
B. Back up a tablespace backup tag 'tsuser' format'/bak/oradata/tsuser _ % u _ % s _ % P' tablespace users;
C. backup archiving log backup tag 'alog 'format'/bak/archivebak/arcbak _ % u _ % s _ % P' archivelog all delete input;

Ii. Maintain RMAN

RMAN maintenance is mainly divided into several aspects

1. View RMAN Information
Check Existing backup
RMAN> list backup
List expired backups
RMAN> report obsolete
Delete expired backups
RMAN> allocate channel for maintenance type disk;
RMAN> change backupset id delete;
RMAN> release channel;
2. Synchronize or reset RMAN if the physical object of the target database changes, for example, if a data file is added, run the following command to synchronize: RMAN> resync catalog; if the target database resets the database, run the following command to synchronize RMAN> reset database. After manually deleting the database archive file, run the following script to synchronize RMAN> allocate channel for maintenance type disk;
RMAN> change archivelog all crosscheck; RMAN> release channel; after manually deleting the RMAN backup of the database, run the following script to synchronize RMAN> allocate channel for maintenance type disk; RMAN> crosscheck backup; RMAN> delete expired backup;
 

Oracle EXP/IMP backup Overview

How to Implement ORACLE backup

Oracle control file recovery

Oracle backup command to use instances

Oracle single row date functions

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.