[ Pobierz całość w formacie PDF ]
.The contents of the command file should be identical to commands entered atthe command line.Here, the Recovery Manager script from Example 1 has been placed into a file(called b_whole_l0.rcv ).This file is run from the command line as follows.rman target internal/kernel@prod1 rcvcat rman/rman@rcat cmdfileb_whole_l0.rcvUsing Stored Scripts: Example 3A stored script is a set of Recovery Manager commands (enclosed in braces) thatare stored in the recovery catalog.A stored script only relates to one database.You cannot use stored scripts if you do not use a recovery catalog.To create a stored script, you can either enter your script interactively into theRecovery Manager command line interface (as in Example 1), or type yourRecovery Manager commands into a command file, and run the command file(as in Example 2).Following is a stored script:replace script b_whole_l0 {# Backup Whole database, and archived logsallocate channel d1 type disk;allocate channel d2 type disk;allocate channel d3 type disk;backupincremental level 0tag b_whole_l06-10 Oracle8 Backup and Recovery Guidefilesperset 6format /dev/backup/prod1/df/df_t%t_s%s_p%p(database);sql alter system archive log current ;backupfilesperset 20format /dev/backup/prod1/al/al_t%t_s%s_p%p(archivelog alldelete input);}Specifying Time Parameters in Recovery ManagerBefore invoking Recovery Manager, set the NLS_DATE_FORMAT andNLS_LANG environment variables.These variables specify the format usedfor the time parameters in Recovery Manager commands, such as:" restore and recover" reportThe following example shows typical environment variables:NLS_LANG=americanNLS_DATE_FORMAT= Mon DD YYYY HH24:MI:SSNote: Both NLS_LANG and NLS_DATE_FORMAT must be set forNLS_DATE_FORMAT to be used.Recovery Manager Sample Scripts and ScenariosThere are a number of sample scripts in the RDBMS demo directory.Thesefiles are executable Recovery Manager command files and are fullycommented to explain the features used.You can edit them to customize themfor your site.The filecase1.rcv creates a number of stored scripts that back up, restore andrecover a database.These scripts are typical of how some DBAs back up theirdatabases, and you can use them as a starting point for developing backup,restore and recovery scripts.Getting Started with Recovery Manager 6-11The following files contain either a backup or recovery scenario.These scriptsshow more of the Recovery Manager syntax flexibility and power thanappears in the sample scripts:case2.rcv - incomplete recoverycase3.rcv - disaster recoverycase4.rcv - consistent backupSee Also: Additional backup and recovery scenarios are in Chapter 9, Recovery Manager Scenarios.Prerequisites for Performing Backups to TapeTo back up to and restore from sequential media, such as tape, you must havea Media Manager integrated with Oracle.This section includes the following topics:" Linking with a Media Manager" Generating Unique File Names" Know Your Media Manager s Maximum File Size LimitLinking with a Media ManagerTo integrate Oracle with a Media Manager, you must:" have Media Manager software and hardware installed and configured" obtain that Media Management Vendor s library interface software(Media Managment Library) from that VendorThe Media Management Library (MML) is then linked with the Oracle kernelsoftware.This enables Oracle server processes to call the Media Manager.Note: For instructions on how to achieve this on your platform, see youroperating system-specific Oracle documentation and the documentationsupplied by your Media Manager.Generating Unique File NamesYou should use the substitution variables provided by Recovery Manager togenerate unique backup piece names when writing backups to a Media6-12 Oracle8 Backup and Recovery GuideManager.A backup piece name is determined by the format string specifiedeither in the backup command, or in the allocate channel command
[ Pobierz całość w formacie PDF ]