I have been requested to migrate the Fusion Middleware repository database from one Linux server to a new one. Here are the steps followed to successfully do this.

In the following of this document, the Fusion Middleware repository created using the repository creation utility (RCU) has the following prefix: VM12FR. Note that the new repository database was already configured as a repository database. This mean that the RCU tool was run at least once against it.

The Fusion Middleware repository database migration has been done following the Oracle Fusion Middleware 12.2.1.4 – Administering Oracle Fusion Middleware documentation. The following restrictions applies to this kind of move:

  • The service name and SID of the database on the target host must be the same as on the source host.
  • The port on the target host must be the same as on the source host.
  • The database on the target host must contain the same schemas as on the source host and the schemas must have the same prefix as on the source host.

This migration has been done in five steps:

  • Check the current database for tablespaces related to the repository and create the SQL script to create them in the target database.
  • Create the tablespaces in the target database
  • Export all Fusion Middleware repository schemas from the source database
  • Import those schemas in the target database
  • Reconfigure the Fusion Middleware to use the new repository database

Check current database for tablespaces related to the repository

Connect to the repository database as user having DBA privileges and run the following SQL queries.

First for the normal tablespaces

select 'CREATE TABLESPACE '||TABLESPACE_NAME||' DATAFILE '||FILE_NAME||' SIZE '||BYTES||' autoextend on '||';' from dba_data_files where TABLESPACE_NAME like 'VM12FR%' order by tablespace_name;

Secondly for the temporary tablespaces

select 'CREATE TEMPORARY TABLESPACE '||TABLESPACE_NAME||' TEMPFILE '||FILE_NAME||' SIZE '||BYTES||' autoextend on '||';' from dba_temp_files where TABLESPACE_NAME like 'VM12FR%' order by tablespace_name;

Create the tablespaces in the target database

Connect to the target database and run the SQL scripts resulting from the previous step

First for the normal tablespaces

CREATE TABLESPACE VM12FR_ias_opss DATAFILE '/u02/app/oracle/oradata/MD/VM12FR_ias_opss.dbf' SIZE 62914560 autoextend on ;

CREATE TABLESPACE VM12FR_iau DATAFILE '/u02/app/oracle/oradata/MD/VM12FR_iau.dbf' SIZE 62914560 autoextend on ;

CREATE TABLESPACE VM12FR_mds DATAFILE '/u02/app/oracle/oradata/MD/VM12FR_mds.dbf' SIZE 104857600 autoextend on ;

CREATE TABLESPACE VM12FR_STB DATAFILE '/u02/app/oracle/oradata/MD/VM12FR_svctbl.dbf' SIZE 10485760 autoextend on ;

CREATE TABLESPACE VM12FR_WLS DATAFILE '/u02/app/oracle/oradata/MD/VM12FR_wlsservices.dbf' SIZE 62914560 autoextend on ;

Secondly for the temporary tablespaces

CREATE TEMPORARY TABLESPACE VM12FR_IAS_TEMP TEMPFILE '/u02/app/oracle/oradata/MD/VM12FR_iastemp.dbf' SIZE 104857600 autoextend on ;

Export all Fusion Middleware repository schemas from the source database

Before exporting the schemas, you need to make sure the export will be done in the right character set. In my case, the recommended character set for Fusion Middleware was used: AL32UTF8

export NLS_LANG=AMERICAN_AMERICA.AL32UTF8
expdp system/***** schemas=VM12FR_STB,VM12FR_IAU_APPEND,VM12FR_IAU_VIEWER,VM12FR_MDS,VM12FR_WLS,VM12FR_WLS_RUNTIME,VM12FR_IAU,VM12FR_OPSS dumpfile=VM12FR.dpdmp

Import those schemas in the target database

Same as for the database schemas export, the character set has to be correctly set in the NLS_LANG to avoid any character conversion or loose.

export NLS_LANG=AMERICAN_AMERICA.AL32UTF8
impdp system/***** file=VM12FR.dpdmp

Reconfigure the Fusion Middleware to use the new repository database

The reconfiguration of the Fusion Middleware Forms & Reports has been done using the chghost.sh tool but this one requires two files. The wallet containing the WebLogic domain administrator password and the mapping file describing the type of changes that the chghost.sh tool will apply. Before running the change host script, make sure no process is running for the Fusion Middleware WebLogic Domain. For example, if the node manager is started as Unix service, make sure to stop it or the change host tool will hang stopping the WebLogic managed servers.

Generate the wallet file for an administrator user named weblogic

$MW_HOME/oracle_common/common/bin/configWallet.sh -walletDir /home/oracle/CHGHOST_TEST weblogic

Create the mapping file. db_host_move.txt in this case.

[ARGUMENTS]

[DATABASE_MAPPING]
#  You can only change the database host name.
vm07.it.dbi-services.com=vm08.it.dbi-services.com

Finally run the chghost.sh script

cd /app/oracle/12c/Middleware/oracle_common/bin/ 
./chghost.sh -chgHostInputFile /home/oracle/CHGHOST_TEST/db_host_move.txt  -javaHome /app/oracle/Java/jdk1.8.0_321 -domainLoc /data/config/12c/domains/vm12fr -domainAdminUserName weblogic -walletDir /home/oracle/CHGHOST_TEST  -logPriority FINEST  -logDir /home/oracle/CHGHOST_TEST/logs

Traces

Command that will be executed :


/app/oracle/Java/jdk1.8.0_321/jre//bin/java -Xms4g -Xmx8g -DignoreErrors=true -Dweblogic.security.SSL.ignoreHostnameVerification=true -cp /app/oracle/12c/Middleware/wlserver/server/lib/weblogic.jar:/app/oracle/12c/Middleware/oracle_common/modules/oracle.pki/oraclepki.jar:/app/oracle/12c/Middleware/oracle_common/jlib/cloningclient.jar:/app/oracle/12c/Middleware/oracle_common/jlib/chghost.jar:/app/oracle/12c/Middleware/oracle_common/modules/oracle.ldap/ojmisc.jar:/app/oracle/12c/Middleware/oracle_common/modules/features/cieCfg_cam_lib.jar oracle.glcm.fmw.chghost.Chghost -chgHostInputFile /home/oracle/CHGHOST_TEST/db_host_move.txt -domainLoc /data/config/12c/domains/vm12fr -domainAdminUserName weblogic -walletDir /home/oracle/CHGHOST_TEST -logPriority FINEST -logDir /home/oracle/CHGHOST_TEST/logs

 Chghost Log File: /home/oracle/CHGHOST_TEST/logs/CHGHOST2022-06-30_14-38_1477087699/logs/chghost.log

I will not past the complete traces here but all can be found in the log file which name provided on the screen.