首页 > 数据库 > Oracle > 笔记:查看oracle进程情况


Oracle 作者:bsy198411 时间:2011-11-02 09:16:30 0 删除 编辑

SELECT a.VALUE|| b.symbol|| c.instance_name|| '_ora_' || d.spid|| '.trc' trace_file
fROM (SELECT VALUE FROM v$parameter WHERE NAME = 'user_dump_dest') a,
     (SELECT SUBSTR (VALUE, -6, 1) symbol
      FROM   v$parameter WHERE NAME = 'user_dump_dest') b,
      (SELECT instance_name FROM v$instance) c,
      (SELECT spid FROM v$session s, v$process p, v$mystat m
      WHERE s.paddr= p.addr AND s.SID = m.SID AND m.statistic# = 0) d ;



select * from v$mystat;
select * from v$process;
select * from v$session;


SQL> desc v$session
Name                    Type         Nullable Default Comments
----------------------- ------------ -------- ------- --------
SADDR                   RAW(4)                             
SID                     NUMBER                             
SERIAL#                 NUMBER                             
AUDSID                  NUMBER                             
PADDR                   RAW(4)                             
USER#                   NUMBER                             
USERNAME                VARCHAR2(30) Y                        
COMMAND                 NUMBER                             
OWNERID                 NUMBER                             
TADDR                   VARCHAR2(8)                        
LOCKWAIT                VARCHAR2(8)                        
STATUS                  VARCHAR2(8)                        
SERVER                  VARCHAR2(9)                        
SCHEMA#                 NUMBER                             
SCHEMANAME              VARCHAR2(30) Y                        
OSUSER                  VARCHAR2(30) Y                        
PROCESS                 VARCHAR2(12) Y                        
MACHINE                 VARCHAR2(64) Y                        
TERMINAL                VARCHAR2(16) Y                        
PROGRAM                 VARCHAR2(64) Y                        
TYPE                    VARCHAR2(10) Y                        
SQL_ADDRESS             RAW(4)                             
SQL_HASH_VALUE          NUMBER                             
SQL_ID                  VARCHAR2(13) Y                        
SQL_CHILD_NUMBER        NUMBER                             
PREV_SQL_ADDR           RAW(4)                             
PREV_HASH_VALUE         NUMBER                             
PREV_SQL_ID             VARCHAR2(13) Y                        
PREV_CHILD_NUMBER       NUMBER                             
MODULE                  VARCHAR2(48) Y                        
MODULE_HASH             NUMBER                             
ACTION                  VARCHAR2(32) Y                        
ACTION_HASH             NUMBER                             
CLIENT_INFO             VARCHAR2(64) Y                        
FIXED_TABLE_SEQUENCE    NUMBER                             
ROW_WAIT_OBJ#           NUMBER                             
ROW_WAIT_FILE#          NUMBER                             
ROW_WAIT_BLOCK#         NUMBER                             
ROW_WAIT_ROW#           NUMBER                             
LOGON_TIME              DATE                               
LAST_CALL_ET            NUMBER                             
PDML_ENABLED            VARCHAR2(3)                        
FAILOVER_TYPE           VARCHAR2(13) Y                        
FAILOVER_METHOD         VARCHAR2(10) Y                        
FAILED_OVER             VARCHAR2(3)                        
RESOURCE_CONSUMER_GROUP VARCHAR2(32) Y                        
PDML_STATUS             VARCHAR2(8)                        
PDDL_STATUS             VARCHAR2(8)                        
PQ_STATUS               VARCHAR2(8)                        
CURRENT_QUEUE_DURATION  NUMBER                             
CLIENT_IDENTIFIER       VARCHAR2(64) Y                        
BLOCKING_SESSION_STATUS VARCHAR2(11) Y                        
BLOCKING_INSTANCE       NUMBER                             
BLOCKING_SESSION        NUMBER                             
SEQ#                    NUMBER                             
EVENT#                  NUMBER                             
EVENT                   VARCHAR2(64) Y                        
P1TEXT                  VARCHAR2(64) Y                        
P1                      NUMBER                             
P1RAW                   RAW(4)                             
P2TEXT                  VARCHAR2(64) Y                        
P2                      NUMBER                             
P2RAW                   RAW(4)                             
P3TEXT                  VARCHAR2(64) Y                        
P3                      NUMBER                             
P3RAW                   RAW(4)                             
WAIT_CLASS_ID           NUMBER                             
WAIT_CLASS#             NUMBER                             
WAIT_CLASS              VARCHAR2(64) Y                        
WAIT_TIME               NUMBER                             
SECONDS_IN_WAIT         NUMBER                             
STATE                   VARCHAR2(19) Y                        
SERVICE_NAME            VARCHAR2(64) Y                        
SQL_TRACE               VARCHAR2(8)                        
SQL_TRACE_WAITS         VARCHAR2(5)                        
SQL_TRACE_BINDS         VARCHAR2(5)                        
SQL> desc v$process;
Name             Type          Nullable Default Comments
---------------- ------------- -------- ------- --------
ADDR             RAW(4)                              
PID              NUMBER                              
SPID             VARCHAR2(12)                        
USERNAME         VARCHAR2(15)                        
SERIAL#          NUMBER                              
TERMINAL         VARCHAR2(16)                        
PROGRAM          VARCHAR2(64)                        
TRACEID          VARCHAR2(255) Y                        
BACKGROUND       VARCHAR2(1)                         
LATCHWAIT        VARCHAR2(8)                         
LATCHSPIN        VARCHAR2(8)                         
PGA_USED_MEM     NUMBER                              
PGA_ALLOC_MEM    NUMBER                              
PGA_FREEABLE_MEM NUMBER                              
PGA_MAX_MEM      NUMBER                              
SQL> desc v$mystat
Name       Type   Nullable Default Comments
---------- ------ -------- ------- --------
SID        NUMBER Y                        
STATISTIC# NUMBER Y                        
VALUE      NUMBER Y                        
SQL> desc v$process_memory
Name          Type         Nullable Default Comments
------------- ------------ -------- ------- --------
PID           NUMBER                             
SERIAL#       NUMBER                             
CATEGORY      VARCHAR2(15) Y                        
ALLOCATED     NUMBER                             
USED          NUMBER                             
MAX_ALLOCATED NUMBER                             

<!-- 正文结束 -->

来自 “ ITPUB博客 ” ,链接:,如需转载,请注明出处,否则将追究法律责任。

上一篇: 没有了~
下一篇: 没有了~
请登录后发表评论 登录