Oracle 11g OCP Notes (15)-Backup with Rman

Source: Internet
Author: User

First, the terminology of backup

Turn off and on (cold and hot standby consistent and non-consistent backups) open backups can only be in archive mode

All and local local backups can only be in archive mode.

Full and incremental backup incremental backups are divided into cumulative incremental and differential incremental backups.

The files that Rman can back up are: Data files, archive files, control files, SPFile, backup pieces

Files that cannot be backed up are: Redo log temp file, password file, pfile,oracle net file.

Rman can be divided into three types of backup sets, compressed backup sets, and image replicas. The backup set is either incremental or complete, and the image can only be complete,

Backup set

A repository (repository) is metadata about a backup, stored in a control file, or in a secondary database.

Second, create a backup

1, consistent backup.

For Rman: Cleanly shut down the database and boot into Mount state. Backup database (snapshot implementation of Rman read control file)

User-managed full backups are not valid in Mount state because the control files are read and written frequently.

run{

Shutdown immediate;

startup Mount;

Allocate channel d Tyoe desk;

Backup as Backupset database

Format ' D:\1.bak ';

ALTER DATABASE open;

}

Rman target Sys/[email protected] @backup. Man

2) server-managed backup of the open state.

run{

Allocate channel T1 type Sbt_disk;

Allocate channel T2 type Sbt_disk;

Backup as compressed backupset filesperset 4 database;

Backup as compressed backupset archivelog all delete all input;

}

If Dbwn is writing, there will be a block break and Oracle will try to replicate him again.

Backup as backupset format '/back/df_%d_%f_%s ' tablespace users%d database ID backup machine number back-up slice number.

Backup as Backupset datafile 4

Backup as backup archivelog like '/ach/arch_1_% '

3) Incremental Backup

The starting point is 0 levels, backup as Backupset incremental level 0 database;

The default level of backup will also read the entire file, the advantage is to check the bad block, the disadvantage is slow, you can turn on block tracking, CTWR process.

The block trace file is located at: Db_create_file_dest.

Alter DATABASE enable block tracking useing file ' D:\1.DBF '

Checksum: SELECT * FROM v$block_change_tracking--size

Select program from v$process where program like '%ctwr% '

Use v$backup_datafile for tracking.

4) Copy Backup

Control file, log file, data file composition, can not have spfile??

Backup as copy database;

Backup as copy archivelog all delete all input.

5) Protect backup

Backup as backup DEVICCE type disk copies database plus archivelog;

Backup device type Sbt_tape backupset all delete all input; Copy the backup on the tape to disk.

Backup recovery area;

backup recovery files;

6) Parallel backup

Starting a backup starts the default session and polling session at least: A third session is required when reading or writing to a disk or tape: a channel.

Select Username,program from V$session order by program; query for these three sessions.

Parallel backups: Number of channels, number of backup sets, number of input files

Backup as Backupset database files per set 8; If 100 files, 13 backup machines, the degree of parallelism is 4.

7) Encrypted backup

Set encryption algorithm ' aes256 ' identified by Pa55word;

Backup as compressed backupset database format '/u01/sss. Bak ';

To increase when restoring

Set decryption identified BU Pa55word is only available.

Third, configure the Rman default value

Show all displays the configured values.

Use configure to modify.

----How to revert to the default value again????

Iv. managing and monitoring Rman backups

1) List, report, and DELETE commands

list backup;
list copy;
list Backup of database; --List all backups that have been executed and recorded in the warehouse
list Backup of datafile 1; --List all backups of the data file
list Backup of Archivelog all; --List all backups of archived redo log files


report need backup; -All content that needs to be backed up (based on Rman's configuration retention policy)
report obsolete; --all backups that are no longer needed (based on Rman's configuration retention policy)

Crosscheck-forces Rman to compare the warehouse to the actual requirements, and the missing content is marked as expired.
Delete Expired--remove references to outdated backups from the warehouse
Delete Obsolete--remove any unwanted backups from the disk or tape and remove the backup references from the warehouse.
Catalog-The location of the user-managed backup is included in the warehouse.

2) Archive Backup:

Backup XXX Keep {forever | until time xxxx} [restore point xxxx]-----The restore point xxxx is the name in the control file.

V$archived_log still exists after the archive log is removed:
Rman Target/
Rman> crosscheck Archivelog All;
rman> Delete Expired Archivelog all
Rman> exit

3) Dynamic Performance view:

V$backup_files

V$backup_set

V$backup_peace

V$backup_redolog--One redo backup row record

V$backup_spfile--A line of spfile information

V$backup_datafile--

V$backup_device--rman connected to the SBT

V$rman_configuration--rman configuration information.

4) Cross-examination

Crosscheck Backup of database;

Delete Expired--Do not delete files, just delete Croesscheck in the repository is a backup marked expired.

Delete obsolete--deletes disk files and database records.

Oracle 11g OCP Notes (15)-Backup with Rman

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.