Oracle7 Enterprise Backup Utility Administrator's Guide Go to Product Documentation Library
Library
Go to books for this product
Product
Go to Contents for this book
Contents
Go to Index
Index



Go to previous file in sequence Go to next file in sequence

Command Script Examples


This appendix provides sample command scripts for a sample database. These examples are not exhaustive in terms of all the options and specifiers demonstrated, but the usage for each Enterprise Backup Utility command is covered.

The Sample Database

The examples in this appendix relate to a database with the following configuration information:

database name

 

PRODB

 

ORACLE_SID

 

PROD

 

ORACLE_HOME

 

/opt1/oracle

 

pfile

 

/opt1/oracle/prod/dbs/initPROD.ora

 

The database has the following tablespaces and datafiles in the directory /opt1/oracle/dbs

Tablespace A

 

datafiles a1.dbf, a2.dbf, a3.dbf, a4.dbf

 

Tablespace B

 

datafiles b1.dbf, b2.dbf, b3.dbf

 

Examples

Register Command Script Examples

Example B-1 The following command script registers the sample database in the EBU Catalog

register
log = "/opt1/oracle/ebu/log/obkPROD.log"


Example B-2 The following command script updates configuration information about the sample database in the EBU Catalog.

register db_name = "PRODB" pfile = "?/dbs/init@.ora"

Backup Command Script Examples

The following command scripts demonstrate various backups of the sample database.

Example B-3 backup offline database without catalog backup

backup offline database
db_name = "PRODB"
log = "/opt1/oracle/ebu/log/obkPROD.log"
catalog = none


Example B-4 backup online database with archdelete specified

backup online database archivelog archdelete log = "/opt1/oracle/ebu/log/obkPROD.log"


Note:

The archivelog specifier is included only for clarity in the example above, as it is the default action and archdelete will not function if the logs are not first backed up.


Example B-5 backup online with three data streams and no archived logs backed up

backup online archivelog = none parallel = 3 log = "opt1/oracle/ebu/log/obkPROD.log"

Example B-6 backup online <subset> of Tablespace A and datafiles b1.dbf and b2.dbf, without catalog backup

backup online db_name = "PRODB" dbfile = "?/dbs/b1.dbf","?/dbs/b2.dbf" tablespace = "A" log = "/opt1/oracle/ebu/log/obkPROD.log" catalog = none

Example B-7 backup online <subset> of Tablespace B with multiplexed datafiles

backup online db_name = "PRODB" tablespace = "B" mux = ("/opt1/oracle/dbs/b1.dbf", "/opt1/oracle/dbs/b2.dbf", "/opt1/oracle/ dbs/b3.dbf") log = "opt1/oracle/ebu/log/obkPROD.log"

Example B-8 Catalog-only backup

backup catalog log = "/opt1/oracle/ebu/log/catback.log" buffer_size = 256

Example B-9 Backup of catalog and archived redo logs only

backup online db_name = "PRODB" oracle_sid = "PROD" archivelog catalog

Restore Command Script Examples

The following command scripts demonstrate various restores of the sample database.

Example B-10 restore database consistent with four tape devices available and archived log files also specified

restore database consistent
db_name = "PRODB"
archivelog
start_lsn = 41
parallel = 4
log = "/opt1/oracle/ebu/log/obkPROD.log"


Example B-11 restore database consistent with two tape devices available and recover to current point in time

restore database consistent db_name = "PRODB" to = "01/01/1995 14:01" parallel = 2 archivelog start_lsn = 12 log = "/opt1/oracle/ebu/log/obkPROD.log" recover

Example B-12 restore database and recover to 12:15 on 9/30/96

restore database db_name = "PRODB" log = "/opt1/oracle/ebu/log/obkPROD.log" recover = "09/30/96 12:15:00"

Example B-13 restore database to with DISK_IO_SIZE of 64 database blocks

restore database db_name = "PRODB" to = "01/01/1995 14:01" log = "/opt1/oracle/ebu/log/obkPROD.log" disk_io_size = 64

Example B-14 restore <subset> of Tablespace B with remapping of datafile b1.dbf

restore db_name = "PRODB" tablespace = "B" remap = "?/dbs/b1.dbf" TO "?/dbs/b4.dbf" rename log = "/opt1/oracle/ebu/log/obkPROD.log"


Note:

ALTER DATABASE RENAME DATAFILE is performed with the rename RENAME operand. If omitted, you must issue the appropriate statements manually.

 

Example B-15 restore <subset> to with two tape devices available

restore
db_name = "PRODB"
dbfile = "?/dbs/b1.dbf","?/dbs/b2.dbf"
tablespace = "A"
to = "05/26/1995 07:00"
parallel = 2
log = "/opt1/oracle/ebu/log/obkPROD.log"


Example B-16 Restore of catalog

restore catalog = "ebucat" log = "/opt1/oracle/ebu/log/backcat.log"

Example B-17 Restore of catalog to new catalog database

restore catalog = "ebucat" as = "newcat" log = "/opt1/oracle/ebu/log/backcat.log"

Example B-18 Restore of catalog to 9/20/96, in a new database

restore catalog = "ebucat"
to = "09/20/96"
as = "newcat"
log = "/opt1/oracle/ebu/log/backcat.log"


Caution:

Oracle Corporation recommends restoring the catalog to a new database if you restore it to a previous point in time. Otherwise you will not be able to restore database backups taken after that point in time up to the time the catalog is restored.

 




Go to previous file in sequence Go to next file in sequence
Prev Next
Oracle
Copyright © 1997 Oracle Corporation.
All Rights Reserved.
Go to Product Documentation Library
Library
Go to books for this product
Product
Go to Contents for this book
Contents
Go to Index
Index