Saturday, September 20, 2014

Create and search RMAN Scripts in Recovery Catalog

C:\Users\rajib.pradhan>SET ORACLE_SID=ORCL

C:\Users\rajib.pradhan>RMAN TARGET / CATALOG RMAN/RMAN@DBRMAN;

Recovery Manager: Release 11.2.0.1.0 - Production on Sun Sep 21 12:47:05 2014

Copyright (c) 1982, 2009, Oracle and/or its affiliates.  All rights reserved.

connected to target database: ORCL (DBID=1350456456)
connected to recovery catalog database

RMAN> CREATE SCRIPT SPFILE_BACKUP
2> {
3> BACKUP SPFILE;
4> }

created script SPFILE_BACKUP

RMAN> CREATE SCRIPT BACKUP_DATABASE_PLUS_ARCHIVE
2> {
3> BACKUP DATABASE PLUS ARCHIVELOG DELETE INPUT;
4> }

created script BACKUP_DATABASE_PLUS_ARCHIVE

RMAN> EXIT


Recovery Manager complete.

C:\Users\rajib.pradhan>SQLPLUS /NOLOG

SQL*Plus: Release 11.2.0.1.0 Production on Sun Sep 21 12:49:24 2014

Copyright (c) 1982, 2010, Oracle.  All rights reserved.

SQL> CONN RMAN/RMAN@DBRMAN
Connected.
SQL> SELECT SCR_KEY, SCR_NAME
  2  FROM SCR;

   SCR_KEY
----------
SCR_NAME
--------------------------------------------------------------------------------
      1425
BACKUP_DATABASE_PLUS_ARCHIVE

      1424
SPFILE_BACKUP


SQL> SET LINE 2000
SQL> SELECT SCR_KEY, SCR_NAME
  2  FROM SCR;

   SCR_KEY SCR_NAME
---------- ----------------------------------------------------------------------------------------------------
      1425 BACKUP_DATABASE_PLUS_ARCHIVE
      1424 SPFILE_BACKUP

SQL> SELECT TEXT
  2  FROM SCRL
  3  WHERE SCR_KEY=1424;

TEXT
------------------------
{
BACKUP SPFILE;
}

SQL>

No comments:

Post a Comment