Quick Search:
 
 Oracle PL/SQL: RMAN (Oracle Recovery Manager) Jump to:  
Category: >> Oracle PL/SQL >> RMAN (Oracle Recovery Manager)  

<< lastnext >>

Snippet Name: RMAN (Oracle Recovery Manager)

Description: Recovery Manager (or RMAN) is an Oracle provided utility for backing-up, restoring and recovering Oracle Databases. RMAN ships with the database server and doesn't require a separate installation. The RMAN executable is located in your ORACLE_HOME/bin directory. You can connect it to a target database, and then use server sessions on the target database to back up, restore, and recover files.

Also see:
» RMAN: List the most recent Level 0 bac...
» RMAN: Format Directives
» RMAN: Command Summary
» RMAN: Data Dictionary Objects

Comment: (none)

Language: PL/SQL
Highlight Mode: PLSQL
Last Modified: March 10th, 2009

-- starting RMAN:
-- Specify the database connection information at the command line:
 
    rman TARGET SYS/target_pwd@target_str # connects IN NOCATALOG MODE
 
    rman TARGET / CATALOG rman/rman@rcat
 
    rman TARGET / CATALOG rman/rman@rcat AUXILIARY sys/aux_pwd@aux_str
 
-- Omit the database connection at the command line, and use the 
-- CONNECT command in your RMAN scripts:
 
    rman
 
 
 
 
RMAN> run {
  SET until TIME TO_DATE('04-Aug-2008 00:00:00', 'DD-MON-YYYY HH24:MI:SS');
  restore database;
  recover database;
}
 
 
/*
RMAN can be operated from Oracle Enterprise Manager, or 
from command line. Here are the command line arguments:
 
Argument     Value          Description
-----------------------------------------------------------------------------
target       quoted-string  connect-string for target database
catalog      quoted-string  connect-string for recovery catalog
nocatalog    none           if specified, then no recovery catalog
cmdfile      quoted-string  name of input command file
log          quoted-string  name of output message log file
trace        quoted-string  name of output debugging message log file
append       none           if specified, log is opened in append mode
debug        optional-args  activate debugging
msgno        none           show RMAN-nnnn prefix for all messages
send         quoted-string  send a command to the media manager
pipe         string         building block for pipe names
timeout      integer        number of seconds to wait for pipe input
*/
 
 
-- for example: 
 
RMAN> CONNECT target;
connected TO target database: ORCL (DBID=1058957020)
RMAN> backup database;
 
 
-- simple backup example: 
 
rman target sys/*** nocatalog 
run { 
  allocate channel t1 type disk;
  backup 
    format '/app/oracle/backup/%d_t%t_s%s_p%p'
      (database); 
   release channel t1; 
}
 
 
-- example RMAN restore: 
 
rman target sys/*** nocatalog 
run {
  allocate channel t1 type disk;
  # set until time 'Aug 07 2000 :51';
  restore tablespace users; 
  recover tablespace users; 
  release channel t1; 
}
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 


 
   Home |    Search |    Code Library |    Sponsors |    Privacy |    Terms of Use |    Contact Us © 2003 - 2024 psoug.org