Oracle DBA Tips Corner |
|
Oracle Secure Backup (OSB) provides a reliable, centralized tape backup management solution which can be used to protect file system data as well as Oracle Database files. For Oracle Recovery Manager (RMAN) users, the Oracle Secure Backup SBT interface enables you to use the RMAN to back up and restore Oracle Database files to and from tape. Oracle Secure Backup supports nearly all tape drives and tape libraries in Storage Area Network (SAN) and Small Computer System Interface (SCSI) environments.Oracle Secure Backup provides the ability to perform automatic tape drive cleaning as well as the option to manually clean a tape drive. The following article provides a brief overview of the tape cleaning functionality built into OSB.
After importing a cleaning cartridge to the tape library, you need to inform OSB that the media just inserted is not a data volume but rather a cleaning tape. Inserting a cleaning cartridge and performing an inventory through OSB while not indicating to OSB that a cleaning cartridge was inserted will result in OSB thinking the new media is a normal data tape. If you were to attempt a tape cleaning operation, the following errors would occur:
ob> clean --drive tape1 --force --use 8 Error: can't execute command - specified element does not hold a cleaning tape ob> clean --drive tape1 --force Error: can't execute command - could not find a usable cleaning tapeImport the cleaning cartridge into a vacant storage element (i.e. storage element 8). Next, notify OSB of the newly imported cleaning cartridge, using the insertvol command. In my example, I already used the cleaning tape once on another drive so I indicate --uses 1
ob> insertvol --library lib1 clean --uses 1 --maxuses 15 8
Use the clean command in obtool to request a manual cleaning be performed on the selected tape drive. The --force option will force the tape to be cleaned. If there is a tape loaded in the tape drive, then selecting this option unloads the tape, loads the cleaning tape, cleans the tape drive, and then reloads the tape that was originally in the tape drive.Import the cleaning cartridge into a vacant storage element (i.e. storage element 8). In my example, I already used the cleaning tape once on another drive so I indicate --uses 1
ob> insertvol --library lib1 clean --uses 1 --maxuses 15 8 ob> lsvol --library lib1 Inventory of library lib1: in 1: volume RMAN-TESTDB1-MF-000006, 83909632 kb remaining, content manages reuse in 2: volume RMAN-TESTDB1-MF-000004, 87050240 kb remaining, content manages reuse in 3: occupied in 4: occupied in 5: occupied in 6: occupied in 7: occupied in 8: cleaning tape: 1 use, 14 remaining ob> clean --drive tape1 --force --use 8 ob> lsvol --library lib1 Inventory of library lib1: in 1: volume RMAN-TESTDB1-MF-000006, 83909632 kb remaining, content manages reuse in 2: volume RMAN-TESTDB1-MF-000004, 87050240 kb remaining, content manages reuse in 3: occupied in 4: occupied in 5: occupied in 6: occupied in 7: occupied in 8: cleaning tape: 2 uses, 13 remaining
Oracle Secure Backup allows you to configure a tape library to automatically perform a type drive cleaning whenever a tape drive reports that it needs cleaning or when a specified usage time has elapsed.Use the --autoclean option of the mkdev or chdev commands of obtool to configure the library to perform automatic cleaning. When the autoclean option is set to yes, the cleaning cycle is initiated either when a tape drive reports that it needs cleaning or when a specified usage time has elapsed. Oracle Secure Backup checks for cleaning requirements when a cartridge is either loaded into or unloaded from a tape drive. If at that time a cleaning is required, then Oracle Secure Backup performs the following steps:
- Loads a cleaning cartridge
- Waits for the cleaning cycle to complete
- Replaces the cleaning cartridge in its original storage element
- Continues with the requested load or unload
The following example queries the tape library configuration for lib1. As you can see, the autoclean option is not currently set:
To enable automatic tape drive cleaning, use the chdev option:ob> lsdev --type library --long lib1 lib1: Device type: library Model: [none] Serial number: [none] In service: yes Debug mode: no Barcode reader: default (hardware-selected) Barcodes required: no Auto clean: no Clean interval: (not set) Clean using emptiest: no Ejection type: auto Min writable volumes: 0 UUID: 89064982-0df2-102c-8f89-00146cc1a7c7 Attachment 1: Host: packmule Raw device: /dev/sg0Another query on the tape library device shows that auto-cleaning is enabled:ob> chdev --type library --autoclean yes --cleanemptiest no lib1In addition to simply enabling auto-cleaning, OSB allows you to specify two other options:ob> lsdev --type library --long lib1 lib1: Device type: library Model: [none] Serial number: [none] In service: yes Debug mode: no Barcode reader: default (hardware-selected) Barcodes required: no Auto clean: yes Clean interval: (not set) Clean using emptiest: no Ejection type: auto Min writable volumes: 0 UUID: 89064982-0df2-102c-8f89-00146cc1a7c7 Attachment 1: Host: packmule Raw device: /dev/sg0
--cleanemptiest/-E {yes | no}
Specifies which cleaning tape to use. This option is useful when a tape library contains multiple cleaning tapes. The default value of yes specifies the emptiest cleaning tape, which causes cleaning tapes to round robin as cleanings are required. The no value specifies that obtool should use the least used cleaning tape, which uses each cleaning tape until it is exhausted, then uses the next cleaning tape until it is exhausted, and so forth.--cleaninterval/-i {duration | off}
Specifies whether there should be a cleaning interval, and if so, the duration of the interval. The default is off. The duration is the interval of time a tape drive is used before a cleaning cycle begins. If automatic tape drive cleaning is enabled, then duration indicates the interval between cleaning cycles. For tape drives that do not report cleaning requirements, you can specify a cleaning interval, for example, 30days.
All articles, scripts and material located at the Internet address of http://www.idevelopment.info is the copyright of Jeffrey M. Hunter
and is protected under copyright laws of the United States. This document may not be hosted on any other site without my express,
prior, written permission. Application to host any of the material elsewhere can be made by contacting me at jhunter@idevelopment.info.
I have made every effort and taken great care in making sure that the material included on my web site is technically accurate,
but I disclaim any and all responsibility for any loss, damage or destruction of data or any other property which may arise from
relying on it. I will in no case be liable for any monetary damages arising from such loss, damage or destruction.