Download the osb10_2install.zip file into your working directory (\home\oracle) and unzip the file.
As the root user, create the OSB home directory by executing the following command:
# mkdir -p /usr/local/oracle/backup
Navigate into your OSB home directory:
# cd /usr/local/oracle/backup
Ensure that the uncompress utility is available:
# ln -s /bin/gunzip /bin/uncompress
In your OSB home directory start the Oracle Secure Backup installation as the root user.
# /stage/setup
Choose passwords appropriate for your environment and ensure that you remember them. Enter your chosen password twice as the key store password and for verification:
Please enter the key store password: keystore_password
Re-type password for verification: keystore_password
Configuring OSB Media Server Devices
Creating a virtual tape library. To define a virtual tape library, I’ll use obtool’s mkdev command set:
#> obtool --user admin --password oracle < /home/oracle/mklib.obp
And here’s the contents of mklib.obp:
mkdev -t library -o -S 4 -a 10gBUR:/vlib -v vlib
To break down this command and its corresponding parameter file’s syntax:
- --user and --password: The device is created for the OSB admin user with the appropriate password. Note that the admin account is specific to OSB – it is not the same as a user account that might exist in a corresponding Oracle database.
- -t library: Signifies that a tape library is being created.
- -o: Tells OSB that this tape library is immediately available for use.
- -S: Instructs OSB to create a specific number of slots for this virtual tape library.
- -a: Constructs the path (also known as the attachment specification, or attachspec) to the tape library attachment(s) for OSB.
- -v: Specifies the verbose option so that detailed information about the OSB media library’s creation is written to stdout.
- vlib: The label that’s assigned to this virtual tape library.
Creating a virtual tape drive. Next, I’ll create a virtual tape drive within the virtual tape library just defined. Once again I’ll use obtool’s mkdev command, but this time with slightly different parameters:
#> obtool --user admin --password oracle < /home/oracle/mktapedev.obp
And here’s the contents of mktapedev.obp:
mkdev -t tape -o -a 10gBUR:/vt -v -l vlib -d 1 vt
To break down this parameter file’s syntax:
- -t tape: Specifies that a tape device is being created.
- -o: Tells OSB that this tape device is immediately available for use.
- -a: Constructs the path to the tape device attachment.
- -v: Specifies the verbose option so that detailed information about the OSB backup device’s creation is written to stdout.
- -l vlib: The tape library that’s assigned to this tape device.
- -d: The Data Transfer Element tag assigned to this virtual tape device within its virtual tape library. This tells OSB to configure just one tape.
- vt: Finally, this is the label that’s assigned to this new virtual tape device.
One important point I learned while mastering these obtool directives that will save you a lot of grief: Be sure that the directories for the virtual tape library and devices don’t exist prior to issuing these commands! Otherwise, obtool will return some unexpected error messages and will simply fail to create the virtual tape library and virtual tape device.
Configuring RMAN For Use With Oracle Secure Backup
Even though I’ve now successfully created a virtual OSB tape library and a virtual OSB tape drive, I still grant permissions to Oracle Recovery Manager (RMAN) so that it can interface directly with these OSB devices. To accomplish this, I’ll once again use the obtool command set to create a preauthorized OSB account for RMAN operations:
#> obtool --user admin --password oracle < /home/oracle/mkauthuser.obp
And here’s the contents of mkauthuser.obp:
mkuser -c oracle -p oracle -U oracle -G dba -N no -h *:*:*+rman+cmdline oracle
To break down this OSB parameter file:
- -c: Specifies that the user should belong to the predefined oracle OSB account class.
- -U and -G: Specifies the corresponding OS account name and OS group name for the OSB user.
- -N no: Tells OSB that this user is not authorized to log into an NDMP server.
- -h *:*:*+rman+cmdline: This parameter is crucial to the configuration of the user. The four sets of permissions defined here, separated by colons, permit the OSB account to perform backups (a) on any OSB host (b) owned by any OS user account (c) on any Windows domain. The rman token preauthorizes the OSB user to create RMAN backups over the standard RMAN SBT channel, while the cmdline token preauthorizes the OSB user to log into OSB.
- oracle: Finally, this is the name of the OSB account that’s going to utilize OSB tools. Note that this is a separate account from the oracle user account on the operating system!
Using Enterprise Manager Database Control with Oracle Secure Backup
Almost done! Now that I’ve successfully configured a preauthorized OSB user account for RMAN access, I just need to make the connection between that OSB account and my Oracle database. The easiest way to do this is to use the Enterprise Manager Database Control (EMDBC) GUI interface to set up a link to the OSB administrative server.
Figure 2.6 shows what EMDBC displays when I select the Oracle Secure Backup Device and Media link on the Administration page for my database server, and Figure 2.7 shows how to provide the proper parameters to set up the link between the database server and OSB. And once the link between the database server and OSB is complete, I can also view the status of the OSB devices that are available for creating database backups via RMAN, as shown in Figure 2.8.
Creating RMAN Backups Through Oracle Secure Backup
The good news is that the hard work is done, and I can now back up my Oracle 10gR2 database directly to tape with a few simple RMAN commands. But – even better! - OSB also gives me the tools I need to back up my database’s Flash Recovery Area directly to tape as well.
Backing Up The Whole Database To An OSB Tape Device.
To create a full backup of my existing Oracle database using an Oracle Secure Backup virtual tape as my target media, I simply invoke the following script within an RMAN session:
run {
allocate channel ch1 device type sbt parms='SBT_LIBRARY=
/usr/local/oracle/backup/lib/libobk.so';
backup database;
release channel ch1;
}
The directive DEVICE TYPE sbt instructs RMAN to look for a qualifying tape device as a target for the backup sets this command will create. Since I’ve already preauthorized the vt tape device in the OSB environment as a suitable target for RMAN backup and restoration operations, it is automatically used in this context.
Linux Attach Points
Oracle recommends that for Linux systems the /dev/sg devices be used as attach points with Oracle Secure Backup. The use of the Oracle Secure Backup /dev/ob devices has certain limitations that some users might find unacceptable in their environments. For example the logical unit number cannot be greater than 7, and the Small Computer System Interface (SCSI) bus number cannot be greater than 1. The existing method of using /dev/ob* devices continues to work for a tape device that does not fall into the limitation category.
To identify the /dev/sg that corresponds to the tape device you are interested in, you can use the sg_map
command. The following example shows a system that has five tape drives and four tape libraries available:
sg_map -i -x
/dev/sg0 0 0 0 0 0 /dev/sda DELL PERC Stripe V1.0
/dev/sg1 0 0 1 0 0 /dev/sdb DELL PERC Stripe V1.0
/dev/sg2 0 0 2 0 0 /dev/sdc DELL PERC Volume V1.0
/dev/sg3 1 0 1 0 8 ADIC FastStor 2 G12r
/dev/sg4 1 0 2 0 1 /dev/nst0 HP Ultrium 2-SCSI F53A
/dev/sg5 2 0 0 0 1 /dev/nst1 IBM ULTRIUM-TD2 5AT0
/dev/sg6 2 0 0 1 8 ADIC Scalar 24 310A
/dev/sg7 2 0 1 0 1 /dev/nst2 IBM ULTRIUM-TD2 5AT0
/dev/sg8 2 0 1 1 8 ADIC Scalar 24 310A
/dev/sg9 2 0 2 0 1 /dev/nst3 IBM ULTRIUM-TD3 54K1
/dev/sg10 2 0 3 0 1 /dev/nst4 IBM ULTRIUM-TD3 54K1
/dev/sg11 2 0 3 1 8 ADIC Scalar 24 310A
After you have identified the /dev/sg that corresponds to the tape device you are interested in, you can use the obtool mkdev
command to create attach points for it. For example, to create the attach points for an ADIC Fastor 2 tape library that has one tape drive, you would enter the following:
ob> mkdev -t library -o -a node1:/dev/sg3 lib1
ob> mkdev -t tape -o -a node1:/dev/sg4 -l lib1 -d 1 tape1
LIST AND RESTORE DATA FROM TAPE DEVICE
#obtool
ob> lsdev
library vlib in service
drive 1 vt in service
drive 2 tape1 in service
to list data:
#obtar -tvf tape1 -F 1
to restore data:
#obtar -xvf tape1 -F 1 /u22/oracle/restore
Комментариев нет:
Отправить комментарий