Script that duplicates a database using a physical standby RAC as source

Β It’s possibile to duplicate a database for testing purposes (it’s an example) using a standby database as source. This allows you to off-load the production environment.

This is a simple script that makes use of ASM and classic duplicate, although I guess it’s possible to use the standby DB for a duplicate from active database.
You can launch it everyday to align your test env at a point in time.

The following two tabs change content below.

Ludovico

Principal Product Manager at Oracle
Ludovico is a member of the Oracle Database High Availability (HA), Scalability & Maximum Availability Architecture (MAA) Product Management team in Oracle. He focuses on Oracle Data Guard, Flashback technologies, and Cloud MAA.

12 thoughts on “Script that duplicates a database using a physical standby RAC as source

  1. Hi Ludovico,

    Test Database subjected to Clone from Standby standalone ( as a Source environment is not working on 12.1.0.2 .. Can you please add up all the Notes , Sufficient information and Requisites required

    Thanks
    Subbu

  2. Hi Ludovico,

    i try to duplicate from standby database to a test one , on different server , using backup on ZDLRA, but it fail with the error below :

    RMAN-00571: ===========================================================
    RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
    RMAN-00571: ===========================================================
    RMAN-03002: failure of Duplicate Db command at 01/23/2018 15:04:06
    RMAN-05501: aborting duplication of target database
    RMAN-03015: error occurred in stored script Memory Script
    RMAN-00600: internal error, arguments [6007] [] [] [] []

    could you help please ?

    Best regards,
    Slim

  3. Hi Ludovico,
    I’m trying to do a duplicate form a standby to a test database on the same server, the version are 11.2.0.3 and the Rman comnad is failing at the end when is trying to open with resetlog the cloned DB, and if I try to do a recover I have an ORA-00600 interla error, do youhave any Idea?

    contents of Memory Script:
    {
    Alter clone database open resetlogs;
    }
    executing Memory Script

    released channel: c1
    released channel: c2
    released channel: c3
    released channel: c4
    released channel: cr1
    released channel: cr2
    released channel: cr3
    released channel: cr4
    RMAN-00571: ===========================================================
    RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
    RMAN-00571: ===========================================================
    RMAN-03002: failure of Duplicate Db command at 08/29/2017 18:04:27
    RMAN-05501: aborting duplication of target database
    RMAN-03015: error occurred in stored script Memory Script
    RMAN-06136: ORACLE error from auxiliary database: ORA-01152: file 2 was not restored from a sufficiently old backup
    ORA-01110: data file 2: ‘/app/testmaster1/oradata/datafiles/undotbs01.dbf’

    SQL> recover database using backup controlfile until cancel;
    ORA-00283: recovery session canceled due to errors
    ORA-00600: internal error code, arguments: [kcvhvdf_1], [], [], [], [], [], [],
    [], [], [], [], []

  4. Hi Ludovico,
    yes, you can “duplicate from active” a standby database. Tested on 11gR2 in the last hour.

    I remember I saw something in the Oracle manuals that went like “you cannot duplicate a standby”, so I never attempted. I can’t find the quote now though.
    But now I saw your blog post, gave it a try and succeeded.

    The main obstacle preventing us to use duplication is that backups are not available at test locations (too big), but standbys are.
    However, duplicating a standby is still cumbersome because only a subset of the data is actually needed on test databases, and duplicating a subset of the tablespaces won’t help.
    Nevertheless, this technique turns out to be really useful for small databases.

    With 12c and storage-snapshot-aware RMAN, things are likely to get easier.

    Thanks

    PS: Nice blog, I just added it to my feed reader.

    Rodolfo
    ITOUG, dbaitalia.org (owner)

    • Hi Rodolfo,

      thank you for your positive feedback.
      I’ve not tested yet the new 12c storage-aware snapshot copy feature, but I’ve a customer who owns a ZFS appliance, I hope I’ll convince them to test the 12c soon (and blog about the feature you mention, consequently). πŸ™‚

      Hope to meet you soon, why not, as soon as the ITOUG starts boost its activities. πŸ˜‰

      Best regards
      Ludovico

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.