Showing posts with label OEM. Show all posts
Showing posts with label OEM. Show all posts

March 21, 2025

How to initiate emcli session on OMS host

 EMCLI Basic commands



EMCLI stands for Enterprise Manager Command Line Interface. This binary is located under $OMS_HOME/bin or $ORACLE_HOME/bin - whichever is set for the oms installation. Sometimes it can be MIDDLEWARE_HOME. It is actually depends on how the admin configured the environment. For a better understanding check where the oms middleware is installed.

you can check this by running which emcli, it will show if the ORACLE_HOME/bin is part of the PATH variable and it can be executed without changing directory to ORACLE_HOME/bin. 

else,
cd $ORACLE_HOME/bin and run the below command.

Prerequisite:

    SYSMAN user password

Initiate the Login session:

    emcli login -username=SYSMAN

Synchronize the OMS:

    emcli sync


Status of the session:

    emcli status

Check for Version:

    emcli version


Logout from the session:

    emcli logout


You can perform all the administrative activities like adding target/removing target/ managing targets through emcli.. to check the full list of commands, please follow this link.

Best Wishes.

February 21, 2025

OEM 13.5 Error | Refresh from My Oracle Support Job is failing

 OEM Offline Patching - Refresh From Oracle Support Error

Title:

Refresh from My Oracle Support Job is failing

Description:

For security recommendations, the oracle em catalog can be uploaded to OEM in offline mode. And while doing so, the Refresh from my oracle support executes to validate the current and required patch sets for all the monitoring agents and systems. The below error occurs due to a Bug which is fixed in OEM 13.5 RU 110 version.


OEM Offline Patching Navigation

OEM Offline Patching Navigation


Log file will show error as below:

The OMS is in offline mode. Using the catalog file saved in the Software Library.

Ensure that the catalog file saved in the Software Library is up to date to avoid stale updates.

Catalog Location is :<Software Library location>

[Free Memory: 274] [Total Memory: 1,706] [Max Memory: 1,706]

Catalog Data Details

---------------------------

aru_products.xml : Parsing...Done : Loading...Done

 - Error 065c9318-ad29-41c3-8602-0abdcc12baf4: An integrity constraint, that is, a foreign key, a primary key, or a unique key has been violated.

Cause: the release id '600000000226924' is not found in the parent release table

 - An error has occurred. The session is being rolled back.

Total Time Taken: 1 minute(s) and 35 seconds

This job failed. For more information, check the logs.


Solution:

Please do not directly perform this is Production environment. If the issue is only happening in Prod system, it is recommended to consult Oracle Support for more environment specific solution. This was part of a bug and I got this solution from oracle Support. 


Refresh from MOS and retry
---------------------------------------------
Login as SYSMAN user in the repository database and run:
SQL> DELETE FROM mgmt_aru_patch_recom_md;
SQL> begin
mos_pa_patch_recom.delete_checksums;
commit;
end;
/
Rerun the "Refresh from My Oracle Support" job.


Reference: 

Below Bugs were fixed in 13.5 RU 110 version & higher.

BUG 34221296 : REFRESH_FROM_MY_ORACLE_SUPPORT_JOB > 'Download Patch Recommendations Metadata' s

BUG 34370999 : EM 13c: Refresh from MOS Job Fails with ORA-02291: integrity constraint Error


Hope this helps. Best Wishes!!

January 15, 2025

Extract the historical database growth from OEM Repository

 Extract the historical database growth from OEM Repository:


alter session set current_schema=sysman;


SELECT Database,

Month_Date,

round(sum(decode(metric_column, 'spaceUsed', maximum))/1024/1024, 3) Used_Size_TB,

round(sum(decode(metric_column, 'spaceAllocated', maximum))/1024/1024, 3) Allocated_Size_TB

FROM

(

SELECT target_name Database, trunc(rollup_timestamp, 'MONTH') Month_Date, key_value TB, metric_column, round(max(maximum),0) maximum

FROM mgmt$metric_daily

WHERE target_type = 'rac_database'

and metric_name = 'tbspAllocation'

and metric_column in ('spaceAllocated', 'spaceUsed')

and target_name in ('&target_name')

GROUP BY target_name, key_value, trunc(rollup_timestamp, 'MONTH'), metric_column

)

GROUP BY Database, Month_Date

ORDER BY Database, Month_Date

/


Recent Post

Oracle Memory usage Queries

Some Important Oracle database Memory management queries. SGA usage by Oracle Instance: select  round(sum(bytes)/1024/1024,2)||' MB'...