Oracle

게시글 보기
작성자 유건데이타 등록일 2015-05-16
제목 performance monitor 에서 thread list 에서 oracle 관련 thread
create user util_schema identified by util_schema
default tablespace user_data
temporary tablespace temporary_data;
grant connect, resource to util_schema;
grant select any table to util_schema with admin option;
grant create public synonym to util_schema;
grant drop public synonym to util_schema;

connect util_schema/util_schema
@Lang_Integer.sql /* Create the hex utility package. */
drop public synonym Lang_Integer;
create public synonym Lang_Integer for util_schema.Lang_Integer;

/*****************************************************************************
This view lists the Oracle thread names (NAME column), with
corresponding NT thread IDs (ID_THREAD), as measured by the
ID Thread counter of the Thread object in the Windows NT
Performance Monitor. Note the ID is the ID Thread counter,
which is NOT the number you will see in the "Instance" list
of the "Add to Chart" dialog of NT Performance Monitor.
In the Instance list you will see entries like "ORACLE73 ==> n",
but this n is not the thread id. You must actually add a chart
line for counter "ID Thread" and observe the value of the counter,
then match the number to the ID_THREAD column of the NT_THREADS
view.

The other columns of this view give typical V$SESSION information.
Add/delete/modify the select list to your liking. (The crucial
query is: SELECT SPID, NAME FROM V$PROCESS, V$BGPROCESS WHERE PADDR=ADDR;)
*****************************************************************************/
create or replace view nt_threads as
select Lang_Integer.parseInt(p.spid, 16) "ID_THREAD",
p.background "BACKGROUND",
b.name "NAME",
s.sid "SID",
s.serial# "SERIAL#",
s.username "USERNAME",
s.status "STATUS",
s.osuser "OSUSER",
s.program "PROGRAM"
from v$process p, v$bgprocess b, v$session s
where s.paddr = p.addr and b.paddr(+) = p.addr;
grant select on nt_threads to dba; /* only DBAs can query this view */
drop public synonym nt_threads;
create public synonym nt_threads for util_schema.nt_threads;

connect internal
revoke connect, resource from util_schema;
revoke create public synonym from util_schema;
revoke drop public synonym from util_schema;
Comment
등록된 코멘트가 없습니다.