Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 283
  • Last Modified:

DB file transfer onto another machine and Data Guard sequence number issue

I have a problem with DB file transfer and Data Guard sequence numbers.

History:
I have a live system (LS) with its data being mirrored onto another system (BS) via Data Guard.  The live system has a disk problem and one of the tablespace files can't be copied.

What is almost working except for the Data Guard:
(i) I do a synchronization between the two systems with the following:
      SQL> alter system switch logfile
      SQL> shutdown immediate
(ii) Shutdown the oracle data Guard on the 'BS':
SQL> alter database recover managed standby database cancel;
SQL> shutdown immediate
(iii) Copy the control files; logXDB.dbf files; init*.ora; orapwASYDB from the 'LS' to a vmWare Live system (vmwLS).
(iv) Copy the tablespace files;control files; logXDB.dbf files; init*.ora; orapwASYDB from the 'BS' to a vmWare backup system (vmwBS).
(v) Copy the tablesapce files from the 'BS' to the 'vmwLS'
(vi) I have to run 'recover datafile X' on 6 datafiles in order to be able to start the database on the vmwLS.

The sequence number info is as follows:
With just the Data Guard running on the vmwBS, we have the last sequence #: 197555; Applied = YES
When the vmwLS is started, we get on the vmwBS:
197555; Applied = YES
197557; Applied = NO

Yes '197556' is missing, all together.

What is my problem?





0
Hope4U
Asked:
Hope4U
  • 2
1 Solution
 
Greg CloughSenior Oracle DBACommented:
If I understand that, your LS database suffered a disk failure which has damaged some datafiles belonging to a tablespace.  The only way to recover these is to either:

1) Restore those datafiles from a backup (rman, hot), and then apply ALL logs needed to bring it up to date.

If you can't restore the datafile, or are missing even 1 log... then the best way would be:

2) Activate your BS database, as it should have all of your transactions.

If you want to try this on a Virtual System to avoid damage to your LS and/or BS system (great idea by the way), then copy the BS database to vwmBS, and force it online as a primary.

This link may be helpful:

http://download.oracle.com/docs/cd/B12037_01/server.101/b10726/recover.htm#1006522
0
 
Hope4UAuthor Commented:
I with the help of a Guru (F.J.) found a solution:

Requirement: Must have an older working image of the 'LS' installed on the 'vmwLS'.


[1] Stopped the LS oracle DB using :
SQL>  alter system switch logfile;
SQL> shutdown immediate.

[2] Stopped the BS oracle DB with these commands:
SQL> alter database recover managed standby database cancel;
SQL> shutdown immediate;

[3] Copy all the following files from the BS to the new vmwLS: Datafiles; Control and Log files; init*.ora files; orapwSID file.
[4] Copy the 'last archive log file' from the LS to the vmwLS - Location '/u02/oradata/SID/arch/'
[5] Set all the permissions and correct owners on the above files.

[6] Repeat step [3 - 5] on the vmwBS except you only add the 'last archive log file' that is present on the BS.

[7] Start up the vmwBS with:
SQL> connect / as sysdba
SQL> Startup nomount;
SQL> ALTER DATABASE MOUNT STANDBY DATABASE;
SQL> ALTER DATABASE RECOVER MANAGED STANDBY DATABASE DISCONNECT FROM SESSION;

[8] Startup the vmwLS with:
SQL> connect / as sysdba
SQL> Startup;

Should get several datafile errors until all are fixed.  Use 'SQL> recover datafile X', where X is the number of the datafile. I had six to fix.

Then restart again.

[9] Can check that the vmwLS and vmwBS are in sync with:
SQL> SELECT SEQUENCE#,FIRST_TIME, NEXT_TIME, APPLIED FROM V$ARCHIVED_LOG WHERE SEQUENCE# > 10256 ORDER BY SEQUENCE#;

And can run some 'select count(*) ...' commands on tables in the vmwLS and the LS and see how they match back before full switch over.


[10] That's all Folks - Bye.
0
 
Hope4UAuthor Commented:
Was the easiest solution.
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now