Difference between revisions of "Snippets"

From dbawiki
Jump to: navigation, search
(Restart ITM Monitoring agent)
(Restart ITM Monitoring agent)
Line 19: Line 19:
 
$ITM_HOME/smitools/scripts/StartAgent.sh restart all
 
$ITM_HOME/smitools/scripts/StartAgent.sh restart all
 
or
 
or
$ITM_HOME/smitools/scripts/StartAgent.sh start or
+
$ITM_HOME/smitools/scripts/StartAgent.sh start or -o SRV2R
 
</pre>
 
</pre>
 
Check the agent is running
 
Check the agent is running

Revision as of 11:37, 31 July 2013

Restart ITM Monitoring agent

To see if the Oracle module is installed

export ITM_HOME=/opt/IBM/ITM
$ITM_HOME/bin/cinfo -i

See which instances have been setup to be monitored

export ITM_HOME=/opt/IBM/ITM
$ITM_HOME/smitools/scripts/kdyedit -h /opt/IBM/ITM list

Add an instance to be monitored

$ITM_HOME/smitools/scripts/kdyedit -h /opt/IBM/ITM -r itmora -i $ORACLE_SID -t or add

Restart the agent

export ITM_HOME=/opt/IBM/ITM
$ITM_HOME/smitools/scripts/StartAgent.sh restart all
or
$ITM_HOME/smitools/scripts/StartAgent.sh start or -o SRV2R

Check the agent is running

ps -ef | grep koragent

Reconfigure agent

export ITM_HOME=/opt/IBM/ITM
$ITM_HOME/bin/itmcmd config -A or

Create a comma separated list of columns from a select statement

Method 1:

SELECT parent_id,
       RTRIM(XMLAGG(XMLELEMENT(e,child_id || ',')).EXTRACT('//text()'),',') AS "Children"
FROM   parentChildTable
WHERE  parent_id = 0
GROUP  BY parent_id
/

or

SELECT parent_id,
       LISTAGG(child_id, ',') WITHIN GROUP (ORDER BY child_id) AS "Children"
  FROM parentChildTable
 WHERE parent_id = 0
 GROUP BY parent_id
/

Method 2 (undocumented and cannot therefore be relied on to continue working in the same manner):

SELECT wmsys.wm_concat(<column_name>)
FROM <table_name>
/

References