Documents

7 pages
107 views

RMAN - From Beginner to Advanced-Manuskript

of 7
All materials on our website are shared by users. If you have any questions about copyright issues, please report us to resolve them. We are always happy to assist you.
Share
Description
rgr r
Transcript
   RMAN - From Beginner to Advanced Marcin Przepiorowski Delphix Ireland Keywords: Backup / Recovery, Recovery Manager, Disaster Recovery Introduction The Oracle Recovery Manager is the main tool for backup and recovery of the Oracle database. It is very important for all DBA’s to understand how it’s working and how to resolve any issues with  backups and more importantly to understand how to recover database in the different scenarios. My work experience is showing me that junior DBA’s are using Recovery Manager mostly through Oracle Enterprise Manager and some of them are afraid or don’t know how to use command line interface. This presentation is going to cover RMAN concepts and show examples of how to deal with typical  back and recovery scenarios and how to interpret scripts and RMAN output logs. It will cover a concept of Recovery Manager channel and typical backup, restore and recover commands. In addition to that, maintenance of backups including adding, cross checking and delete of backup set in the typical scenarios. Recovery Manager concept Recovery Manager is a part of an Oracle database. It’s built into kernel of database and it has a PL/SQL API. Recovery Manager has two interfaces: command line interface (rman command) and GUI interface ( Oracle Cloud Control or Oracle Enterprise Manager). GUI interface has a faster learning curve but it also has more limitations. All jobs defined by GUI are generating scripts executed by command line interface. Client command (rman) can be connected to managed database in same way like SQLPlus is connected to database: using SQL*Net network or local connection. Recovery Manager user must have the followed role: SYSDBA role in 11g or at least SYSBACKUP in 12c. Client parses single commands or scripts created by DBA or generated automatically by GUI. If script can’t be parsed due to syntax errors, all errors are reported immediately to the user. After the  parsing phase, a final version of script is translated into PL/SQL and executed on the database server. If there are errors during a runtime, error messages are sent back by server to client and displayed there.  When Recovery Manager is connected to an Oracle database, a dedicated server process is started and this process is responsible for coordination of backup and recovery operations.  Illustration. 1: Recovery Manager schema   Recovery Manager performs I/O operations using channels. Each channel is assigned to an additional Oracle dedicated process. This process is reading data from data files and sending to output data stream. An Oracle database supports two types of output data streams: -   disk -   sbt_tape – an library with well defined API which can be provided by a 3 rd  party RMAN script can define a channel or a default channel will be used. If a channel is defined as a disk type, output data stream will be saved into a file system accessible from a database server. If channel is defined as a sbt_tape type, a 3 rd  party library has be in installed and this library will redirect a data stream into a Media Manager server, backup appliance or cloud. This is a clearer solution as changing the data stream’s location doesn’t require a change in the backup script. RMAN connection   Recovery Manager client uses local or SQL*Net connectivity. Here are connectivity examples: Local connection [oracle@linuxtarget ~]$ rman target / Recovery Manager: Release 12.1.0.2.0 - Production on Sat Sep 24 17:58:26 2016  Copyright (c) 1982, 2014, Oracle and/or its affiliates. All rights reserved. connected to target database: RMANTEST (DBID=3937007440) RMAN> Remote connection [oracle@linuxtarget ~]$ rman target sys/oracle@rmantest Recovery Manager: Release 12.1.0.2.0 - Production on Sat Sep 24 18:07:08 2016 Copyright (c) 1982, 2014, Oracle and/or its affiliates. All rights reserved. connected to target database: RMANTEST (DBID=3937007440) RMAN> When connection is established, there will be one coordination process and one channel process. 20:09:59 SYS @ rmantest:>select sid, serial# from v$session where program like 'rman%'; SID SERIAL# ---------- ---------- 266 27553 269 15497 Basic RMAN backup Full database backup should have three parts: -   database backup -   archive log backup at least for a time of database backup plus one -   control file backup   If a Fast Recovery Area is configured, an Oracle database uses it as a default location for all backups executed by Recovery manager. After successful connection, the easiest command to run is “backup database” to perform a backup of database using the default settings. RMAN> backup database; Starting backup at 24-SEP-16 using channel ORA_DISK_1 channel ORA_DISK_1: starting full datafile backup set channel ORA_DISK_1: specifying datafile(s) in backup set input datafile file number=00001 name=/u01/oradata/rmantest/system01.dbf … channel ORA_DISK_1: starting piece 1 at 24-SEP-16 channel ORA_DISK_1: finished piece 1 at 24-SEP-16 piece handle=/u01/app/oracle/fast_recovery_area/RMANTEST/backupset/2016_09  _24/o1_mf_nnndf_TAG20160924T181151_cyfdyr20_.bkp tag=TAG20160924T181151 comment=NONE channel ORA_DISK_1: backup set complete, elapsed time: 00:00:07 … Finished backup at 24-SEP-16  In the next step an archive log backup should be performed. There is a command to do it “backup archivelog all” RMAN> backup archivelog all; Starting backup at 28-SEP-16 current log archived using channel ORA_DISK_1 channel ORA_DISK_1: starting archived log backup set channel ORA_DISK_1: specifying archived log(s) in backup set input archived log thread=1 sequence=9 RECID=7 STAMP=923776569 channel ORA_DISK_1: starting piece 1 at 28-SEP-16 … channel ORA_DISK_1: backup set complete, elapsed time: 00:00:01 Finished backup at 28-SEP-16 The last step is a control file backup and this time it’s good to add a tag to have a easier way to identify a backup set name. RMAN> backup current controlfile tag 'controlfile'; Starting backup at 28-SEP-16 using channel ORA_DISK_1 channel ORA_DISK_1: starting full datafile backup set channel ORA_DISK_1: specifying datafile(s) in backup set including current control file in backup set channel ORA_DISK_1: starting piece 1 at 28-SEP-16 … handle=/u01/app/oracle/fast_recovery_area/RMANTEST/backupset/2016_09_28/o1_mf_ncnnf_CONTROLFILE_cyr730vl_.bkp tag=CONTROLFILE comment=NONE channel ORA_DISK_1: backup set complete, elapsed time: 00:00:01 Finished backup at 28-SEP-16
We Need Your Support
Thank you for visiting our website and your interest in our free products and services. We are nonprofit website to share and download documents. To the running of this website, we need your help to support us.

Thanks to everyone for your continued support.

No, Thanks
SAVE OUR EARTH

We need your sign to support Project to invent "SMART AND CONTROLLABLE REFLECTIVE BALLOONS" to cover the Sun and Save Our Earth.

More details...

Sign Now!

We are very appreciated for your Prompt Action!

x