Standard RMAN backup process (CASE) (Database Backup) and rman Database Backup

Source: Internet
Author: User

Standard RMAN backup process (CASE) (Database Backup) and rman Database Backup

Created By BaO new

I. Summary

RMAN _ learning the clinical RMAN backup Standard Process (case study)

RMAN is a recovery and backup tool provided by Oracle. It is a tool software installed with the Oracle server software. It can be used to back up and restore database files, archive logs and control files, used to perform full or incomplete database recovery.

Compared with traditional tools, RMAN has a unique advantage: Skipping unused data blocks.

When you back up an RMAN backup set, RMAN does not back up data blocks that have never been written, but the traditional method cannot tell which data blocks are not used.

RMAN adopts the Oracle-specific binary compression mode. Compared with the traditional backup compression mode, it can compress some typical data in data blocks to the maximum extent.

 

Ii. Backup-Backup

Step1. Check whether a new directory is large enough-Check new filesystem for backup

[oracle@odellprod backup]$ pwd/data/oracle/odellprod/backup
[oracle@odellprod backup]$ df -k /data/oracle/odellprod/backupFilesystem 1K-blocks Used Available Use% Mounted on/dev/sda2 38352124 18196724 18175792 51% /

Step2. switch the database odellprod to the Mount mode-Mount database odellprod

[oracle@odellprod backup]$ . oraenvORACLE_SID = [odellprod] ? odellprodThe Oracle base for ORACLE_HOME=/opt/oracle/product/11.2.0/odellprod is /opt/oracle
[oracle@odellprod backup]$ sqlplus '/as sysdba'SQL*Plus: Release 11.2.0.1.0 Production on Tue Dec 23 01:34:36 2014Copyright (c) 1982, 2009, Oracle. All rights reserved.Connected to an idle instance.SQL> startup mountORACLE instance started.Total System Global Area 422670336 bytesFixed Size 1336960 bytesVariable Size 318769536 bytesDatabase Buffers 96468992 bytesRedo Buffers 6094848 bytesDatabase mounted.

Step back up databases, logs, control files, and parameter files-Backup database, archivelogs, controlfiles and spfile with rman

[oracle@odellprod backup]$ export NLS_DATE_FORMAT='YYYY-MM-DD HH24:MI:SS'[oracle@odellprod backup]$ rman target /Recovery Manager: Release 11.2.0.1.0 - Production on Tue Dec 23 01:38:07 2014Copyright (c) 1982, 2009, Oracle and/or its affiliates.  All rights reserved.connected to target database: ODELLPRO (DBID=1328237028, not open)RMAN> show DEVICE TYPE;using target database control file instead of recovery catalogRMAN configuration parameters for database with db_unique_name ODELLPROD are:CONFIGURE DEVICE TYPE DISK PARALLELISM 1 BACKUP TYPE TO BACKUPSET; # defaultRMAN> CONFIGURE DEVICE TYPE DISK PARALLELISM 6;new RMAN configuration parameters:CONFIGURE DEVICE TYPE DISK PARALLELISM 6 BACKUP TYPE TO BACKUPSET;new RMAN configuration parameters are successfully storedRMAN> show DEVICE TYPE;RMAN configuration parameters for database with db_unique_name ODELLPROD are:CONFIGURE DEVICE TYPE DISK PARALLELISM 6 BACKUP TYPE TO BACKUPSET;RMAN> run{BACKUP AS COMPRESSED BACKUPSETINCREMENTAL LEVEL = 0 DATABASEFORMAT = '/data/oracle/odellprod/backup/ODELLPROD_DF_%U_%T' tag 'database backup'PLUS ARCHIVELOG SKIP INACCESSIBLEFORMAT='/data/oracle/odellprod/backup/ODELLPROD_ARCH_%U_%T' tag 'archive log backup';backup spfile format '/data/oracle/odellprod/backup/ODELLPROD_SPFILE' tag 'spfile backup';backup current controlfile format '/data/oracle/odellprod/backup/ODELLPROD_CONTROLFILE' tag 'control file backup';}2> 3> 4> 5> 6> 7> 8> 9> 10> 11> 12> Starting backup at 2014-12-23 01:39:01Finished backup at 2014-12-23 01:44:46RMAN> list backup;

RMAN> exit

 

Iii. Restore-Restore/Recovery

Step1. check whether the Backup directory is valid-Make sure filesystem with backups is mounted

[oracle@odellprod backup]$ df -k /data/oracle/odellprod/backupFilesystem           1K-blocks      Used Available Use% Mounted on/dev/sda2             38352124  19588744  16783772  54% /[oracle@odellprod backup]$ ls -ltr /data/oracle/odellprod/backuptotal 1391716-rw-r----- 1 oracle oinstall 169477120 Dec 23 01:42 ODELLPROD_ARCH_0apqrkto_1_1_20141223-rw-r----- 1 oracle oinstall 160933376 Dec 23 01:42 ODELLPROD_ARCH_0fpqrktq_1_1_20141223-rw-r----- 1 oracle oinstall 179330048 Dec 23 01:42 ODELLPROD_ARCH_0bpqrkto_1_1_20141223-rw-r----- 1 oracle oinstall 190604800 Dec 23 01:42 ODELLPROD_ARCH_0cpqrktp_1_1_20141223-rw-r----- 1 oracle oinstall 195282944 Dec 23 01:43 ODELLPROD_ARCH_0dpqrktp_1_1_20141223-rw-r----- 1 oracle oinstall 195831296 Dec 23 01:43 ODELLPROD_ARCH_0epqrktp_1_1_20141223-rw-r----- 1 oracle oinstall   1441792 Dec 23 01:43 ODELLPROD_DF_0hpqrl5i_1_1_20141223-rw-r----- 1 oracle oinstall   3637248 Dec 23 01:43 ODELLPROD_DF_0kpqrl5l_1_1_20141223-rw-r----- 1 oracle oinstall     98304 Dec 23 01:43 ODELLPROD_DF_0mpqrl66_1_1_20141223-rw-r----- 1 oracle oinstall   1114112 Dec 23 01:43 ODELLPROD_DF_0lpqrl5m_1_1_20141223-rw-r----- 1 oracle oinstall  22978560 Dec 23 01:43 ODELLPROD_DF_0jpqrl5j_1_1_20141223-rw-r----- 1 oracle oinstall  93609984 Dec 23 01:44 ODELLPROD_DF_0ipqrl5i_1_1_20141223-rw-r----- 1 oracle oinstall 199303168 Dec 23 01:44 ODELLPROD_DF_0gpqrl5h_1_1_20141223-rw-r----- 1 oracle oinstall     98304 Dec 23 01:44 ODELLPROD_SPFILE-rw-r----- 1 oracle oinstall   9895936 Dec 23 01:44 ODELLPROD_CONTROLFILE

Step2. Restore the parameter file from the backup-Restore spfile from backups

[oracle@odellprod dbs]$ . oraenvORACLE_SID = [odellprod] ? odellprodThe Oracle base for ORACLE_HOME=/opt/oracle/product/11.2.0/odellprod is /opt/oracle
[oracle@odellprod dbs]$ export NLS_DATE_FORMAT='YYYY-MM-DD HH24:MI:SS'
[oracle@odellprod dbs]$ rman target /Recovery Manager: Release 11.2.0.1.0 - Production on Tue Dec 23 01:57:55 2014Copyright (c) 1982, 2009, Oracle and/or its affiliates. All rights reserved.connected to target database (not started)RMAN> startup nomountOracle instance startedTotal System Global Area 422670336 bytesFixed Size 1336960 bytesVariable Size 318769536 bytesDatabase Buffers 96468992 bytesRedo Buffers 6094848 bytesRMAN> restore spfile to '$ORACLE_HOME/dbs/spfileodellprod.ora' from '/data/oracle/odellprod/backup/ODELLPROD_SPFILE';RMAN> shutdown immediateOracle instance shut down

Step3. Restore the control file from the backup-Restore controlfiles from backups and mount database

RMAN> startup nomountconnected to target database (not started)startup failed: ORA-01078: failure in processing system parametersLRM-00109: could not open parameter file '/opt/oracle/product/11.2.0/odellprod/dbs/initodellprod.ora'starting Oracle instance without parameter file for retrieval of spfileOracle instance startedTotal System Global Area     159019008 bytesFixed Size                     1335192 bytesVariable Size                 75497576 bytesDatabase Buffers              79691776 bytesRedo Buffers                   2494464 bytesRMAN> restore controlfile from '/data/oracle/odellprod/backup/ODELLPROD_CONTROLFILE'; Starting restore at 2014-12-23 02:03:52allocated channel: ORA_DISK_1channel ORA_DISK_1: SID=18 device type=DISKchannel ORA_DISK_1: restoring control filechannel ORA_DISK_1: restore complete, elapsed time: 00:00:01output file name=/opt/oracle/product/11.2.0/odellprod/dbs/cntrlodellprod.dbfFinished restore at 2014-12-23 02:03:53RMAN> alter database mount;database mountedreleased channel: ORA_DISK_1

Step 4. Restore the data file from the backup-Restore database from backups

RMAN> restore database;Starting restore at 2014-12-23 02:04:35allocated channel: ORA_DISK_1channel ORA_DISK_1: SID=18 device type=DISKallocated channel: ORA_DISK_2channel ORA_DISK_2: SID=19 device type=DISKallocated channel: ORA_DISK_3channel ORA_DISK_3: SID=21 device type=DISKallocated channel: ORA_DISK_4channel ORA_DISK_4: SID=22 device type=DISKallocated channel: ORA_DISK_5channel ORA_DISK_5: SID=23 device type=DISKallocated channel: ORA_DISK_6channel ORA_DISK_6: SID=24 device type=DISKskipping datafile 1; already restored to file /opt/oracle/oradata/odellprod/system01.dbfskipping datafile 2; already restored to file /opt/oracle/oradata/odellprod/sysaux01.dbfskipping datafile 3; already restored to file /opt/oracle/oradata/odellprod/undotbs01.dbfskipping datafile 4; already restored to file /opt/oracle/oradata/odellprod/users01.dbfskipping datafile 5; already restored to file /opt/oracle/oradata/odellprod/example01.dbfrestore not done; all files read only, offline, or already restoredFinished restore at 2014-12-23 02:04:37

Step 5. Restore the database-Recover database

RMAN> recover database;Starting recover at 2014-12-23 02:05:15using channel ORA_DISK_1using channel ORA_DISK_2using channel ORA_DISK_3using channel ORA_DISK_4using channel ORA_DISK_5using channel ORA_DISK_6starting media recoveryarchived log for thread 1 with sequence 103 is already on disk as file /opt/oracle/oradata/odellprod/redo01.logarchived log file name=/opt/oracle/oradata/odellprod/redo01.log thread=1 sequence=103media recovery complete, elapsed time: 00:00:00Finished recover at 2014-12-23 02:05:16

Step 6. Open Data-Open database

RMAN> alter database open resetlogs;database opened

 

Thanks and Regards

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.