Thursday, February 12, 2009

Re-installation of GC repository keeping software tree intact

Some days ago I trashed my 10.2 database when testing conversion of database character sets. This database held the repository of my Grid Control.

So now I had a nice installation of the 10.2.0.1 GC software, with patches to 10.2.0.4, all intact, but no repository. (and no backup :-) I figured that I could re-create the repository, just as easy as it is with Database Control using emca, as that script was present in the oms home, but oh no. Googling and searching Metalink did not give any hints, so finally I gave up at read the documentation, and finally, it was quite easy:

[oracle@localhost oms10g]$ cd $ORACLE_HOME/sysman/admin/emdrep/bin
[oracle@localhost bin]$ ./RepManager localhost 1521 ORCL -sys_password WAS_CHANGED_ON_INSTALL -action create

<.... much output about many strange items like Forms etc (!) ....>

Done.
Repository Creation Successful.

But when going to website, it complained about emkey not being configured correctly, or that it might be corrupted.

[oracle@localhost bin]$ emctl status emkey
Oracle Enterprise Manager 10g Release 10.2.0.1.0
Copyright (c) 1996, 2005 Oracle Corporation. All rights reserved.
Please enter repository password:
The Em Key exists in the Management Repository, but is not configured properly or is corrupted in the file system.
Configure the Em Key by running "emctl config emkey -repos".

[oracle@localhost bin]$ emctl config emkey -repos
Oracle Enterprise Manager 10g Release 10.2.0.1.0
Copyright (c) 1996, 2005 Oracle Corporation. All rights reserved.
Please enter repository password:
The Em Key has been configured successfully.


TADA.... The website now works. But the targets are gone, and my agent does no upload.

[oracle@localhost agent10g]$ emctl upload agent
Oracle Enterprise Manager 10g Release 10.2.0.1.0.
Copyright (c) 1996, 2005 Oracle Corporation. All rights reserved.
---------------------------------------------------------------
EMD upload error: uploadXMLFiles skipped :: OMS version not checked yet..

Seems reasonable as I used secure OMS and agent, so:

[oracle@localhost agent10g]$ emctl clearstate agent
[oracle@localhost agent10g]$ emctl secure agent
Oracle Enterprise Manager 10g Release 10.2.0.1.0.
Copyright (c) 1996, 2005 Oracle Corporation. All rights reserved.
Enter Agent Registration password :
Agent successfully stopped... Done.
Securing agent... Started.
Requesting an HTTPS Upload URL from the OMS... Done.
Requesting an Oracle Wallet and Agent Key from the OMS... Done.
Check if HTTPS Upload URL is accessible from the agent... Done.
Configuring Agent for HTTPS in CENTRAL_AGENT mode... Done.
EMD_URL set in /opt/oracle/product/agent10g/sysman/config/emd.properties
Securing agent... Successful.
Agent successfully restarted... Done.
[oracle@localhost agent10g]$ emctl upload agent
Oracle Enterprise Manager 10g Release 10.2.0.1.0.
Copyright (c) 1996, 2005 Oracle Corporation. All rights reserved.
---------------------------------------------------------------
EMD upload completed successfully


That's it!
:-)
Kim