[20191221]12c查詢跟蹤檔案內容.txt
[20191221]12c查詢跟蹤檔案內容.txt
--//12cR2下查詢跟蹤檔案內容,可以透過檢視V$DIAG_TRACE_FILE定位檔案.使用V$DIAG_TRACE_FILE_CONTENTS檢視跟蹤檔案內容.
--//透過簡單的例子說明問題:
1.環境:
SYS@xxxxxx:1521/orcl> select BANNER from v$version;
BANNER
----------------------------------------------------------------------
Oracle Database 18c Enterprise Edition Release 18.0.0.0.0 - Production
--//18c一樣可以演示.
SYS@xxxxxx:1521/orcl> @ spid
SID SERIAL# PROCESS SERVER SPID PID P_SERIAL# C50
---------- ---------- ------- ------------------ ------ ------- ---------- --------------------------------------------------
17 58402 16889 DEDICATED 21820 88 8797 alter system kill session '17,58402' immediate;
SYS@xxxxxx:1521/orcl> @ P
INST_ID NAME VALUE CON_ID
---------- -------------------- -------------------------------------------------------------------------------------- ----------
1 Default Trace File /u01/app/oracle/diag/rdbms/orclcdb/orclcdb/trace/orclcdb_ora_21820.trc 0
2.測試:
SYS@xxxxxx:1521/orcl> @ 10046on 12
Session altered.
SYS@xxxxxx:1521/orcl> select SysDate from dual ;
SYSDATE
-------------------
2019-02-21 15:50:45
SYS@xxxxxx:1521/orcl> @ 10046off
Session altered.
SYS@xxxxxx:1521/orcl> select adr_home,trace_filename,change_time from v$diag_trace_file order by change_time desc fetch first 5 rows only;
ADR_HOME TRACE_FILENAME CHANGE_TIME
------------------------------------------ ----------------------- ------------------------------
/u01/app/oracle/diag/rdbms/orclcdb/orclcdb orclcdb_ora_21820.trc 2019-02-21 15:51:24.000 +08:00
/u01/app/oracle/diag/rdbms/orclcdb/orclcdb orclcdb_cjq0_8994.trc 2019-02-21 10:00:00.000 +08:00
/u01/app/oracle/diag/rdbms/orclcdb/orclcdb orclcdb_j000_27096.trc 2019-02-21 06:00:01.000 +08:00
/u01/app/oracle/diag/rdbms/orclcdb/orclcdb orclcdb_j000_12208.trc 2019-02-20 06:00:02.000 +08:00
/u01/app/oracle/diag/rdbms/orclcdb/orclcdb orclcdb_j000_29061.trc 2019-02-19 06:00:02.000 +08:00
--//可以看出倒排序第1個就是當前生成的跟蹤檔案.以前必須要到後臺檢視跟蹤檔案內容.現在不需要,僅僅查詢檢視:
SYS@xxxxxx:1521/orcl> select payload c140 from V$DIAG_TRACE_FILE_CONTENTS where ADR_HOME='/u01/app/oracle/diag/rdbms/orclcdb/orclcdb' and trace_filename='orclcdb_ora_21820.trc';
C140
---------------------------------------------------------------------------------
Trace file /u01/app/oracle/diag/rdbms/orclcdb/orclcdb/trace/orclcdb_ora_21820.trc
Oracle Database 18c Enterprise Edition Release 18.0.0.0.0 - Production
Version 18.3.0.0.0
Build label: RDBMS_18.1.0.0.0_LINUX.X64_180103.1
ORACLE_HOME: /u01/app/oracle/product/18.0.0/db_home
System name: Linux
Node name: hosp2
Release: 4.1.12-112.16.4.el7uek.x86_64
Version: #2 SMP Mon Mar 12 23:57:12 PDT 2018
Machine: x86_64
Instance name: orclcdb
Redo thread mounted by this instance: 1
Oracle process number: 88
Unix process pid: 21820, image: oracle@hosp2
*** 2019-02-21T15:50:32.810834+08:00 (ORCL(3))
*** SESSION ID:(17.58402) 2019-02-21T15:50:32.810867+08:00
*** CLIENT ID:() 2019-02-21T15:50:32.810873+08:00
*** SERVICE NAME:(orcl) 2019-02-21T15:50:32.810878+08:00
*** MODULE NAME:(sqlplus@gxqyydg4 (TNS V1-V3)) 2019-02-21T15:50:32.810883+08:00
*** ACTION NAME:() 2019-02-21T15:50:32.810888+08:00
*** CLIENT DRIVER:(SQL*PLUS ) 2019-02-21T15:50:32.810893+08:00
*** CONTAINER ID:(3) 2019-02-21T15:50:32.810898+08:00
WAIT #140040343033784: nam='Disk file operations I/O' ela= 58 FileOperation=8 fileno=0 filetype=8 obj#=-1 tim=8577113998376
WAIT #140040343033784: nam='SQL*Net message to client' ela= 1 driver id=1413697536 #bytes=1 p3=0 obj#=-1 tim=8577113999258
*** 2019-02-21T15:50:45.145102+08:00 (ORCL(3))
WAIT #140040343033784: nam='SQL*Net message from client' ela= 12334057 driver id=1413697536 #bytes=1 p3=0 obj#=-1 tim=8577126333336
CLOSE #140040343033784:c=8,e=8,dep=0,type=1,tim=8577126333446
=====================
PARSING IN CURSOR #140040317036936 len=25 dep=0 uid=0 oct=3 lid=0 tim=8577126334502 hv=297459922 ad='28a91d140' sqlid='6p3a1sn8vps6k'
select SysDate from dual
~~~~~~~~~~->我執行的命令
END OF STMT
PARSE #140040317036936:c=752,e=1021,p=0,cr=0,cu=0,mis=1,r=0,dep=0,og=1,plh=1388734953,tim=8577126334501
EXEC #140040317036936:c=30,e=30,p=0,cr=0,cu=0,mis=0,r=0,dep=0,og=1,plh=1388734953,tim=8577126334592
WAIT #140040317036936: nam='Disk file operations I/O' ela= 23 FileOperation=8 fileno=0 filetype=8 obj#=-1 tim=8577126334640
WAIT #140040317036936: nam='SQL*Net message to client' ela= 1 driver id=1413697536 #bytes=1 p3=0 obj#=-1 tim=8577126334678
FETCH #140040317036936:c=10,e=10,p=0,cr=0,cu=0,mis=0,r=1,dep=0,og=1,plh=1388734953,tim=8577126334711
STAT #140040317036936 id=1 cnt=1 pid=0 pos=1 obj=0 op='FAST DUAL (cr=0 pr=0 pw=0 str=1 time=1 us cost=2 size=0 card=1)'
WAIT #140040317036936: nam='SQL*Net message from client' ela= 701 driver id=1413697536 #bytes=1 p3=0 obj#=-1 tim=8577126335497
FETCH #140040317036936:c=0,e=1,p=0,cr=0,cu=0,mis=0,r=0,dep=0,og=0,plh=1388734953,tim=8577126335528
WAIT #140040317036936: nam='SQL*Net message to client' ela= 1 driver id=1413697536 #bytes=1 p3=0 obj#=-1 tim=8577126335544
*** 2019-02-21T15:51:24.601851+08:00 (ORCL(3))
WAIT #140040317036936: nam='SQL*Net message from client' ela= 39454527 driver id=1413697536 #bytes=1 p3=0 obj#=-1 tim=8577165790081
CLOSE #140040317036936:c=10,e=10,dep=0,type=0,tim=8577165790222
=====================
PARSING IN CURSOR #140040317036936 len=55 dep=0 uid=0 oct=42 lid=0 tim=8577165790435 hv=2217940283 ad='0' sqlid='06nvwn223659v'
alter session set events '10046 trace name context off'
END OF STMT
PARSE #140040317036936:c=150,e=149,p=0,cr=0,cu=0,mis=0,r=0,dep=0,og=0,plh=0,tim=8577165790434
EXEC #140040317036936:c=332,e=333,p=0,cr=0,cu=0,mis=0,r=0,dep=0,og=0,plh=0,tim=8577165790817
51 rows selected.
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/267265/viewspace-2636592/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- 檔案批次查詢複製匯出,按檔名批次查詢檔案,按檔案內容批次查詢檔案
- centos vim怎麼查詢檔案內容CentOS
- [20200818]12c 10046跟蹤時間戳.txt時間戳
- Java對txt檔案內容的增刪該查操作Java
- Centos7 中查詢檔案、目錄、內容CentOS
- [20200818]12c 10046跟蹤時間戳2.txt時間戳
- [20211227]抽取跟蹤檔案中的繫結變數值.txt變數
- [20210819]給檔案內容編行號.txt
- Git跟蹤與提交檔案Git
- .gitignore忽略跟蹤指定檔案Git
- 在Linux中,如何使用grep命令查詢檔案中的內容?Linux
- java檔案相關(檔案追加內容、檔案內容清空、檔案內容讀取)Java
- git刪除未跟蹤檔案Git
- git列出跟蹤的檔案列表Git
- git clean清除未跟蹤檔案Git
- [20190402]跟蹤vmstat.txt
- LIUNUX如何擷取txt檔案中的內容,並建立新檔案UX
- [20230308]12c以上版本模糊查詢問題.txt
- git列出所有已經跟蹤檔案Git
- 轉:使用 Tkprof 分析 ORACLE 跟蹤檔案Oracle
- [20210603]如何跟蹤索引分裂.txt索引
- 檔案查詢
- 如何使用Rust查詢目錄中的所有 txt 檔案?Rust
- 如何在 Git 中取消檔案的跟蹤Git
- [20231025]跟蹤rename操作2.txt
- 呼叫鏈與日誌的關聯式跟蹤查詢
- oracle查詢語句查詢增加一列內容Oracle
- Linux 檔案查詢Linux
- 檔案查詢命令
- 拼多多商家批次查詢跟蹤快遞的簡單教程
- 檔案內容比較
- [20190401]跟蹤dbms_lock.sleep呼叫.txt
- [20211013]閱讀ldd原始碼跟蹤.txt原始碼
- vim內替換檔案內容
- Linux查詢大檔案Linux
- [20181031]12c 線上移動資料檔案.txt
- [20190917]oracle跟蹤事件簡單寫法.txtOracle事件
- [20210220]gdb跟蹤邏輯讀2.txt