[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/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- 【監聽】ADR_BASE_listenername理解
- 【ADRCI】使用ADRCI (ADR Command Interpreter) 工具檢視Oracle alert警告日誌Oracle
- github慢解決辦法Github
- Grub Rescue解決辦法
- /dev/null解決辦法devNull
- MSBuild Tools解決辦法UI
- Automatic Diagnostic Repository (ADR) in Oracle Database 11g Release 1 (ADRCI)OracleDatabase
- 檔案無法粉碎解決辦法
- 接上次問答【八千萬 txt 檔案快速匯入】解決辦法
- OpenStack 的NAT解決辦法
- android ExceptionInInitializerError解決辦法AndroidExceptionError
- Could not find *.apk!解決辦法APK
- man出錯解決辦法
- ARP病毒解決辦法
- 公寓噪音的解決辦法
- ADRCI工具的SHOW ALERT TAIL返回過多的結果AI
- [20210723]Minimum sga_target.txt
- 【11g】ADRCI (ADR Command Interpreter) -- IPS事件打包服務事件
- SSH 連線卡頓解決辦法
- 錕斤拷個人解決辦法
- 資料傾斜解決辦法
- ModuleNotFoundError: No module named ‘DBUtils‘解決辦法Error
- SqlServer鎖表解鎖解決辦法SQLServer
- 跨域問題解決辦法跨域
- github訪問受限解決辦法Github
- win7黑屏解決辦法Win7
- mysql事件關閉解決辦法MySql事件
- EXP-00091解決辦法
- CACTI:ICMPPingError:gethostbynamefailed解決辦法ErrorAI
- SVN被鎖的解決辦法
- ORA-28056的解決辦法
- Eclipse閃退解決辦法Eclipse
- sysctl -P 報錯解決辦法
- 資料庫漏洞解決辦法資料庫
- SAP錯誤提示解決辦法
- job都停了的解決辦法
- 表碎片起因及解決辦法
- 新浪UC無法登入的解決辦法