Symantec NetBackup 7.x For Oracle LAB
Symantec NetBackup 7.x For Oracle LAB
Symantec NetBackup
7.x for Oracle
for UNIX
LABS
200-002674-B
COURSE DEVELOPER
Lisa Childress
LEAD SUBJECT MATTER
EXPERTS
Geoff Bergren
Dustin Scharf
TECHNICAL
CONTRIBUTORS AND
REVIEWERS
John Gerhardson
Lisa Goldring
Appendix A
323
324
Lab #
325
Lab Activity
Page
Oracle Concepts
A-5
A-13
A-21
A-35
A-47
A-51
A-59
A-3
326
Lab Setup
327
All of the labs in this course are performed using three virtual machines, as illustrated in
the diagram on this page. One machine serves as the NetBackup master server, media
server, and as the host for the Oracle recovery catalog database (RMANCAT). This
machine is referred to as the master machine, and has a hostname of train1. The
master server system also hosts the OpsCenter Server software in this lab environment.
The second machine serves as the NetBackup client, and as the host for the target
database (ORCL). This is also the machine on which you configure the NetBackup for
Oracle (NBUO) extension. This machine is referred to as the client machine, and has a
hostname of train2. The third virtual machine hosts the virtual tape library (VTL) used
for writing backups to tape, and has a hostname of falconvtl.
Startup of virtual machines
At the start of this lab activity you must start each of the three virtual machines (VMs) in
your lab environment. The virtual machines should be started in the following sequence:
1st falconvtl (the tape library emulation)
2nd train1 (the NetBackup master/media server)
3rd train2 (the ORCL db system and NetBackup client)
CONFIDENTIAL - NOT FOR DISTRIBUTION
Symantec NetBackup 7.x for Oracle for UNIX
Copyright Symantec Corporation. All rights reserved.
A-5
328
Example
Lab Value
master
train1
root
root
veritas
veritas
oracle
oracle
veritas
veritas
RMANCAT
RMANCAT
/usr/openv
/usr/openv
/oracle
/u01/oracle
Variable
Example
Lab Value
Client Name
client
train2
Client OS Version
root
root
veritas
veritas
oracle
oracle
veritas
veritas
ORCL
ORCL
/usr/openv
/usr/openv
/oracle
/u01/oracle
Client Information
329
TLD
2 dlt drives
A-7
If you have not already done so, start the virtual machines in the following listed below. Wait for
each virtual machine to reach the login prompt before starting the next virtual machine.
2. Type env from the Oracle command prompt to view the environment variables.
MASTER $
MASTER $ env
...
HOME=/u01/oracle
...
ORACLE_BASE=/u02/oradata
ORACLE_HOME=/u01/oracle
ORACLE_SID=RMANCAT
...
CLIENT $
CLIENT $ env
...
HOME=/u01/oracle
...
ORACLE_BASE=/u02/oradata
ORACLE_HOME=/u01/oracle
ORACLE_SID=ORCL
...
What is the name of the database instance running on the master machine?
________________________________________________________________
330
CLIENT
2. From the SQL> prompt, connect to the instance as user sysdba by typing the following
command:
SQL> connect / as sysdba
Connected to an idle instance.
331
A-9
4. Determine the database structure by querying the v$ views. Using the following commands,
what can you determine about:
b. Data files (remember, these values vary depending upon the Oracle instance name):
SQL> select name from v$datafile;
NAME
--------------------------------------------------/u02/oradata/oradata/<db>/system01.dbf
/u02/oradata/oradata/<db>/undotbs01.dbf
/u02/oradata/oradata/<db>/sysaux01.dbf
/u02/oradata/oradata/<db>/users01.dbf
c. Online redo logs (remember, these values vary depending upon the Oracle instance
name):
SQL> select member from v$logfile;
MEMBER
----------------------------------------------/u02/oradata/oradata/<db>/redo03.log
/u02/oradata/oradata/<db>/redo02.log
/u02/oradata/oradata/<db>/redo01.log
d. Control files
332
5. Leave the database open on the MASTER (train1); do not perform a shutdown command.
6. On the master server (train1), type exit, and press Enter, to exit SQL*Plus.
SQL> exit
Disconnected from Oracle Database 10g Enterprise Edition
Release 10.2.0.1.0 - 64bit Production
With the Partitioning, OLAP and Data Mining options
Lab Summary
This lab exercise provided the steps necessary to start up a database as well as to perform queries
to check the structure and integrity of the database.
In this exercise you:
333
A-11
334
Note: For the purposes of this lab exercise, the target database is ORCL.
train1
root
veritas
Policy type:
Data classification :
335
Standard
Default
(Instructor will specify)
disk_stu or tape_stu
Oracle (if using tape_stu)
Default
Default
0 (zero)
default
Yes
No
No
No
No
Policy storage:
Policy volume pool:
Take checkpoints
Limit jobs per policy:
Job priority:
Media Owner :
Active:
Follow NFS:
Cross mount points:
Compression
Encryption
Collect disaster recovery information
- NOT
DISTRIBUTION
for Bare MetalCONFIDENTIAL
Restore
No FOR
<deselect>
Symantec NetBackup 7.x for Oracle for UNIX
Copyright Symantec Corporation. All rights reserved.
A-13
default
default
No
No
Table 1
e. Set the schedule for the Lab3_coldbackup policy using the parameters shown in
Table 2.
Schedule Name:
Full_Backup
Type of Backup:
Full Backup
Schedule Type:
Default
Destination:
Default
Multiple Copies:
Default
Default
Default
Default
Retention:
Default
Media Multiplexing:
1 (Default)
Window Start
No entry required
Window Duration
No entry required
Table 2
f.
Note: The backup window remains closed so the backup job never automatically (and
inadvertently) starts. You will execute this policy as a manual backup only.
336
9. When the backup completes, restart the database on the CLIENT machine.
SQL> startup
ORACLE instance started.
337
A-15
1. As user root on the client, simulate a disk failure by removing the database files from the
target database.
CLIENT # cd /u02/oradata/oradata/ORCL
CLIENT # rm *
Note: If necessary, respond y to confirm.
(password: veritas)
b. Start SQL*Plus
CLIENT $ sqlplus /nolog
338
4. Using the NetBackup System Administration Console GUI, restore all data files.
a. As user root, launch the NetBackup System Administration Console GUI.
MASTER # /opt/openv/netbackup/bin/jnbSA &
b. From the NetBackup Administration Console, access the Backup, Archive, and
Restore interface, and select the Restore Files tab.
- Select Actions > Specify NetBackup Machines and Policy Type
-
Set the Destination client to the NetBackup client, train2, and click OK, to close
the Specify NetBackup Machines and Policy Type dialog box.
If the Browse directory does not display /, type / in the field, and press Enter.
6. After the restore process completes, start up the restored database on the CLIENT, train2.
CLIENT $ sqlplus /nolog
SQL> connect / as sysdba
SQL> startup
339
9. At the file system prompt on the client, train2, verify that the database files have been
restored to the target database.
CLIENT $ cd /u02/oradata/oradata/ORCL
CLIENT $ ls -l
A-17
1. Exit from SQL*Plus on the CLIENT, train2, and return to user root.
2. Create a NetBackup shell script to shutdown the database before performing the
backup.
a. Change to the /usr/openv/netbackup/bin/ directory.
CLIENT # cd /usr/openv/netbackup/bin/
3. Create the NetBackup shell script to startup the database after performing the backup.
a. In the same directory, create a file named bpend_notify.Lab3_coldbackup
CLIENT # touch bpend_notify.Lab3_coldbackup
This file will be a script that restarts the target database after NetBackup finishes
the backup operation.
340
5. Test the new bpstart_notify script and ensure that it performs a database shutdown :
CLIENT # sh v bpstart_notify.Lab3_coldbackup
6. Test the new bpend_notify script and ensure that it performs a database startup before
you continue the lab:
CLIENT # sh v bpend_notify.Lab3_coldbackup
7. Prepare to monitor the ORCL alert log to verify that the database does shutdown properly
when a backup is initiated. This can be done as follows:
CLIENT # cd /u02/oradata/admin/ORCL/bdump
CLIENT # tail -f alert_ORCL.log
b. In the left pane of the NetBackup Administration Console on the master, select
NetBackup Management > Policies.
c. In the All Policies pane of the NetBackup Administration Console, right-click the
Lab3_coldbackup policy and select Manual Backup.
d. In the Manual Backup dialog box, select the Full_Backup schedule, and click OK.
9. Monitor the output from the tail command on the CLIENT to be sure the notify scripts shut
down and start up the database appropriately. In addition, monitor the backup using Activity
Monitor on the MASTER until it completes successfully with a status code of 0 (zero).
10. Type ctrl-c to exit the tail command on the CLIENT, train2.
Lab Summary
This lab exercise provided the steps necessary to use NetBackup to perform a cold consistent
backup of an Oracle database and to then restore that database.
341
A-19
342
Note: For the purposes of this lab exercise, the target database is ORCL, and the RMAN recovery
catalog database is RMANCAT.
b. As the oracle user, open the recovery catalog database (RMANCAT) and perform
343
A-21
3. As the oracle user, you would normally configure the Oracle listener to define the HOST as
the master server.
344
SID_LIST_LISTENER =
(SID_LIST =
(SID_DESC =
(SID_NAME = PLSExtProc)
(ORACLE_HOME = /u01/oracle)
(PROGRAM = extproc)
)
)
LISTENER =
(DESCRIPTION_LIST =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = train1)(PORT = 1521))
)
)
b. As the oracle user, start the listener process on the master system.
MASTER $ lsnrctl start listener
The last line of output from this command should read:
The command completed successfully.
Note: The listener may already be running.
2. Verify that the Oracle user sys can now communicate to the recovery catalog:
a. Ping the recovery catalog.
345
A-23
b. If the command executes successfully, continue to the next step. If the command
fails, troubleshoot as follows:
Double-check the parameters in the listener.ora file on the master.
c. As a last check, connect the user rmanowner to RMANCAT by typing the following
command:
CLIENT $ sqlplus rmanowner/rmanowner@RMANCAT
SQL*Plus: Release 10.2.0.1.0 - Production on Thu Sep 29
18:48:10 2011
Copyright (c) 1982, 2005, Oracle.
Connected to:
Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 64bit Production
With the Partitioning, OLAP and Data Mining options
3. In a different terminal window as the oracle user on the CLIENT, verify the
remote_login_passwordfile = EXCLUSIVE setting in the configuration file,
/u01/oracle/dbs/spfileORCL.ora. If the entry does not exist, notify your
instructor.
CLIENT $ more $ORACLE_HOME/dbs/spfileORCL.ora
...
*.background_dump_dest=/u02/oradata/admin/ORCL/bdump
...
*.remote_login_passwordfile = EXCLUSIVE
*.sga_target=167772168
...
4. On the CLIENT machine, create an Oracle user account, named rmandba, with sys
privileges to connect RMAN to the target database.
SQL> create user rmandba identified by rmandba;
User created.
346
SQL> exit
Disconnected from Oracle Database 10g Enterprise Edition
Release 10.2.0.1.0 - 64bit Production
With the Partitioning, OLAP and Data Mining options
Note: If the systems in your classroom have not been setup, your instructor can help you
configure them according to the description provided.
347
#
#
#
#
mkdir
mkdir
mkdir
chmod
/export
/export/data1;cd /export/data1
ORCL_backups
777 ORCL_backups
A-25
2. Connect to the target database, shut it down immediately, and restart it in mount mode.
RMAN> connect target rmandba/rmandba
connected to target database: ORCL (DBID=1270287627)
using target database control file instead of recovery catalog
RMAN> shutdown immediate
database closed
database dismounted
Oracle instance shut down
RMAN> startup mount
connected to target database (not started)
Oracle instance started
database mounted ...
Total System Global Area
Fixed Size
Variable Size
Database Buffers
Redo Buffers
1224736768
2020384
318770144
889192448
14753792
bytes
bytes
bytes
bytes
bytes
348
349
A-27
350
2. Exit RMAN.
RMAN> exit
2. Connect to the target database, connect to the recovery catalog, shut the database down
immediately, and restart it in mount mode.
RMAN> connect target rmandba/rmandba
connected to target database: ORCL (DBID=1289542671, not open)
RMAN> connect catalog rmanowner/rmanowner@RMANCAT
connected to recovery catalog database
RMAN> shutdown immediate
Database dismounted
Oracle instance shut down
RMAN> startup mount
Connected to target database (not started)
Oracle instance started
Database mounted
Total System Global Area 1224736768 bytes
Fixed Size
Variable Size
Database Buffers
Redo Buffers
2020384 bytes
318770144 bytes
889192448 bytes
14753792 bytes
351
A-29
352
Exercise 8: Backing Up the Entire Database to Disk Using Parallel Data Streams
This exercise describes how to utilize parallel backup streams to back up an entire Oracle
database to disk using the recovery catalog.
1. Type the run command to allocate three parallel data streams and to back up the target
database.
How much time do you think this backup will take?_____________________
RMAN> run {
2> allocate channel stream1 type disk format
'/export/data1/ORCL_backups/%U';
3> allocate channel stream2 type disk format
'/export/data1/ORCL_backups/%U';
4> allocate channel stream3 type disk format
'/export/data1/ORCL_backups/%U';
5> backup
6> filesperset 2
7> database;
8> }
released channel: ORA_DISK_1
allocated channel: stream1
channel stream1: sid=157 devtype=DISK
allocated channel: stream2
channel stream2: sid=155 devtype=DISK
353
A-31
354
2. Exit RMAN.
RMAN> exit
Lab Summary
This lab exercise guided you through the necessary steps to create an RMAN recovery catalog for
a target database and register the target database with RMAN. You also learned to perform
RMAN backups, ranging from a single datafile to a complete database.
In this exercise you:
Questions/Discussion
When you have finished the lab exercise, answer the following questions:
1. What is the benefit (if any) of allocating multiple parallel data streams?
2. What is the benefit of allocating parallel data streams in an enterprise environment in which
databases and data files are distributed across multiple file systems?
0.
355
A-33
356
Modify shell scripts used by NBUO to conduct both cold and hot database backups.
Use the NBUO Backup Wizard to generate templates for backups.
Establish Oracle policies for both cold and hot database backups.
Test the configuration between NBUO and RMAN by conducting both cold and hot database
backups.
Note: For the purposes of this lab exercise, the target database is ORCL.
357
CLIENT $ /usr/openv/netbackup/bin/oracle_link
Fri Sep 30 08:23:44 CDT 2011
All Oracle instances should be shutdown before running this
script.
Please log into the Unix system as the Oracle owner for
running this script.
Do you want to continue? (y/n) [n] y
LIBOBK_PATH: /usr/openv/netbackup/bin
CONFIDENTIAL
ORACLE_HOME:
/u01/oracle - NOT FOR DISTRIBUTION
Symantec NetBackup 7.x for Oracle for UNIX
Copyright Symantec Corporation. All rights reserved.
A-35
4. Check the update trace file to confirm that the update was successful.
CLIENT $ more /tmp/make_trace.####
Sun May 1 16:06:44 CDT 2011
All Oracle instances should be shutdown before running this
script.
Please log into the Unix system as the Oracle owner for
running this script.
Do you want to continue? (y/n) [n] y
LIBOBK_PATH: /usr/openv/netbackup/bin
ORACLE_HOME: /u01/oracle
Oracle version: 10.2.0.1.0
Platform type: x86_64 ;
Linking LIBOBK:
ln -s /usr/openv/netbackup/bin/libobk.so64
/u01/oracle/libobk.so
Done
358
167772160 bytes
2019320 bytes
79691784 bytes
83886080 bytes
2174976 bytes
Exercise 2: Configuring an RMAN Script for Cold Backup Using the Sample Scripts
NetBackup provides sample RMAN scripts which you can copy to an alternate location and
modify for your specific needs.
As the root user, perform the following steps on the CLIENT machine.
b. Change the permissions of the sample scripts to allow the user oracle to run them.
Also, change the owner of the directories to oracle .
CLIENT # cd /oracle/scripts/
CLIENT # chmod 770 *
CLIENT # chown oracle:dba rman
359
ORACLE_HOME
ORACLE_SID
ORACLE_USER
TARGET_CONNECT_STR
TARGET_INIT_FILE
/u01/oracle
ORCL
oracle
rmandba/rmandba
/u02/oradata/admin/ORCL/pfile/
init.ora.813201116344
Table 3
A-37
4. On the NetBackup master server, create an Oracle policy named ORA_COLD. Use the
parameters for the policy as shown in Table 4.
Policy Name:
Attributes:
Policy Type:
Data classification :
Policy Storage:
ORA_COLD
Oracle
Default
Instructor will specify :
tape_stu or disk_stu
Oracle
(if using tape_stu)
Default
Defaults
Default
Yes (checked)
Defaults
Default
infinity
Accept Default
Accept the default settings.
train2
Linux,RedHat2.6
/oracle/scripts/cold_database_backup.sh
Table 4
360
7. When the jobs complete, examine the bphdb and dbclient logs, located on the client
system, train2. Also, examine the cold_database_backup.sh.out file, located in
the /oracle/scripts directory. This file is generated by the NBUO script.
3. On the NetBackup master server, create a new policy named ORA_HOT_FULL, using the
parameter provided in Table 5.
Policy Name:
Attributes :
Policy Type:
Data classification :
Policy Storage:
361
ORA_HOT_FULL
Oracle
Default
Your Instructor will specify
tape_stu or disk_stu
Oracle (if using tape_stu)
Defaults
Default
Yes
(checked)
Defaults
Default
Schedules :
Note : DO NOT DELETE THE EXISTING SCHEDULE ADD A NEW ONE !!!
Name:
Automatic_Full
Type:
Automatic Full Backup
Retention Period:
infinity
Start Window:
Accept Default
For Schedule Type
Accept the default settings.
Clients :
Client Name:
train2
Operating System:
Linux,RedHat2.6
Backup Selections :
Backup Selection List:
/oracle/scripts/hot_database_backup.s
h
Table 5
A-39
b. As user oracle on the client, use sql commands to enable ARCHIVELOG mode and open
the database.
SQL> alter database archivelog;
Database altered.
SQL> alter database open;
Database altered.
Archive Mode
Enabled
USE_DB_RECOVERY_FILE_DEST
1
3
3
6. Test the hot database backup configuration by performing a manual backup. This time
initiate the backup as the oracle user from the CLIENT.
a. As user oracle, set user-defined runtime variables:
CLIENT $ NB_ORA_CLIENT=train2;export NB_ORA_CLIENT
CLIENT $ NB_ORA_POLICY=ORA_HOT_FULL;export NB_ORA_POLICY
CLIENT $ NB_ORA_SCHED=Default-Application-Backup;export
NB_ORA_SCHED
CLIENT $ NB_ORA_SERV=train1;export NB_ORA_SERV
CLIENT $ /oracle/scripts/hot_database_backup.sh
362
7. Monitor the backup progress with the Activity Monitor interface on the MASTER. Notice
that only jobs associated with the Application Backup schedule appear in Activity Monitor.
You may also monitor the progress of the backup by tailing the
hot_database_backup.sh_out file on the CLIENT.
ORA_HOT_DIFF
Automatic Schedule:
363
Name:
Type:
Retention Period:
Start Window:
For Schedule Type
Clients:
Client Name:
Operating System:
Backup Selections:
Backup Selection List:
Oracle
Default
Instructor will specify
tape_stu or disk_stu
Oracle (if using tape_stu)
Defaults
Yes
(checked)
Defaults
Default
Change the schedule name from DefaultApplication-Backup to ApplicationBackup-Diff. Make no additional modifications to
this schedule.
Note: Change the existing Automatic_Full
schedule. Use the schedule parameter information
listed when changing the schedule.
Automatic_Diff
Automatic Differential Incr. Backup
infinity
Accept Default
Accept the default settings.
train2
Linux,RedHat2.6
/oracle/scripts/hot_database_backup.sh
Table 6
A-41
2. Test the differential hot database backup by performing a manual backup from the
NetBackup Administration Console (NetBackup Management > Polices), and selecting the
Automatic-Diff (Automatic Differential Incremental) schedule.
Monitor the backup progress with the Activity Monitor interface.
Note the Application Backup schedule selected for the backup. It may not be the
Application Backup schedule associated with the policy you initiated. This problem can
be avoided by setting user-defined variables and running the NBUO script from the
command line on the client or by copying and modifying the sample script to use the
send command to pass the appropriate schedule name. You would then change the
specified script name in the Backup Selections of the Differential Policy.
3. Perform the backup again, this time initiate the backup as the oracle user from the
CLIENT.
4. Monitor the backup progress from activity monitor. Note that this time theres no possibility
of NetBackup selecting the wrong application backup schedule since you used an
environment variable to specify. Examine the .out file created by the
hot_database_backup.sh script to ensure a differential backup was performed.
364
Exercise 5: Creating a NetBackup for Oracle (NBUO) Template for Cold Backup
Perform the following steps on the CLIENT machine.
b.
c.
d.
e.
Host name
train2
Login
oracle
Password
veritas
OS Authentication
Not checked
Checked
Selected
Unchecked
365
5. Add the Backup set identifier, Lab5, and click Next to continue.
A-43
Checked
Checked
/u02/oradata/admin/ORCL/pfile/
init.ora.813201116344
8. Click Next on the Backup Limits screen without entering any values.
9. Review and save the template.
a. Review the template settings.
b. Check Save Template.
c. Enter the Template name, cold_database_backup_template.
d. Click Finish.
10. Verify the template exists on the MASTER machine.
MASTER # cd /usr/openv/netbackup/db/dbtemplates/oracle
MASTER # ls
cold_database_backup_template.tpl
366
a. Select Actions > Administer Templates > Oracle, in the Backup, Archive and
Restore interface.
b. Click to highlight the entry for the cold_database_backup_template in the
Oracle Template Administration dialog box, and click Run.
c. Select OS Authentication in the Run Oracle Template dialog box, and enter the
following options:
Recovery Catalog Logon Credentials
Use Oracle RMAN recovery catalog:
Not Selected
d. Click OK in the Run Oracle Template dialog box, then click Run.
e. Click Yes to view the progress of the backup job, in the Task Progress tab of the
Backup, Archive, and Restore interface.
You can also monitor the job in Activity Monitor on the MASTER machine.
0.
Exercise 7: Changing the Oracle scripts to use the Recovery Catalog
1. On the CLIENT, edit the /oracle/scripts/cold_database_backup script, to use
the RMAN recovery catalog (RMANCAT).
a. Edit the /oracle/scripts/cold_database_backup.sh script.
b. Replace the nocatalog option from the statement which invokes the RMAN
executable with the following :
rcvcat rmanowner/rmanowner@RMANCAT
This statement is required in order to connect to the recovery catalog.
2. On the MASTER server, invoke another manual backup using the ORA_COLD policy.
Confirm that NetBackup is connecting to the RMAN recovery catalog by examining the
cold_database_backup.sh.out file generated by the NBUO script, located in
/oracle/scripts.
367
4. On the MASTER server, invoke another manual backup using the ORA_HOT_FULL policy.
Confirm that NetBackup is connecting to the RMAN recovery catalog by examining the
hot_database_backup.sh.out file generated by the NBUO script, located in
/oracle/scripts.
A-45
Lab Summary
This lab exercise provided the steps needed to configure NBUO to work with RMAN to perform
both cold and hot database backups.
In this exercise, you:
Used the NBUO Wizards to automatically generate backup scripts for both hot and cold
backups.
Modified shell scripts used by NBUO to conduct both cold and hot database backups
Established Oracle policies for both cold and hot database backups
Tested the configuration between NBUO and RMAN by conducting both cold and hot
database backups
Questions/Discussion
Explain the benefits of using the RMAN script to back up the Oracle database.
368
2. As user root, open a separate terminal window and move a data file to a different location.
CLIENT # mkdir /lab6
CLIENT # cd /u02/oradata/oradata/ORCL
CLIENT # mv system01.dbf /lab6
directory.
369
CLIENT # cp
/usr/openv/netbackup/ext/db_ext/oracle/samples/rman/database_r
estore.sh /oracle/scripts/
Change the owner and group on the copied files, if necessary.
CLIENT # cd /oracle/scripts/
CLIENT # chmod 770 *
CLIENT # chown oracle:dba *
A-47
/u01/oracle
ORCL
oracle
rmandba/rmandba
Table 7
7. From the original terminal window (user oracle running SQL*Plus), shut down and
remount the database.
SQL> shutdown abort
SQL> startup mount
b. Open an additional terminal window if necessary, and monitor the progress of the
restore using the log file.
CLIENT $ tail -f /oracle/scripts/database_restore.sh.out
9. After the restore is complete, from the second terminal window (user oracle running
SQL*Plus), shut down and restart the database.
SQL> shutdown immediate
SQL> startup
SQL> exit
12. Verify that the backup completes successfully before continuing to the next lab exercise.
370
Exercise 2: Using the NBUO Restore Wizard to Restore and Recover a Datafile
Perform the following steps as user root on the CLIENT machine:
Client Name
Login
oracle
Password
veritas
2. On the Backup, Archive, and Restore interface, specify the NetBackup machines.
a. Click the Restore Files tab.
b. Select Actions > Specify NetBackup Machines and Policy Type from the menu
options at the top of the interface.
c. Select your Oracle client (train2) as the Source client for restores and the
Destination client for restores.
d. Select Oracle as the Policy type for restores.
e. Click OK to return to the Backup, Archive and Restore interface.
371
OSAuthentication
Oracle Authentication
User name :
Password :
Net service name (TNS Alias) :
Use Oracle RMAN recovery catalog
Not selected
Selected
oracle
veritas
Default (leave blank)
Checked
Table 8
A-49
9. Enter the Recovery Catalog Logon Credentials (RMANCAT), as shown in the table, and then
click Next to continue.
Username:
Password:
Net service name:
rmanowner
rmanowner
RMANCAT
10. Specify the Recovery Options to define the restore tasks and any associated options.
a. Enter the values as shown in the table.
Restore
Recover
Checked
Checked
Not selected
/u02/oradata/admin/ORCL/pfile/
init.ora.813201116344
Not selected
14. Select Yes in the View Progress dialog box, to monitor restore progress in the Task Progress
372
window. You can also view the restore job using the Activity Monitor on the master server.
Verify that the restore runs successfully.
Lab Summary
This lab exercise provided the practice performing the steps necessary to restore an Oracle
database following a media failure.
In this exercise, you:
Note: For the purposes of this lab exercise, the target database is ORCL and resides on the
CLIENT machine. The recovery catalog database is RMANCAT and resides on the MASTER
machine.
373
A-51
374
375
A-53
2. For demonstration purposes only, configure a NetBackup retention period to expire backups
immediately:
a. On the MASTER, launch the NetBackup Administration Console.
MASTER # jnbSA &
b. Select NetBackup Management > Host Properties > Master Servers, and right-click
the entry for the host name of your Master server, in the right pane. Select
Properties.
c. In Master Server Properties dialog box, select Retention Periods in the left pane.
Scroll down the list of Retention periods displayed in the right pane, until you reach
Retention Level 10.
d. Click the entry for Retention Level 10, change the Units setting at the top of the
screen to expires immediately, and click OK to save the retention level change.
376
h. Start the NetBackup daemons on the master server, to activate the new retention
period.
MASTER # netbackup start
3. Change the retention period for backups performed with the ORA_HOT_FULL policy to
expires immediately.
a. Launch the NetBackup Administration Console, and log in as root.
MASTER # jnbSA &
b. Open the ORA_HOT_FULL policy, and change the Retention setting in the DefaultApplication-Backup schedule to the new expires immediately retention period
(Retention Level 10), and click OK to save the change to the schedule.
c. Close the ORA_HOT_FULL policy.
4. Perform a manual backup of ORA_HOT_FULL. Initiate the backup as the oracle user from
the CLIENT machine.
a. As user oracle set user-defined runtime variables:
CLIENT $ NB_ORA_CLIENT=train2;export NB_ORA_CLIENT
CLIENT $ NB_ORA_POLICY=ORA_HOT_FULL;export NB_ORA_POLICY
CLIENT $ NB_ORA_SCHED=Default-Application-Backup;export
NB_ORA_SCHED
CLIENT $ NB_ORA_SERV=train1;export NB_ORA_SERV
5. Monitor the backup progress on the MASTER server using the Activity Monitor interface,
until the backup jobs complete successfully.
6. Trigger a NetBackup database cleanup job on the MASTER server, to ensure the backup
images are deleted from the NetBackup databases.
Note: This step is only necessary here in the lab environment to ensure the images are
quickly cleaned-up for lab purposes.
MASTER # bpimage cleanup -allclients
7. On the CLIENT system, list current backup set information again now that the backup has
completed successfully, and been expired and deleted from the NetBackup databases:
RMAN> list backup;
Note the Backup Set Numbers (BS) for the most recent backup.
377
8. Are all the new backup sets listed as AVAILABLE? Why or why not ?
A-55
9. Perform an RMAN CROSSCHECK on the RMAN catalog and check the status of the new
backup sets again:
RMAN> allocate channel for maintenance type sbt;
RMAN> crosscheck backup;
RMAN> list backup;
Is the status of the backup sets still AVAILABLE ? Why or why not ?
10. Delete the expired backup sets from the RMAN catalog and check the status of the new
backup sets one more time :
RMAN> delete expired backupset;
Do you really want to delete the above objects (enter YES or
NO)? y
RMAN> list backup;
Are the backup sets with the expired retentions still listed ?
11. Change the Retention setting in the ORA_HOT_FULL back to an infinite value:
a. On the Master system launch the NetBackup Administration Console.
MASTER # jnbSA &
b. Open the ORA_HOT_FULL policy, change the Retention setting in the Default-
378
Lab Summary
379
A-57
380
381
A-59
https://train1/opscenter/
admin
password
Source Attribute
Destination Attribute
Host name :
train2
train2
Instance Name :
ORCL
ORCL
Database Name:
ORCL
ORCL
Database Home:
/u01/oracle
/u01/oracle
b. Select the Control File paths tab, and enter the following values :
382
Source Path
Destination Path
/u02/oradata/oradata/ORCL/control
01.ctl
/disk1/new_loc/control01.ctl
/u02/oradata/oradata/ORCL/control
02.ctl
/disk1/new_loc/control02.ctl
/u02/oradata/oradata/ORCL/control
03.ctl
/disk1/new_loc/control03.ctl
c. Select the Datafile Paths tab, and enter the following values :
Tablespace
EXAMPLE
SYSAUX
SYSTEM
UNDOTBS1
USERS
TEMP
d. Select the Redo log paths tab and enter the following values:
Group# Source Path
/u02/oradata/oradata/
3
ORCL/redo03.log
/u02/oradata/oradata/ORCL/
2
redo02.log
/u02/oradata/oradata/ORCL/
1
redo01.log
Destination Path
/disk1/new_loc/redo03.log
/disk1/new_loc/redo02.log
/disk1/new_loc/redo01.log
18. Wait until the restore jobs are successful, and then go to the next step.
383
A-61
19. Cloning creates a new database which must be registered with RMAN.
Using RMAN, connect to the RMANCAT database and ORCL database.
CLIENT $ rman target rmandba/rmandba catalog
rmanowner/rmanowner@RMANCAT
Recovery Manager: Release 10.2.0.1.0 - Production on Sat Oct 1
10:23:21 2011
Copyright (c) 1982, 2005, Oracle.
384
4. In another terminal window, as the oracle user, run the following RMAN commands and
script to back up the databases archived log files. Ensure that the current log file is switched
to disk.
CLIENT $ rman
RMAN> connect catalog 'rmanowner/rmanowner@RMANCAT'
RMAN> connect target 'rmandba/rmandba'
RMAN> run {
2> allocate channel stream1 type sbt;
3> send 'NB_ORA_POLICY=ORA_COLD';
4> sql 'alter system archive log current';
5> # backup all archive logs
6> backup format 'al_%s_%p_%t' archivelog all
7> delete input;
8> }
385
A-63
6. Now, imagine a scenario in which a user error occured which accidently deleted all customer
records along with associated customer order records. This error occured at the same time
that orauser3 was created. To fix the problem we need to roll back the database to a
point-in-time prior to the user error (and therefore, just prior to the creation of orauser3).
386
387
A-65
Lab Summary
This lab demonstrated complex Oracle recovery procedures. Specifically, it illustrated the steps
required to perform a Guided Recovery using the OpsCenter interface and an incomplete database
recovery using the Until clause.
In this exercise you:
Used Guided Application Recovery to perform a cloning operation of the ORCL database
Backed up archived log files
Simulated a user error that resulted in the complete loss of customer and order records.
Restored and recovered the database to a point-in-time prior to the user error.
Reset the databases online redo logs and the RMAN database.
388