Friday, April 27, 2012

OIM11G: BulkLoad Utility


Hi, this is Thiago again. This article I will explain step-by-step how to use BulkLoad Utility. Please note that you can see the document and one video related of this task.
1-First Step: I will import the table I want to use into bulkLoad process:
[oracle@xpto bin]$ imp ONE_SCHEMA/****** file=HR_TEMP.dmp full=yes
Import: Release 11.1.0.7.0 – Production on Tue Mar 27 13:14:06 2012
Copyright (c) 1982, 2007, Oracle. All rights reserved.
Connected to: Oracle Database 11g Enterprise Edition Release 11.1.0.7.0 – Produc tion
With the Partitioning, Oracle Label Security, OLAP, Data Mining,
Oracle Database Vault and Real Application Testing options
Export file created by EXPORT:V11.02.00 via conventional path
import done in US7ASCII character set and UTF8 NCHAR character set
import server uses AL32UTF8 character set (possible charset conversion)
export server uses AL16UTF16 NCHAR character set (possible ncharset conversion)
. importing DEV_OIM’s objects into OIM_SCHEMA
. importing DEV_OIM’s objects into OIM_SCHEMA
. . importing table “HR_TEMP” 20 rows imported
Import terminated successfully without warnings.
2-Environment Variables
[oracle@xpto bin]$ export ORACLE_HOME=[ORACLE-DATABASE-HOME]/product/11.1.0/db_1
[oracle@xpto bin]$ export JAVA_HOME=[OIM-JAVA-HOME]/oim11g_MWH/jdk160_24/
[oracle@xpto bin]$ export PATH=$JAVA_HOME/bin:$ORACLE_HOME/bin:$PATH
[oracle@xpto bin]$ cd [OIM-HOME]server/db/oim/oracle/Utilities/oimbulkload
Be careful with this information below:

34.5.2.2 Creating Database Tables As the Input Source
If you want to use a database table as the input source for loading OIM User data, then apply the following guidelines while creating the database table:
Create the table in the Oracle Identity Manager database.
The table must contain the following primary key column:
OIM_BLKLD_USRSEQ NUMBER(19)  <— very important ****
So,
ALTER TABLE HR_TEMP ADD(OIM_BLKLD_USRSEQ NUMBER(19));
The utility uses this column as the primary key. If required, you can use a database sequence to populate this column.
The rest of the columns must be the same as the ones in the USR table that you want to use. In other words, ignore optional USR_ columns that you do not want to include in the table that you create.
Note that the following default values are inserted into Oracle Identity Manager if the table does not contain values for these columns:
ORG_NAME: Xellerate Users
USR_TYPE: End-User
USR_STATUS: Active
USR_EMP_TYPE: Full-Time
———————————-
3-RUNNING BULKLOAD UTILITY:
———————————
cd [OIM_HOME]/server/db/oim/oracle/Utilities/oimbulkload/scripts
./oim_blkld.sh
***************************************
M A I N M E N U
***************************************
Select the operation to perform:
1) Load User Data
2) Load Account Data
3) Load Role Data
4) Load Role Hierarchy
5) Load Role Membership
6) Load Role Category
7) Generate Audit Snapshot
8) Exit
## Enter your option [1-8] :
1
—————————
Enter Database Details:
—————————
######################################################
###### ENTER DATABASE INFORMATION #######
######################################################
###### Get the ORACLE_HOME #######
## Enter the ORACLE HOME directory or Press [Enter] to
accept the default …/product/11.1.0/db_1 as ORACLE_HOME.
The ORACLE_HOME ==> …/oracle/product/11.1.0/db_1 IS VALID
###### Get the database connect string ######
## Enter the OIM database connect string in following format //HostIPAddress:Port/ServiceName
//THIAGO-OIMIP:1521/idm11gdb
ERROR ==> You must enter the name of the Oracle Identity Manager(OIM) database user
## Enter Oracle Identity Manager(OIM) database user name
OIM_SCHEMA
The OIM database user name entered is ==> The ORACLE_HOME ==> [ORACLE-DATABASE-HOME]/product/11.1.0/db_1 IS VALID
###### Get the Oracle Identity Manager password #######
*****
**** Password Entered ****
==== Attempting to connect to OIM database ====
Connection to OIM database is established successfully…
Compiling Procedures ….
Compilation done…
Enter password for OIM database user again :
**********************************
Select the input for user load:
**********************************
1) DB Table
2) CSV File
3) Exit
Enter your option (1, 2 or 3):
1
Enter the name of the DB table, to be used as load source:
HR_TEMP
Enter the comma separated column names, to be loaded, of table HR_TEMP :
USR_FIRST_NAME,USR_LAST_NAME,USR_LOGIN,USR_EMP_TYPE,ACT_KEY
Enter the Name of tablespace to be used for creating custom objects, by the utility [OIM_SCHEMA]:
OIM_SCHEMA is selected as default tablespace
Enter the batch size for processing ( default size is 10000 ) :
5000
Do you wish to insert log msgs (This will impact performance) (y/Y/n/N) :
y
————————————————————-
Utility expects you to create a User using OIM web console
and enter a password for this user, which will be used as
initial password for all users loaded using Bulk Load utility
————————————————————-
Enter the User ID (USR_LOGIN), of the user created from web console :
xelsysadm
Exception table name :HR_TEMP_EX1
Processing TMP table: HR_TEMP
********************************************************************************************************************
****** User load for table ‘HR_TEMP’ complete.
For details check file ../logs_20120306_1400/oim_blkld_user_load_summary.log ******
********************************************************************************************************************
****** RE-BUILDING INDEXES and ENABLING CONSTRAINTS ******
************** THIS MAY TAKE SOMETIME **************
****** Indexes and FK constraints successfully enabled ******
GO TO TABLE:OIM_BLKLD_LOG
Check the bulkload_usr table:

Reference:
LINK:http://docs.oracle.com/cd/E21764_01/doc.1111/e14309/bulkload.htm#CHDGFGHH
Video: http://www.youtube.com/watch?v=szVznoYwLEM
I hope this helps,
Thiago Leoncio