{"id":2004,"date":"2012-12-03T11:18:34","date_gmt":"2012-12-03T16:18:34","guid":{"rendered":"http:\/\/appcrawler.com\/wordpress\/?p=2004"},"modified":"2012-12-03T11:18:34","modified_gmt":"2012-12-03T16:18:34","slug":"quick-way-to-trace-a-session-on-a-server","status":"publish","type":"post","link":"http:\/\/appcrawler.com\/wordpress\/2012\/12\/03\/quick-way-to-trace-a-session-on-a-server\/","title":{"rendered":"Quick way to trace a session on a server"},"content":{"rendered":"<p>If you identify an Oracle database process consuming a high amount of CPU, or want to trace it for any reason, you can simply run the following script and pass the PID of the offending process when requested.<\/p>\n<pre lang=\"plsql\" line=\"1\">\r\nbegin\r\n  for cur in (select sid,serial# from v$session where paddr in (select addr from v$process where spid = &spid)) loop\r\n    dbms_monitor.session_trace_enable(cur.sid,cur.serial#,true,true);\r\n  end loop;\r\nend;\r\n\/\r\nexit\r\n<\/pre>\n<p>You could also create an alias for the script, something like&#8230;<\/p>\n<pre lang=\"text\">\r\nalias trcspid='sqlplus \/ as sysdba @script_location.sql'\r\n<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>If you identify an Oracle database process consuming a high amount of CPU, or want to trace it for any reason, you can simply run the following script and pass the PID of the offending process when requested. begin for&hellip;<\/p>\n<p class=\"more-link-p\"><a class=\"more-link\" href=\"http:\/\/appcrawler.com\/wordpress\/2012\/12\/03\/quick-way-to-trace-a-session-on-a-server\/\">Read more &rarr;<\/a><\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_mi_skip_tracking":false,"footnotes":""},"categories":[19,22],"tags":[],"_links":{"self":[{"href":"http:\/\/appcrawler.com\/wordpress\/wp-json\/wp\/v2\/posts\/2004"}],"collection":[{"href":"http:\/\/appcrawler.com\/wordpress\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/appcrawler.com\/wordpress\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/appcrawler.com\/wordpress\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"http:\/\/appcrawler.com\/wordpress\/wp-json\/wp\/v2\/comments?post=2004"}],"version-history":[{"count":4,"href":"http:\/\/appcrawler.com\/wordpress\/wp-json\/wp\/v2\/posts\/2004\/revisions"}],"predecessor-version":[{"id":2630,"href":"http:\/\/appcrawler.com\/wordpress\/wp-json\/wp\/v2\/posts\/2004\/revisions\/2630"}],"wp:attachment":[{"href":"http:\/\/appcrawler.com\/wordpress\/wp-json\/wp\/v2\/media?parent=2004"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/appcrawler.com\/wordpress\/wp-json\/wp\/v2\/categories?post=2004"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/appcrawler.com\/wordpress\/wp-json\/wp\/v2\/tags?post=2004"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}