9.7.3.2 Converting an Existing Full Clone or Standby Database to a Test Master

If you already have a full clone or a standby database that you want to repurpose as a test master, then you can convert that database to a test master.

Standby databases cannot be running redo apply while serving as a test master.
  1. If you are using an Oracle Data Guard standby database, perform the following steps:
    1. For initial creation of the Oracle Data Guard replica, use the steps outlined in My Oracle Support note 1617946.1.

      The Data Guard copy must have enough redo applied that it can be opened in a READ ONLY state.

    2. If the test master is a physical standby database and you need to make any modifications to the test master, for example, deleting or masking sensitive data, then perform the following steps:
      1. Convert the standby database into a snapshot standby.

        Note:

        An Oracle Data Guard snapshot standby is different from an Oracle Exadata snapshot. An Oracle Data Guard snapshot standby is a complete copy of the source database that is open read-write. Conversion to an Oracle Data Guard snapshot standby is a simple operation using a single command. Oracle Data Guard snapshot standby facilitates making modifications to the test master and refreshing it for subsequent rounds of testing. See Oracle Data Guard Concepts and Administration (referenced at the end of this topic) for more information on Oracle Data Guard snapshot standby databases.
      2. Modify the standby database as required.
    3. When the standby database is at a consistent state and can be opened in READ ONLY mode, stop log transport to the standby and disable redo apply on the standby.
      DGMGRL> edit database TESTMASTER set property logshipping=OFF;
      Property "logshipping" updated

      If you have not converted the physical standby database into a snapshot standby, then stop redo apply.

      DGMGRL> edit database TESTMASTER set state=APPLY-OFF;
      Succeeded
      
  2. If access control is not already enabled on the disk group that contains the test master's data files, then enable access control on the disk group.

    The disk group must be on Oracle Exadata storage servers.

    SQL> ALTER DISKGROUP DATA SET ATTRIBUTE 'ACCESS_CONTROL.ENABLED' = 'TRUE';
    
  3. Grant ownership to all data files.
  4. Remove write permissions on all the data files to help prevent accidental overwrite.

    SQL commands in an Oracle ASM instance only allow you to set file permissions to read only. You cannot remove write permissions in SQL.

    SQL> ALTER DISKGROUP DATA set permission owner=read ONLY, group=read ONLY, other=none for file 'FILENAME';
    

    This allows snapshots to be created and owned by users other than the owner of the base files.