-
Please look, PANDO
Here, I am showing that I can use "Recover datafile" while the db is open. Did I get you wrong? Or, did the DOC actually say that?
My conclusion is here:
1. If the log required for recovering the datafile is still online, then you can use both "reover datafile" and "alter database"
2. If the log is now archived, you have to use "recover datafile"
Please challenge me. Thanks!
----------------------------------
SQL> shutdown abort;
ORACLE instance shut down.
SQL> startup
ORACLE instance started.
Total System Global Area 293855392 bytes
Fixed Size 73888 bytes
Variable Size 136314880 bytes
Database Buffers 157286400 bytes
Redo Buffers 180224 bytes
Database mounted.
Database opened.
SQL> recover datafile '/export/home/u01/oradata/ktvw/users01.dbf';
ORA-00279: change 479108523 generated at 05/07/2002 15:42:09 needed for thread
1
ORA-00289: suggestion : /export/home/u03/arch/ktvw/arch_1_667.arc
ORA-00280: change 479108523 for thread 1 is in sequence #667
Specify log: {=suggested | filename | AUTO | CANCEL}
Log applied.
Media recovery complete.
SQL>
-
BTW CAN SOMEONE PLS EXPLAIN ME WHY LOGFILE HAS TO BE SWITCHED "10" TIMES. PLS EXPLAIN.
-
Hi,
That's just for simulating dml activities.
Vijay.
Say No To Plastics
-
Re: Please look, PANDO
Originally posted by abongwa
Here, I am showing that I can use "Recover datafile" while the db is open. Did I get you wrong? Or, did the DOC actually say that?
Please challenge me. Thanks!
Very well said. I am not aware whos right here. But I liked your attitude. I had a similar phase with Pando, I stopped after a while. Maybe he was right, it just that the "tone" in which Pando speaks is what ulteriorly mattered in my opinion.
-
Originally posted by oravijay
Hi,
That's just for simulating dml activities.
Vijay.
Could you please expalin a little., I am thinking why "10" times? And why at all any number of times, if not 10.
-
Abongwa
I agree with you : Here is the proof
*** Without Log switches ***
SVRMGR> alter database datafile '/u06/oradata/testDB/users_TESTDB.dbf' offline;
Statement processed.
SVRMGR> alter database datafile '/u06/oradata/testDB/users_TESTDB.dbf' online;
alter database datafile '/u06/oradata/testDB/users_TESTDB.dbf' online
*
ORA-01113: file 5 needs media recovery
ORA-01110: data file 5: '/u06/oradata/testDB/users_TESTDB.dbf'
SVRMGR> shutdown abort;
ORACLE instance shut down.
SVRMGR> startup mount;
ORACLE instance started.
Total System Global Area 25444776 bytes
Fixed Size 94632 bytes
Variable Size 24989696 bytes
Database Buffers 204800 bytes
Redo Buffers 155648 bytes
Database mounted.
SVRMGR> alter database recover datafile '/u06/oradata/testDB/users_TESTDB.dbf';
Statement processed.
SVRMGR> alter database open;
Statement processed.
SVRMGR>
Case 2: *** With Logswitches ....
SVRMGR> alter database datafile '/u06/oradata/testDB/users_TESTDB.dbf' offline;
Statement processed.
SVRMGR> alter database datafile '/u06/oradata/testDB/users_TESTDB.dbf' online;
alter database datafile '/u06/oradata/testDB/users_TESTDB.dbf' online
*
ORA-01113: file 5 needs media recovery
ORA-01110: data file 5: '/u06/oradata/testDB/users_TESTDB.dbf'
SVRMGR> alter system switch logfile;
Statement processed.
SVRMGR> alter system switch logfile;
Statement processed.
SVRMGR> alter system switch logfile;
Statement processed.
SVRMGR> alter system switch logfile;
Statement processed.
SVRMGR> alter system switch logfile;
Statement processed.
SVRMGR> alter system switch logfile;
Statement processed.
SVRMGR> alter system switch logfile;
Statement processed.
SVRMGR> alter system switch logfile;
Statement processed.
SVRMGR> alter system switch logfile;
Statement processed.
SVRMGR> alter system switch logfile;
Statement processed.
SVRMGR> recover datafile '/u06/oradata/testDB/users_TESTDB.dbf';
ORA-00279: change 337664 generated at 05/08/2002 15:14:22 needed for thread 1
ORA-00289: suggestion : /u06/oradata/testDB/arch/arch_1_798.arc
ORA-00280: change 337664 for thread 1 is in sequence #798
Specify log: {=suggested | filename | AUTO | CANCEL}
Log applied.
Media recovery complete.
Case 3: With Log Switches...
SVRMGR> alter database datafile '/u06/oradata/testDB/users_TESTDB.dbf' offline;
Statement processed.
SVRMGR> alter database datafile '/u06/oradata/testDB/users_TESTDB.dbf' online;
alter database datafile '/u06/oradata/testDB/users_TESTDB.dbf' online
*
ORA-01113: file 5 needs media recovery
ORA-01110: data file 5: '/u06/oradata/testDB/users_TESTDB.dbf'
SVRMGR> alter system switch logfile;
Statement processed.
SVRMGR> alter system switch logfile;
Statement processed.
SVRMGR> alter system switch logfile;
Statement processed.
SVRMGR> alter system switch logfile;
Statement processed.
SVRMGR> alter system switch logfile;
Statement processed.
SVRMGR> alter system switch logfile;
Statement processed.
SVRMGR> alter system switch logfile;
Statement processed.
SVRMGR> alter system switch logfile;
Statement processed.
SVRMGR> alter system switch logfile;
Statement processed.
SVRMGR> alter system switch logfile;
Statement processed.
SVRMGR> alter system switch logfile;
Statement processed.
SVRMGR> shutdown abort;
ORACLE instance shut down.
SVRMGR> startup mount;
ORACLE instance started.
Total System Global Area 25444776 bytes
Fixed Size 94632 bytes
Variable Size 24989696 bytes
Database Buffers 204800 bytes
Redo Buffers 155648 bytes
Database mounted.
SVRMGR> alter database recover datafile '/u06/oradata/testDB/users_TESTDB.dbf';
alter database recover datafile '/u06/oradata/testDB/users_TESTDB.dbf'
*
ORA-00279: change 337678 generated at 05/08/2002 15:21:07 needed for thread 1
ORA-00289: suggestion : /u06/oradata/testDB/arch/arch_1_808.arc
ORA-00280: change 337678 for thread 1 is in sequence #808
SVRMGR> recover datafile '/u06/oradata/testDB/users_TESTDB.dbf';
ORA-00275: media recovery has already been started
SVRMGR> shutdown immediate;
ORA-01109: database not open
Database dismounted.
ORACLE instance shut down.
SVRMGR> startup mount;
ORACLE instance started.
Total System Global Area 25444776 bytes
Fixed Size 94632 bytes
Variable Size 24989696 bytes
Database Buffers 204800 bytes
Redo Buffers 155648 bytes
Database mounted.
SVRMGR> recover datafile '/u06/oradata/testDB/users_TESTDB.dbf';
ORA-00279: change 337678 generated at 05/08/2002 15:21:07 needed for thread 1
ORA-00289: suggestion : /u06/oradata/testDB/arch/arch_1_808.arc
ORA-00280: change 337678 for thread 1 is in sequence #808
Specify log: {=suggested | filename | AUTO | CANCEL}
Log applied.
Media recovery complete.
SVRMGR>
Nagesh
-
cut & pasted from Oracle 8i ILT PDF
Code:
Recover Syntax
Recover a mounted database:
SQL> recover database;
SQL> recover datafile ‘/disk1/data/df2.dbf’;
SQL> alter database recover database;
Recover an opened database:
SQL> recover tablespace USER_DATA;
SQL> recover datafile 2;
SQL> alter database recover datafile 2;
Recover Syntax
One of the following commands may be issued to recover the database:
• RECOVER [AUTOMATIC] DATABASE
Can only be used for a closed database recovery.
• RECOVER [AUTOMATIC] TABLESPACE |
Can only be used for an opened database recovery.
• RECOVER [AUTOMATIC] DATAFILE |
Can only used for both an opened and closed database recovery.
where: automatic automatically applies archived and
redo log files.
Note: ALTER DATABASE may be placed in front of the RECOVER command. This
is not recommended because some error messages get suppressed and do not show up
on screen during recovery.
regards
[Edited by pando on 05-08-2002 at 04:17 AM]
-
Originally posted by dbafreak
Originally posted by oravijay
Hi,
That's just for simulating dml activities.
Vijay.
Could you please expalin a little., I am thinking why "10" times? And why at all any number of times, if not 10.
To simitulate the situation, the number of log switches depends on how many online log groups you have. Let's say you have 5 groups. Then, switch 5 times will definitely push the log required for recovery into archived logs, assuming you are in auto arch mode.
Any more questions?
-
Give Command
Alter database recover logfile '/export/home/u03/arch/ktvw/arch_1_667.arc'
Tell me what happens
-
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|