Oracle7 Enterprise Backup Utility Administrator's Guide | ![]() Library |
![]() Product |
![]() Contents |
![]() Index |
This appendix describes the command script syntax for Enterprise Backup Utility command scripts.
Topics covered in this appendix are:
Syntax in this appendix is given in both syntax diagram and BNF notation. BNF notation is located at the end of this appendix.
The characters "?" and "@" can be used as macros when specifying datafiles. The "?" character represents ORACLE_HOME, while the "@" character represents ORACLE_SID. EBU expands these symbols with the respective values set in the environment at the time of the run. These should not be used for remap specifiers.
The %token% syntax can be used as macros when specifying datafiles. The %token% will be substituted by the corresponding value of the key, from either the environment or the registry. These cannot be used with remap specifiers.
In all the syntax descriptions and examples, the specifiers are on separate lines. This is not a requirement but has been done for clarity. The Enterprise Backup Utility also supports scripts like the following:
backup online db_name = PROD control_file pfile tablespace = A,B log = /opt1/oracle/obackup/log/onln_prodb.log
The EBU specifiers are case insensitive, but the values specified are case sensitive. Depending on the Operating System, the datafile names will be case-sensitive or not.
The Oracle database is case-sensitive when storing data; however, Oracle7 stores names of tablespaces in uppercase by default, so EBU will peform case-insensitive comparisons when looking at the tablespace list in the script, however, Oracle recommends always using quotes with tablespace names, specifically for use with multibyte character set tablespace names.
Comments are delimited by "#"and the newline character. When the Enterprise Backup Utility encounters the "#" character on a line, it ignores all remaining characters on that line, and resumes parsing on the next line. Use this capability to annotate your command scripts.
With the Enterprise Backup Utility, comments can also be used as escape sequences for your third-party media management software.
In Enterprise Backup Utility Release 2.2 double quotes are not needed for value specifiers unless there are embedded spaces in the value, the value corresponds to one of the EBU reserved words, or the value contains multibyte characters.
For example:
datafile=/oracle/data/mydata.dbf does not need quotes,
while
datafile="/oracle/data/my data.dbf" does require quotes as there is a space in the middle
log="log" requires quotes as log is a keyword
log=output.log does not require quotes
Single quotes should not be used, they are not recognized and will generate syntax errors.
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. For offline backups, the database will be started to verify its configuration in the EBU catalog before the backup, and will again be started after the backup to verify that the database was not opened during the offline backup.
Name | Description |
---|---|
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. Use -noauto command line option to disable configuration checking. If database has not been registered before the backup will do the registration, the default OS dependent value will be assigned to pfile. |
database |
Specifies all online 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. |
tablespace |
Specifies the list of tablespaces to be backed up. If specified without arguments, all tablespaces in the target database are backed up. To back up 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 backup database files which do not belong to the tablespaces you specify. |
dbfile |
Specifies one or more online datafiles in the target database for backup. During a restore, Backup File Sets containing multiplexed files are automatically demultiplexed correctly. You can remap datafiles being restored to a different location with the remap and remap_path specifiers, as long as EBU has write permission on the new destination. If you use the restore to a different location, rename the datafiles before you bring the database back online or use the RENAME specifier so that EBU does this automatically. 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 STARTUP_PFILE to direct EBU to use the newly restored paratmer file for recovery, or if doing recover manually use the pfile option of the startup command when starting up the database. During restore, the Enterprise Backup Utility renames any parameter files existing before they are restored the disk. Parameter files are never overwritten. You cannot specify which parameter files are restored. EBU uses the list of parameter files that were registered with the database. |
control_file |
Specifies that the 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. Its usage during backup is not needed unless only the parameter files (and no archivelogs are being backed up), or just the control file wants to be backed up. By default any backup involving datafiles or archivelog files will backup up the control file automatically. During RESTORE DATABASE or RESTORE DATABASE CONSISTENT , it can be used to direct EBU to overwrite the existing control file(s). A copy of the control file(s) is made before being overwritten by the restore. It can also be used to direct EBU to overwrite the control files in other RESTORE <subset> scenarios. The database must be shutdown in order for the control file to be restored to its original location. |
offline database |
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, although it verifies that the configuration is up to date and refuses to perform the backup if it is not up to date. Use the -noauto option to disable configuration checking for offline backups. Offline datafiles are not backed up by default even in offline backups. |
startup_pfile |
Direct EBU to use an altenate parameter file to startup the database to verify its state when performing offline backups. By default EBU will use the default OS dependent default pfile value. |
db_name |
Identifies the name of the target database. This specifier is optional; you can include it in each command script. If specified, the database name of the target database should match the specified name, otherwise an error is signaled. If not specified, it is assumed no validation is performed. |
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. Construct groups of files to be multiplexed together by enclosing the list in parenthesis. 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: "Multiplexing"". |
<param_clause> |
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 itself. See "<COMMON_ARGS>". |
archivelog [ = <arch log directory list> | none] |
Used to specify whether or not archivelogs are to be backed up, and the list of directories where they are located. 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. The none specifier indicates that archived logs are not to be backed up. |
archdelete |
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. |
catalog [=none] |
Used to specify whether or not the EBU catalog is to be backed up. |
arch_per_bfs |
Specifies the number of archived redo logs to be placed in each BFS. |
arch_copies |
Specifies the number of times to backup the archivelogs in different BFSs to provide archivelog redundancy in case of media failure. |
allow_corrupt |
Specifies that files with corrupted RBA block headers are to be patched and backed up in the job. The deafult behavior of EBU will error out if a file with a corrupted RBA header is encountered. |
include_dbfile |
Specifies the list of OFFLINE datafiles to be included in the backup. Offline datafiles will be backed up in image mode without block header verification. |
backup offline database db_name = PROD parallel = 4 log = /opt1/oracle/obackup/log/obkPROD.logExample A-2 backup online database with archivelog backup
backup online archivelog parallel = 3 log = /opt1/oracle/obackup/log/obkPROD.logExample A-3 backup online tablespace subset with datafile multiplexing and multiple archivelog directories
backup online db_name = "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 A-4 online backup <subset> with catalog backup disabled
backup online db_name = PROD control_file arch_copies=2 arch_per_bfs=64 tablespace = a, b parallel = 16 log = /opt1/oracle/obackup/log/obkPROD.log param = /opt1/oracle/obackup/defaults.obk catalog = noneExample A-5 offline backup with archdelete specified, non default startup parameter file and offline datafiles
backup offline database archdelete include_dbfile="/opt1/oracle/data/offline1.dbf",/opt1/oracle/data/offline2.dat parallel = 16 startup_pfile=/opt1/oracle/admin/initoffPROD.ora log = /opt1/oracle/obackup/log/obkPROD.log param = "/opt1/oracle/obackup/defaults.obk"Example A-6 backup online tablespace subset
backup online tablespace = "A","B" parallel = 16 log = "/opt1/oracle/obackup/log/obkPROD.log"
The backup catalog command creates a logical backup of the EBU catalog.
The backup catalog database must be started and open. No new EBU jobs can be performed while the EBU catalog is being backed up.
Keywords | Description |
---|---|
backup catalog |
Backs up the EBU catalog. |
(see backup command) |
(see backup command keywords and specifiers) |
backup catalogExample A-8 backup catalog using a temporary directory
backup catalog tempdir=c:/temp
To register target database information in the EBU Catalog database. This command can be used to register a new target database in the EBU Catalog or to update information for an existing target database.
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.ebu file is in EBU_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".
registerExample A-10 register to update the List of Parameter Files Associated with the Database
register db_name = "PROD" pfile = ?/dbs/init@.ora,"?/dbs/include@.ora" , ?/dbs/config@.ora"
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.
Name | Description |
---|---|
database [consistent] [controlfile] |
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. Using controlfile indicates that the database controlfile should be restored to the location where it was backed up, overwriting current controlfile. |
[tablespace|dbfile|pfile| controlfile] |
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. Note that database and <subset> are mutually exclusive, except for the CONTROL_FILE specifier, which can be used to indicate to EBU that the control file should be restored replacing the current control files. For more information refer to the "Restore Subset" |
bfs=<bfsname>,... |
Restores the listed backup file sets(s). |
archivelog [ = <arch log dirlist> | none] |
Used to specify whether or not archivelogs should be restore, and if so so, where they should be restored to. |
|start_lsn=<thread>:<seq> |end_lsn=<thread>:<seq> |
Specifiy the thread and logical sequence number range of archved logs to be restored. |
db_name |
Identifies the name of target database. This specifier is optional; you can include it in each command script. If specified, the database name of the target database should match the specified name,. Otherwise an error is signaled. If not specified, it is assumed that no validation is performed. |
to |
Specifies the point in time to which the Enterprise Backup Utility restores the database. If this keyword is not used, 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: MM/DD/YYYY (HH24:MI:SS default to 23:59:59) MM/DD/YYYY HH24 (MI:SS default to 00:00) MM/DD/YYYY HH24:MI (SS default to 00) MM/DD/YYYY HH24:MI:SS |
remap |
Specifies that files be restored to a new location. See"Remap" for information about remapping. |
remap_path |
Specifies that EBU will remap all the files matching the old_file_path file to be restored to the new_file_path See chapter 5 for discussion about remapping. |
rename |
Specifies that EBU will rename the datafiles in the database automatically after remapping. This is used in conjunction with the remap or remap_path specifier. This needs to be specified in addition to the remap/remap_path specifier if EBU will be performing automatic recovery. |
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 EBU Catalog to restore to a new host. |
recover [ = [ <scn> | <time> ]
|
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. |
include_dbfile |
Specifies the list of OFFLINE datafiles to be included in the restore. Files that were offline when backed up are not restored by default. Offline datafiles restored in this way will not be recovered by the automatic recovery option. |
restore database to = "01/01/1994 12:00Example A-12 restore database consistent
restore database consistent db_name = "PROD" parallel = 4 log = /opt1/oracle/obackup/log/obkPROD.log"Example A-13 restore of two tablespaces and control file, with database-wide recovery
restore db_name = prod parallel = 4 control_file tablespace = a, B recover log = "/opt1/oracle/obackup/log/obkPROD.log"Example A-14 restore tablespace subset
restore db_name = PROD parallel = 4 control_file tablespace = a, B log = "/opt1/oracle/obackup/log/obk@.log"Example A-15 restore tablespace subset and archivelogs
restore db_name = "PROD" tablespace = A, b archivelog = "/home/oracle/archive03" parallel = 4 control_file log = "/opt1/oracle/obackup/log/obk@.log"Example A-16 restore database consistent with archivelog range
restore database consistent start_lsn=2:100 end_lsn=2:150 parallel=2 log="c:/orant/obackup/log/racPROD.log"Example A-17 restore database consistent replacing current control files with the ones in the backup
restore database consistent controlfile parallel = 4 archivelog start_lsn = 65
To restore the EBU catalog in the event it has been corrupted or the catalog database has been lost. Backups of the EBU catalog are created using by default any time a BACKUP operation is performed or can be created with the BACKUP CATALOG command.
The backup catalog database must be started and open. No other backup or restore job can be performed while the catalog is being restored.
If restoring the catalog to a new database, the EBU_HOME/admin/catalog.ebu file must be updated to point to the new catalog database before invoking the restore catalog command.
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. |
restore catalog = EBUCAT to "12/07/1996" seq = 9Example A-19 restore catalog to a new database
restore catalog = EBUCAT as = NEWCAT
To specify common parameters for backup, restore, backup catalog, and restore catalog commands.
To specify tape and disk I/O parameters for backup, restore, backup catalog, and restore catalog commands. Parameters detailed below can either be used as command specifiers or placed in a separate EBU parameter file.
BACKUP { ONLINE{ DATABASE| [TABLESPACE [= "tablespace_name" [, "tablespace_name"]...]] [DBFILE = "datafile_pathname" [, "datafile_pathname"]...] [PFILE] [CONTROL_FILE] } } | OFFLINE DATABASE [STARTUP_PFILE=pfile_pathname]} [DB_NAME = "database_name" ] [INCLUDE_DBFILE="datafile_pathname" [, "datafile pathname"] [MUX =("datafile_pathname" [, "datafile_pathname"]...) [,("datafile_pathname" [, "datafile_pathname"]...)]...] [ALLOW_CORRUPT] [ARCHIVELOG=["archivelog_directory_name"[,"archivelog_directory_name"]...]| [NONE]] [ARCH_PER_BFS = number of archivelogs per bfs] [ARCH_COPIES = number of copies of achivelog BFSs] [ARCHDELETE] [CATALOG [=NONE] ] [<COMMON_ARGS>]
BACKUP CATALOG [<COMMON_ARGS>]
REGISTER [DB_NAME = "database_name" ] [PFILE = "pfile_pathname" [,"pfile_pathname"...] ] [LOG[= "message_log_file_pathname"]] [TRACE[= "status_trace_file_pathname"]]
{DATABASE [CONSISTENT] [CONTROL_FILE] | [TABLESPACE [= "tablespace_name" [, "tablespace_name"]...]] [DBFILE = "datafile_pathname" [, "datafile_pathname"]...] [PFILE] [CONTROL_FILE] [BFS = bfsname [, bfsname] ] } [DB_NAME ="database_name" ] [INCLUDE_DBFILE="datafile_pathname" [, "datafile pathname"] [TO = MM/DD/YYYY [ HH24 [:MI [:SS] ] ] ] [BACKUP_HOST = "full_name_of _original_backup_host"] [RECOVER [={SCN | MM/DD/YYYY [ HH24 [:MI [:SS] ] ] } ] [RENAME] [REMAP = "old_pathname" to "new_pathname" [,"old_pathname" to "new_pathname"]....] [REMAP_PATH = "old_pathname" to "new_pathname" [,"old_pathname" to "new_pathname"]....] [ [ARCHIVELOG=["archivelog_directory_name"] | [NONE]] [START_LSN = [THREAD#:] LSN] [END_LSN = [THREAD#:] LSN] ] [<COMMON_ARGS>]
RESTORE CATALOG = catalog_db_name [AS = new_catalog_db_name ] [TO = MM/DD/YYYY [SEQ = sequence ] ] [<COMMON_ARGS>]
[TEMPDIR = tempdir_pathname] [USE_IO_MODEL={SHM|AIO}] [PARALLEL = number_of_parallel_data_streams] [<PARAM_CLAUSE>] [CHECKSUM] [TEST] [LOG = "message_log_file_pathname"] [TRACE = "status_trace_file_pathname"]
{ PARAM = ebu_parameter_file_pathname | [ DISK_IO_SIZE = number_of_blocks ] [ TAPE_IO_SIZE = number_of_blocks] [ BUFFER_SIZE = number_of_blocks] [ TAPE_RETRY_COUNT = number_of_retries ] [ TAPE_RETRY_PERIOD = number_of_seconds ] }
![]() ![]() Prev Next |
![]() Copyright © 1997 Oracle Corporation. All Rights Reserved. |
![]() Library |
![]() Product |
![]() Contents |
![]() Index |