Friday, June 27, 2014

[OEM] Can't add Compliance Standard Rule to Compliance Standard

Situation:
You want to add a custom Compliance Standard Rule to a custom Compliance Standard but when you click the 'Save' button the following error appears:




Also when you review your emoms.log you found the following entry:
2014-06-26 08:34:28,675 [[ACTIVE] ExecuteThread: '1' for queue: 'weblogic.kernel.Default (self-tuning)'] WARN applicationModule.ComplianceLibraryAMImpl logp.251 - SQL Exception
java.sql.SQLException: ORA-01403: no data found
ORA-06512: at "SYSMAN.EM_COMPLIANCE_RULE_OP", line 70
ORA-06512: at "SYSMAN.EM_COMPLIANCE_STANDARD_OP", line 2585
ORA-06512: at line 1

at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:462)
at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:405)
at oracle.jdbc.driver.T4C8Oall.processError(T4C8Oall.java:931)
at oracle.jdbc.driver.T4CTTIfun.receive(T4CTTIfun.java:481)
at oracle.jdbc.driver.T4CTTIfun.doRPC(T4CTTIfun.java:205)
at oracle.jdbc.driver.T4C8Oall.doOALL(T4C8Oall.java:548)
at oracle.jdbc.driver.T4CCallableStatement.doOall8(T4CCallableStatement.java:213)
at oracle.jdbc.driver.T4CCallableStatement.executeForRows(T4CCallableStatement.java:1111)
at oracle.jdbc.driver.OracleStatement.doExecuteWithTimeout(OracleStatement.java:1488)
.......... 

Bug Related:
Bug 18380944 - COMPLIANCE STANDARD UPDATE FAIL: When a target is deleted from the Cloud Control, the custom compliance standards associated to it are not deleted.

Solution:
1. Upload the cleanup_stale_data.sql to the repository database server.
2. Login to the repository database as SYSMAN user.
3. Run the cleanup_stale_data.sql script:
SQL>@cleanup_stale_data.sql
4. Execute the following query. It result should be zero:
SQL> select count(*) from sysman.em_cs_tgt_assoc_txf_req where root_target_guid not in (select target_guid from mgmt_targets);