Pages

Saturday, May 26, 2012

Assigning bulk users to groups in 11.1.2.1 - using command line utility

In my previous post I discussed the steps to assign multiple users to groups in one go using the Life Cycle Management available under shared services. Being an administrator, I would still like to have some automated way to avoid performing all these steps every time I need to assign users. It eventually led to writing this post.

Step 4 : Migration definition XML
We need to perform the first three steps defined in the previous post, but this will be a one time activity to export group information and obtain the folder structure at 'Base path' (I will come to defining base path later in this post). While performing step 4 for the first time, save the migration definition before launching it. This file gets downloaded as an XML file and the contents of the same are as shown below.


The file has a tag <Options> which defines the operation to be performed during the import. It has the same value which we choose during the 'Import Operation Type'  - Create/Update, Create, Update, Delete.


We will be creating two such files and save them as 'ImportCreate' and 'ImportDelete' to signify the operation they perform.



Life Cycle Management also comes as a command line utility to initiate LCM. This utility is placed under <Installation drive>:\Oracle\Middleware\user_projects\epmsystem1\bin. This utility can be executed from any command line interface in Windows (Utility.bat) or Unix (Utility.sh). The documentation for the same is available on Oracle website.
The syntax for executing the utility is:
Utility.bat <migration definition XML> -b <base path>

Migration definition XML : The XML file saved during the Migration definition XML step
Base Path: The file system path where all exports & imports are stored. The utility provides the ability to move the exported folder to any other location and define that path as base path. Make sure the new path does not have spaces or special characters in its name.

Let us first try removing few users from the group 'GrpCtrl'. We enter 'E001', 'E002' in the 'Groups.csv' and execute the utility. Moreover we move the GroupExport folder and the xml files to C:\ to provide an easy file location.

Utility.bat C:\ImportDelete.xml -b C:\

On executing the utility with a fresh xml file, the utility asks for user name and password.


One thing to observe is that the ImportDelete.xml gets updated with this username and encrypted password which was initially not present in the file.


Lets check the group properties. We find E001 and E002 are no longer part of GrpCtrl.


Now lets add few users to a different group 'GrpEast'. We enter 'E004', 'E006' in the 'Groups.csv' and execute the utility.

Utility.bat C:\ImportCreate.xml -b C:\


On checking the properties, we see the users get added to 'GrpEast' while they still exist to be part of 'GrpCtrl'.



Its done !!! 
We can further automate this process by saving this command as a .bat file and pass the XML as parameter to perform desired operation. Let me know your comments.

4 comments:

  1. Wonderful post..thanks for sharing!!

    ReplyDelete
  2. Navan,

    Thanks for the information. I having some issues with the xml. file and I was wondering if you had any suggestions. I've completed steps 1-3 with no issues. In step 4, I followed steps 1-3 without executing. I saved the migration, opened up the xml file, but the file seems to be backwards from yours. See below:



    en_US


















    Am I saving the migration incorrectly? Any help would be appreciated.
    Thanks,
    AJ

    ReplyDelete
    Replies
    1. Looks like my xml file did not go through. Essentially, what it is doing is reversing the Application and FileSystem where Application Connection is showing as my Source and my Target is FileSystem.



      en_US





















      Thanks, AJ

      Delete
    2. Hi AJ,
      You need to run the migration during the steps 1 to 3. This will create the folder structure under import_export folder. It is in the step 4 where we need to save the migration definition as xml rather than executing it. This will have source as file system and destination as Shared services.
      Try it and let me know if you still face any issue.

      Delete