Showing posts with label Repair Failure. Show all posts
Showing posts with label Repair Failure. Show all posts

Monday, June 9, 2014

Repair failure

1.Repair failure should follow steps
(a) list failure
(b) advise failure
(c) Repair failure
RMAN> list failure;

List of Database Failures
=========================

Failure ID Priority Status    Time Detected Summary
---------- -------- --------- ------------- -------
548        HIGH     OPEN      09-JUN-14     Tablespace 4: 'USERS' is offline
542        HIGH     OPEN      09-JUN-14     One or more non-system datafiles are offline

RMAN> repair failure;

Strategy: The repair includes complete media recovery with no data loss
Repair script: /u01/app/orcl/oracle/diag/rdbms/cvrman/cvrman/hm/reco_1312477392.hm

contents of repair script:
   # online a offline tablespace
   sql "begin sys.dbms_ir.execsqlscript(filename => ''/u01/app/orcl/oracle/diag/rdbms/cvrman/cvrman/hm/reco_3578264930.hm'' ); end;";

Do you really want to execute the above repair (enter YES or NO)? yes
executing repair script

sql statement: begin sys.dbms_ir.execsqlscript(filename => ''/u01/app/orcl/oracle/diag/rdbms/cvrman/cvrman/hm/reco_3578264930.hm'' ); end;
repair failure complete

RMAN> list failure;

no failures found that match specification



Repair failure with preview

1.Repair failure with preview
RMAN> list failure;

List of Database Failures
=========================

Failure ID Priority Status    Time Detected Summary
---------- -------- --------- ------------- -------
548        HIGH     OPEN      09-JUN-14     Tablespace 4: 'USERS' is offline
542        HIGH     OPEN      09-JUN-14     One or more non-system datafiles are offline

RMAN> repair failure preview;

Strategy: The repair includes complete media recovery with no data loss
Repair script: /u01/app/orcl/oracle/diag/rdbms/cvrman/cvrman/hm/reco_1312477392.hm

contents of repair script:
   # online a offline tablespace
   sql "begin sys.dbms_ir.execsqlscript(filename => ''/u01/app/orcl/oracle/diag/rdbms/cvrman/cvrman/hm/reco_3578264930.hm'' ); end;";

RMAN> host 'cat /u01/app/orcl/oracle/diag/rdbms/cvrman/cvrman/hm/reco_3578264930.hm';

begin
/*Online Tablespace*/
execute immediate 'ALTER TABLESPACE USERS ONLINE';
end;
host command complete