46 Performing Backup and Restore and Migration of OAM Sytem Using Snapshot Tool

The OAM Snapshot tool provides tooling to create a snapshot of the Oracle Access Management (OAM) Domain with all its configurations, persist it, and use it for creating fully functional OAM IDM Domain clones.

You can backup your entire OAM configuration so that it can be restored in case of a server or data-center crash. You can also move the OAM domain to a different infrastructure, leaving the OAM schemas in the same database. Alternatively, you can move both the OAM domain and the database schemas to a different infrastructure.

46.1 Backing Up an OAM Deployment

Backup an OAM deployment using the OAM Snapshot Tool.

The OAM Snapshot Tool allows you to create a backup of the following configurations:

  • The OAM domain configuration only
  • The OAM domain configuration along with the OAM database schemas.

Note:

At present it is only supported to backup and restore database schemas stored in an Oracle Database.

Follow these steps to create a backup of your OAM deployment:

46.1.1 Prerequistes for Backing up an OAM Deployment

Follow the prerequisites prior to backing up an OAM deployment.

If your OAM is used with third party sites, for example with federation, then the OAM server ports on the source server should be load balanced using a load balancer. This is a requirement for deployment migration where the source will be replaced by the target or where the source will be load balanced with the target as a standby server. The load balancer should have a different hostname.domain to the OAM hostname.domain. Once the load balancer is configured, modify the settings in OAM as follows:
  1. Launch a browser and access the OAM console (For example, http://localhost:7001/oamconsole). Login with the weblogic username and password.
  2. In the OAM homepage navigate to Configuration.
  3. In the Configuration page, from the Settings tile, select View and from the drop down menu select Access Manager.
  4. In the Access Manager Settings tab, under Load Balancing modify the OAM Server Host and OAM Server Port fields to match the load balancer HTTP endpoint hostname.domain and port.
  5. Under WebGate Traffic Load Balancer modify the OAM Server Host and OAM Server Port, to point to the Loadbalancer HTTP endpoint hostname.domain and port.
  6. Click Apply.

Note:

If using OAP (TCP) rather than OAP over HTTP then you must also update the SSO Agents with the load balancer hostname.domain and port:
  1. Navigate to Application Security.
  2. In the Application Security Launch Pad select Agents.
  3. In the Search SSO Agents tab, under Webgates click Search.
  4. Click on a WebGate to update.
  5. In the webgate tab, under Server Lists , Primary Server List select Add.
  6. Under Access Server select Other and enter the load balancer Host Name and Host Port respectively.
  7. Click Apply.
  8. Repeat the above steps for any other WebGates that need updating.

46.1.2 Creating a backup.properties file

Create a backup.properties file that contains the OAM deployment settings.

On the server where the OAM domain resides, create a backup.properties file that contains the OAM deployment settings. The entries to add to the properties file depend on whether you are backing up the OAM domain only or also backing up the OAM database schemas. The following table describes all the parameters that can be added to the backup.properties file.

Parameter Description Sample Value
ORACLE_HOME The path to the directory where OAM binaries are installed; same as MW_HOME. /u01/oracle/product/OAM
DOMAIN_NAME The name of the OAM WebLogic Server domain. oam_domain
JAVA_HOME The path to the JDK installed. /u01/oracle/product/jdk8
CONNECT_STRING The Oracle database connect string <hostname.domain>:<port>/<service_name> where the OAM schemas reside. Database where the domain is backed up. sourcedb.example.com:1521/oampdb.example.com
OAM_SCHEMA_USER The OAM <schema_prefix>_OAM schema. DEV_OAM
OAM_SCHEMA_PASSWORD The OAM <schema_prefix>_OAM schema password. <schema_password>
DB_SYS_USER The database SYS user. This parameter is only required if you are also exporting the OAM database schemas. SYS
DB_SYS_PASSWORD The database SYS user password. This parameter is only required if you are also exporting the OAM database schemas. <sys_password>
DATA_PUMP_DIR The alias of the Data Pump directory configured in the Oracle Database.

This parameter is only required if you are also exporting the OAM database schemas.

To view the current Data Pump alias and directory, or to configure a new one see Understanding Dump_ Log_ and SQL File Default Locations

Note:

Make sure the directory is empty and no *.dmp files exist prior to running the createSnapshot.sh in Running the createSnapshot.sh script

DATA_PUMP_DIR
DB_VERSION

The version of the database to export the data to.

For example, if both the source and target databases are running Oracle Database 12c Release 1 (12.1), then the Data Pump DB_VERSION parameter must be set to at least 12.0 or the COMPATIBLE database initialization parameter must be set to at least 12.0 or later.

This parameter is only required if you are also exporting the OAM database schemas.

12.1
OPERATION The operation to perform. If backing up the OAM domain only then the value is BACKUP. If backing up the OAM domain and database schemas then the value is MIGRATE. BACKUP
OAM_SCHEMA_PREFIX The OAM <schema_prefix>. DEV
DB_HOME The path to the directory where the Database binaries are located. This parameter is only required if you are also exporting the OAM database schemas. The Database version must be same as the Database used in the CONNECT_STRING

Note:

Database binaries must be on the same infrastructure from where the createSnapshot and applySnapshot scripts need to be run. For more information, see Configuring OAM Snapshot Tool when the DB is on a Different Infrastructure
/u01/oracle/product/database/12.2.1/db_1
LOG_DIR The path where the log output will be stored. Ensure that the directory exists and can be written to. /tmp
An example backup.properties to back up the OAM domain only will look as follows:
ORACLE_HOME=/u01/oracle/product/OAM
DOMAIN_NAME=oam_domain
JAVA_HOME=/u01/oracle/product/jdk8
CONNECT_STRING=sourcedb.example.com:1521/oampdb.example.com
OAM_SCHEMA_USER=DEV_OAM
OAM_SCHEMA_PASSWORD=<schema_password>
OPERATION=BACKUP
OAM_SCHEMA_PREFIX=DEV 
LOG_DIR=/tmp
An example backup.properties to back up the OAM domain and database schemas will look as follows:
ORACLE_HOME=/u01/oracle/product/OAM
DOMAIN_NAME=oam_domain
JAVA_HOME=/u01/oracle/product/jdk8
CONNECT_STRING=sourcedb.example.com:1521/oampdb.example.com
OAM_SCHEMA_USER=DEV_OAM
OAM_SCHEMA_PASSWORD=<schema_password>
DB_SYS_USER=sys
DB_SYS_PASSWORD=<sys_password>
DATA_PUMP_DIR=DATA_PUMP_DIR
DB_VERSION=12.1
OPERATION=MIGRATE
OAM_SCHEMA_PREFIX=DEV
DB_HOME=/u01/oracle/product/database/12.2.1/db_1
LOG_DIR=/tmp

46.1.3 Running the createSnapshot.sh script

Take a backup of the OAM deployment using the createSnapshot.sh script.

To run the backup script:
  1. Shutdown the OAM AdminServer and Managed Servers on the source infrastructure.
  2. Launch a terminal window on the OAM source server and navigate to the $MW_HOME/oam/server/upgrade/script directory.
  3. Run $ sh createSnapshot.sh <path>/backup.properties.
The output for an OAM domain only backup will look similar to the following:
bash-4.1$ sh createSnapshot.sh backup.properties
Invoking moveToDB command : sh moveToDB.sh /u01/oracle/product/OAM oam_domain /u01/oracle/product/jdk8 jdbc:oracle:thin:@sourcedb.example.com:1521/oampdb.example.com DEV_OAM *******
Apr 08, 2020 7:34:55 AM oracle.security.am.artifacts.DBConfigCommand moveToDBOperation
INFO: move to DB for Context : STATELESS_CONTEXT
Apr 08, 2020 7:34:55 AM oracle.security.am.artifacts.common.DBConnection createConnection
INFO: Opening Connection
Apr 08, 2020 7:34:56 AM oracle.security.am.artifacts.common.DBTableValidator validate
WARNING: during db-table validation, context_name: STATELESS_CONTEXT
......
......
......
Apr 08, 2020 7:35:02 AM oracle.security.am.artifacts.store.FileArtifactStore storeArtifacts
INFO: Successfully written file with name : opss-audit-jdbc.xml in folder /tmp/tempDir/user_projects/domains/base_domain/config/jdbc/
Apr 08, 2020 7:35:02 AM oracle.security.am.artifacts.store.ArtifactStore cleanup
INFO: Closing the stream for file opss-audit-jdbc.xml
Apr 08, 2020 7:35:02 AM oracle.security.am.artifacts.processor.DBToFileArtifactProcessor postProcess
INFO: Successfully validated the checksum for artifact opss-audit-jdbc.xml in folder /tmp/tempDir/user_projects/domains/base_domain/config/jdbc/
Apr 08, 2020 7:35:02 AM oracle.security.am.artifacts.processor.DBToFileArtifactProcessor postProcess
INFO: Calculated Checksum [WR/Mjp9ls92UGZIEnmigAYDifPt9IwMhJ9xIMJtCa/U=]. Checksum in DB [WR/Mjp9ls92UGZIEnmigAYDifPt9IwMhJ9xIMJtCa/U=]
Apr 08, 2020 7:35:02 AM oracle.security.am.artifacts.DBConfigCommand moveToDBOperation
INFO: Closing the DB Connection.
Apr 08, 2020 7:35:02 AM oracle.security.am.artifacts.common.DBConnection close
INFO: Closing Connection
STATUS=SUCCESS
bash-4.1$
The output for an OAM domain and database schema backup will look similar to the following:
bash-4.2$ sh createSnapshot.sh backup.properties
Invoking moveToDB command : sh moveToDB.sh /u01/oracle/product/OAM oam_domain /u01/oracle/product/jdk8 jdbc:oracle:thin:@sourcedb.example.com:1521/oampdb.example.com DEV_OAM *******
Apr 02, 2020 4:16:45 AM oracle.security.am.artifacts.DBConfigCommand moveToDBOperation
INFO: move to DB for Context : STATELESS_CONTEXT
Apr 02, 2020 4:16:45 AM oracle.security.am.artifacts.common.DBConnection createConnection
INFO: Opening Connection
Apr 02, 2020 4:16:46 AM oracle.security.am.artifacts.common.DBTableValidator validate
WARNING: during db-table validation, context_name: STATELESS_CONTEXT
Apr 02, 2020 4:16:46 AM oracle.security.am.artifacts.common.DBTableUtility prepareSqlStatment
INFO: SCHEMA_NAME:DEV_OAM
Apr 02, 2020 4:16:46 AM DBTableValidator validate
INFO: Record Found in the database table.cohstore.jks
Apr 02, 2020 4:16:46 AM DBTableValidator validate
INFO: Successfully able to validate the table in the database
Apr 02, 2020 4:16:46 AM oracle.security.am.artifacts.DBConfigCommand processRecord
INFO: Moving file ORACLE_HOME@/user_projects/domains/oam_domain/servers/AdminServer/security/boot.properties with mandatory flag as :false for context:STATELESS_CONTEXT
Apr 02, 2020 4:16:46 AM oracle.security.am.artifacts.handler.FileHandler handle
INFO:  File Handler: versionnull
Apr 02, 2020 4:16:46 AM oracle.security.am.artifacts.processor.ArtifactProcessor execute
SEVERE: Request to process artifacts failed. Context=STATELESS_CONTEXT
......
......
......
Connected to: Oracle Database 12c Enterprise Edition Release 12.1.0.2.0 - 64bit Production
With the Partitioning, OLAP, Advanced Analytics and Real Application Testing options
Starting "SYS"."SYS_EXPORT_SCHEMA_01":  "sys/********@sourcedb.example.com:1521/oampdb.example.com AS SYSDBA" schemas=DEV_WLS_RUNTIME directory=DATA_PUMP_DIR dumpfile=DEV_WLS_RUNTIME.dmp logfile=DEV_WLS_RUNTIME.log Version=12.1
Estimate in progress using BLOCKS method...
Processing object type SCHEMA_EXPORT/TABLE/TABLE_DATA
Total estimation using BLOCKS method: 0 KB
Processing object type SCHEMA_EXPORT/USER
Processing object type SCHEMA_EXPORT/SYSTEM_GRANT
Processing object type SCHEMA_EXPORT/ROLE_GRANT
Processing object type SCHEMA_EXPORT/DEFAULT_ROLE
Processing object type SCHEMA_EXPORT/TABLESPACE_QUOTA
Processing object type SCHEMA_EXPORT/PRE_SCHEMA/PROCACT_SCHEMA
Processing object type SCHEMA_EXPORT/TABLE/TABLE
Processing object type SCHEMA_EXPORT/TABLE/CONSTRAINT/CONSTRAINT
Processing object type SCHEMA_EXPORT/TABLE/INDEX/STATISTICS/INDEX_STATISTICS
Processing object type SCHEMA_EXPORT/TABLE/STATISTICS/TABLE_STATISTICS
Processing object type SCHEMA_EXPORT/STATISTICS/MARKER
. . exported "DEV_WLS_RUNTIME"."ACTIVE"                    0 KB       0 rows
Master table "SYS"."SYS_EXPORT_SCHEMA_01" successfully loaded/unloaded
******************************************************************************
Dump file set for SYS.SYS_EXPORT_SCHEMA_01 is:
  /u01/oracle/product/database/12.2.1/db_1/dpdump/DEV_WLS_RUNTIME.dmp
Job "SYS"."SYS_EXPORT_SCHEMA_01" successfully completed at Thu Apr 2 11:37:56 2020 elapsed 0 00:00:19

bash-4.2$ 

Note:

The createSnapshot.sh backs up the OAM domain configuration to a table in the <schema_prefix>_OAM schema. If you choose to also backup the database schemas, then all the OAM schemas are exported as dump files (*.dmp) into the directory on the database server referenced by the DATA_PUMP_DIR parameter.

46.1.4 Backing up Keystores and Custom Applications

Manually backup keystores and custom applications.

The OAM Snapshot tool backs up the OAM domain and optionally the database schemas. There are some extra manual steps that may be required depending on your configuration. If your configuration contains any of the following items then manually back up these files:
  • Any java keystores or wallets you have configured on the source server that reside in any directory other than $DOMAIN_HOME/config/fmwconfig.
  • Any custom war files deployed for custom login pages, custom error pages or custom UI pages.

46.2 Rebuilding an OAM Deployment - Domain Only

Rebuild an OAM Deployment (Domain Only) using the OAM Snapshot Tool.

Topics

Note:

Before following the steps below make sure you have followed the instructions in Backing Up an OAM Deployment to backup the domain only.

Follow these steps to rebuild your OAM deployment (Domain Only):

46.2.1 Installing the OAM Software in the New Infrastructure

Install the OAM software in the new target infrastructure.

Prior to installation refer to the backup.properties used to backup the OAM domain and note the PATH for the JDK_HOME and ORACLE_HOME. For the restore to be successful on the target infrastructure, the following OAM software must be installed in the same paths as the source infrastructure:

  • Oracle JDK
  • Oracle Identity and Access Management 12cPS4 Infrastructure
  • Oracle Identity and Access Management 12cPS4

Note:

The version of the software installed on the target has to be the exact same version as the source, or a later version. It is not possible to restore to a version of the software earlier than used on the source.

To install the software refer to Roadmap for Installing and Configuring a Standard Installation Topology

46.2.2 Creating a restore.properties file

Create a restore.properties file that contains the OAM deployment settings for the rebuild.

On the target server where the OAM domain will be restored, create a restore.properties file that contains the OAM deployment settings. The table below describes all the parameters that can be added to the properties file for restoring the OAM domain only.

Parameter Description Sample Value
ORACLE_HOME The path to the directory where OAM binaries are installed; same as MW_HOME. /u01/oracle/product/OAM
DOMAIN_NAME The name of the OAM WebLogic Server domain. oam_domain
JAVA_HOME The path to the JDK installed. /u01/oracle/product/jdk8
CONNECT_STRING The Oracle database connect string <hostname.domain>:<port>/<service_name> where the OAM schemas reside. sourcedb.example.com:1521/oampdb.example.com
OAM_SCHEMA_USER The OAM <schema_prefix>_OAM schema. DEV_OAM
OAM_SCHEMA_PASSWORD The OAM <schema_prefix>_OAM schema password. <schema_password>
DB_SYS_USER The database SYS user. SYS
DB_SYS_PASSWORD The database SYS user password. <sys_password>
OPERATION The operation to perform. In this case for domain only, the operation is RESTORE. RESTORE
OAM_SCHEMA_PREFIX The OAM <schema_prefix>. DEV
DB_HOME The path to the directory where the Database binaries are located. /u01/oracle/product/database/12.2.1/db_1
LOG_DIR The path where the log output will be stored. Ensure that the directory exists and can be written to. /tmp
An example restore.properties will look as follows:
ORACLE_HOME=/u01/oracle/product/OAM
DOMAIN_NAME=oam_domain
JAVA_HOME=/u01/oracle/product/jdk8
CONNECT_STRING=sourcedb.example.com:1521/oampdb.example.com
OAM_SCHEMA_USER=DEV_OAM
OAM_SCHEMA_PASSWORD=<schema_password>
DB_SYS_USER=sys
DB_SYS_PASSWORD=<sys_password>
OPERATION=RESTORE
OAM_SCHEMA_PREFIX=DEV
DB_HOME=/u01/oracle/product/database/12.2.1/db_1
LOG_DIR=/tmp

46.2.3 Running the applySnapshot.sh script

Restore the OAM Deployment (domain only) using the applySnapshot.sh script.

To run the restore script:
  1. Launch a terminal window on the target server and navigate to the OAM $MW_HOME/oam/server/upgrade/script directory.
  2. Run $ sh applySnapshot.sh <path>/restore.properties.
The output for an OAM domain only backup will look similar to the following:
bash-4.1$ sh applySnapshot.sh restore.properties
Invoking extract_from_db command : sh extract_from_db.sh /u01/oracle/product/OAM oam_domain /u01/oracle/product/jdk8 sourcedb.example.com:1521/oampdb.example.com /tmp DEV DEV_OAM ***** sys *****
Apr 08, 2020 7:56:27 AM oracle.security.am.artifacts.DBConfigCommand extractFromDBOperation
INFO: extract from DB. Context=STATELESS_CONTEXT
Apr 08, 2020 7:56:27 AM oracle.security.am.artifacts.common.DBConnection createConnection
INFO: Opening Connection
Apr 08, 2020 7:56:28 AM oracle.security.am.artifacts.common.DBTableValidator validate
WARNING: during db-table validation, context_name: STATELESS_CONTEXT
Apr 08, 2020 7:56:28 AM oracle.security.am.artifacts.common.DBTableUtility prepareSqlStatment
INFO: SCHEMA_NAME:DEV3_OAM
Apr 08, 2020 7:56:28 AM DBTableValidator validate
INFO: Record Found in the database table.cohstore.jks
Apr 08, 2020 7:56:28 AM DBTableValidator validate
INFO: Successfully able to validate the table in the database
......
......
......
SQL>
0 rows updated.

SQL>
Table truncated.

SQL> SQL> SQL> not spooling currently
SQL> Disconnected from Oracle Database 12c Enterprise Edition Release 12.1.0.2.0 - 64bit Production
With the Partitioning, OLAP, Advanced Analytics and Real Application Testing options
bash-4.1$

46.2.4 Restoring Keystores and Custom Applications

Manually restore keystores and custom applications

The OAM Snapshot tool restores the OAM domain only. If you backed up any of the files on the source server referenced in Backing up Keystores and Custom Applications then these must be restored to the same location on the target server prior to starting the OAM domain.

Note:

Before starting the OAM domain on the target infrastructure, the AdminServer and Managed Servers in the OAM domain on the source infrastructure must be shut down.

46.3 Migrating OAM Domain and Database Schemas

Migrate the OAM Domain and Database Schemas using the OAM Snapshot Tool.

46.3.1 Installing and Creating a New Database

Install database software on a new target server and create a database.

On the target infrastructure you must manually install the database software and create a new database. The following requirements must be met:
  • The Oracle database software must be a version supported by Oracle Access Management.
  • The Oracle database software can be an earlier version, the same version, or later version than the source server.
  • If you install an earlier version of the supported Oracle database software, the DB_VERSION parameter in backup.properties must match the version of the target database, prior to backing up.
  • The installation PATH can be the same as the source, or installed to a different PATH.
  • When creating the new database instance, it should be the same specification, or a higher specification than the source database.
  • The new database instance service_name can be the same as the source, or given a different name.
    If the target database service_name is different than the source, run the following script after running applySnapshot.sh.
    perl $MW_HOME/idm/oam/server/upgrade/script/replaceHostnames.pl $DOMAIN_HOME <OLD SERVICE NAME> <NEW_SERVICE_NAME> "DB"
  • The new database instance must have the same DATA_PUMP_DIR configured.
  • The database *.dmp files must be copied from the source DATA_PUMP_DIR to the target DATA_PUMP_DIR.
  • After the database is created, the database and listener must be started prior to running the restore script.

46.3.2 Installing the OAM Software in the New Infrastructure

Install the OAM software in the new target infrastructure.

Prior to installation refer to the backup.properties used to backup the OAM domain and database schemas and note the PATH for the JDK_HOME and ORACLE_HOME. For the restore to be successful on the target infrastructure, the following OAM software must be installed in the same paths as the source infrastructure:

  • Oracle JDK
  • Oracle Identity and Access Management 12cPS4 Infrastructure
  • Oracle Identity and Access Management 12cPS4

Note:

The version of the software installed on the target have to be the exact same version as the source, or a later version. It is not possible to restore to a version of the software earlier than used on the source.

To install the software refer to Roadmap for Installing and Configuring a Standard Installation Topology

46.3.3 Creating a restore.properties file

Create a restore properties file that contains the OAM deployment settings for rebuilding the OAM domain and database schemas.

On the target server where the OAM domain will be restored, create a restore.properties file that contains the OAM deployment settings. The table below describes all the parameters that need to be added to the properties file for restoring the OAM domain and database schemas.

Parameter Description Sample Value
ORACLE_HOME The path to the directory where OAM binaries are installed; same as MW_HOME. /u01/oracle/product/OAM
DOMAIN_NAME The name of the OAM WebLogic Server domain. oam_domain
JAVA_HOME The path to the JDK installed. /u01/oracle/product/jdk8
CONNECT_STRING The target Oracle database <hostname.domain>:<port>/<service_name> where the OAM schemas will reside. target.example.com:1521/oampdb.example.com
OAM_SCHEMA_USER The OAM <schema_prefix>_OAM schema. DEV_OAM
OAM_SCHEMA_PASSWORD The OAM <schema_prefix>_OAM schema password. <schema_password>
SCHEMA_PASSWORD This must have the same value as OAM_SCHEMA_PASSWORD.

Note:

It is mandatory to have both OAM_SCHEMA_PASSWORD and SCHEMA_PASSWORD for OPERATION=MIGRATE.
<schema_password>
DB_SYS_USER The target database SYS user. SYS
DB_SYS_PASSWORD The target database SYS user password. <sys_password>
DATA_PUMP_DIR The alias of the Data Pump directory configured in the target Oracle Database.

The directory referenced by the alias should only contain the *.dmp files copied across from the source database DATA_PUMP_DIR.

DATA_PUMP_DIR
OPERATION The operation to perform. In this case the operation is MIGRATE. MIGRATE
OAM_SCHEMA_PREFIX The OAM <schema_prefix>. DEV
DB_HOME The path to the directory where the Database binaries are located. The Database version must be same as the Database used in the CONNECT_STRING

Note:

Database binaries must be on the same infrastructure from where the createSnapshot and applySnapshot scripts need to be run. For more information, see Configuring OAM Snapshot Tool when the DB is on a Different Infrastructure
/u01/oracle/product/database/12.2.1/db_1
LOG_DIR The path where the log output will be stored. Ensure that the directory exists and can be written to. /tmp
An example restore.properties will look as follows:
ORACLE_HOME=/u01/oracle/product/OAM
DOMAIN_NAME=oam_domain
JAVA_HOME=/u01/oracle/product/jdk8
CONNECT_STRING=targetdb.example.com:1521/oampdb.example.com
OAM_SCHEMA_USER=DEV_OAM
SCHEMA_PASSWORD=<schema_password>
OAM_SCHEMA_PASSWORD=<schema_password>
DB_SYS_USER=sys
DB_SYS_PASSWORD=<sys_password>
DATA_PUMP_DIR=DATA_PUMP_DIR
OPERATION=MIGRATE
OAM_SCHEMA_PREFIX=DEV
DB_HOME=/u01/oracle/product/database/12.2.1/db_1
LOG_DIR=/tmp

46.3.4 Running the applySnapshot.sh script

Running the applySnapshot.sh script to restore the OAM domain and database schemas.
  1. Launch a terminal window on the target server and navigate to the OAM $MW_HOME/oam/server/upgrade/script directory.
  2. Run $ sh applySnapshot.sh <path>/restore.properties.
The output for an OAM domain and database schemas restore will look similar to the following:
bash-4.2$ sh applySnapshot.sh backup.properties
Invoking createtableusers command : sh createtableusers.sh /u01/oracle/product/database/12.2.1/db_1 targetdb.example.com:1521/oampdb.example.com sys DEV ******* /tmp ******

SQL*Plus: Release 12.1.0.2.0 Production on Thu Apr 2 05:57:51 2020

Copyright (c) 1982, 2014, Oracle.  All rights reserved.


Connected to:
Oracle Database 12c Enterprise Edition Release 12.1.0.2.0 - 64bit Production
With the Partitioning, OLAP, Advanced Analytics and Real Application Testing options

SQL> SQL> SP2-0606: Cannot create SPOOL file "sys/createtablespace.log"
SQL> show SGA
SQL>
Total System Global Area 4546625536 bytes
Fixed Size                  2933352 bytes
Variable Size             889195928 bytes
Database Buffers         3640655872 bytes
Redo Buffers               13840384 bytes
SQL>
SQL>
    sga_gb
----------
  4.234375
......
......
......
SQL>
1 row updated.

SQL>
3 rows updated.

SQL>
1 row updated.

SQL>
Table truncated.

SQL> SQL> SQL> SQL> Disconnected from Oracle Database 12c Enterprise Edition Release 12.1.0.2.0 - 64bit Production
With the Partitioning, OLAP, Advanced Analytics and Real Application Testing options
bash-4.2$

Note:

The applySnapshot.sh restores all the OAM schemas to the target database. If each schema password is different in the source database, then you must change the passwords for those schemas in the target database manually prior to starting the OAM domain on the target infrastructure.
To change the passwords connect to the target database as the SYS user and run:
alter user <SCHEMA_PREFIX>_STB identified by <STB_PASSWORD>;
alter user <SCHEMA_PREFIX>_IAU_APPEND identified by <IAU_APPEND_PASSWORD>;
alter user <SCHEMA_PREFIX>_IAU_VIEWER identified by <IAU_VIEWERPASSWORD>;
alter user  <SCHEMA_PREFIX>_MDS identified by <MDS_PASSWORD>;
alter user <SCHEMA_PREFIX>_WLS identified by <WLS_PASSWORD>;
alter user <SCHEMA_PREFIX>_WLS_RUNTIME identified by <WLS_RUNTIME_PASSWORD>;
alter user IAU identified by <IAU_PASSWORD>;
alter user <SCHEMA_PREFIX>_OPSS identified by <OPSS_PASSWORD>;
alter user <SCHEMA_PREFIX>_OAM identified by <OAM_PASSWORD>;

46.3.5 Restoring Keystores and Custom Applications

Manually restore keystores and custom applications.

The OAM Snapshot tool restores the OAM domain and database schemas only. If you backed up any of the files on the source server referenced in Backing up Keystores and Custom Applications then these must be restored to the same location on the target server, prior to starting the OAM domain.