FS
Documentation

Backup3G/DA-Oracle/Command Reference

From Documentation

(Difference between revisions)
Jump to: navigation, search
Revision as of 06:31, 12 April 2006
Daniels (Talk | contribs)
(ORAofflne)
← Previous diff
Revision as of 06:33, 12 April 2006
Daniels (Talk | contribs)
(ORAofflne)
Next diff →
Line 8: Line 8:
<code>ORAofflne [ -v ] [ -n ] [ -p <params_pattern> ] [ -s <file_patterns> ] [ -D ] [ -U ] [ -u logname ] Host SID</code> <code>ORAofflne [ -v ] [ -n ] [ -p <params_pattern> ] [ -s <file_patterns> ] [ -D ] [ -U ] [ -u logname ] Host SID</code>
-Description+Description:
-ORAofflne implements full backup of Oracle control files, redo logs and+ 
-tablespaces with the database shut down.+ORAofflne implements full backup of Oracle control files, redo logs and tablespaces with the database shut down. Control files and redo logs are backed up using cpio format. Each data file in a tablespace is backed up as a multi-part image.
-Control files and redo logs are backed up using cpio format. Each data file in a+ 
-tablespace is backed up as a multi-part image [see FSmimage].+Before starting a backup ORAofflne shuts down the database if it is up, restarts it in restricted mode, determines the files to back up, and then shuts the database down. ORAofflne also backs up the contents of one of the directories $ORACLE_BASE/admin/$SID, $ORACLE_HOME/dbs, or $ORACLE_HOME/admin, which should contain parameter and configuration files.
-Before starting a backup ORAofflne shuts down the database if it is up, restarts it+ 
-in restricted mode, determines the files to back up, and then shuts the database+If none of these directories exist the backup will give a warning and return an error status 1 on completion.
-down. ORAofflne also backs up the contents of one of the directories+ 
-$ORACLE_BASE/admin/$SID, $ORACLE_HOME/dbs, or+When all files are backed up ORAofflne sends a request to bring the database up, unless the -D flag is specified or the database was already down before the backup started.
-$ORACLE_HOME/admin, which should contain parameter and configuration files.+ 
-If none of these directories exist the backup will give a warning and return an error+
-status 1 on completion.+
-When all files are backed up ORAofflne sends a request to bring the database up,+
-unless the -D flag is specified or the database was already down before the backup+
-started.+
ORAofflne understands the following options: ORAofflne understands the following options:
--v Verbose mode. List the files to be backed up in the backup log.+;-v Verbose mode:List the files to be backed up in the backup log.
-Appendix A—Command Reference 35+;-n Do not follow symbolic links.: The default is to follow symbolic links and backup the target file rather than the symbolic link.
--n Do not follow symbolic links. The default is to follow symbolic+;-p params_pattern:Specifies the directory and file pattern for the Oracle configuration files of this SID which should be backed up along with Oracle backup. Note that the –p flag can only be specified once. If -p is not supplied, one of the directories
-links and backup the target file rather than the symbolic link.+$ORACLE_BASE/admin/$SID, $ORACLE_HOME/dbs, or $ORACLE_HOME/admin is backed up.
--p params_pattern+;-s file_patterns: Specifies additional files which should be backed up along with Oracle backup. Note that file-patterns can be a spaceseparated list of patterns, and that the –s flag can be specified multiple times.
-Specifies the directory and file pattern for the Oracle configuration+;-D :Do not restart the database after backup.
-files of this SID which should be backed up along with Oracle+;-U :Restart the database after backup.
-backup. Note that the –p flag can only be specified once. If -p is+
-not supplied, one of the directories+
-$ORACLE_BASE/admin/$SID, $ORACLE_HOME/dbs, or+
-$ORACLE_HOME/admin is backed up.+
--s file_patterns+
-Specifies additional files which should be backed up along with+
-Oracle backup. Note that file-patterns can be a spaceseparated+
-list of patterns, and that the –s flag can be specified+
-multiple times.+
--D Do not restart the database after backup.+
--U Restart the database after backup.+
-u logname The Oracle user login name. If -u is not supplied, the login name -u logname The Oracle user login name. If -u is not supplied, the login name
will be picked up from the environment variable will be picked up from the environment variable

Revision as of 06:33, 12 April 2006

This section describes the DA-Oracle backup and restore methods.

Contents

ORAofflne

Name
ORAofflne—Offline Oracle backup

Synopsis:

ORAofflne [ -v ] [ -n ] [ -p <params_pattern> ] [ -s <file_patterns> ] [ -D ] [ -U ] [ -u logname ] Host SID

Description:

ORAofflne implements full backup of Oracle control files, redo logs and tablespaces with the database shut down. Control files and redo logs are backed up using cpio format. Each data file in a tablespace is backed up as a multi-part image.

Before starting a backup ORAofflne shuts down the database if it is up, restarts it in restricted mode, determines the files to back up, and then shuts the database down. ORAofflne also backs up the contents of one of the directories $ORACLE_BASE/admin/$SID, $ORACLE_HOME/dbs, or $ORACLE_HOME/admin, which should contain parameter and configuration files.

If none of these directories exist the backup will give a warning and return an error status 1 on completion.

When all files are backed up ORAofflne sends a request to bring the database up, unless the -D flag is specified or the database was already down before the backup started.

ORAofflne understands the following options:

-v Verbose mode
List the files to be backed up in the backup log.
-n Do not follow symbolic links.
The default is to follow symbolic links and backup the target file rather than the symbolic link.
-p params_pattern
Specifies the directory and file pattern for the Oracle configuration files of this SID which should be backed up along with Oracle backup. Note that the –p flag can only be specified once. If -p is not supplied, one of the directories

$ORACLE_BASE/admin/$SID, $ORACLE_HOME/dbs, or $ORACLE_HOME/admin is backed up.

-s file_patterns
Specifies additional files which should be backed up along with Oracle backup. Note that file-patterns can be a spaceseparated list of patterns, and that the –s flag can be specified multiple times.
-D 
Do not restart the database after backup.
-U 
Restart the database after backup.

-u logname The Oracle user login name. If -u is not supplied, the login name will be picked up from the environment variable ORA_LOGNAME or will default to oracle7. Host The host where the database resides. SID The Oracle SID of the database to backup. See also FScpio(1), FSmimage(1) Copyright Copyright © 1990-2002 Functional Software. All rights reserved. 36 Appendix A—Command Reference

ORAonline

Name ORAonline—Online Oracle backup Synopsis ORAonline [ -v ] [ -n ] [ -r | -R ] [ -p <params_pattern> ] [ -s <file_pattern> ] [ -t <tablespaces> | -x <tablespaces> ] [ -u logname ] Host SID Description ORAonline implements full or partial backup of Oracle tablespaces while the database is running. Initially ORAonline sends a request to Oracle to check whether the database is running and whether it is in ARCHIVELOG mode. If one of these conditions is not true Oracle online backup does not run. ORAonline first obtains the oldest archived sequence log number (SLN). Then it obtains the list of tablespaces in the database and the files which are to be backed up, and backs up one tablespace at a time by putting the tablespace in backup mode, backing up all files of this tablespace and releasing the tablespace back to normal mode. When all tablespaces are backed up, ORAonline sends a request to the database to perform a log switch and obtains the next SLN to archive, and all relevant archive logs are backed up. Then ORAonline sends a request to the Oracle server to back up the control files by running the ‘alter database backup controlfile …’ command, and they are then backed up. ORAonline will then attempt to save the parameter and configuration files from ORACLE_HOME/admin/$SID. If this directory does not exist the job will give a warning and return an error status 1 on completion. Finally any additional files (see the -s flag) are backed up. Appendix A—Command Reference 37 Each tablespace data file is backed up as multi-part image backup (FSmimage). Each archive log and control file is backed up as a single part cpio backup (FScpio). ORAonline understands the following options: -v Verbose mode. List the tablespaces, their current status and the files to be backed up in the backup log. -n Do not follow symbolic links. The default is to follow symbolic links and backup the target file rather than the symbolic link. -r Backup read only tablespaces. This is the default. -R Do not backup, that is, skip read only tablespaces. -p params_pattern Specifies the directory and file pattern for the Oracle configuration files of this SID which should be backed up along with Oracle backup. Note that the –p flag can only be specified once. If -p is not supplied, one of the directories $ORACLE_BASE/admin/$SID, $ORACLE_HOME/dbs, or $ORACLE_HOME/admin is backed up. -s file-pattern Specifies additional files which should be backed up together with Oracle backup. -t <ts-list> A space-separated list of tablespace names which are to be backed up. If the option is omitted all tablespaces are backed up. -x <ts-list> A space-separated list of tablespace names which should not be backed up. The -t and -x options must not be supplied together. -u logname The Oracle user login name. If -u is not supplied, the login name will be picked up from the environment variable ORA_LOGNAME or will default to oracle7. Host The Oracle host. SID The Oracle SID. 38 Appendix A—Command Reference Examples ORAonline wombat ORCL Performs an online backup of all tablespaces of the ORCL database on host wombat. ORAonline -t "SYSTEM TEMP" wombat ORCL Performs an online backup of tablespaces SYSTEM and TEMP. ORAonline -x "SYSTEM TEMP" wombat ORCL Performs an online backup of all tablespaces except SYSTEM and TEMP. Files orafiles The temporary backup table with a list of data files and corresponding tablespaces, archive logs and control files. See also FScpio(1), FSmimage(1) Copyright Copyright © 1990-2002 Functional Software. All rights reserved.


ORAarch

Name ORAarch—Backup Oracle archive logs Synopsis ORAarch [ -v ] [ -n ] [ -k num_logs_to_keep] [ -u logname ] Host SID Description ORAarch implements a full backup of Oracle archived log files. ORAarch backs up all logs in the Oracle archive destination directory using multi-part cpio. -v Verbose mode. List the files to be backed up in the backup log. -n Do not follow symbolic links. The default is to follow symbolic links and backup the target file rather than the symbolic link. -k num_logs_to_keep Specifies the number of latest archive log files which should be left on disk. All others are removed. -u logname The Oracle user login name. If -u is not supplied the login name will be picked up from the environment variable ORA_LOGNAME or will default to oracle7. Host The Oracle host. SID The Oracle SID. 40 Appendix A—Command Reference Examples ORAarch wombat ORCL The archive log files for the Oracle SID ORCL on host wombat are located in /usr/opt/oracle/arch: arch_233.log, arch_234.log, …, arch_256.log The next log sequence number to archive is 260. ORAarch will switch the archive logs, then back up all files from /usr/opt/oracle/arch See also FScpio(1) Copyright Copyright © 1990-2002 Functional Software. All rights reserved. Appendix A—Command Reference 41

ORAexport

Name ORAexport—Create oracle export file and back it up Synopsis ORAexport -f|-i|-t tables|-o owner -l <username/password> [ -p <params_file> ] [ -P <export_params> ] [-u <ora_logname>] [-d <tmpdir>] Host SID Description ORAexport performs an Oracle export of tables in a database. You may perform a full or incremental database export, or an export of select tables or of the tables owned by specified users. All exports are first performed to a temporary file, and then this file is backed up to a removable media using the multi-part image backup method. -f Perform a full (complete) Oracle export. -i Perform an incremental Oracle export. Only tables modified since the last full export are saved. Note that Oracle calls this type of export cumulative. -t tables Perform an Oracle export of the space-separated list of tables. -o owners Perform Oracle export of tables which belong to the spaceseparated list of owners. -l <username/password> Perform the export as the user username. -d tmpdir Use the given temporary directory to store the exported data prior to being copied to the removable medium. Default is /tmp. 42 Appendix A—Command Reference -p params_file Use the given file to specify all the export parameters. -P export_params Use the additional specified export parameters. The specified export parameters must be enclosed by a single set of double quotes. -u logname Use the specified Oracle login name. This is the UNIX login name for the Oracle user; it is NOT a user of the Oracle database. If -u is not supplied, the login name will be picked up from the environment variable ORA_LOGNAME which is set in the Oracle backup profile. Host The host where the database resides. SID The Oracle SID of the database. Examples ORAexport -t ’finance dept’ -l scott/tiger wombat ORCL Create an Oracle export file of tables finance and dept of the Oracle database ORCL on host wombat. Perform the Oracle export as user scott (password tiger). See also FSmimage(1) Copyright Copyright © 1990-2002 Functional Software. All rights reserved. Appendix A—Command Reference 43


ORArestre

Name ORArestre—Restore from Oracle backup Synopsis ORArestre [Directory] Description ORArestre restores files which have been backed up by ORAofflne or ORAonline to their original places or to a new directory. The list of files to restore is passed from runrec as an environment variable ORALIST. If ORALIST is null, all files in the chosen media set will be restored. Directory specifies where the files should be restored. If directory is null, the original database is restored. Warnings If two or more data files of the same or different tablespaces have different paths but the same names, their contents could be lost if they are restored to the same directory. In this case, un-check Collapse dirs? Note that ORArestre performs only UNIX file restore and does not check the database status. See also FScpio(1), FSmimage(1)