ITPub博客

首页 > Linux操作系统 > Linux操作系统 > Tracing session created through dblink [ID 258754.1]

Tracing session created through dblink [ID 258754.1]

原创 Linux操作系统 作者:spider0283 时间:2012-09-11 22:07:02 0 删除 编辑
PURPOSE
-------

To trace the session created through database link (dblink)

 
SCOPE & APPLICATION
-------------------

Will help DBAs in generating traces from remote site


TRACING SESSION CREATED THROUGH DATABASE LINK
----------------------------------------------
 
Tracing session created through dblink. 


When a query using a dblink is executed, a session is created on the remote site. The below mentioned steps explain how to set Event 10046 for the remote site session.

   
 1) On the remote site, ensure no sessions running for the required username:

 SQL> select * from v$session where username = 'user_name';

Replace "user_name" with the username mentioned in the create dblink statement after "connect to " clause.

 2) From "local" site, start an sqlplus session. From this session, start a remote session using same dblink using a simple select with dblink :
        	select count(*) from dual@dblink;
    Leave this session open.

 3)On the "remote" site, find out the session id of the session created by 
    above mentioned dblink :
    	select sid, username, machine from v$session;
        MACHINE column will help to identify the SID.

In case of multiple outputs with same username,machine combination, use the output from step1 to identify the new session created.
    
    And, using SID, get the Process ID of the problem session from the 
    V$PROCESS:
    	 SELECT pid FROM v$process
    	 WHERE addr =
    		        (SELECT paddr FROM v$session
    		         WHERE  sid = sid_of_problem_session);
    
 4) Start tracing on remote site using PID obtained above :
    	    svrmgr> oradebug setorapid
    	    svrmgr> oradebug unlimit
    	    svrmgr> oradebug event 10046 trace name context forever, level 12
    
      
On the local site from the same session :
    Execute the Procedure / query involving dblink.



返回页首返回页首

来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/38267/viewspace-743191/,如需转载,请注明出处,否则将追究法律责任。

请登录后发表评论 登录
全部评论

注册时间:2011-03-29

  • 博文量
    194
  • 访问量
    626395