Install the Utility and Configure the Test Master Database Server

Install the Database Clone Snapshot Management (gDBClone) script on the database server and configure the server to clone your production database.

Review the following data refresh frequency guidelines to help you determine the best method of cloning your production database to create your Test Master:

  • Frequent refreshes (daily/weekly): Create a Test Master as a physical standby database
  • Regular refreshes (bi-weekly, monthly): Create a Test Master from an active database using RMAN DUPLICATE
  • Occasional refreshes (quarterly, semi-annually): Create a Test Master from an RMAN full database backup

Install the Database Clone Snapshot Management Script

Install the gDBClone script on the database server where you want to create the Test Master.

The Database Clone Snapshot Management (gDBClone) command-line utility requires root system privileges for most tasks. In environments where system administration is handled by a different group than database administration, or where security is a significant concern, you may want to limit access to the root user account and password. Sudo enables system administrators to grant certain users (or groups of users) the ability to run commands as root, while logging all commands and arguments as part of your security and compliance protocol.

Ensure that the production and test master servers meet the required services, products, and roles for the gDBClone command-line utility.
  1. Download the gDBClone utility to the Test Master Server.
  2. Log in and sudo to root.
    $ sudo -s
  3. Install the gDBClone utility using the RPM command.
    The example uses version number 3.0.2-129.
    # rpm -i gDBClone-3.0.2-129.noarch.rpm
    The utility is installed in the /opt/gDBClone directory.
  4. (Optional) To update the gDBClone utility to a newer version, use the RPM update command and enter the gDBClone version number.
    #rpm -Uvh gDBClone-version number.noarch.rpm

Add the Test Master to the Directory and Configure the Port

If you'll create your Test Master as a physical standby database or using Oracle Recovery Manager (RMAN) active duplication, then add an entry for the Test Master server in the /etc/hosts directory of production database server and configure the ports.
  1. Log into the production database server as root and navigate to the /etc/hosts directory.
  2. Add an entry for the Test Master server (tstmstr).
    The SCAN name on the Test Master server is tstmstr-scan.
    [oracle@tstmstr ~]$ srvctl config scan
    SCAN name: tstmstr-scan, Network: 1
    Subnet IPv4: 192.0.2.1/255.255.255.0/p7p1, static
    Subnet IPv6: 
    SCAN 0 IPv4 VIP: 192.0.2.7
    SCAN VIP is disabled.
    SCAN VIP is individually enabled on nodes: 
    SCAN VIP is individually disabled on nodes: 
    [oracle@tstmstr ~]$ 
    
  3. Confirm that tstmstr and tstmstr-scan are in the/etc/hosts directory and the domains are assigned.
    [oracle@proddb ~]$ cat /etc/hosts
    203.0.113.1 localhost localhost.localdomain localhost4 localhost4.localdomain4
    ::1 localhost localhost.localdomain localhost6 localhost6.localdomain6
    192.0.2.6  proddb.bass1.ebsvcn.examplevcn.com  proddb
    198.51.100.1  proddb-priv.bass1.ebsvcn.examplevcn.com  proddb-priv
    192.0.2.6  proddb-vip.bass1.ebsvcn.examplevcn.com  proddb-vip
    192.0.2.6  proddb-scan.bass1.ebsvcn.examplevcn.com  proddb-scan
    192.0.2.7 tstmstr.bass1.ebsvcn.examplevcn.com	tstmstr		tstmstr-scan
  4. Open port 35007 in the security list in the database subnet on the Oracle Cloud Infrastructure console and in the iptables on the database server.
    The gDBClone utility creates a temporary auxiliary listener (on port 35007) on the Test Master server for RMAN duplication. The rule creates an ingress rule for port 35007 from the production database subnet. In the example, 192.0.2.1/24 is the subnet of the production database.
    [root@tstmstr opc]# iptables -I INPUT -p tcp -m state --state NEW -m tcp --dport 35007 -s 192.0.2.1/24 -j ACCEPT
    [root@tstmstr opc]# service iptables save
    [root@tstmstr opc]# service iptables status

Configure the Test Master Server

For all Test Master options, you must create an Oracle Database Home (DB Home), configure Oracle ASM Cluster File System (Oracle ACFS), and create a Transparent Data Encryption (TDE) wallet on the Test Master server instance.

This example uses the following names:

  • Source production database instance: PRODDB (the PDB name is PDB1)
  • Test Master database instance: TSTMSTR (the PDB name is PDB1)
  1. Create a DB Home with the same version as your source production database.
    Use the dbcli list-dbhomes command to confirm that the DB Home and version are configured. This example uses version 12.1.0.2.190416.
    [root@tstmstr ~]# dbcli create-dbhome -v 12.1.0.2.190416
    
    [root@tstmstr ~]# dbcli list-dbhomes
    
    ID                                       Name                 DB Version        Home Location                                Status    
    ---------------------------------------- -------------------- ----------------- -------------------------------------------- ----------
    547437ec-b40e-4f53-8cd5-4b4fd11f449b     OraDB12102_home1     12.1.0.2.190416    /u01/app/oracle/product/12.1.0.2/dbhome_1     Configured
    98632e4c-1907-4a6a-b60a-76577505ff92     OraDB12102_home2     12.1.0.2.190416    /u01/app/oracle/product/12.1.0.2/dbhome_2     Configured
    
    
  2. Create Oracle ASM Cluster File System (Oracle ACFS) storage for the Test Master database.
    Use the dbcli create-dbstorage command to create storage for data, redo, and fast recovery area (fra).
    
    [root@tstmstr ~]# dbcli create-dbstorage --dataSize 1024 --dbname TSTMSTR --databaseUniqueName TSTMSTR --dbstorage ACFS
    
  3. Verify that the storage appears in the list of database storage and validate the file systems.
    Use the dbcli list-dbstorages command to confirm that the filesystem is configured.
    [root@tstmstr ~]# dbcli list-dbstorages
    
    ID                                       Type   DBUnique Name        Status    
    ---------------------------------------- ------ -------------------- ----------
    67123ff1-1b14-4467-87e8-3247e7ab4db2     Asm    ORCL_iad1hb          Configured
    4d2790a7-ec55-4957-a1cf-1d78ce22ce6a     Acfs   TSTMSTR              Configured
    
    ###### validate Filesystems on ACFS
    # df -h
  4. Create a sys password file in the /opt/gDBClone/ directory.
    This is an encrypted file with the SYS password that gDBClone can read.
    [root@tstmstr ~]# cd /opt/gDBClone/
    [root@tstmstr gDBClone]# /opt/gDBClone/gDBClone syspwf  -syspwf SYS.password
    [root@tstmstr gDBClone]# ls -rlt SYS.password
    -rw-rw-rw- 1 root root 33 Sept 30 04:47 SYS.password
  5. Copy the TDE wallet from PRODDB to TSTMSTR.
    Create a tar of the TDE wallet on the Production database server and restore the wallet on the Test Master database server.
    ##### Create a tar of TDE wallet on Production Database Server
    [oracle@proddb ~]$ cd /opt/oracle/dcs/commonstore/wallets/tde/PRODDB_iad1df/
    [oracle@proddb PRODDB_iad1df]$ ls -rlt
    total 48
    -rw------- 1 oracle asmadmin  2555 Sept 24 06:26 ewallet_2019092406265698_defaultTag.p12
    -rw------- 1 oracle asmadmin  5819 Sept 24 06:26 ewallet.p12
    -rw------- 1 oracle asmadmin  5880 Sept 24 06:26 cwallet.sso 
    [oracle@proddb PRODDB_iad1df]$ tar cvf wallet.tar ./ewallet.p12  ./cwallet.sso
    ./ewallet.p12
    ./cwallet.sso
    [oracle@proddb PRODDB_iad1df]$ 
      
    ##### Restore TDE wallet on Test Master Database Server
    [oracle@tstmstr ~]$ cd /opt/oracle/dcs/commonstore/wallets/tde/TSTMSTR
    [oracle@tstmstr TSTMSTR]$ tar xvf /tmp/wallet.tar
    ./ewallet.p12
    ./cwallet.sso
    [oracle@tstmstr TSTMSTR]$
The Production database server is configured for Oracle Data Guard and you can create a Test Master.