What is wrong? Open DB recover [message #335483] |
Tue, 22 July 2008 05:29  |
in.lukfai Messages: 6 Registered: July 2008 Location: India |
Junior Member |
|
|
What is wrong?
I was doing practice about User-Manages Restore and Recovery. The scenario is:
- I have full backup(close database)
- I ran database in Archive mode
SQL> archive log list;
Database log mode Archive Mode
Automatic archival Enabled
Archive destination f:\arc
Oldest online log sequence 5
Next log sequence to archive 7
Current log sequence 7
- I have 2 tables:
SQL> select table_name,tablespace_name from user_tables where tablespace_name <> 'SYSTEM';
TABLE_NAME TABLESPACE_NAME
------------------------------ ------------------------------
EMPLOYEES USERDATA2
USER1 USER2_TPSP1
SQL> select t.name,d.name from v$tablespace t,v$datafile d where t.ts#=d.ts# and t.name like '%USER%';
NAME NAME
---------------------------------------------------------------------------------------------------------------
USERDATA2 C:\ORACLE\ORADATA\KATIE3\USERDATA2.DBF
USER2 C:\ORACLE\ORADATA\KATIE3\USER2.DBF
USER2_TPSP1 C:\ORACLE\ORADATA\KATIE3\U2_TBSP1.DBF
3 rows selected.
So the summary table would be:
TABLE_NAME TABLESPACE_NAME DATAFILE
------------------------------ ------------------------------
EMPLOYEES USERDATA2 C:\ORACLE\ORADATA\KATIE3\USERDATA2.DBF
USER1 USER2_TPSP1 C:\ORACLE\ORADATA\KATIE3\U2_TBSP1.DBF
- table employees has contents;
SQL> select employee_id from employees;
EMPLOYEE_ID
-----------
1
2
3
4
5
6
7
8
9
10
11
EMPLOYEE_ID
-----------
12
12 rows selected.
- I would like to drop table employees and then wanted to perform Recovering Open database so I did as the step below:
1. drop table employees:
SQL> drop table employees;
Table dropped.
SQL> select table_name,tablespace_name from user_tables where tablespace_name <> 'SYSTEM';
TABLE_NAME TABLESPACE_NAME
------------------------------ ------------------------------
USER1 USER2_TPSP1
2. Bring tablespace userdata2 offline:
SQL> alter tablespace userdata2 offline;
Tablespace altered.
3. Restored userdata2.dbf from backup.
4. Issued recover command:
SQL> recover automatic tablespace userdata2;
Media recovery complete.
5. Bring tablespace userdata2 online
SQL> alter tablespace userdata2 online;
Tablespace altered.
6. Checked whether table employees has been restored:
SQL> select * from employees;
select * from employees
*
ERROR at line 1:
ORA-00942: table or view does not exist
That is the problem. I expected that table employees should be there but I could not find it in database. What is wrong in my part? Or I misconcept.
However, then I tried again by shutdown the database and then restore all files from backup and then open database. Everything is fine. The table employees
is in database. I don't understand. The purpose of this practice was for Recovery an Open database in archive mode. Could you please tell me what is wrong?
I read about TSPITR or the scenario is different I have to do TSPITR instead. Please advise..
|
|
|
| Re: What is wrong? Open DB recover [message #335490 is a reply to message #335483 ] |
Tue, 22 July 2008 05:43   |
Michel Cadot Messages: 19111 Registered: March 2007 Location: Nanterre, France, http://... |
Senior Member |
|
|
| Quote: | That is the problem. I expected that table employees should be there but I could not find it in database. What is wrong in my part?
|
You recover the tablespace INCLUDING the drop statement.
| Quote: | However, then I tried again by shutdown the database and then restore all files from backup and then open database.
|
In this case, you just restored and not recovered so database is at the time of your backup BEFORE the drop.
Regards
Michel
|
|
|
| Re: What is wrong? Open DB recover [message #335496 is a reply to message #335490 ] |
Tue, 22 July 2008 05:57   |
in.lukfai Messages: 6 Registered: July 2008 Location: India |
Junior Member |
|
|
[quote title=Michel Cadot wrote on Tue, 22 July 2008 16:13]| Quote: | You recover the tablespace INCLUDING the drop statement.
|
I do think so. So what is the best way to recover this scenario?
I spinned around like anything.
Regards,
Katie
|
|
|
| Re: What is wrong? Open DB recover [message #335504 is a reply to message #335496 ] |
Tue, 22 July 2008 06:37   |
Michel Cadot Messages: 19111 Registered: March 2007 Location: Nanterre, France, http://... |
Senior Member |
|
|
| Quote: | So what is the best way to recover this scenario?
|
You already have the answer: TSPITR which needs to have the space for another database.
Regards
Michel
|
|
|
|
| Re: What is wrong? Open DB recover [message #335913 is a reply to message #335899 ] |
Thu, 24 July 2008 02:51   |
Michel Cadot Messages: 19111 Registered: March 2007 Location: Nanterre, France, http://... |
Senior Member |
|
|
1/ OP clearly stated he is in 9i, why replying with a 10g specific anser?
2/ Don't use IM speak as stated in forum guidelines (please read them).
Regards
Michel
|
|
|
| Re: What is wrong? Open DB recover [message #336593 is a reply to message #335483 ] |
Mon, 28 July 2008 05:42  |
in.lukfai Messages: 6 Registered: July 2008 Location: India |
Junior Member |
|
|
Thanks Michel, I am more clear now..After user recover topic then I move on to RMAN..
|
|
|