[20200309]rlwrap: error: Cannot execute sqlplus: Too many levels of symbolic lin
[20200309]rlwrap: error: Cannot execute sqlplus: Too many levels of symbolic links.txt
--//同事安裝安裝oracle以及rlwrap在centos 7時遇到的問題。再測試環境重複演示:
$ alias sql='rlwrap sqlplus'
$ sql
rlwrap: error: Cannot execute sqlplus: Too many levels of symbolic links
--//看了安裝文件,不知道為什麼要執行如下步驟:
cd ~
ln -s $ORACLE_HOME/bin/sqlplus /usr/bin
--//有兩者可能:1.當時環境變數$ORACLE_HOME沒有定義。 2.命令在root使用者下執行,ORACLE_HOME環境變數不存在。實際上這步多餘
--//的,只要定義環境變數PATH中包括$ORACLE_HOME/bin就ok了。
1.演示看看。
--//我以root執行:。
# echo $ORACLE_HOME
# ln -s $ORACLE_HOME/bin/sqlplus /usr/bin
--//這樣實際上相當於執行:
ln -s /bin/sqlplus /usr/bin
# ls -l /usr/bin/sqlplus
lrwxrwxrwx. 1 root root 12 Mar 9 11:52 /usr/bin/sqlplus -> /bin/sqlplus
# ls -l /bin/sqlplus
lrwxrwxrwx. 1 root root 12 Mar 9 11:52 /bin/sqlplus -> /bin/sqlplus
--//經典的環,為什麼會出現這樣的情況呢?
--//而實際上centos的低版本rhel 5.9:
$ ls -l /
total 206
drwxr-xr-x 2 root root 4096 2013-03-22 04:14:17 bin
drwxr-xr-x 4 root root 1024 2007-07-06 15:37:45 boot
drwxrwxrwx 14 oracle oinstall 4096 2017-12-21 11:27:38 data
drwxr-xr-x 8 root root 5420 2020-03-08 04:03:06 dev
drwxr-xr-x 106 root root 12288 2020-03-06 04:03:45 etc
drwxr-xr-x 5 root root 4096 2014-11-05 09:49:05 home
drwxr-xr-x 2 root root 4096 2004-08-13 01:02:09 initrd
drwxr-xr-x 10 root root 4096 2007-07-06 17:01:29 lib
drwxr-xr-x 7 root root 4096 2013-03-22 04:10:12 lib64
drwx------ 2 root root 16384 2007-07-06 23:26:01 lost+found
drwxr-xr-x 4 root root 4096 2018-01-05 16:29:27 media
drwxr-xr-x 2 root root 4096 2005-12-02 23:40:17 misc
drwxr-xr-x 12 root root 4096 2017-12-25 16:20:36 mnt
drwxr-xr-x 4 root root 4096 2017-01-17 09:39:43 opt
dr-xr-xr-x 133 root root 0 2018-01-06 00:26:17 proc
drwxr-x--- 24 root root 4096 2020-02-27 11:47:03 root
drwxr-xr-x 3 root root 12288 2014-07-29 04:03:56 sbin
drwxr-xr-x 2 root root 4096 2007-07-06 15:26:28 selinux
drwxr-xr-x 2 root root 4096 2004-08-13 01:02:09 srv
drwxr-xr-x 9 root root 0 2018-01-06 00:26:17 sys
drwxr-xr-x 3 root root 4096 2014-07-14 11:28:17 tftpboot
drwxrwxrwt 8 root root 20480 2020-03-09 15:43:54 tmp
drwxr-xr-x 5 root root 4096 2017-02-07 15:33:55 u01
drwxr-xr-x 18 root root 4096 2011-04-14 19:02:34 usr
drwxr-xr-x 26 root root 4096 2012-03-15 14:53:16 var
--//而centos 7呢?
# ls -l /
total 32
lrwxrwxrwx. 1 root root 7 Feb 25 07:20 bin -> usr/bin
dr-xr-xr-x. 5 root root 4096 Feb 25 07:29 boot
drwxr-xr-x. 20 root root 3260 Mar 2 05:43 dev
drwxr-xr-x. 92 root root 8192 Mar 2 05:43 etc
drwxr-xr-x. 3 root root 99 Feb 26 13:15 home
lrwxrwxrwx. 1 root root 7 Feb 25 07:20 lib -> usr/lib
lrwxrwxrwx. 1 root root 9 Feb 25 07:20 lib64 -> usr/lib64
drwxr-xr-x. 2 root root 6 Jun 9 2014 media
drwxr-xr-x. 2 root root 6 Jun 9 2014 mnt
drwxr-xr-x. 3 root root 21 Feb 27 06:47 opt
dr-xr-xr-x. 412 root root 0 Mar 2 05:43 proc
dr-xr-x---. 2 root root 4096 Feb 27 05:43 root
drwxr-xr-x. 24 root root 720 Mar 9 08:04 run
lrwxrwxrwx. 1 root root 8 Feb 25 07:20 sbin -> usr/sbin
drwxr-xr-x. 2 root root 6 Jun 9 2014 srv
dr-xr-xr-x. 13 root root 0 Mar 2 05:43 sys
drwxrwxrwt. 9 root root 4096 Mar 9 11:40 tmp
drwxr-xr-x. 3 oracle oinstall 16 Feb 26 13:16 u01
drwxr-xr-x. 13 root root 4096 Feb 25 07:20 usr
drwxr-xr-x. 20 root root 4096 Mar 2 05:43 var
--//注意看centos 7 根目錄下的/bin ,/sbin, /lib /lib64目錄都是軟連結,注意看真實連結的目錄。
--//而且定義PATH一般都是在後面追加。centos 7下PATH定義如下:
$ echo -e ${PATH//:/\\n}
/usr/local/bin
/bin
/usr/bin
/usr/local/sbin
/usr/sbin
/home/oracle/.local/bin
/home/oracle/bin
/home/oracle/bin
/home/oracle/bin
/u01/app/oracle/product/11.2.0/db_1/bin
--//這樣找到sqlplus在/bin目錄,這樣找到的sqlplus就形成一個環。
# ls -l /bin/sqlplus
lrwxrwxrwx. 1 root root 12 Mar 9 11:52 /bin/sqlplus -> /bin/sqlplus
--//也就是在低版本就算定義錯誤,也不可能報如上錯誤。而正是centos 7版本的這點點改進,導致問題暴露出來。
--//如果我手工定義PATH如下:
export PATH=/usr/local/bin:/usr/local/sbin:/u01/app/oracle/product/11.2.0/db_1/bin:/bin:/usr/bin:/usr/sbin:/home/oracle/bin
$ sqlplus / as sysdba
--//就可以正常使用。
--//總之,任何安裝版本都會有一小小改進。
--//補充rhel 5.9的測試:
# echo $ORACLE_HOME
# ln -s $ORACLE_HOME/bin/sqlplus /usr/bin
# ls -l /usr/bin/sqlplus
lrwxrwxrwx 1 root root 12 2020-03-09 15:33:18 /usr/bin/sqlplus -> /bin/sqlplus
# ls -l /bin/sqlplus
ls: /bin/sqlplus: No such file or directory
--//看不到前面的環。
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/267265/viewspace-2679222/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- 解決 ln -s 軟連結產生的Too many levels of symbolic links錯誤Symbol
- MySQL ERROR 1040: Too many connectionsMySqlError
- [20230104]Oracle too many parse errors PARSE ERROR.txtOracleError
- [20190108]rlwrap sqlplus tee相關問題.txtSQL
- 解決 Too many symbol filesSymbol
- Too many files with unapproved license異常APP
- [20190110]rlwrap sqlplus tee相關問題3.txtSQL
- mongodb錯誤解決辦法-bash: ./mongod: cannot execute binary file: Exec format errorMongoDBORMError
- Too many open files報錯處理
- Ubuntu 解決 Too many open files 問題Ubuntu
- React報錯之Too many re-rendersReact
- 如何修復 SPF PermError: too many DNS lookupsErrorDNS
- mysql備份提示 too many open files Errornumber 24MySqlError
- linux Too Many Files 問題檢視和解決方法Linux
- ValueError: output parameter for reduction operation logical_and has too many dimensions ?Error
- MySQL問題處理——1040錯誤Too many connectionsMySql
- nginx 報錯 accept4 () failed (24: Too many open files)NginxAI
- 解決:ChatGPT too many requests in 1 hour.Try again laterChatGPTAI
- 31.提示錯誤fopen_means Too many open files
- ‘error: ‘‘this‘‘ cannot be implicitly captured in this context‘ErrorAPTContext
- Uncaught Error: Cannot instantiate interfaceError
- Error running ‘Application’Command line is too longErrorAPP
- Method has too many Body parameters: public abstract com.cloud.module.smartkeCloud
- docker中使用systemctl命令時報Too many open files錯誤Docker
- ERROR: Cannot uninstall ‘PyYAML‘. It is a distutils installed project and thus we cannot accuratelyErrorYAMLProject
- Fatal error: Cannot redeclare printerror() (previously declared in …Error
- Error: Cannot find configuration directory: /etc/hadoopErrorHadoop
- Oracle資料庫出現WARNING: too many parse errors告警的分析思路Oracle資料庫Error
- rlwrap安裝
- MySQL異常刨析:ata source rejected establishment of connection, message from server: “Too many connectionMySqlServer
- krpano 問題解決之 “Too many active WebGL contexts. Oldest context will be lost.”WebContext
- MySQL案例01:Last_SQL_Errno: 1755 Cannot execute the current event group in the parallel modeMySqlASTParallel
- The API server is burning too much error budget 異常處理APIServerError
- Import Error: cannot import name ‘export_saved_modelImportErrorExport
- 【k8s】etcd叢集took too long to execute慢日誌告警問題分析K8S
- ] Failed to execute goal org.mybatis.generator:mybatis-generator-maven-plugin Cannot instantiate object of typeAIGoMyBatisMavenPluginObject
- Links, Symbolic or OtherwiseSymbol
- linux系統中安裝jdk出現bash: ./java: cannot execute binary file 問題LinuxJDKJava