[20210723]adrci show 'No ADR base is set' 解決辦法.txt
[20210723]adrci show 'No ADR base is set' 解決辦法.txt
--//在自己的測試環境下模擬測試.參考連結
$ xxd -c 16 $ORACLE_HOME/log/diag/adrci_dir.mif
0000000: 2f75 3031 2f61 7070 2f6f 7261 636c 6500 /u01/app/oracle.
--//注意這個檔案相當奇特,實際上最後的字元是00.沒有回車換行之類的字元.
$ cat -vs $ORACLE_HOME/log/diag/adrci_dir.mif ; echo
/u01/app/oracle^@
1.環境:
SCOTT@book> @ ver1
PORT_STRING VERSION BANNER
------------------------------ -------------- --------------------------------------------------------------------------------
x86_64/Linux 2.4.xx 11.2.0.4.0 Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production
$ mv $ORACLE_HOME/log/diag/adrci_dir.mif $ORACLE_HOME/log/diag/adrci_dir.mif.ORG
`/u01/app/oracle/product/11.2.0.4/dbhome_1/log/diag/adrci_dir.mif' -> `/u01/app/oracle/product/11.2.0.4/dbhome_1/log/diag/adrci_dir.mif.ORG'
2.測試:
$ rladrci
ADRCI: Release 11.2.0.4.0 - Production on Fri Jul 23 10:02:01 2021
Copyright (c) 1982, 2011, Oracle and/or its affiliates. All rights reserved.
No ADR base is set
adrci>
3.分析:
$ strace -f -o aa.txt adrci
--//檢查aa.txt,可以發現如下:
23825 times({tms_utime=0, tms_stime=1, tms_cutime=0, tms_cstime=0}) = 1834869394
23825 lstat("/u01/app/oracle/product/11.2.0.4/dbhome_1/log/diag/adrci_dir.mif", 0x7fff6930c440) = -1 ENOENT (No such file or directory)
23825 stat("/u01/app/oracle/product/11.2.0.4/dbhome_1/log/diag/adrci_dir.mif", 0x7fff6930c4f0) = -1 ENOENT (No such file or directory)
23825 close(3) = 0
--// 嘗試建立新的adrci_dir.mif在目錄/u01/app/oracle/product/11.2.0.4/dbhome_1/log/diag/,注意我使用vim結尾0a.
$ xxd -c 16 adrci_dir.mif
0000000: 2f75 3031 2f61 7070 2f6f 7261 636c 650a /u01/app/oracle.
$ strace -f -o bb.txt adrci
ADRCI: Release 11.2.0.4.0 - Production on Fri Jul 23 10:13:08 2021
Copyright (c) 1982, 2011, Oracle and/or its affiliates. All rights reserved.
No ADR base is set
adrci>
--//檢查bb.txt,可以發現如下:
24088 lstat("/u01/app/oracle/product/11.2.0.4/dbhome_1/log/diag/adrci_dir.mif", {st_mode=S_IFREG|0644, st_size=16, ...}) = 0
24088 stat("/u01/app/oracle/product/11.2.0.4/dbhome_1/log/diag/adrci_dir.mif", {st_mode=S_IFREG|0644, st_size=16, ...}) = 0
24088 open("/u01/app/oracle/product/11.2.0.4/dbhome_1/log/diag/adrci_dir.mif", O_RDONLY) = 7
24088 fcntl(7, F_SETFD, FD_CLOEXEC) = 0
24088 read(7, "/u01/app/oracle\n", 512) = 16
--//實際上vim也可以編輯比較麻煩,使用vim -b開啟,:%!xxd; :%xxd -r.再保持就ok了.
$ xxd -c 16 adrci_dir.mif
0000000: 2f75 3031 2f61 7070 2f6f 7261 636c 65 /u01/app/oracle
--//實際上還是實際檔案差別最後沒有\0.
$ strace -f -o cc.txt adrci
ADRCI: Release 11.2.0.4.0 - Production on Fri Jul 23 10:20:06 2021
Copyright (c) 1982, 2011, Oracle and/or its affiliates. All rights reserved.
ADR base = "/u01/app/oracle"
--//OK,問題解決.
--//檢查cc.txt,可以發現如下:
24193 lstat("/u01/app/oracle/product/11.2.0.4/dbhome_1/log/diag/adrci_dir.mif", {st_mode=S_IFREG|0644, st_size=15, ...}) = 0
24193 stat("/u01/app/oracle/product/11.2.0.4/dbhome_1/log/diag/adrci_dir.mif", {st_mode=S_IFREG|0644, st_size=15, ...}) = 0
24193 open("/u01/app/oracle/product/11.2.0.4/dbhome_1/log/diag/adrci_dir.mif", O_RDONLY) = 7
24193 fcntl(7, F_SETFD, FD_CLOEXEC) = 0
24193 read(7, "/u01/app/oracle", 512) = 15
--//還原使用原來檔案呢?
$ mv $ORACLE_HOME/log/diag/adrci_dir.mif.ORG $ORACLE_HOME/log/diag/adrci_dir.mif
/bin/mv: overwrite `/u01/app/oracle/product/11.2.0.4/dbhome_1/log/diag/adrci_dir.mif'? y
`/u01/app/oracle/product/11.2.0.4/dbhome_1/log/diag/adrci_dir.mif.ORG' -> `/u01/app/oracle/product/11.2.0.4/dbhome_1/log/diag/adrci_dir.mif'
strace -f -o dd.txt adrci
ADRCI: Release 11.2.0.4.0 - Production on Fri Jul 23 10:23:19 2021
Copyright (c) 1982, 2011, Oracle and/or its affiliates. All rights reserved.
ADR base = "/u01/app/oracle"
adrci> quit
--//檢查dd.txt,可以發現如下:
24222 lstat("/u01/app/oracle/product/11.2.0.4/dbhome_1/log/diag/adrci_dir.mif", {st_mode=S_IFREG|0640, st_size=16, ...}) = 0
24222 stat("/u01/app/oracle/product/11.2.0.4/dbhome_1/log/diag/adrci_dir.mif", {st_mode=S_IFREG|0640, st_size=16, ...}) = 0
24222 open("/u01/app/oracle/product/11.2.0.4/dbhome_1/log/diag/adrci_dir.mif", O_RDONLY) = 7
24222 fcntl(7, F_SETFD, FD_CLOEXEC) = 0
24222 read(7, "/u01/app/oracle\0", 512) = 16
4.補充:
--//實際上即使不使用vim來編輯也可以使用echo,tr之類命令完成.
$ xxd -c 16 adrci_dir.mif
0000000: 2f75 3031 2f61 7070 2f6f 7261 636c 650a /u01/app/oracle.
$ cat adrci_dir.mif | tr -d '\n' | xxd -c 16
0000000: 2f75 3031 2f61 7070 2f6f 7261 636c 65 /u01/app/oracle
$ cat adrci_dir.mif | tr '\n' '\000' | xxd -c 16
0000000: 2f75 3031 2f61 7070 2f6f 7261 636c 6500 /u01/app/oracle.
$ echo -n "/u01/app/oracle" | xxd -c 16
0000000: 2f75 3031 2f61 7070 2f6f 7261 636c 65 /u01/app/oracle
$ echo -en "/u01/app/oracle\0" | xxd -c 16
0000000: 2f75 3031 2f61 7070 2f6f 7261 636c 6500 /u01/app/oracle.
--//我就是沒想到printf,^_^.總之方法還有很多.
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/267265/viewspace-2782862/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- 【ADRCI】使用ADRCI (ADR Command Interpreter) 工具檢視Oracle alert警告日誌Oracle
- Automatic Diagnostic Repository (ADR) in Oracle Database 11g Release 1 (ADRCI)OracleDatabase
- [20210723]Minimum sga_target.txt
- [20210723]Database link and user defined datatypes.txtDatabase
- github慢解決辦法Github
- Namespoace Terminating 解決辦法
- 時區提示:Local time zone must be set--see zic manual page 2018的解決辦法
- 檔案無法粉碎解決辦法
- 接上次問答【八千萬 txt 檔案快速匯入】解決辦法
- 公寓噪音的解決辦法
- height:100%失效解決辦法
- 記vscode無法啟動解決辦法VSCode
- -bash: XXX: command not found解決辦法
- cnpm link 報錯解決辦法NPM
- mysql事件關閉解決辦法MySql事件
- IDEA 找不到包解決辦法Idea
- 資料傾斜解決辦法
- SpringBoot 迴圈引用解決辦法Spring Boot
- VScode 更新失敗解決辦法VSCode
- npm install 失敗解決辦法NPM
- github訪問受限解決辦法Github
- 跨域問題解決辦法跨域
- SqlServer鎖表解鎖解決辦法SQLServer
- ModuleNotFoundError: No module named ‘DBUtils‘解決辦法Error
- tomcat埠被佔用解決辦法Tomcat
- Vue 下 ESLint 的 error 解決辦法VueEsLintError
- 表碎片起因及解決辦法(zt)
- [git]warning: LF will be replaced by CRLF in 解決辦法Git
- ERROR 1290 (HY000) 解決辦法Error
- iOS 大圖顯示解決辦法iOS
- Access restriction: The type 'Resource' is not API 解決辦法RESTAPI
- 畢設之錯誤解決辦法
- git報錯400的解決辦法Git
- celery Discarding revoked task: ... 的解決辦法
- NPM run dev 失敗解決辦法NPMdev
- SSH 連線卡頓解決辦法
- ClassNotFoundException: org.json.JSONObject解決辦法ExceptionJSONObject
- Row size too large (> 8126)解決辦法