cancel
Showing results for 
Search instead for 
Did you mean: 

Mass create repository

Former Member
0 Kudos

Hi Experts,

Has anyone already tried to mass create repositories?

I looked at the stored procedures, there is nothing like that.

Your ideas and thoughts are welcome.

IdM 7.2 SP8

Fadoua

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi Fadoua,

Usually the requirement for mass creation of repositories arises when you have to move the repository configurations from DEV environment to QAS environment.

You can use the Transport feature in the IDM Admin UI if it is a complete transport. ( Including repositoris, tasks, configurations etc)

If you want to mass create only the repository information,I would think of following way. Hope it may help you.

There are three tables which maintain repositories related information.

MC_Repository (unique list of repositories and type of repository (referenced from MC_Repository_type table), other fields)

MC_Repository_type  (Master list of type of repositories)

MC_Repository_vars ( the constants of repository)

So when you want to mass create the repositories, write the required repository information from these tables from the dev database to an excel sheet.

This you can achieve using a To ASCII file pass.

Say  like

MC_Repository --> MC_repository.xslx ( Delete the rep_id column for this excel sheet as this is auto generated when you write to table in QAS environment) - Write a select query to get only the list of repositories to be created in the target

MC_Repository_vars --> MC_Repository_vars.xslx

Note: You do not have to repopulate the table MC_Repository_type table as this is populated by IDM during the installation. But I always recommend to check & compare this table of Dev & QAS environemnt.

If the values are different, then you have to update the rep_type filed in the MC_repository.xslx file created accordingly.

Now, from IDM, read the file MC_repository.xslx using From ASCII file pass and write it to the table MC_Repository. After the successful execution of this pass, the required Repository is written in to the table MC_Repository.

Note: Use the database connection string in the destination tab of From ASCII file with user id mxmc_admin. If you use %$ddm.identitycenter%, IDM uses the user mxmc_rt which will not have DML permission of these tables.

Now, query the table MC_Repository in QAS and get the repid of the repository you have just created.

Update the Repository column of the excel sheet MC_Repository_vars.xslx with the respective rep_id.

Now write the data from MC_Repository_vars.xslx to the table MC_Repository_vars in QAS environment using From ASCII file.

Now the repositories required are created with the respective repository constants.

If you refresh the repositories node of QAS environment in the Management console, you will get the new repositories created. update the required fields accordingly.

Hope this helps.

~ Krishna.

Former Member
0 Kudos

Hi All,

I managed to create reposotories combining the mc_repository and mc_repository_vars tables.

And yes I had to create  arround a hundred with some custom constants for each one, at the development environment first, so having such job can be very handy....

Thanks,

Fadoua

Former Member
0 Kudos

Great work Fadoua !!

Regards,

Krishna.

former_member2987
Active Contributor
0 Kudos

Something like this should be in the framework (or Job templates) but there's always the chance someone will use it improperly and blow things to $@%.

Glad to see you overcame the hurdle!

Answers (3)

Answers (3)

lambert-giese
Active Participant
0 Kudos

Hello Fadoua,

not exactly what you asked for, but I found stored procedure MC_CLONE_REPOSITORY quite helpful in this context. It corresponds to the "Copy Repository" button in the IdM administration UI (/idm/admin), i.e. it creates a copy from an already existing repository.

You can call the stored procedure from an IdM job in the destination of a ToDatabase pass. This requires permission that the the runtime user doesn't have. So make sure you specify a JDBC URL that connects to the Identity Center DB as PROV or OPER user, but not as RT user.

Set the "SQL Updating" flag, and then use code to invoke the stored procedure. On SQL server/T-SQL, this could look like the following, all in one "Value" cell of the "Destination" tab:

DECLARE @RC int
DECLARE @PNewRepId int
DECLARE @PStatus int
DECLARE @PStatusText varchar(256)

EXECUTE @RC = [mc_clone_repository] 
   1    --numeric ID of repository to use as copy template
  ,'ERPCLNT100'    --name of new repository
  ,'System ERP, client 100'    --description of new repository
  ,@PNewRepId OUTPUT
  ,@PStatus OUTPUT
  ,@PStatusText OUTPUT

Hope that helps,

Lambert

Former Member
0 Kudos

Hi,

Note that unless you find documentation stating otherwise, you should not call stored procedures directly. There is a reason that this procedure is only accessible from the MXMC_PROV user.

So NEVER connect as any other user than RT, and NEVER use any stored procedures not explicitly documented.

Best regards

John Erik Setsaas

SAP NW IdM Development Architect

Former Member
0 Kudos

Hi Lambert,

Your solution seems interesting, but are you sure the the MC_CLONE_REPOSITORIES do exist in 7.2 sp8 ?

However, I can see it in one of the sql scripts for updating the schema, but IDM can not find it either while calling it from a job, maybe the procedure not installed by default.

Fadoua

lambert-giese
Active Participant
0 Kudos

Hi Fadoua,

good to hear you solved the problem. Regarding MC_CLONE_REPOSITORY, I respect John Erik's comment and will therefore not advise to use it.

However, I may say that it exists in SP8, as you can see from the below screenshot. I assume your problems in calling it are related to insufficient permissions. As mentioned before, the runtime user is not allowed to call this stored procedure. My screenshot below is made from a session of the PROV user.

BR, Lambert

Former Member
0 Kudos

You can do it - I suppose it really depends on how many you want to do.  I found it easy enough to create 20 shells and then copy the constants from the primary to all the others (excluding connection constants).

If you want to do hundreds then sure - a to database pass works.  There's actually a stored procedure that I used for setting repository constants iirc.  I'll look it up when I get home.

Peter

Former Member
0 Kudos

Hello Fadoua,

during a 7.2 migration we used Excel/CSV files and ToDatabase passes to add/update the entries in mc_repository and mc_repository_vars. Still used to configure the repositories in 7.2 pure mode.

Best regards

Dominik Trui