Oracle7 Enterprise Backup Utility Administrator's Guide | ![]() Library |
![]() Product |
![]() Contents |
![]() Index |
Topics covered in this appendix are:
EBU does not obtain values from environment variables like ORACLE_HOME and ORACLE_SID. The utility obtains and checks these values with those it stores in the backup catalog.
Note: These macros cannot be used when specifying log or trace files.
backup online db_name = "PROD"
control_file pfile tablespace = "A","B"
log = "/opt1/oracle/obackup/log/onln_prodb.log"
The Oracle database is case-sensitive when storing data, however, Oracle7 stores names of tablespaces in uppercase by default. The Enterprise Backup Utility preserves the case of values you assign all specifiers. This means that if a tablespace name is stored in the database in uppercase, you must enter it in uppercase in the command script as well. If you do not, an error message displays and the job is not carried out.
You can determine exact tablespace names by querying the table SYS.DBA_TABLESPACES in the target database.
With the Enterprise Backup Utility, comments can also be used as escape sequences for your third-party media management software.
Single quotes are reserved for regular expressions in the future. This allows the Enterprise Backup Utility to store uppercase and lowercase values in the backup catalog. The only exceptions to the double-quote rule are the numerical specifiers such as parallel or job_id, which you enter without quotes.
To perform backups of target databases. You can perform the following types of backups:
For online backups, ensure that the target database is online and you can connect as the backup user to the target database. For offline backups, ensure that the target database is shut down cleanly.
online
Specifies that the backup of the target database be taken when the database is open and available for use. Some tablespaces in the database may be offline, but the backup is still considered online. Autoregistration and archived log file backup are enabled by default for online backups.
database
Specifies all datafiles, control files, and parameter files be backed up. You cannot use the database specifier in the same command script as the control_file, tablespace, pfile, or dbfile specifiers.
<subset>
Substitution variable for the backup command. It implies that only a part of the database is backed up by the Enterprise Backup Utility. You must specify the objects to be backed up in the backup script. Note that database and <subset> are mutually exclusive. For more information refer to the <subset> section .
<archive- log>
Specifies that archived redo log files should be backed up. Enabled by default when any datafile is backed up; disabled for all offline backups. Can be used to specify logfile-only backup. By default, backs up files in the directory specified by the initialization parameter LOG_ARCH_DEST, but other directories can be specified. For more information refer to the <archivelog> section .
offline
Specifies that the database is shut down and not available for general use during backup. Note that the keywords online and offline are mutually exclusive. The Enterprise Backup Utility does not perform autoregistration for offline backups, though a shell script can include the register command, thereby verifying configuration before offline backups.
db_name
Identifies the name of the target database. This specifier is mandatory; you must include it in each command script. The db_name specifier allows EBU to verify the target database name registered in the backup catalog.
oracle_sid
Specifies the Oracle7 Server system identifier. ORACLE_SID uniquely identifies each instance of the database.
parallel
Specifies the number of concurrent data streams in reading from or writing to a media device. Specify a value equal to the number of backup devices available. If you do not enter a value, the number of parallel streams defaults to one.
mux
Specifies a list of datafiles that are to be multiplexed into a single BFS. The mux specifier can be used multiple times in a command script.
Note: When using the mux specifier, make sure you either specify the database parameter or explicitly specify the tablespace(s) to which the multiplexed datafiles belong in the backup command.
Additional Information: See Also: "Multiplexing Files" .
log
Specifies the pathname of the Enterprise Backup Utility log file. This file stores utility runtime messages. The log file can be specified as either a relative or absolute pathname. If unspecified, messages are sent to standard output.
Note: The log file is not a value stored in the backup catalog. Entering log without a corresponding file results in an error.
trace
Specifies pathname of the Enterprise Backup Utility status trace file. This file stores utility runtime messages. The trace file can be specified as either a relative or absolute pathname. If unspecified, no output is generated
Note: You cannot use the "?" and "@" characters as macros when specifying pathnames for log or trace. However, the filename can have the "@" character. Oracle Corporation recommends you specify $OBK_HOME/log as the destination for the log and trace files.
param
Specifies the pathname to the Enterprise Backup Utility system parameters file. This specifier is optional. You can also specify individual parameters in the command script.
test
Specifies that you want only a test run. When you use this specifier in a command script, the Enterprise Backup Utility performs the command, except for any destructive operations to tape or disk (such as write operations, for example). This allows you to check the effectiveness of your command scripts before you carry out the specified operation. Cannot be used with the checksum specifier or command option.
arch- delete
Specifies that backed up archived log files be deleted. Not enabled by default. The utility will not delete any archived log file it has not backed up.
checksum
Performs a checksum on each file in the backup and stores the information in the backup catalog. Cannot be used with test specifier or command option.
catalog
Specifies that the backup catalog be backed up after the backup job. Catalog backup is the default and occurs with every backup that includes database objects, unless catalog=none is specified. EBU identifies each successful catalog backup with a sequence number to facilitate locating the job in the event it must be used to restore the catalog.
The catalog can also be backed up independently of other backup jobs by using the catalog specifier, but no other specifiers, in the backup script.
Example 1
backup offline database
backup offline database db_name = "PROD" oracle_sid = "PROD" parallel = 4 log = "/opt1/oracle/obackup/log/obkPROD.log"
Example 2
backup online database archivelog
backup online db_name = "PROD" oracle_sid = "PROD" parallel = 3 log = "/opt1/oracle/obackup/log/obkPROD.log"
Example 3
backup online <subset> with datafile multiplexing and multiple log directories
backup online db_name = "PROD" oracle_sid = "PROD" control_file tablespace = "A", "B" mux = ("home/oracle/dbs/A1.dbf", "home/oracle/dbs/B1.dbf","home/oracle/dbs/A2.dbf", "home/oracle/dbs/B2.dbf") parallel = 5 archivelog = "/home/oracle/archive01", "/home/oracle/archive02"
Example 4
online backup <subset> with catalog backup disabled
backup online db_name = "PROD" oracle_sid = "PROD" control_file tablespace = "A","B" parallel = 16 log = "/opt1/oracle/obackup/log/obkPROD.log" param = "/opt1/oracle/obackup/defaults.obk" catalog = none
Example 4
online backup <archivelog> with archdelete specified
backup online archivelog = "/home/oracle/archive01", "/home/oracle/archive02" archdelete db_name = "PROD" oracle_sid = "PROD" control_file tablespace = "A","B" parallel = 16 log = "/opt1/oracle/obackup/log/obkPROD.log" param = "/opt1/oracle/obackup/defaults.obk"
To cancel an active job and clean up its resources. You should always use cancel instead of the UNIX kill command when terminating EBU jobs.
Prerequisites
Be sure you have the job ID of the job you want to cancel. You can cancel any active job.
job_id
Job identifier of job to be cancelled. To find the job identifier for a job you want to cancel, look at the log file or query the table OBK_RT_JOB_BR in the backup catalog to see active jobs.
log
Specifies the pathname of the Enterprise Backup Utility log file. This file stores utility runtime messages. The log file can be specified as either a relative or absolute pathname. If unspecified, messages are sent to standard output.
Note: The log file is not a value stored in the backup catalog. Entering log without a corresponding file results in an error.
trace
Specifies pathname of the Enterprise Backup Utility status trace file. This file stores utility runtime messages. The trace file can be specified as either a relative or absolute pathname. If unspecified, no output is generated
Note: You cannot use the "?" and "@" characters as macros when specifying pathnames for log or trace. However, the filename can have the "@" character. Oracle Corporation recommends you specify $OBK_HOME/log as the destination for the log and trace files.
Example 1
cancel
cancel job_id = 4467 log = "/opt1/oracle/obackup/log/obkPROD.log"
Example 2
cancel with log information dumped in standard output
cancel job_id = 4489
To invalidate a successfully completed job.
Prerequisites
Be sure you have the job ID of the job you will invalidate. You can invalidate jobs you started or jobs started by others as long as the jobs have completed successfully.
You cannot invalidate catalog backups, or jobs in progress (use cancel for jobs in progress). The difference between invalidate and using ebutool -deljob is that invalidate retains a record that the job was performed; ebutool -deljob deletes it completely.
job_id
Job identifier of job to be invalidated. To find job identifier, query the table OBK_JOBS in the backup catalog.
log
Specifies pathname of the Enterprise Backup Utility message log file. This file stores utility runtime messages. The log file can be specified as either a relative or absolute pathname. If unspecified, messages are sent to standard output.
Note: The log file is not a value stored in the backup catalog. Entering log without a corresponding file results in an error.
trace
Specifies pathname of the Enterprise Backup Utility status trace file. This file stores utility runtime messages. The trace file can be specified as either a relative or absolute pathname. If unspecified, no output is generated
Note: You cannot use the "?" and "@" characters as macros when specifying pathnames for log or trace. However, the filename can have the "@" character. Oracle Corporation recommends you specify the full pathname of the $OBK_HOME/log directory as the destination for the log and trace files.
Example 1
invalidate
invalidate job_id = 4467 log = "/opt1/oracle/obackup/log/obkPROD.log"
Example 2
invalidate with log information dumped in standard output
invalidate job_id= 4492
To register target database information in the backup catalog database. This command can be used to register a new target database in the backup catalog or to update information for an existing target database.
Prerequisites
The target database must be online to register or update. If the target database is offline, the Enterprise Backup Utility aborts and displays an error message.
Check that the catalog.obk file is in $OBK_HOME/admin directory and has the connect string to the backup catalog database.
The backup user must have been created in the target database prior to registering the database in the backup catalog. See "Authorizing Target Database Backups" .
db_name
Identifies the name of target database. You must include this specifier in each command script. EBU uses the db_name specifier to verify the target database name registered in backup catalog.
oracle_ home
Specifies the full or relative directory path of the ORACLE_HOME directory of the target database. This specifier is mandatory. You can use the ? character in place of the full ORACLE_HOME when specifying some filenames. For example, if you enter: pfile="?/dbs/my_initPROD.ora" EBU expands the macro "?" to replace it with the value of ORACLE_HOME.
Note: The ORACLE_HOME specified in the script does not have to be the ORACLE_HOME from the current environment. EBU verifies the specified value against those stored in the backup catalog, not the user's environment.
oracle_sid
Specifies the Oracle instance system identifier. Uniquely identifies each database instance. You can use the @ character in place of the full ORACLE_SID when specifying some filenames. For example, if you enter: pfile="/u01/oracle/PROD/dbs/my_init@.ora" the utility expands the macro "@" to replace it with value of ORACLE_SID.
Note: The ORACLE_SID specified does not have to be the ORACLE_SID from the current environment. EBU verifies specified values against those stored in the backup catalog, not the user's environment.
pfile
Specifies list of parameter files used by target database. Required for both registering and reconfiguring target database information.
log
Specifies pathname of the Enterprise Backup Utility message log file. This file stores utility runtime messages. The log file can be specified as either a relative or absolute pathname. If unspecified, messages are sent to standard output.
Note: The log file is not a value stored in the backup catalog. Entering log without a corresponding file results in an error.
trace
Specifies pathname of the Enterprise Backup Utility status trace file. This file stores utility runtime messages. The trace file can be specified as either a relative or absolute pathname. If unspecified, no output is generated
Note: You cannot use the "?" and "@" characters as macros when specifying pathnames for log or trace. However, the filename can have the "@" character. Oracle Corporation recommends you specify the $OBK_HOME/log directory as the destination for the log and trace files.
Example 1
register to register target database
register db_name = "PROD" oracle_home = "/opt1/oracle" oracle_sid = "PROD" pfile = "?/dbs/init@.ora","?/dbs/include@.ora", "?/dbs/config@.ora" log = "/opt1/oracle/obackup/log/obkPROD.log"
Example 2
register to update the backup catalog
register db_name = "PROD" oracle_home = "/opt1/oracle" oracle_sid = "PROD" pfile = "?/dbs/init@.ora","?/dbs/include@.ora" , "?/dbs/config@.ora"
Additional Information: See Also: For more information on the register command, see Chapter 2.
To restore a database in case of media failure, with the option to recover it, as well. This command can be used to perform the following restores:
Verify that the target database or the specified objects being restored are offline. Requires SYSDBA privileges, or INTERNAL with the user in the OSDBA group, when used with recover option.
database
Specifies that the entire database be restored. If you use the database specifier with the consistent switch, EBU restores only from the most recent backup offline database. Using database consistent to restore your entire database from one backup job means you need not apply redo log files to make the database consistent.
<subset>
Substitution variable for the restore command. It implies that the Enterprise Backup Utility restores only a part of the database. Explicitly specify the objects to restore in the restore script.
Additional Information: See Also: For more information refer to the <subset> section .
<archive- log>
Specifies that archived logs are to be restored. Archivelog restore is the default, unless consistent is specified. Can be disabled by specifying archivelog = none. Default destination is the location from which log files were backed up, but this can be overridden by giving a different location.
Additional Information: See Also: For more information refer to the <archivelog> section .
db_name
Identifies the name of the target database. This specifier is mandatory; you must include it in each command script. The db_name specifier allows EBU to verify the target database name registered in the backup catalog.
oracle_sid
Specifies the Oracle7 Server system identifier. ORACLE_SID uniquely identifies each instance of the database.
to
Specifies the point in time to which the Enterprise Backup Utility restores the database. If you do not enter a value, the utility finds the most recent backup(s) to use in performing the restore. Use the following valid date formats to specify the to parameter:
Specifies that files be restored to a new location. See page 5 - 5 for information about starting up the database after restoring with the remap option.
parallel
Specifies the number of concurrent data streams in reading from or writing to a media device. Specify a value equal to the number of backup devices available. If you do not enter a value, the number of parallel streams defaults to one.
backup_ host
Specifies the full name of the original backup host when restoring to a different host. You need this specifier to identify the backup set in the backup catalog to restore to a new host.
log
Specifies pathname of the Enterprise Backup Utility message log file. This file stores utility runtime messages. The log file can be specified as either a relative or absolute pathname. If unspecified, messages are sent to standard output.
Note: The log file is not a value stored in the backup catalog. Entering log without a corresponding file results in an error.
trace
Specifies pathname of the Enterprise Backup Utility status trace file. This file stores utility runtime messages. The trace file can be specified as either a relative or absolute pathname. If unspecified, no output is generated
Note: You cannot use the "?" and "@" characters as macros when specifying pathnames for log or trace. However, the filename can have the "@" character. Oracle Corporation recommends you specify $OBK_HOME/log as the destination for the log and trace files.
param
Specifies the pathname to the Enterprise Backup Utility system parameter file. This specifier is optional. If not specified, EBU uses default values in the $OBK_HOME/defaults.obk file.
test
Specifies that you want only a test run. When you use this specifier in a command script, the utility performs the command, except for any destructive operations to tape or disk (such as write operations, for example). This allows you to check the effectiveness of your command scripts before you carry out the specified operation. Cannot be used with checksum specifier or command option.
checksum
Performs a checksum on each file being restored and compares it to the information stored in the backup catalog. Cannot be used with test specifier or command option.
recover
Recovers the database following a successful restore. Default is to recover the database to the most recent point in time possible, though earlier points can be specified by either timestamp or SCN.
Example 1
restore database to point-in-time
restore database db_name = "PROD" oracle_sid = "PROD" to = "01/01/1994 12:00
Example 2
restore database consistent
restore database consistent db_name = "PROD" oracle_sid = "PROD" parallel = 4 log = "/opt1/oracle/obackup/log/obkPROD.log"
Example 3
restore of two tablespaces and control file, with database-wide recovery
restore db_name = "PROD" oracle_sid = "PROD" parallel = 4 control_file tablespace = "A","B" recover log = "/opt1/oracle/obackup/log/obkPROD.log"
Example 4
restore database consistent
restore database consistent db_name = "PROD" oracle_sid = "PROD" parallel = 4 archivelog start_lsn = 65 log = "/opt1/oracle/obackup/log/obkPROD.log"
To restore the backup catalog in the event it has been corrupted or the catalog database has been lost. The backup catalog command creates a logical backup of the catalog schema.
Prerequisites
The backup catalog database must be started and open. No other backup or restore operations can be performed while the catalog is being restored.
If restoring the catalog to a new database, the catalog.obk file must be updated to point to the new catalog database before invoking the restore catalog command.
Syntax
src_cat_ db_name
This is the DB_NAME of the backup catalog and must be specified in any restore catalog command. EBU compares this DB_NAME with the DB_NAME of the database specified in $OBK_HOME/admin/catalog.obk. If the two locations are not identical, the utility aborts.
as
Specifies a new database in which to restore the backup catalog.
Note: The connect information to the new catalog database must be entered in the catalog.obk file on the target database from which you are running the restore catalog command, before running the command.
to
Specifies a point-in-time to which the catalog should be restored. EBU restores the most current catalog backup available for the given time.
The valid date format for catalog restore is "MM/DD/YYYY". Hours and minutes, if specified, are ignored.
If no catalog backup can be located within seven days of the specified time, the job fails.
seq
Specifies the sequence number generated during catalog backup. The sequence number can be obtained from the log file of the backup job and used to speed up the search for the most current backup.
The sequence number indicates the order of catalog backups for any given day.
Warning: Oracle Corporation strongly recommends that you restore the catalog to a different location, if you are restoring it to a previous point-in-time.
Example 1
restore catalog
restore catalog = "EBUCAT" to "12/07/1996" seq = 9
Example 1
restore catalog to a new database
restore catalog = "EBUCAT" as = "NEWCAT"
To specify an object of the database to backup or restore. This command can be used to specify the following objects:
The subset clause works only with backup and restore commands. You cannot use this option if you use the database specifier.
control_ file
Specifies that control file(s) of the target database be backed up or restored.
Note: You cannot use the control_file specifier to specify a list of control files. The only time you need to use this specifier is when you are backing up or restoring only the control files. In all other cases, the Enterprise Backup Utility backs up and restores the control files automatically.
You must shut down the target database for the Enterprise Backup Utility to restore control files.
table- space
Specifies the list of tablespaces to be backed up or restored. If specified without arguments, all tablespaces in the target database are backed up or restored. To back up or restore only specific tablespaces, enter a list of tablespaces separated by commas. If you use the tablespace specifier, you need not use the dbfile specifier unless you want to restore database files which do not belong to the tablespaces you specify.
dbfile
Specifies one or more database files in the target database for backup or restore. Backup File Sets containing multiplexed files are automatically demultiplexed correctly. You can remap datafiles being restored to a different location, as long as EBU has write permission on the new destination. If you use the remap specifier, rename the datafiles before you bring the database back online.
Additional Information: For information on renaming files, see the Oracle7 Server Administrators Guide.
pfile
Specifies that parameter files used by the target database be backed up or restored. If you rename parameter files, use the pfile option when starting up the database. During restore, the Enterprise Backup Utility renames any parameter files existing before you restored the database.
You cannot specify which parameter files are backed up.
EBU takes the values from the backup catalog by default.
Example 1
restore <subset>
restore db_name = "PROD" oracle_sid = "PROD" parallel = 4 control_file tablespace = "A","B" log = "/opt1/oracle/obackup/log/obk@.log"
Example 2
backup online <subset>
backup online db_name = "PROD" oracle_sid = "PROD" tablespace = "A","B" parallel = 16 log = "/opt1/oracle/obackup/log/obkPROD.log"
To specify that archived redo log files be backed up or restored. Archived log file backup is default for online backups and disabled for offline backups. Archived log file restore is default unless consistent is also specified.
Prerequisites
This clause works with only backup online and restore commands. The RDBMS parameter LOG_ARCHIVE_FORMAT cannot be specified using the star (*) or pound (#) characters as wildcards.
archive- log
Explicitly specifies that archived redo logs be backed up or restored. Not required for online backups because is enabled by default when any datafile is backed up. Disabled for offline backups.
For backups, the default source directory is the current LOG_ARCHIVE_DEST (obtained by querying the target database). Other destinations can be specified, but these override, not augment, the default.
For restores, default is to restore files to the directory from which they were backed up. The default can be overridden by providing a destination directory. During restore, if a file by the same name already exists in the destination directory, the utility skips the restore of that file and goes on the next file.
start_lsn
Specifies the log sequence number at which to begin restoring archived redo logs. Must be used in conjunction with the archivelog specifier.
none
Specifies that no archived redo logs be backed up or restored.
Example 1
backup online <archivelog>
backup online db_name = "PROD" oracle_sid = "PROD" archivelog log = "/opt1/oracle/obackup/log/obkPROD.log"
Example 2
restore <subset> <archivelog>
restore db_name = "PROD" oracle_sid = "PROD" tablespace = "A", "B" archivelog = "/home/oracle/archive03" parallel = 4 control_file tablespace = "A","B" log = "/opt1/oracle/obackup/log/obk@.log"
BACKUP
{ ONLINE{ DATABASE|<SUBSET> } | OFFLINE DATABASE } DB_NAME = "database_name" ORACLE_SID = "target_database_oracle_sid" [PARALLEL = number_of_parallel_data_streams] [MUX =("datafile_pathname" [, "datafile_pathname"]...) [,("datafile_pathname" [, "datafile_pathname"]...)]...] [ARCHIVELOG [=["archivelog_directory_name" [,"archivelog_directory_name"]...]|[NONE]] START_LSN= LSN] [LOG = "message_log_file_pathname"] [TRACE = "status_trace_file_pathname"] [PARAM = "Obackup_parameter_file_pathname"] [ARCHDELETE] [TEST] [CATALOG [= NONE]]
CANCEL
JOB_ID = job_id
[LOG = "message_log_file_pathname"]
[TRACE = "status_trace_file_pathname"]
INVALIDATE
JOB_ID = job_id
[LOG = "message_log_file_pathname"]
[TRACE = "status_trace_file_pathname"]
REGISTER
DB_NAME = "database_name"
ORACLE_SID = "target_database_oracle_sid"
ORACLE_HOME = "target_database_oracle_home"
PFILE = "target_database_parameter_file_pathname" [,"target_database_parameter_file_pathname"...]
[LOG[= "message_log_file_pathname"]]
[TRACE[= "status_trace_file_pathname"]]
RESTORE DATABASE [CONSISTENT]|<SUBSET>
DB_NAME ="database_name" ORACLE_SID = "target_database_oracle_sid" [TO = "date_and_time_to_restore_to"] [REMAP = "old_pathname" to "new_pathname" [,"old_pathname" to "new_pathname"]....] [PARALLEL = number_of_parallel_data_streams] [BACKUP_HOST = "full_name_of _original_backup_host"] [ARCHIVELOG [=["archivelog_directory_name" [,"archivelog_directory_name"]...]|[NONE]] START_LSN = LSN] [LOG = "message_log_file_pathname"] [TRACE = "status_trace_file_pathname"] [PARAM = "Obackup_parameter_file_pathname"] [TEST] [RECOVER [TO [SEQ]]] [CATALOG]
[TABLESPACE [= "tablespace_name" [, "tablespace_name"]...]]
[DBFILE = "datafile_pathname" [, "datafile_pathname"]...]
[PFILE]
[CONTROL_FILE]
[=["archivelog_directory_name"[,"archivelog_directory_name"]...]|[NONE] START_LSN = LSN]
![]() ![]() Prev Next |
![]() Copyright © 1996 Oracle Corporation. All Rights Reserved. |
![]() Library |
![]() Product |
![]() Contents |
![]() Index |