RAC從11.2.0.3升級到11.2.0.4後,一個節點的Public IP、VIP沒法鏈接數據庫node
SQL> CONN SYS/oracle@192.168.122.101:1521/pplus as sysdba
ERROR:
ORA-12537: TNS:connection closedsql
查看RAC的監聽日誌:數據庫
# cd $ORACLE_BASE/diag/tnslsnr/racdb2/listener/trace/bash
# vi listener.logoracle
06-MAY-2019 12:13:52 * (CONNECT_DATA=(SERVICE_NAME=posplus)(CID=(PROGRAM=sqlplus)(HOST=racdb1)(USER=grid))) * (ADDRESS=(PROTOCOL=tcp)(HOST=192.168.122.100)(PORT=40081)) * establish * posplus * 12518
TNS-12518: TNS:listener could not hand off client connection
TNS-12546: TNS:permission denied
TNS-12560: TNS:protocol adapter error
TNS-00516: Permission denied
Linux Error: 13: Permission deniedapp
首先想到GRID和Database的是oracle文件權限的問題,都有s權限,確認沒有問題tcp
[grid@racdb1 ~]$ ll $ORACLE_HOME/bin/oracleide
-rwsr-s--x 1 grid oinstall 209914479 Mar 25 23:39 /home/grid/app/11.2.0.4/grid/bin/oracleoop
[oracle@racdb1 ~]$ ll $ORACLE_HOME/bin/oracleui
-rwsr-s--x 1 oracle asmadmin 239626641 Mar 26 01:36 /home/oracle/app/oracle/product/11.2.0.4/db_1/bin/oracle
而後再用GRID用戶去訪問Database的HOME目錄
[grid@racdb1 ~]$ cd $ORACLE_HOME/bin
-bash: cd: $ORACLE_HOME/bin: Permission denied
果真沒有權限
[grid@racdb2 ~]$ ll /home/
total 8
drwxr-xr-x. 7 root oinstall 4096 Mar 23 16:43 grid
drwx------. 8 oracle oinstall 4096 May 6 11:45 oracle
把/home/oracle的權限修改成
chmod g+rx,o+rx /home/oracle
[grid@racdb1 ~]$ sqlplus / as sysdba
SQL*Plus: Release 11.2.0.4.0 Production on Wed May 8 10:41:06 2019
Copyright (c) 1982, 2013, Oracle. All rights reserved.
Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production
With the Real Application Clusters and Automatic Storage Management options
SQL> CONN SYS/oracle@192.168.122.111:1521/posplus as sysdba
Connected.
SQL> CONN SYS/oracle@192.168.122.101:1521/posplus as sysdba
Connected.
SQL> CONN SYS/oracle@192.168.122.110:1521/posplus as sysdba
Connected.
SQL> CONN SYS/oracle@192.168.122.120:1521/posplus as sysdba
至此問題已解決
-------------------------------------------------------------------------------
參考Oracle官方文檔:
In this Document
APPLIES TO:Oracle Database - Enterprise Edition - Version 11.2.0.3 and laterOracle Database Configuration Assistant - Version 11.1.0.7 and later Oracle Net Services - Version 11.2.0.2 and later Information in this document applies to any platform. SYMPTOMSIn environment where listener home (including SCAN listener which resides in GRID Infrastructure/ASM home) and database home are owned by different OS user, ORA-12537 could happen when connecting through listener, when creating database through DBCA, or when installing database software and creating a database in runInstaller. Job Role Separation is a typical example as SCAN and local grid home listener is owned differently than database.
CAUSE
$ ls -l $RDBMS_HOME/bin/oracle
ls: /home/oracle/app/oracle/product/11.2/db/bin/oracle: Permission denied
ls -l $RDBMS_HOME/bin/oracle
-rwxr-x--x 1 oracle asmadmin 184286251 Aug 9 16:25 /home/oracle/app/oracle/product/11.2/db/bin/oracle
-rwsr-s--x 1 oracle asmadmin 184286251 Aug 9 16:25 /home/oracle/app/oracle/product/11.2/db/bin/oracle
mount| grep <mount_point_of_ORACLE_HOME>
/home/oracle on /dev/dsk/diskoracle read/write/nosuid..
4. RDBMS_HOME/lib has wrong ownership/permission: As listener owner:
$ ls -l $RDBMS_HOME/lib
ls: /home/oracle/app/oracle/product/11.2/db/lib: Permission denied
5. Another cause may be permissions on the RDBMS Directory structure or Home directory which needs to be accessed by the CRS user.
[grid@orcl002:+ASM2 ~]$ ls -al /home/oracle/app/oracle
ls: cannot open directory /u01/app/oracle: Permission denied ***NOTE: the Oracle directory has 700 for the permissions, which should be changed to 755:
Current (incorrect) -->
[grid@orcl002:+ASM2 ~]$ ll /home/oracle/app
drwx------. 8 oracle oinstall 4096 Oct 12 08:38 oracle
Should be (correct) -->
[grid@orcl002:+ASM2 ~]$ ll /home/oracle/app
drwxr-xr-x. 8 oracle oinstall 4096 Oct 12 08:38 oracle
b) Likewise the /product directory has 700 perms, so change to 755 -->
[grid@orcl002:+ASM2 ~]$ ls -al /home/oracle/app/oracle/product
ls: cannot open directory /u01/app/oracle/product: Permission denied
[grid@orcl002:+ASM2 ~]$ ls -al /home/oracle/app/oracle
drwx------. 3 oracle oinstall 4096 Oct 12 08:58 product
Should be (correct) -->
[grid@orcl002:+ASM2 ~]$ ls -al /u01/app/oracle
drwxr-xr-x. 3 oracle oinstall 4096 Oct 12 08:58 product
$ sqlplus system/<pwd>@'(description=(address=(protocol=tcp)(host=orcl002)(port=1521))(connect_data=(server=dedicated)(service_name=ORCL)))'
SQL>
SOLUTIONSolution is to make sure file system for database home has setuid/suid set, database binary($RDBMS_HOME/bin/oracle) has correct ownership and permission, and listener owner is able to access database oracle binary (as listener owner, "ls -l $RDBMS_HOME/bin/oracle" will tell)If its Job Role Separation environment, please refer to the following document:Oracle® Grid Infrastructure Installation Guide11g Release 2 (11.2)Oracle ASM Job Role Separation Option with SYSASM |