Академический Документы
Профессиональный Документы
Культура Документы
Header Data
Released On 27.06.2003 22:57:19
Release Status Released for Customer
Component BC-DB-ORA Oracle
Priority Recommendations / Additional Info
Category Consulting
Symptom
Because of user error (changing/deleting the contents of a table) you
need to restore and recover the database to a point in time to get the
information back to the state before the change. However you don't want
to loose all of the current changes that have been made since the user
error happened.
Other Terms
Recreate Table User Error
Solution
What you can do is to create a minimal copy of your system's database. This copy would just include
the SYSTEM tablespace, the tablespace where the table you are trying to recover exists, and the
rollback segment tablespace. Once this new copy of the database is created you
can export the table from there and then import it into the real
database.
Step 1:
--------
On the target machine create the following directories under the
orat00 id:
/oracle/T01/sapdata1/cntrl
/oracle/T01/sapdata2/cntrl
/oracle/T01/sapdata3/cntrl
/oracle/T01/sapdata1/system_1
/oracle/T01/sapdata1/roll_1
/oracle/T01/sapdata2/user1d_1
/oracle/T01/sapdata2/user1d_2
/oracle/T01/sapdata2/user1d_3
/oracle/T01/saparch
/oracle/T01/saptrace
/oracle/T01/saptrace/background
*NOTE* you may have to create more sapdata directories. You should
create the ones that match the original location for the
datafiles that you are copying over. The same is true for
the controlfile locations.
Step 2:
--------
Restore the following files onto the target (T00) box from the
production box (T01):
- all the datafiles from the following tablespaces:
1) system tablespace
2) rollback tablespace
3) tablespace that contains the object that you want to export
- the controlfiles
- init<SID>.ora file
- if you want to start recovery or you are restoring from an online
backup copy all archive files necessary
- if you do not want to start recovery after the restore and if it
is not from an online backup, also restore the online redologfiles
files
Step 3:
--------
Set the two following environment varibles to the SID of your
productive system on your target system.
setenv ORACLE_SID T01
setenv SAPDATA_HOME /oracle/T01
Step 4:
--------
Startup the database in mount mode:
sqlplus '/ as sysdba'
SQL> startup mount
Step 5:
--------
Take all non-essential datafiles offline:
SQL> set linesize 132 pagesize 30000
SQL> spool df_offline.sql
SQL> select 'alter database datafile '|| '''' || name
|| '''' || ' offline drop;'
from v$datafile
where status NOT in ('SYSTEM')
and name not like '%roll%'
and name not like '%<tablespace-identifier>%';
Step 6:
--------
If you want to recover the database
- make sure you have the archive files you need.
- SQL> recover database until cancel using backup controlfile;
- SQL> alter database open resetlogs;
Step 7:
--------
If no recovery is required:
- SQL> alter database open;
Step 8:
--------
You now can start the export of the table in question
exp sapr3/<passwd> tables=<table_name> file=<table_name>.dmp
log=./<tablename>.log
Step 9:
--------
Now copy the export file over to your productive system and
import it there
Validity
This document is not restricted to a software component or software component version
References
This document refers to:
SAP Notes
605062 FAQ: Restore and recovery
This document is referenced by:
SAP Notes (1)
605062 FAQ: Restore and recovery