Tải bản đầy đủ (.pdf) (50 trang)

Oracle RMAN 11g Backup and Recovery- P13

Bạn đang xem bản rút gọn của tài liệu. Xem và tải ngay bản đầy đủ của tài liệu tại đây (514.97 KB, 50 trang )

568
Part V: Appendixes
backupSpec Parameter Syntax Diagram
(
archivelogRecordSpecifier
BACKUPSET
ALL
completedTimeSpec
FROM TAG

tag_name

,
primaryKey
,
CONTROLFILECOPY

filename

ALL
LIKE

string_pattern

copyOfSpec
CURRENT CONTROLFILE
DATABASE
datafileCopySpec
DATAFILE
datafileSpec
,


RECOVERY AREA
DB_RECOVERY_FILE_DEST
RECOVERY FILES
SPFILE
TABLESPACE

tablespace_name

,
backupSpecOperand
)
Please purchase PDF Split-Merge on www.verypdf.com to remove this watermark.
Appendix A: RMAN Syntax Reference Guide
569
backupSpecOperand Parameter Syntax Diagram
CHANNEL

channel_id

DELETE
ALL
INPUT
DISKRATIO
integer
FILESPERSET
integer
FORCE
AUXILIARY FORMAT
formatSpec
,

NEW
FORMAT
formatSpec
,
TO DESTINATION
toDestSpec
,
FROM TAG

tag_name

INCLUDE CURRENT CONTROLFILE
keepOption
MAXSETSIZE
sizeSpec
notBackedUpSpec
NOEXCLUDE
POOL
integer
REUSE
SECTION SIZE
sizeSpec
skipSpec
TAG

tag_name

Please purchase PDF Split-Merge on www.verypdf.com to remove this watermark.
570
Part V: Appendixes

backupTypeSpec Parameter Syntax Diagram
AS
COMPRESSED
BACKUPSET
COPY
copyOfSpec Parameter Syntax Diagram
COPY OF
DATABASE
DATAFILE
datafileSpec
,
TABLESPACE

tablespace_name

,
datafileCopySpec Parameter Syntax Diagram
DATAFILECOPY

filename

,
ALL
LIKE

string_pattern

FROM TAG

tag_name


,
NODUPLICATES
duration Parameter Syntax Diagram
DURATION
integer
:
integer
MINIMIZE
LOAD
TIME
PARTIAL
Please purchase PDF Split-Merge on www.verypdf.com to remove this watermark.
Appendix A: RMAN Syntax Reference Guide
571
forRecoverOfSpec Parameter Syntax Diagram
FOR RECOVER OF
COPY
DATAFILECOPY FORMAT
formatSpec
WITH TAG

tag_name

TAG

tag_name

notBackedUpSpec Parameter Syntax Diagram
NOT BACKED UP

integer
TIMES
SINCE TIME

date_string

sizeSpec Parameter Syntax Diagram
integer
G
K
M
skipSpec Parameter Syntax Diagram
SKIP
INACCESSIBLE
OFFLINE
READONLY
Chapter Reference
The backup command is covered in detail in Chapter 11.
Examples
backup database plus archivelog delete input;
backup tablespace users, system;
backup as copy datafile 1,2,3;
backup incremental level 0 check logical database plus archivelog;
Please purchase PDF Split-Merge on www.verypdf.com to remove this watermark.
572
Part V: Appendixes
catalog Command
The catalog command allows you to do the following:
Add metadata about backup pieces and image copies to the database control file and
recovery catalog

Catalog valid backup sets, datafile copies, and archived redo logs in the flash recovery
area (FRA)
Catalog valid backups in ASM, OMF, and user-defined disk locations
Record a datafile copy as a level 0 backup in the RMAN repository, so you can use that
backup as the source of an incremental backup
Syntax Diagram
CATALOG
ARCHIVELOG
BACKUPPIECE
CONTROLFILECOPY

filename

,
DATAFILECOPY

filename

,
LEVEL
integer
TAG

tag_name

RECOVERY AREA
DB_RECOVERY_FILE_DEST
START WITH

string_pattern


NOPROMPT
;
Chapter Reference
Chapter 16 provides more information on the catalog command.
Examples
catalog recovery area noprompt;
catalog datafilecopy 'd:\oracle\oraback\system01.bak'
'd:\oracle\oraback\users01.bak' level 0;




Please purchase PDF Split-Merge on www.verypdf.com to remove this watermark.
Appendix A: RMAN Syntax Reference Guide
573
change Command
The change command is used to mark backup pieces, image copies, and archived redo logs with
a status of AVAILABLE if they currently have a status of UNAVAILABLE. Additionally, this command
can totally remove a backup or copy from a repository, and can also be used to modify the retention
policy that is effective for a given backup or copy.
Syntax Diagram
CHANGE
maintSpec
AVAILABLE
keepOption
UNAVAILABLE
UNCATALOG
DEVICE TYPE
deviceSpecifier

,
changeFailure
DB_UNIQUE_NAME FROM

db_unique_name

TO

db_unique_name

;
forDbUniqueNameOption
resetDbUniqueNameOption
maintSpec Parameter Syntax Diagram
BACKUP
OF
listObjList
archivelogRecordSpecifier
COPY
OF
listObjList
foreignlogRecordSpecifier
maintQualifier
recordSpec
DEVICE TYPE
deviceSpecifier
,
forDbUniqueNameOption Parameter Syntax Diagram
FOR
DB_UNIQUE_NAME ALL

DB_UNIQUE_NAME

db_unique_name

Please purchase PDF Split-Merge on www.verypdf.com to remove this watermark.
574
Part V: Appendixes
resetDbUniqueNameOption Parameter Syntax Diagram
RESET DB_UNIQUE_NAME
TO

db_unique_name

changeFailure Parameter Syntax Diagram
FAILURE
ALL
CRITICAL
HIGH
LOW
failureNumber
,
EXCLUDE FAILURE
failureNumber
,
CLOSED
PRIORITY
HIGH
LOW
NOPROMPT
Chapter Reference

Chapter 16 contains a discussion on the use of the change command.
Example
change backup tag 'Gold Backup' keep forever nologs;
configure Command
The configure command allows you to configure persistent RMAN configuration settings. These
settings apply to all RMAN sessions, unless they are changed or disabled. These settings are stored
in the database control file.
Please purchase PDF Split-Merge on www.verypdf.com to remove this watermark.
Appendix A: RMAN Syntax Reference Guide
575
Syntax Diagram
CONFIGURE
DB_UNIQUE_NAME

db_unique_name

CLEAR
CONNECT IDENTIFIER
quoted_string
delalConf
AUXNAME FOR DATAFILE
datafileSpec
CLEAR
TO

filename

backupConf
cfauConf
COMPRESSION ALGORITHM

CLEAR
quoted_string
OPTIMIZE FOR LOAD
TRUE
FALSE
AS OF RELEASE
quoted_string
deviceConf
ENCRYPTION
ALGORITHM
CLEAR
quoted_string
FOR
DATABASE
TABLESPACE

tablespace_name

ON
OFF
CLEAR
SNAPSHOT CONTROLFILE NAME
CLEAR
TO

filename

forDbUniqueNameOption
;
Please purchase PDF Split-Merge on www.verypdf.com to remove this watermark.

576
Part V: Appendixes
delalConf Parameter Syntax Diagram
ARCHIVELOG DELETION POLICY
CLEAR
TO
APPLIED ON
ALL
STANDBY
BACKED UP
integer
TIMES TO DEVICE TYPE
deviceSpecifier
NONE
SHIPPED TO
ALL
STANDBY
backupConf Parameter Syntax Diagram
ARCHIVELOG
DATAFILE
BACKUP COPIES FOR DEVICE TYPE
deviceSpecifier
CLEAR
TO
integer
BACKUP OPTIMIZATION
ON
OFF
CLEAR
EXCLUDE FOR TABLESPACE


tablespace_name

CLEAR
MAXSETSIZE
CLEAR
TO
sizeSpec
UNLIMITED
RETENTION POLICY
CLEAR
TO
NONE
RECOVERY WINDOW OF
integer
DAYS
REDUNDANCY
integer
cfauConf Parameter Syntax Diagram
CONTROLFILE AUTOBACKUP
ON
OFF
CLEAR
FORMAT FOR DEVICE TYPE
deviceSpecifier
CLEAR
TO
formatSpec
Please purchase PDF Split-Merge on www.verypdf.com to remove this watermark.
Appendix A: RMAN Syntax Reference Guide

577
deviceConf Parameter Syntax Diagram
AUXILIARY
CHANNEL
integer
DEVICE TYPE
deviceSpecifier
allocOperandList
CLEAR
DEFAULT DEVICE TYPE
CLEAR
TO
deviceSpecifier
DEVICE TYPE
deviceSpecifier
CLEAR
BACKUP TYPE TO
COMPRESSED
BACKUPSET
COPY
PARALLELISM
integer
forDbUniqueNameOption Parameter Syntax Diagram
FOR
DB_UNIQUE_NAME ALL
DB_UNIQUE_NAME

db_unique_name

Chapter Reference

The configure command is covered in Chapter 3 in detail.
Examples
configure retention policy to recovery window of 180 days;
configure backup optimization off;
configure default device type to 'sbt tape';
configure controlfile autobackup on;
configure controlfile autobackup format for
device type 'sbt tape' ''%f'';
configure controlfile autobackup format for device type disk to
'/oradata/oraback/rman/robone/%f';
configure device type 'sbt tape' parallelism 4;
configure device type disk parallelism 2;
configure datafile backup copies for device type 'sbt tape' to 1;
configure datafile backup copies for device type disk to 1;
configure archivelog backup copies for device type 'sbt tape' to 1;
configure archivelog backup copies for device type disk to 1;
configure channel device type 'sbt tape' parms
'env (tdpo optfile /opt/oracle/rman/tdpo a273.opt)'
rate 9 g format 'a273 %u' maxpiecesize 20 g maxopenfiles 64;
configure channel device type disk format
'/oradata/orabck01/rman/a273/ora a273 df%t s%s s';
configure auxiliary channel device type 'sbt tape' parms
'env (tdpo optfile /opt/oracle/rman/tdpo a273 dup.opt)'
Please purchase PDF Split-Merge on www.verypdf.com to remove this watermark.
578
Part V: Appendixes
rate 99 g format 'a273 %u' maxpiecesize 20 g maxopenfiles 64;
configure maxsetsize to 20 g;
configure snapshot controlfile name to
'/oradata/orabck01/rman/a273/snapcf a273.f';

configure channel 1 device type sbt
connect 'sys/robert@test1' parms 'env (nsr server bktest1)';
connect Command
The connect command is used to connect to the target database, the recovery catalog, or the
auxiliary instance from the RMAN prompt.
Syntax Diagram
CONNECT AUXILIARY
CONNECT CATALOG
connectStringSpec
CONNECT TARGET
connectStringSpec
;
Chapter References
Examples of the connect command can be found in many of the chapters in this book.
Examples
connect target sys/Robert@maindb
connect catalog rman/rman@rmancat
convert Command
The convert command is used when moving tablespaces and databases across platforms. If
the source and destination platforms are of a different byte-ordering format (endian), then the
convert command must be used to make the datafiles compatible with the new platform.
The convert command can also be used to move datafiles in and out of ASM storage.
Syntax Diagram
CONVERT
DATABASE
transportOptionList
convertOptionList
convertOptionList
DATAFILE


filename

,
convertOptionList
TABLESPACE

tablespace_name

,
convertOptionList
;
Please purchase PDF Split-Merge on www.verypdf.com to remove this watermark.
Appendix A: RMAN Syntax Reference Guide
579
transportOptionList Parameter Syntax Diagram
NEW DATABASE

database_name

ON DESTINATION PLATFORM
CONVERT SCRIPT

script_name

skipSpec
SKIP UNNECESSARY DATAFILES
TRANSPORT SCRIPT

script_name


skipSpec Parameter Syntax Diagram
SKIP
INACCESSIBLE
OFFLINE
READONLY
convertOptionList Parameter Syntax Diagram
fileNameConversionSpec
FORMAT
formatSpec
FROM PLATFORM

platform

PARALLELISM
integer
TO PLATFORM

platform

Chapter Reference
The convert command is covered in Chapter 14 in more detail.
Examples
-- Copy regular datafiles into ASM storage
convert datafile '/disk1/oracle/dbs/my tbs f1.df',
'/disk1/oracle/dbs/t ax1.f'
format '+asmfile';
-- Copy a tablespace from ASM storage to disk.
convert tablespace tbs 2 format '/tmp/tbs 2 %U.df';
-- Convert a database, moving it to a new platform
convert database new database 'convdb'

transport script '/ora01/scripts/transport/transportscript'
to platform 'Microsoft Windows IA (32-bit)'
db file name convert '/ora01/oracle/dbs' '/newora/converted';
Please purchase PDF Split-Merge on www.verypdf.com to remove this watermark.
580
Part V: Appendixes
create catalog Command
The create catalog command is used to create the recovery catalog schema.
Syntax Diagram
CREATE
VIRTUAL
CATALOG
;
Chapter Reference
The create catalog command is covered in Chapter 10.
Example
create catalog tablespace rec cat;
create script Command
The create script command allows you to create a stored command script within RMAN. You
must have a recovery catalog to use this command.
Syntax Diagram
CREATE
GLOBAL
SCRIPT

script_name

COMMENT

comment


{
backupCommands
maintenanceCommands
miscellaneousCommands
restoreCommands
}
FROM FILE

filename

;
Chapter Reference
The create script command is referenced in Chapter 10.
Example
create script backup db {backup database plus archivelog delete input;}
crosscheck Command
The crosscheck command is used to verify that existing backup sets and backup set pieces listed
in the control file or recovery catalog exist on the backup media. Any physical backup file
(backup set piece, copy, and so forth) that is not found on backup media is marked as EXPIRED
and will not be considered by RMAN for recovery operations. If the backup file later appears,
then it will be marked AVAILABLE during a subsequent crosscheck operation.
Please purchase PDF Split-Merge on www.verypdf.com to remove this watermark.
Appendix A: RMAN Syntax Reference Guide
581
Syntax Diagram
CROSSCHECK
maintSpec
;
maintSpec Parameter Syntax Diagram

BACKUP
OF
listObjList
archivelogRecordSpecifier
COPY
OF
listObjList
foreignlogRecordSpecifier
maintQualifier
recordSpec
DEVICE TYPE
deviceSpecifier
,
Chapter Reference
The crosscheck command is covered in Chapter 16.
Examples
crosscheck backup;
crosscheck backup completed between 'sysdate' and 'sysdate-30';
crosscheck archivelog all;
crosscheck archivelog time between 'sysdate' and 'sysdate-30';
delete Command
The delete command allows you to mark backups and copies in the recovery catalog or control
file with a status of DELETED. Once backups or copies are marked DELETED, the status cannot be
changed. Objects that are marked as EXPIRED (via the crosscheck command) or OBSOLETE (via
predefined retention criteria) can be marked DELETED with the delete command.
Syntax Diagram
DELETE
FORCE
NOPROMPT
EXPIRED

maintSpec
forDbUniqueNameOption
OBSOLETE
obsOperandList
DEVICE TYPE
deviceSpecifier
,
;
Please purchase PDF Split-Merge on www.verypdf.com to remove this watermark.
582
Part V: Appendixes
maintSpec Parameter Syntax Diagram
BACKUP
OF
listObjList
archivelogRecordSpecifier
COPY
OF
listObjList
foreignlogRecordSpecifier
maintQualifier
recordSpec
DEVICE TYPE
deviceSpecifier
,
forDBUniqueNameOption Parameter Syntax Diagram
FOR
DB_UNIQUE_NAME ALL
DB_UNIQUE_NAME


db_unique_name

Chapter Reference
The delete command is covered in Chapter 16.
Examples
delete expired backup;
delete expired archivelog;
delete script Command
The delete script command allows you to delete any existing RMAN script stored in the recovery
catalog.
Syntax Diagram
DELETE
GLOBAL
SCRIPT

script_name

;
Chapter Reference
The delete script command is covered in Chapter 10.
Example
delete script backup;
drop catalog Command
The drop catalog command is used to drop the recovery catalog schema.
Please purchase PDF Split-Merge on www.verypdf.com to remove this watermark.
Appendix A: RMAN Syntax Reference Guide
583
Syntax Diagram
DROP CATALOG
;

Chapter Reference
The drop catalog command is covered in Chapter 10.
Example
drop catalog;
drop database Command
The drop database command is used to remove the target database. If connected to a recovery
catalog, the database will also be unregistered. When dropped, RMAN will remove all datafiles,
online logs, and control files belonging to the target database.
Syntax Diagram
DROP DATABASE
INCLUDING BACKUPS
NOPROMPT
;
Chapter Reference
The drop database command is discussed in Chapter 16.
Example
drop database;
duplicate Command
The duplicate command is used to create either a duplicate database (with a new DBID) or a
standby database (with the same DBID) using RMAN backups of a given target database.
Syntax Diagram
DUPLICATE
DATABASE

database_name

DBID
integer
INCARNATION
primaryKey

TARGET DATABASE
FOR STANDBY
TO

database_name

dupOptionList
;
Please purchase PDF Split-Merge on www.verypdf.com to remove this watermark.
584
Part V: Appendixes
dupOptionList Parameter Syntax Diagram
BACKUP LOCATION

backup_location

DEVICE TYPE
deviceSpecifier
,
DORECOVER
fileNameConversionSpec
FROM ACTIVE DATABASE
LOGFILE
INSTANCE

name

logSpec
,
NOFILENAMECHECK

NOREDO
NORESUME
OPEN RESTRICTED
PASSWORD FILE
PFILE

filename

SKIP READONLY
SKIP TABLESPACE

tablespace_name

,
SPFILE
setParameter
PARAMETER_VALUE_CONVERT
(

string_pattern

,
)
setParameter
TABLESPACE
UNDO TABLESPACE

tablespace_name

,

TO RESTORE POINT
restore_point_name
untilClause
SetParameter Parameter Syntax Diagram
SET
identifier
quoted_string
string
,
COMMENT
quoted_string
RESET
identifier
quoted_string
Please purchase PDF Split-Merge on www.verypdf.com to remove this watermark.
Appendix A: RMAN Syntax Reference Guide
585
logSpec Parameter Syntax Diagram

filename

SIZE
sizeSpec
REUSE
GROUP
integer
(

filename


,
)
SIZE
sizeSpec
REUSE
dupOptionList Parameter Syntax Diagram
BACKUP LOCATION

backup_location

DEVICE TYPE
deviceSpecifier
,
DORECOVER
fileNameConversionSpec
FROM ACTIVE DATABASE
LOGFILE
INSTANCE

name

logSpec
,
NOFILENAMECHECK
NOREDO
NORESUME
OPEN RESTRICTED
PASSWORD FILE
PFILE


filename

SKIP READONLY
SKIP TABLESPACE

tablespace_name

,
SPFILE
setParameter
PARAMETER_VALUE_CONVERT
(

string_pattern

,
)
setParameter
TABLESPACE
UNDO TABLESPACE

tablespace_name

,
TO RESTORE POINT
restore_point_name
untilClause
Please purchase PDF Split-Merge on www.verypdf.com to remove this watermark.
586
Part V: Appendixes

sizeSpec Parameter Syntax Diagram
integer
G
K
M
Chapter References
The duplicate command is covered in Chapters 19 and 20.
Example
duplicate target database to copydb
db file name convert
('/ora01/oracle/oradata/olddb/','/ora02/oracle/oradata/newdb/')
until time 'sysdate- 5'
skip tablespace oldusers, test
pfile ?/dbs/initcopydb.ora
logfile
group 1 ('/ora01/oraredo/newdb/redo01 1.f',
'/ora02/oraredo/newdb/redo01 2.f') size 200k,
group 2 ('/ora01/oraredo/newdb/redo02 1.f',
'/ora02/oraredo/newdb/redo02 2.f') size 200k,
group 3 ('/ora01/oraredo/newdb/redo03 1.f',
'/ora02/oraredo/newdb/redo03 2.f') size 200k reuse;
execute script Command
The execute script command is used to execute a stored RMAN script.
Syntax Diagram
EXECUTE
GLOBAL
SCRIPT

script_name


USING
string_or_identifier
integer
;
Chapter Reference
The execute script command is covered in Chapter 10.
Example
execute script my script;
exit Command
The exit command terminates the operation of your RMAN session and returns you to the OS
prompt.
Please purchase PDF Split-Merge on www.verypdf.com to remove this watermark.
Appendix A: RMAN Syntax Reference Guide
587
Chapter Reference
The exit command is covered in Chapter 3.
flashback database Command
The flashback database command allows RMAN to manage Oracle Flashback Database
operations. This allows you to reset the database to some previous time or SCN.
Syntax Diagram
FLASHBACK
DEVICE TYPE
deviceSpecifier
,
DATABASE
TO BEFORE SCN
integer
TO BEFORE SEQUENCE
integer
THREAD

integer
TO BEFORE RESETLOGS
TO BEFORE TIME

date_string

TO SCN
integer
TO SEQUENCE
integer
THREAD
integer
TO RESTORE POINT
restore_point_name
TO TIME

date_string

;
Chapter Reference
Chapter 15 contains a great deal of information on the flashback command.
Examples
flashback database to scn 669605;
flashback database to timestamp (sysdate-2);
flashback database to timestamp
to timestamp('2006-01-03 15:00:00', 'yyyy-mm-dd hh24:mi:ss');
flashback database to restore point “gold copy”;
flashback database to before resetlogs;
grant Command
The grant command is associated with the RMAN recovery catalog and a feature called a virtual

private catalog. This feature provides the ability to restrict access to recovery catalog records by
user. The grant command provides the means to grant privileges to users to see records in the
recovery catalog when a virtual private catalog has been configured.
Please purchase PDF Split-Merge on www.verypdf.com to remove this watermark.

×