Thursday, February 23, 2017

Sort by size in linux

du -sk * | sed -e 's_^\([0-9]*\)_\1 KB_' | sort -n

Monday, February 13, 2017

Check OEM threshold settings

select target_name,key_value ,WARNING_THRESHOLD,CRITICAL_THRESHOLD from mgmt$target_metric_settings where metric_column='pctUsed' and target_type='oracle_database' and WARNING_THRESHOLD is not null;

sql query history

SELECT
   h.sample_time,
   u.username,
   h.program,
   h.module,
   s.sql_text
FROM
   DBA_HIST_ACTIVE_SESS_HISTORY h,
   DBA_USERS u,
   DBA_HIST_SQLTEXT s
WHERE  sample_time >= SYSDATE - 60
   AND h.user_id=u.user_id
   AND h.sql_id = s.sql_iD
   and s.sql_text like '%'
   and u.username not in ('SYS')
ORDER BY h.sample_time
/

Thursday, February 2, 2017

Agent is Unreachable (REASON = The agent is running but is currently not ready to accept client requests).

1.) Stop the agent:
emctl stop agent

2.) Set the following properties as shown below:
emctl setproperty agent -allow_new -name MaxInComingConnections -value 150
emctl setproperty agent -allow_new -name _cancelThread  -value 210

3.) Take backup and edit AGENT_INST/sysman/config/emd.properties

Change MaxThreads value to 250

Default
MaxThreads=10

to
MaxThreads=250

4.) Start the agent:
emctl start agent