Home » Server Options » Data Guard » Rebuild Standby Database fails
Rebuild Standby Database fails [message #246227] Wed, 20 June 2007 06:13 Go to next message
mlgoins
Messages: 116
Registered: March 2007
Location: Denver, CO
Senior Member

A shortcut of mine has been to rebuild the standby database on the standby server after a failover, from an old backup of the primary database. Normally, when managed recover starts, the standby database catches up, but there is a scenario which has forced me to create a NEW backup of the Primary database: adding a data file, removing it, and adding it again. Here's what happened...

We had a standard Primary, Physical Standby setup and decided to do some testing. We created a temporary tablespace in the Primary and saw that it was replicated:

SQL> create tablespace test datafile '/u01/oradata/MYDATA/test01.dbf'
2 size 300M extent management local;

The datafile "test01.dbf" was created in the file system. After a logswitch, the actions were applied on the standby. THEN, we dropped the tablespace, and removed the data file from the server using an OS command 'rm <filename>'. We repeated the test with no problems. However...

When I went to rebuild the Standby database, and it got to the second archived log entry that read "create tablespace..." it crashed. Why? I'm thinking it's because we could not physically remove the "test01.dbf" file on the Standby site before the system attempted to recreate it the second time.

The result? I am making a fresh backup of the database, and creating a Standby database from that (takes about 6-8 hours with a 240Gb database). I'm wondering if there's any way to recover from this error? You can't (as far as I know) remove the offending entry from v$datafile on the standby database, because it can only be opened 'read only'. What a mess!

Mike
Re: Rebuild Standby Database fails [message #246332 is a reply to message #246227] Wed, 20 June 2007 11:37 Go to previous messageGo to next message
DreamzZ
Messages: 1666
Registered: May 2007
Location: Dreamzland
Senior Member
Quote:
When I went to rebuild the Standby database, and it got to the second archived log entry that read "create tablespace..." it crashed. Why? I'm thinking it's because we could not physically remove the "test01.dbf" file on the Standby site before the system attempted to recreate it the second time.


You didnt give drop tablespace command?
How you noticed your standby crashed?
Any other activity except TEMP tablespace?
Any parameter modificiation?
DISK space?

[Updated on: Wed, 20 June 2007 11:37]

Report message to a moderator

Re: Rebuild Standby Database fails [message #246665 is a reply to message #246227] Thu, 21 June 2007 10:33 Go to previous messageGo to next message
mlgoins
Messages: 116
Registered: March 2007
Location: Denver, CO
Senior Member

Here's the scenario (from Oracle documentation):

(on the Primary database)

SQL> create tablespace test datafile '/u01/oradata/MYDATA/test01.dbf' size 300M extent management local;
SQL> alter system archive log current;

(verified on the Standby side)

- drop the tablespace at the Primary site

SQL> drop tablespace test;
SQL> alter system switch logfile;

- on the Standby site, verify the "drop tablespace test" has been executed, then remove the file from the filesystem

oracle # rm /u01/oradata/MYDATA/test01.dbf

- then, remove the file on the Primary site

When this was repeated, it went fine. However, when Managed Recovery went through the archived redo logs and applied the actions in sequence, it broke the Standby Database -- I "think" it was because we couldn't get in and execute the "rm /.../test01.dbf" before it tried creating it the 2nd time.

Mike
Re: Rebuild Standby Database fails [message #246694 is a reply to message #246665] Thu, 21 June 2007 11:35 Go to previous messageGo to next message
DreamzZ
Messages: 1666
Registered: May 2007
Location: Dreamzland
Senior Member
did you check before removing file on standby?


  SQL> SELECT SEQUENCE#,APPLIED FROM V$ARCHIVED_LOG
       ORDER BY SEQUENCE#;

??
I guess there could be some flaw.
Re: Rebuild Standby Database fails [message #246887 is a reply to message #246227] Fri, 22 June 2007 06:46 Go to previous message
mlgoins
Messages: 116
Registered: March 2007
Location: Denver, CO
Senior Member

Yes, that was checked (part of the procedure). I'm pretty sure it's just a flaw -- there's always a way to break a thing.
Previous Topic: coping datafiles from primery to standby
Next Topic: RFS error after failover
Goto Forum:
  


Current Time: Fri Apr 19 17:35:11 CDT 2024