Oracle RMAN 11g Backup and Recovery (178 page)

BOOK: Oracle RMAN 11g Backup and Recovery
10.91Mb size Format: txt, pdf, ePub

586
Part V: Appendixes

sizeSpec Parameter Syntax Diagram

G

K

M

integer

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

string_or_identifier

USING

GLOBAL



integer

EXECUTE

SCRIPT

script_name

;

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.

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

,

DEVICE TYPE

deviceSpecifier

FLASHBACK

DATABASE

TO BEFORE SCN

integer

THREAD

integer

TO BEFORE SEQUENCE

integer

TO BEFORE RESETLOGS

TO BEFORE TIME


date_string


;

TO SCN

integer

THREAD

integer

TO SEQUENCE

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.

588
Part V: Appendixes

Syntax Diagram



database_name

CATALOG FOR DATABASE

TO

integer

GRANT

userid

;

REGISTER DATABASE TO

Chapter Reference

Chapter 9 contains information on the
grant
command and on using a virtual private catalog.

Example

grant catalog for database mydb to operator1;

host Command

The
host
command invokes the OS command-line subshell from within RMAN. The
host
command also allows you to run a specific OS command from the RMAN prompt.

Syntax Diagram


command


HOST

;

Chapter Reference

Examples of the
host
command can be found in Chapter 16.

Examples

host 'dir';

Host 'ls –al';

host

import catalog Command

The
import catalog
command imports the metadata from one recovery catalog schema into a different catalog schema.

Syntax Diagram

,

DBID

integer

,



DB_NAME

database_name

NO UNREGISTER

IMPORT CATALOG connectStringSpec

;

Appendix A: RMAN Syntax Reference Guide
589

Chapter Reference

Examples of the
import catalog
command can be found in Chapter 10.

Example

import catalog cat owner@oldcatdb;

list Command

The
list
command provides information on RMAN backups, such as when they occurred, what files they contain, and how long they took.

Syntax Diagram

ALL

DB_UNIQUE_NAME



database_name

OF DATABASE

maintQualifier

recoverableClause

listObjectSpec

forDbUniqueNameOption

EXPIRED

recordSpec

ALL

CRITICAL

HIGH

LOW

,

failureNumber

,

LIST

;

CLOSED

EXCLUDE FAILURE

failureNumber

DETAIL

FAILURE



database_name

OF DATABASE

INCARNATION

maintQualifier

recoverableClause

listObjectSpec

recordSpec

forDbUniqueNameOption

RESTORE POINT

restore_point_name

RESTORE POINT ALL

ALL

GLOBAL

SCRIPT NAMES

590
Part V: Appendixes

maintQualifier Parameter Syntax Diagram

completedTimeSpec

,

DEVICE TYPE

deviceSpecifier

LIKE


string_pattern


BACKED UP

integer

TIMES TO DEVICE TYPE

deviceSpecifier



TAG

tag_name

listObjectSpec Parameter Syntax Diagram

OF listObjList

listBackupOption

BACKUP

archivelogRecordSpecifier

OF

listObjList

COPY

foreignlogRecordSpecifier

recoverableClause Parameter Syntax Diagram

TO RESTORE POINT

restore_point_name

untilClause

RECOVERABLE

listBackupOption Parameter Syntax Diagram

BY FILE

SUMMARY

Chapter Reference

Chapter 17 contains information on the RMAN
list
command.

Examples

list backup of database;

list backup of database summary;

list backup of datafile;

list backup of archivelog all;

print script Command

The
print script
command allows you to display a stored script.

Appendix A: RMAN Syntax Reference Guide
591

Syntax Diagram

GLOBAL



TO FILE


filename


PRINT

SCRIPT

script_name

;

Chapter Reference

Chapter 10 provides more detail on the
print script
command.

Example

print script booga booga;

quit Command

Use the
quit
command to exit the RMAN executable.

Chapter Reference

The
quit
command is covered in Chapter 3.

recover Command

The
recover
command is used after a restore to complete recovery of a database, tablespace, or datafile. The
recover
command will extract needed archived redo logs during the recovery process and apply the undo as required.

Other books

Arrebatos Carnales by Francisco Martín Moreno
Working With Heat by Anne Calhoun
I'm With the Bears by Mark Martin
Solstice by P.J. Hoover
Wicked Wyoming Nights by Greenwood, Leigh
Boss Takes All by Carl Hancock
Fangs for the Memories by Molly Harper
Guardian by Jo Anderton