понедельник, 9 декабря 2013 г.

Recover Tablespace using TSPITR

Sometimes we we lost data in the tablespace due to HARDWARE problems, or just because of mad experiments. There Tablespace point in time recovery(TSPITR) came to help,
it's quite handy because DB will be online during restoration of tablespace.
======================================
Get rid of problematic tablespace:
=====================================
As we restoring default tablespace, we need to change default to another, SYSAUX is on duty today

SQL> alter database default tablespace SYSAUX;

Database altered.

SQL> drop tablespace USERS including contents and datafiles;

Tablespace dropped.

======================================
recover tablespace to the time before the problem:
======================================
RMAN> recover tablespace USERS until time "to_date('09-DEC-2013 11:44:00','DD-MON-YYYY HH24:MI:SS')" AUXILIARY DESTINATION='/u01/recover';

======================================
poststeps
======================================
SQL> alter database default tablespace USERS;
SQL> alter tablespace USERS online;

Backup database via RMAN once restore will be completed!

There can be following problems while using TSPITR:
=======================================
#ISSUE I
########################
During automatic import/export job faced with following:
>>>>>>>>>>>>
~
ORA-01555: snapshot too old: rollback segment number ORA-01555: snapshot too old: rollback segment number with name "" too small
ORA-06512: at "SYS.DBMS_SYS_ERROR", line 95
ORA-06512: at "SYS.KUPW$WORKER", line 8358
~
#SOLUTION I
#########################
Is not easy to detected such solution at all, There component XML DB (XDB) need to be installed to the oracle DB(if not installed before).
So accoiring to the oracle note performed the follwing steps:
============================
catqm.sql XDB_P SYSAUX TEMP
there can be lot of errors related to the object already exists, it can be safely ignored.

#ISSUE II
#########################
ORA-12919: Can not drop the default permanent tablespace

#SOLUTION II
#########################

As we restoring default tablespace need to change it to another, SYSAUX is on duty today
>>>>>>>>>>>>>>>>>>>>>>
alter database default tablespace SYSAUX;
<<<<<<<<<<<<<<<<<<<<<<

then drop tablespace USERS to make fun with TSPITR:
>>>>>>>>>>>>>>>>>>>>>>
drop tablespace USERS including contents and datafiles;
<<<<<<<<<<<<<<<<<<<<<<

Комментариев нет:

Отправить комментарий