Monday, 11 May 2015

Recover and Restore Tablespace

SQL> startup;
Database mounted.
ORA-01157: cannot identify/lock data file 6 - see DBWR trace file
ORA-01110: data file 6: ‘D:\ORACLE\ORADATA\ISSCOHR\EDSS_DBF01.DBF '
We made this tablespace offline and open the database. So that end users can use the database while recovering the tablespace (as this is not the system tablespace).

SQL> alter database datafile ‘D:\ORACLE\ORADATA\ISSCOHR\EDSS_DBF01.DBF' OFFLINE;

Database altered.
SQL> alter database open;
alter database open
* ERROR at line 1:
ORA-01157: cannot identify/lock data file 7 - see DBWR trace file
ORA-01110: data file 7: ‘D:\ORACLE\ORADATA\ISSCOHR\EDSS_DBF02.DBF'

SQL> alter database datafile ‘D:\ORACLE\ORADATA\ISSCOHR\EDSS_DBF02.DBF' OFFLINE;

Database altered.
SQL> alter database open;
Database altered.
SQL> exit
Disconnected from Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 –
Production With the Partitioning, OLAP and Data Mining options
C:\>rman target sys/****@ISSCOHR.world catalog catalog/catalog@rman 
Recovery Manager: Release 10.2.0.1.0 - Production on Fri Jan 12 10:13:26 2013
Copyright (c) 1982, 2005, Oracle. All rights reserved.
connected to target database: ISSCOHR (DBID=2613999945)
connected to recovery catalog database

RMAN> run{
      restore tablespace EDSS_DBF;
      recover tablespace EDSS_DBF;
      }

Starting restore at 12-JAN-13
allocated channel: ORA_DISK_1
channel ORA_DISK_1: sid=128 devtype=DISK
creating datafile fno=7 name= D:\ORACLE\ORADATA\ISSCOHR\EDSS_DBF02.DBF
channel ORA_DISK_1: starting datafile backupset restore
channel ORA_DISK_1: specifying datafile(s) to restore from backup set
restoring datafile 00006 to D:\ORACLE\ORADATA\ISSCOHR\EDSS_DBF01.DBF
channel ORA_DISK_1: reading from backup piece H:\ORABACK\ WEEKLY_20130112_FULL_ISSCOHR-2587_1.DB
channel ORA_DISK_1: restored backup piece 1
piece handle= H:\ORABACK\WEEKLY_20130112_FULL_ISSCOHR-2588_1.DB
channel ORA_DISK_1: restore complete, elapsed time: 00:13:11
Finished restore at 12-JAN-13
Starting recover at 12-JAN-13
using channel ORA_DISK_1
starting media recovery
archive log thread 1 sequence 36 is already on disk as file E:\ORACLE\ARCHIVE\ARC02244.001
archive log thread 1 sequence 37 is already on disk as file E:\ORACLE\ARCHIVE\ARC02245.001
archive log thread 1 sequence 38 is already on disk as file E:\ORACLE\ARCHIVE\ARC02246.001
archive log thread 1 sequence 39 is already on disk as file E:\ORACLE\ARCHIVE\ARC02247.001
media recovery complete, elapsed time: 00:01:23
Finished recover at 12-JUN-13

SQL> connect sys/password as sysdba
Connected.
SQL> alter database datafile ‘D:\ORACLE\ORADATA\ISSCOHR\EDSS_DBF01.DBF' ONLINE;
Database altered.
SQL> alter database datafile ‘D:\ORACLE\ORADATA\ISSCOHR\EDSS_DBF02.DBF' ONLINE;

No comments:

Post a Comment