Showing pages 1 to 3 of 6 pages
Week Three LabFor this week we will continue to use DB101 as our target database.The goal for this week’s lab is begin to understand more fully how BACKUPS run withinRMAN. There a number of different ways that backups can be run and scheduled.With the advent of the Oracle 12c Multitenant architecture there are additional factors that needto be considered. If your database includes a CONTAINER database and PLUGGABLEdatabases, there areBacking up an enterprises database so that they are available for a possible database restore andrecovery is at the core of the duties of the DBA. The DBA must ensure that databases are backedup are regular intervals, and validated so that the DBA knows that with certainty that thesebackups can be used to restore the database.In this lab we will look the various types of backups that can be employed in an overview backupstrategy.In today’s computing environment applications are frequently required to run in a 24x7 mode.Consequently, the databases that constitute the backend of these applications cannot be takendown to backup the database in a consistent manner. This portion of the lab will walk youthrough the inconsistent or hot backup.The RMAN utility allows for the use the many of the commands hat we looked in the previouslab, to backup the database, archived log and other database structures.Whenever we log into the Oracle database we need to set our environment so that all of theOracle environmental variables are set, so that we can connect to the correct Oracle database. Forthe purposes of our labs we will be using using two databases, DB101 (our target database) andRMANCAT (the database containing the RMAN CATALOG schema)1.Completing a HOT backup of the database.2.Once you have logged into the server with the Oracle shell account, set the Oracleenvironmental variables and the ORACLE_SID variable to the target database.3.There is a a file in the Oracle Home directory, /home/oracle, named profile. The contentof this file contains variables such as ORACLE_HOME and PATH. This path needs to besourced she the shell has the variables set. This is completed at the OS level.$ . profileYou can check to see if the environment is set up properly by typing the ENV command.
$ envThe ORACLE_SID is set separately since we have two databases running on this server.$ export ORACLE_SID=db1014.Now we need to initialize the RMAN utility and connect to the TARGET andCATALOG.$ rmanRecovery Manager: Release 22.214.171.124.0 - Production on Sat Oct 10 16:39:39 2015Copyright (c) 1982, 2014, Oracle and/or its affiliates. All rights reserved.RMAN>At this point we have only stared up RMAN. We have no connection to the targetdatabase or the RMAN catalog. Note here that the name of the ORACLE_SID or theDBID may not match your environment. As long as you have connected properly to yourTARGET database you should be able to run the lab objectives properly.Now connect to your TARGET database.RMAN> connect targetconnected to target database: SPOCK (DBID=3181554993)In the previous lab, we looked at important ORACLE files. One of these files was theTNSNAMES.ORA files. To connect the CATALOG we will be using an alias set in thatfile.(10 points)RMAN> connect catalog rmanowner/R1d3c0l0@rman5.Now you are connected to RMAN, your target database and the RMAN catalog. We arenow ready to complete many of the tasks require to both backup and maintain ourenvironment.While you are still connected to RMAN backup your database. This first backup will bevery straightforward, without any of the options that are available to Oracle.(10 points)RMAN> backup database;
This command, without any options will backup the database to its default location theFLASH RECOVERY AREA. Backups can take a significant amount of disk space,which as a DBA you are responsible for maintaining effectively. One of the ones tomanage the location of the backup sets is to user the FORMAT option.Using the FORMAT option backup the database again.RMAN>backup format '/db_backup/db101/bk_%s_%p_%t' database;(10 points)This FORMAT command will direct RMAN to backup to the new location andname the Backupsets so the names are more easily read and understood.This backup is INCONSISTENT, since it is considered a HOT backup, takenwhile database is OPEN.6.As stated earlier, the RMAN utility can be used to backup other database structures, notsimply backing up the entire database. The REDO LOG files are a record of transactionsthat occur in the database. If the database is running in ARCHIVELOG mode, it willsave the ARCHIVED LOG FILES to a designated location. If not properly maintained,the ARCHIVED LOG FILES can build up, taking up disk space and if not backed up andremoved from DISK, Oracle can stop operating, waiting for enough space to archive theREDO LOGS.The command to backup the ARCHIVED LOG FILES is similar to the backup commandfor the database.In your environment issue the command to backup the ARCHIVED LOG FILES.(10points)RMAN>backup format '/db_backup/db101/arch_%s_%p_%t' archivelog all deleteinput;Notice the difference between this command and the previous database backupcommand. The FORMAT command has name the backupset will contain the prefix of“arch” so the Backupsets can be distinguished from the backupsets of the database. Whathas been added to the command is also “all delete input”. This option tells RMAN tobackup thethe ARCHIVED LOG FILES and then delete them from disk. These files nolonger need to reside on disk, but are still important to the RECOVERY process.7.While, in most case, the database will need to be backed up while still operating, therewill be occasions in which the database will be backed up while it is shutdown. Thisbackup is considered CONSISTENT, since all buffered data has been written to disk.