Ok

En poursuivant votre navigation sur ce site, vous acceptez l'utilisation de cookies. Ces derniers assurent le bon fonctionnement de nos services. En savoir plus.

How do you re-duplicate a broken physical standby database?

https://stackoverflow.com/questions/8135393/how-do-you-re-duplicate-a-broken-physical-standby-database

Here is my solution that worked for me:

  1. Shutdown the physical standby database

    SQL> shutdown immediate;
    
  2. (Optional, safer in case of failure) Backup all datafiles (*.dbf), redologs, archive logs, online logs, flashback logs and control files that are used by the shut down instance.

  3. Delete all datafiles (*.dbf), redologs, archive logs, online logs, flashback logs and control files in their referenced locations, but make sure to keep the directories.

  4. Start up your physical standyby database with NOMOUNT-Option

    SQL> startup nomount;
    
  5. Now switch to your primary database environment.

  6. Start your rman on you primary envoronment:

    $> rman target / auxiliary sys@Dataguard_instance
    

    Dataguard_instance must be substituted with your DataGuard instance name. After connect make sure your connected target database is your primary database

    connected to target database: PRIM_DB (DBID=4135917300)
    auxiliary database Password:
    connected to auxiliary database: PRIM_DB (not mounted)
    

    Note that your physical standby database is listed as not mounted primary database. If you see the same information as in target database, chances are that you are connected twice to your primary database. In that case we would create a 100% copy and not a physical standby database. So make sure you are using the right DataGuard instance.

  7. So before we start we force a log switch:

    RMAN> sql 'alter system archive log current';
    
  8. Now we are going to start the full replication of our physical standby database

    RMAN> duplicate target database for standby from active database dorecover  nofilenamecheck;
    
  9. Now rman will perform a duplication of your physical standby database. Depending on your datafile size, this can take from a few hours to open end (I needed about 4 hours during night when the primary database was idle for about 1,5T of files) .

  10. After rman is finished you can exit rman.

  11. Reconnect to your physical standby database and shut it down:

    SQL> shutdown immediate;
    
  12. If you use flashback option (else continnue with step 13):

    SQL> startup mount;
    SQL> alter database flashback on;
    SQL> alter database open;
    
  13. Restart physical standby:

    SQL> startup;
    
  14. Finished!

Les commentaires sont fermés.