【KSDWRT】自發在ALERT檔案或TRACE檔案中留“腳印”
使用sys.dbms_system.ksdwrt儲存過程可以實現主動向alert或trace檔案中記錄資訊的功能。簡單記錄一下,供參考。
1.先看一下向alert檔案中寫資訊的功能
1)使用引數“2”實現向alert檔案中記錄資訊
sys@ora10g> execute sys.dbms_system.ksdwrt(2,'Secooler marked here at '||to_char(sysdate,'yyyy-mm-dd hh24:mi:ss'));
PL/SQL procedure successfully completed.
2)檢視alert檔案,會發現如下兩條資訊,第一條是系統自動記錄的時間,第二條就是我悄悄做的mark。
Thu Dec 17 21:24:41 2009
Secooler marked here at 2009-12-17 21:24:41
2.再看一下向trace檔案中寫資訊的功能
1)使用引數“1”實現向trace檔案中記錄資訊
sys@ora10g> execute sys.dbms_system.ksdwrt(1,'Secooler marked here at '||to_char(sysdate,'yyyy-mm-dd hh24:mi:ss'));
PL/SQL procedure successfully completed.
2)此時會自動建立一個trace檔案,並在trace檔案中看到我們寫入的資訊。
sys@ora10g> ed /oracle/app/oracle/admin/ora10g/udump/ora10g_ora_3634.trc
/oracle/app/oracle/admin/ora10g/udump/ora10g_ora_3634.trc
Oracle Database 10g Enterprise Edition Release 10.2.0.3.0 - 64bit Production
With the Partitioning, Oracle Label Security, OLAP and Data Mining Scoring Engine options
ORACLE_HOME = /oracle/app/oracle/product/10.2.0/db_1
System name: Linux
Node name: asdlabdb01
Release: 2.6.18-128.el5
Version: #1 SMP Wed Dec 17 11:41:38 EST 2008
Machine: x86_64
Instance name: ora10g
Redo thread mounted by this instance: 1
Oracle process number: 14
Unix process pid: 3634, image: oracle@asdlabdb01 (TNS V1-V3)
*** 2009-12-17 21:28:51.050
*** SERVICE NAME:(SYS$USERS) 2009-12-17 21:28:51.050
*** SESSION ID:(513.163) 2009-12-17 21:28:51.050
Secooler marked here at 2009-12-17 21:28:51
~
~
3.該儲存過程可以同時向alert檔案和trace檔案寫入資訊
1)使用引數“3”便可以實現同時向alert和trace檔案中記錄資訊
sys@ora10g> execute sys.dbms_system.ksdwrt(3,'Secooler marked here at '||to_char(sysdate,'yyyy-mm-dd hh24:mi:ss'));
PL/SQL procedure successfully completed.
2)檢視在alert檔案中記錄的資訊
Thu Dec 17 21:30:08 2009
Secooler marked here at 2009-12-17 21:30:08
3)檢視在trace檔案中記錄的資訊
*** 2009-12-17 21:30:08.067
Secooler marked here at 2009-12-17 21:30:08
4.小結
如果對系統的某繫緊急事件需要向alert或trace檔案輸出的話,這是一個很好的途徑。
sys.dbms_system.ksdwrt儲存過程中DEST有三個可用值:
PROCEDURE KSDWRT
Argument Name Type In/Out Default?
------------------------------ ----------------------- ------ --------
DEST BINARY_INTEGER IN
TST VARCHAR2 IN
“1”:向trace檔案中寫入資訊;
“2”:向alert檔案中寫入資訊:
“3”:同時向trace和alert檔案中寫入資訊。
Good luck.
secooler
09.12.17
-- The End --
1.先看一下向alert檔案中寫資訊的功能
1)使用引數“2”實現向alert檔案中記錄資訊
sys@ora10g> execute sys.dbms_system.ksdwrt(2,'Secooler marked here at '||to_char(sysdate,'yyyy-mm-dd hh24:mi:ss'));
PL/SQL procedure successfully completed.
2)檢視alert檔案,會發現如下兩條資訊,第一條是系統自動記錄的時間,第二條就是我悄悄做的mark。
Thu Dec 17 21:24:41 2009
Secooler marked here at 2009-12-17 21:24:41
2.再看一下向trace檔案中寫資訊的功能
1)使用引數“1”實現向trace檔案中記錄資訊
sys@ora10g> execute sys.dbms_system.ksdwrt(1,'Secooler marked here at '||to_char(sysdate,'yyyy-mm-dd hh24:mi:ss'));
PL/SQL procedure successfully completed.
2)此時會自動建立一個trace檔案,並在trace檔案中看到我們寫入的資訊。
sys@ora10g> ed /oracle/app/oracle/admin/ora10g/udump/ora10g_ora_3634.trc
/oracle/app/oracle/admin/ora10g/udump/ora10g_ora_3634.trc
Oracle Database 10g Enterprise Edition Release 10.2.0.3.0 - 64bit Production
With the Partitioning, Oracle Label Security, OLAP and Data Mining Scoring Engine options
ORACLE_HOME = /oracle/app/oracle/product/10.2.0/db_1
System name: Linux
Node name: asdlabdb01
Release: 2.6.18-128.el5
Version: #1 SMP Wed Dec 17 11:41:38 EST 2008
Machine: x86_64
Instance name: ora10g
Redo thread mounted by this instance: 1
Oracle process number: 14
Unix process pid: 3634, image: oracle@asdlabdb01 (TNS V1-V3)
*** 2009-12-17 21:28:51.050
*** SERVICE NAME:(SYS$USERS) 2009-12-17 21:28:51.050
*** SESSION ID:(513.163) 2009-12-17 21:28:51.050
Secooler marked here at 2009-12-17 21:28:51
~
~
3.該儲存過程可以同時向alert檔案和trace檔案寫入資訊
1)使用引數“3”便可以實現同時向alert和trace檔案中記錄資訊
sys@ora10g> execute sys.dbms_system.ksdwrt(3,'Secooler marked here at '||to_char(sysdate,'yyyy-mm-dd hh24:mi:ss'));
PL/SQL procedure successfully completed.
2)檢視在alert檔案中記錄的資訊
Thu Dec 17 21:30:08 2009
Secooler marked here at 2009-12-17 21:30:08
3)檢視在trace檔案中記錄的資訊
*** 2009-12-17 21:30:08.067
Secooler marked here at 2009-12-17 21:30:08
4.小結
如果對系統的某繫緊急事件需要向alert或trace檔案輸出的話,這是一個很好的途徑。
sys.dbms_system.ksdwrt儲存過程中DEST有三個可用值:
PROCEDURE KSDWRT
Argument Name Type In/Out Default?
------------------------------ ----------------------- ------ --------
DEST BINARY_INTEGER IN
TST VARCHAR2 IN
“1”:向trace檔案中寫入資訊;
“2”:向alert檔案中寫入資訊:
“3”:同時向trace和alert檔案中寫入資訊。
Good luck.
secooler
09.12.17
-- The End --
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/519536/viewspace-622766/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- Oracle清理trace、alert、aud、listener.log檔案Oracle
- oracle清理trace、alert、aud、listener等日誌檔案Oracle
- 反單引號在vue檔案的alert中怎麼換行Vue
- 如何清理Mac系統中殘留的檔案和快取檔案Mac快取
- ar——建立或修改備存檔案,或是從備存檔案中抽取檔案
- 在Linux中,如何進行備份或歸檔檔案(tar 命令)?Linux
- 在silverlight中利用socket傳送圖片或檔案
- [20200225]alert檔案亂碼問題.txt
- [20200429]記錄不成功的登入在alert檔案.txt
- 重新命名vue檔案後ts爆紅。檔案xxx不在專案xxx的檔案列表中。專案必須列出所有檔案,或使用 "include" 模式。Vue模式
- 從Matlab到FPGA(Matlab生成coe檔案或mem檔案)MatlabFPGA
- [20220826]顯示alert日誌檔案全路徑.txt
- 在 Linux 中如何歸檔檔案和目錄Linux
- VS 開啟程式碼檔案時,在解決方案中自動定位到對應檔案位置
- 在 Linux 中如何移動檔案Linux
- 在blender中開啟pmx檔案
- nodejs命令列利用模板生成檔案腳手架開發NodeJS命令列
- nodejs獲取檔案資訊,判斷是檔案或目錄NodeJS
- 運用Log和Trace檔案排除Oracle Net問題Oracle
- 分析及格式化trace檔案 - TKPROF (Transient Kernel Profiler)
- BT自動檔案分發系統
- 軟體登錄檔殘留怎樣清理_win10刪除登錄檔殘留檔案的方法Win10
- vue 腳手架 配置 及檔案介紹Vue
- 在檔案中夾雜其他資訊
- ASM有自己的引數、密碼、alert、監聽檔案ASM密碼
- mv 命令 – 移動或改名檔案
- 在Ubuntu檔案管理器中檢視隱藏檔案和資料夾Ubuntu
- oracle ebs 根據請求id找到對應trace 檔案Oracle
- 檔案流下載檔案,zip/其他格式檔案
- springboot專案中yaml檔案Spring BootYAML
- Python科研武器庫 - 檔案/路徑操作 - 判斷檔案或資料夾Python
- 在 Linux 中如何刪除檔案中的空行Linux
- 在Oracle中,如何定時刪除歸檔日誌檔案?Oracle
- Playwright使用Typescript實現在測試case檔案中呼叫另一個檔案中的方法TypeScript
- vue-cli腳手架中webpack配置基礎檔案詳解VueWeb
- 02@在類的標頭檔案中儘量少引入其他標頭檔案
- 在NodeJS中操作檔案常見的APINodeJSAPI
- 說說在 Python 中,如何寫入檔案Python
- [譯] 在 UNIX 中,一切皆檔案