Hi All,
This post will provide detailed steps to replicate one OIM 10g environment to the other. It is assumed that source and target OIM environments are of 10g version and are on patches with same application server.
Steps to be performed at Source OIM environment:
- Shutdown the OIM server.
- Export the OIM database using below command
exp system/<SYSTEM_PASSWORD> file=<DUMP_FILE_NAME>.dmp owner=<SOURCE_OIM_DB_USER> log=exp_<file_name>.log consistent=y statistics=none
- Export the tablespaces used by OIM server using below commands
select DEFAULT_TABLESPACE, TEMPORARY_TABLESPACE from dba_users where username=’<SOURCE_OIM_DB_USER>’;
select distinct tablespace_name from dba_segments where owner=’<SOURCE_OIM_DB_USER>’;
Steps to be performed at Destination OIM environment:
- Shutdown the OIM server.
- Backup the OIM database schema using the below command
exp system/<system_password> file=<file_name>_backup.dmp owner=<OIM_DB_USER> log=exp_<FILE_NAME>.log statistics=none
- Backup the files $OIM_HOME/config/.xldatabasekey and $OIM_HOME/config/.xlkeystore and $OIM_HOME/config/configkey.key
- Drop the OIM schema user and tablespaces using the below commands
drop user <OIM_DB_USER> cascade
drop tablespace <OIM_DB_TABLESPACE_NAME> including content and datafile
drop tablespace <OIM_DB_TEMP_TABLESPACE_NAME> including content and datafile
- Create OIM schema user with prepare_xl_db.bat/sh script as shown below. NOTE: The schema name should be same as it was dropped in previous step.
prepare_xl_db.bat <DB_CONNECT_STRING> <$ORACLE_HOME> <OIM_DB_USER> <OIM_DB_USER_PASSWORD> <OIM_DB_TABLESPACE_NAME> <OIM_DB_DATAFILE_LOCATION> <OIM_DB_DATAFILE_NAME> <OIM_DB_TEMP_TABLESPACE_NAME> <DB_SYSTEM_USER_PASSWORD>
- If there are any additional tablespaces that are used by OIM they need to be created too.
- Copy the dmp files from Source to Destination OIM environment to a location that has appropriate permissions.
- Ensure the tablespaces of OIM schema user are dimensioned properly for smooth importing of DB dump file.
- Import the dump file using the below command.
imp system/<SYSTEM_PASSWORD> file=<DUMP_FILE_NAME>.dmp fromuser=<SOURCE_OIM_DB_USER> touser=<OIM_DB_USER> log=imp_<FILE_NAME>.log
Check the import log file to make sure that there are no errors.
Additional Steps:
- When a OIM schema backup was taken in a fresh OIM 10g environment and in the future you wish to restore the OIM 10g with fresh DB then there is no need to execute the below steps.
- Login to OIM Database as OIM schema user and update the schema name using the below command.
SQLPLUS>update SDK set SDK_SCHEMA=’<OIM_DB_USER>’;
SQLPLUS>commit;
- Copy from source to destination the following files: $OIM_HOME/config/.xldatabasekey, $OIM_HOME/config/.xlkeystore and $OIM_HOME/config/configkey.key.
- Modify xlconfig.xml with following changes under DirectDB section:
Change the <url> value to the correct one.
Change the <username> value to the correct one.
If the password for the schema of the new environment is different from the original one, then set the encrypted value for to “false” and then set the password in clear text.Modify xlconfig.xml
- Login to the application server console and update the data sources xlDS and xlXADS for Database URL, DB port, and DB schema credentials.
Testing the replication:
Start the OIM server and make sure that there are no exceptions in logs. Try to login to OIM admin console with xelsysadm user. Please note to use xelsysadm credentials as per Source OIM environment.
References:
Oracle metalink note 555655.1.