Oracle動態效能檢視學習筆記(7)_v$session
Oracle動態效能檢視學習筆記(7)_v$session
目錄
參考文件<>Chapter 24
##################################################################
1 Overview
##################################################################
This view has one row for every session connected to the database instance.
The sessions include user sessions, as well as background processes.
v$session is basically an information view used for finding the SID or SADDR of a user.
##################################################################
2 Userful Columns for v$session
##################################################################
1) STATUS:
Active: executing a SQL statement(waiting for/ using a resource)
正在執行語句,可能在等待或使用資源
Inactive: waiting for more work(???)
Killed: marked to be killed.
被標誌為killed
2) SID: Session identifier.
3) SERIAL#: Counter, which is incremented each time a SID is reused by another session.
(When a session ends and another session starts and uses the same SID)
會話重用次數?不是。
SQL> select sid from v$mystat where rownum =1;
SID
----------
26
SQL> select sid, serial# from v$session where sid=26;
SID SERIAL#
---------- ----------
26 442
SQL> disc
Not logged on
SQL> conn gzdc/gzdc2009@testdb
Connected to Oracle9i Enterprise Edition Release 9.2.0.8.0
Connected as gzdc
SQL> select sid, serial# from v$session where sid=26;
SID SERIAL#
---------- ----------
26 444
SQL> select sid, serial# from v$session where sid=26;
SID SERIAL#
---------- ----------
26 444
SQL> disc
Not logged on
SQL> conn gzdc/gzdc2009@testdb
Connected to Oracle9i Enterprise Edition Release 9.2.0.8.0
Connected as gzdc
SQL> select sid, serial# from v$session where sid=26;
SID SERIAL#
---------- ----------
26 450
只是一個標識數。
4) AUDSID: Auditing session ID uniquely identifies a session over the life of a database.
It si also useful when finding the parallel query slaves for a query coordinator.(during the PQ execution they have
the same AUDSID)
審計會話ID,在整個資料庫的生命週期中有唯一性,同一個並行程式的幾個會話具有相同的AUDSID.
5) USERNAME: The Oracle user name for the connected session
Client Information
1) OSUSER: Operating system user name for the client process.
客戶端的作業系統使用者名稱
2) MACHINE: Machine where the client process is executing
3) TERMINAL: Terminal where the client process is running
4) PROCESS: Process ID of the client process(pid:ppid)
客戶端父子程式ID號
5) PROGRAM: Client program being executed by the client process
客戶端程式名
##################################################################
3 Join Columns for v$session
##################################################################
1) v$session.sid = v$session_wait.sid, v$sesstat.sid, v$lock.sid, v$session_event.sid, v$open_cursor.sid
2) v$session.sql_hash_value = v$sqltext.hash_value, v$sqlarea.hash_value, v$sql.hash_value;
3) v$session.sql_address = v$sqltext.address, v$sqlarea.address, v$sql.address;
4) v$session.taddr = v$transaction.addr
5) v$session.paddr = v$process.addr
##################################################################
4 示例
##################################################################
1) Finding Your Session
SELECT SID, OSUSER, USERNAME, MACHINE, PROCESS FROM V$SESSION WHERE audsid = userenv('SESSIONID');
2) Finding a Session When the Machine Is Known
SELECT SID, OSUSER, USERNAME, MACHINE, TERMINAL FROM V$SESSION WHERE machine like 'WORKGROUP\MOUSE-PC%';
SQL中如何轉義/,
不需要轉義。
當欄位中包含%時。
select * from procedure_log where errmsg like 'xxx\%xxx' escape '\';
##################################################################
4 問題
##################################################################
目錄
參考文件<
##################################################################
1 Overview
##################################################################
This view has one row for every session connected to the database instance.
The sessions include user sessions, as well as background processes.
v$session is basically an information view used for finding the SID or SADDR of a user.
##################################################################
2 Userful Columns for v$session
##################################################################
1) STATUS:
Active: executing a SQL statement(waiting for/ using a resource)
正在執行語句,可能在等待或使用資源
Inactive: waiting for more work(???)
Killed: marked to be killed.
被標誌為killed
2) SID: Session identifier.
3) SERIAL#: Counter, which is incremented each time a SID is reused by another session.
(When a session ends and another session starts and uses the same SID)
會話重用次數?不是。
SQL> select sid from v$mystat where rownum =1;
SID
----------
26
SQL> select sid, serial# from v$session where sid=26;
SID SERIAL#
---------- ----------
26 442
SQL> disc
Not logged on
SQL> conn gzdc/gzdc2009@testdb
Connected to Oracle9i Enterprise Edition Release 9.2.0.8.0
Connected as gzdc
SQL> select sid, serial# from v$session where sid=26;
SID SERIAL#
---------- ----------
26 444
SQL> select sid, serial# from v$session where sid=26;
SID SERIAL#
---------- ----------
26 444
SQL> disc
Not logged on
SQL> conn gzdc/gzdc2009@testdb
Connected to Oracle9i Enterprise Edition Release 9.2.0.8.0
Connected as gzdc
SQL> select sid, serial# from v$session where sid=26;
SID SERIAL#
---------- ----------
26 450
只是一個標識數。
4) AUDSID: Auditing session ID uniquely identifies a session over the life of a database.
It si also useful when finding the parallel query slaves for a query coordinator.(during the PQ execution they have
the same AUDSID)
審計會話ID,在整個資料庫的生命週期中有唯一性,同一個並行程式的幾個會話具有相同的AUDSID.
5) USERNAME: The Oracle user name for the connected session
Client Information
1) OSUSER: Operating system user name for the client process.
客戶端的作業系統使用者名稱
2) MACHINE: Machine where the client process is executing
3) TERMINAL: Terminal where the client process is running
4) PROCESS: Process ID of the client process(pid:ppid)
客戶端父子程式ID號
5) PROGRAM: Client program being executed by the client process
客戶端程式名
##################################################################
3 Join Columns for v$session
##################################################################
1) v$session.sid = v$session_wait.sid, v$sesstat.sid, v$lock.sid, v$session_event.sid, v$open_cursor.sid
2) v$session.sql_hash_value = v$sqltext.hash_value, v$sqlarea.hash_value, v$sql.hash_value;
3) v$session.sql_address = v$sqltext.address, v$sqlarea.address, v$sql.address;
4) v$session.taddr = v$transaction.addr
5) v$session.paddr = v$process.addr
##################################################################
4 示例
##################################################################
1) Finding Your Session
SELECT SID, OSUSER, USERNAME, MACHINE, PROCESS FROM V$SESSION WHERE audsid = userenv('SESSIONID');
2) Finding a Session When the Machine Is Known
SELECT SID, OSUSER, USERNAME, MACHINE, TERMINAL FROM V$SESSION WHERE machine like 'WORKGROUP\MOUSE-PC%';
SQL中如何轉義/,
不需要轉義。
當欄位中包含%時。
select * from procedure_log where errmsg like 'xxx\%xxx' escape '\';
##################################################################
4 問題
##################################################################
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/10248702/viewspace-669518/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- 動態規劃學習筆記動態規劃筆記
- iOS學習筆記04 檢視切換iOS筆記
- 8.1關於動態效能檢視
- oracle學習筆記(十四) 資料庫物件 索引 檢視 序列 同義詞Oracle筆記資料庫物件索引
- [20211019]V$DETACHED_SESSION檢視.txtSession
- Oracle高階培訓 第7課 學習筆記Oracle筆記
- 檢視提交歷史 —— Git 學習筆記 11Git筆記
- Echarts檢視視覺化-學習筆記(努力更新中)Echarts視覺化筆記
- oracle學習筆記《一》Oracle筆記
- db2常用動態效能檢視DB2
- V$ACTIVE_SESSION_HISTORY檢視的使用Session
- Python學習筆記6——動態型別Python筆記型別
- java反射之動態代理學習筆記Java反射筆記
- Solidity語言學習筆記————27、檢視函式Solid筆記函式
- Adaptive AUTOSAR 學習筆記 5 - 架構 - 物理檢視APT筆記架構
- [20211214]檢視檢視V$ACTIVE_SESSION_HISTORY遇到奇怪問題.txtSession
- Tensorflow學習筆記No.7筆記
- Adaptive AUTOSAR 學習筆記 4 - 架構 - 邏輯檢視APT筆記架構
- 動態dp複習筆記筆記
- Oracle學習筆記(6)——函式Oracle筆記函式
- [20221130]測試訪問檢視v$session幾種情況的效能差異.txtSession
- Tomcat學習筆記—-本地部署servlet動態資源Tomcat筆記Servlet
- Google Protocol buffer 學習筆記.下篇-動態編譯GoProtocol筆記編譯
- “平板電視”學習筆記筆記
- [學習筆記 #7] Link Cut Tree筆記
- G01學習筆記-7筆記
- (重要)關於效能的幾個主要動態檢視
- React學習筆記-State(狀態)React筆記
- Oracle檢視已被使用的open_cursors&session_cached_cursorsOracleSession
- Oracle體系結構學習筆記Oracle筆記
- [python學習手冊-筆記]004.動態型別Python筆記型別
- MYSQL學習筆記7: 聚合函式MySql筆記函式
- oracle學習筆記(十一) 高階查詢Oracle筆記
- MySQL筆記 13 檢視MySql筆記
- Solidity語言學習筆記————14、動態位元組陣列Solid筆記陣列
- 高效能運算學習筆記(1)筆記
- [高效能MYSQL學習筆記]事務MySql筆記
- OpenCV學習筆記-Harris角點檢測OpenCV筆記
- 比特幣學習筆記——————7、區塊鏈比特幣筆記區塊鏈