Friday, April 14, 2017

Deleting a large number of groups in PBCS

Adjusting to working in the cloud takes some time; there are things we are used to being able to do on-premise where the functionality may be more mature or we have additional utilities to assist us.

Recently I ran into an issue in PBCS where we had imported a large number of groups and then decided we did not need them.  At first glance it appeared the only way to remove them was one by one via the GUI.  Since there were over 500 groups I was not willing to do that.  I opened an SR and unfortunately Oracle confirmed there was no way to do it and I would need to submit an enhancement request.

I did some poking around on blogs and the documentation, along with some more trial and error and actually figured out a way to do it by altering LCM exports and the Import Settings.  Below are the steps I took to accomplish this.  I suspect this method might be "unsupported" by Oracle, I'm not sure, so full disclosure that you are doing this at your own risk.  Please be sure to take a full back up of your environment before you attempt this in case you have to roll back.

With that said, these are the steps to delete groups en masse in PBCS.

1. LCM Export your current security, and name the snapshot GROUPS

2. Download the GROUPS Snapshot

3. Once downloaded, extract to a temp directory on your PC, such as C:\Temp. 

4. Open C:\Temp\GROUPS\HSS-Shared Services\resource\Native Directory\Groups.csv with a text editor.
     - Remove the groups you want to KEEP from the #group section
     - Remove all #group_children sections (you don't need them for delete operation)

5. Go to C:\Temp\GROUPS\HSS-Shared Services\resource\Native Directory\Assigned Roles
     - Open the various folders and modify the .csv files in them.  You have to remove all references to the groups you are deleting.  Leave references to groups that you are keeping.
6. Now that you are done editing, you can Zip your modified files for re-import to PBCS.

*Note that I had a lot of issues when I first tried to re-zip my files.  I was getting a lot of errors on upload and import.  I will show the method I used that seems to work, this may or may not be optional.

-If you do not already have 7zip, download and install it.
-Open 7zip and navigate to the temp directory where the modified files are located.
Note it is important that you do not zip the GROUPS folder, you have to archive the folder 'HSS-Shared Services', and the two xml files 'Export.xml' and 'Import.xml' (see screenshot)

-Click the Add button 

In the 'Add to Archive' options select 
Archive format = Zip 
Compression level = Store

(This is a case where other compression methods may work but I had errors with the few I tried. Stored essentially puts the file in a zip container but it doesn't actually compress it.  This was the way I got it to import back into PBCS successfully.)

7. Rename your zip to

8. Go to PBCS and import your zip file

9. The next setting is extremely important.  You need to tell LCM to Delete instead of add when you import the files back in.  Next to the Refresh button is the 'Import Settings' button, it looks like a hammer and wrench.  Open 'Import Settings' and change 'Groups and Membership - Import Mode' to 'Delete' and click 'Save and Close'.

10. Import your modified LCM

Check the migration status report for Completion

Navigate back to Access Control and you should see your groups have been removed.

*** Important - Be sure to go back to 'Import Options' and change it from 'Delete' to the default 'Create or Update'.  Failing to do this could result in a big problem the next time someone tries to restore a back up or migrate across environments.

1 comment:

Avishek Priyadarshi said...

I really appreciate information shared above. It’s of great help. If someone want to learn Online (Virtual) instructor lead live training in ORACLE SOLARIS, kindly contact us
MaxMunus Offer World Class Virtual Instructor led training on ORACLE SOLARIS. We have industry expert trainer. We provide Training Material and Software Support. MaxMunus has successfully conducted 100000+ trainings in India, USA, UK, Australlia, Switzerland, Qatar, Saudi Arabia, Bangladesh, Bahrain and UAE etc.
For Demo Contact us.
Avishek Priyadarshi
Skype id: avishek_2 .
Ph:(0) 8553177744 / 080 - 41103383