Tuesday, July 10, 2012

Grid Control 11g (OMS) repository database moving into new database and passwords

If you need to move your Grid Control (OMS) repository database into new database. You probably do it with following guide (this can be find from MOS (My Oracle Support)):
11g Grid Control: Steps for Migrating the 11g Grid Control Repository from One Database to Another [ID 1302281.1]

This guide will work if you remember to use EE database and always run scripts with correct user. Best way to run individual scripts is sign out and in into sqlplus always between different scripts. This way you always check that the user is correct.

Problem with this guide is the Grid Control users passwords. The scripts that this guide use will move also Grid Control users but it recreates those users passwords. After move is done Grid Control console users passwords are same as the usernames except all passwords are writen with caps.

If you want to change passwords back like they where in old database you can do it this way:

Check username password hash from old Oracle 11 repository database with following sql (older Oracle version did show password hash in the dba_users password column but it is not anymore there in Oracle 11 (this is because security reasons)):
--
select REGEXP_SUBSTR (DBMS_METADATA.get_ddl ('USER','USERNAME'), '''[^'']+''') PASSWD from dual;
-- 

and after that change user password into new repository database with following sql (and use the hash you get from the first sql):
--
alter user USERNAME identified by values 'S:91F217F4280C854E10D66C2C79E729C55B45E26DAD30297D8705542EF5B5;45BE3895069161E2';
--

You must run above scripts for all Grid Control console users to change their passwords.

And of course you can use same sql's for another Oracle 11 password changes where you need for old password. For example if you need to use older exp/imp tools and you need to create users into new database before import.

No comments:

Post a Comment