[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
- [HP-UX] cannot fork: too many processesUX
- sqlplus cannot execute binary fileSQL
- MySQL ERROR 1040: Too many connectionsMySqlError
- rlwrap sqlplus in linuxSQLLinux
- MySQL: Too many connectionsMySql
- 超過最大檔案數—Linux-x86_64 Error: 23: Too many open files in systemLinuxError
- 解決 Too many symbol filesSymbol
- ERROR 1661 (HY000): Cannot execute statement: impossible to write to binaryError
- linux Too Many Files 問題檢視和解決方法Linux
- Too many open files in system處理
- [20230104]Oracle too many parse errors PARSE ERROR.txtOracleError
- Too many open files報錯處理
- 【MySQL】Too many connections 案例一則MySql
- NETAPP - LOGIN TOO MANY USERSAPP
- when tag object too many, performance very lowObjectORM
- Too many files with unapproved license異常APP
- Links, Symbolic or OtherwiseSymbol
- ora-02020 too many database links in useDatabase
- linux下sqlplus調出歷史命令--rlwrap介紹LinuxSQL
- React報錯之Too many re-rendersReact
- titan-hadoop “Too many open files”修正Hadoop
- Ubuntu 解決 Too many open files 問題Ubuntu
- rlwrap sqlplus下的回顯工具SQL
- mongodb錯誤解決辦法-bash: ./mongod: cannot execute binary file: Exec format errorMongoDBORMError
- linux rlwrapLinux
- mysql備份提示 too many open files Errornumber 24MySqlError
- 關於mysql的Too many connections問題MySql
- AIX5.3: Too many processes 0403-030AI
- weblogic日誌報錯too many open filesWeb
- rlwrap的安裝使用 [SQLPlus上下鍵]SQL
- linux symbolic link attack tutorialLinuxSymbol
- Linux - 修改檔案控制程式碼數(Too many open files 異常)Linux
- Error running ‘Application’Command line is too longErrorAPP
- Percona MySQL 5.6 語句加鎖報錯"ERROR 1665 (HY000): Cannot execute statement"MySqlError
- 如何修復 SPF PermError: too many DNS lookupsErrorDNS
- 解決Mysql錯誤[1040]Too many connectionsMySql
- mysql的max_connections和Too many connectionsMySql