Oracle 11gR2 ASM 单实例安装 DBCA 建库报错: ORA-12547: TNS:lost contact

时间:2021-09-16 22:40:25
1、首先查看$ORACLE_HOME/bin/oracle权限
oracle和grid用户下$ORACLE_HOME/bin/oracle的权限是否为"-rwsr-s--x"且属于oinstall组:
[oracle@dbserver ~]$ ls -al $ORACLE_HOME/bin/oracle
-r-sr-s--x 1 oracle asmadmin 210824714 08-10 01:52 /u01/app/oracle/product/11.2.0/dbhome_1/bin/oracle


[grid@dbserver ~]$ ls -al $ORACLE_HOME/bin/oracle
-rwsr-s--x 1 grid oinstall 184286237 08-10 01:20 /u01/app/grid/11.2.0/product/bin/oracle


2、更改oracle用户的$ORACLE_HOME/bin/oracle权限
[oracle@dbserver ~]$ chown oracle:oinstall $ORACLE_HOME/bin/oracle 
[oracle@dbserver ~]$ ls -al $ORACLE_HOME/bin/oracle
-rwxr-x--x 1
oracle oinstall 210824714 08-10 01:52 /u01/app/oracle/product/11.2.0/dbhome_1/bin/oracle


[oracle@dbserver bin]$  chmod 6751 $ORACLE_HOME/bin/oracle  
[oracle@dbserver ~]$ ls -al $ORACLE_HOME/bin/oracle
-rwsrws--x 1 oracle oinstall 210824714 08-10 01:52 /u01/app/oracle/product/11.2.0/dbhome_1/bin/oracle


3、分别查看oracle和grid用户的环境变量设置,分别添加export LD_LIBRARY_PATH=$ORACLE_HOME/lib:/lib:/usr/lib
首先来添加oracle用户:
[oracle@dbserver ~]$ cat .bash_profile
# .bash_profile
# Get the aliases and functions
if [ -f ~/.bashrc ]; then
        . ~/.bashrc
fi
# User specific environment and startup programs
PATH=$PATH:$HOME/bin
export PATH
ORACLE_BASE=/u01/app/oracle
ORACLE_SID=orcl
ORACLE_HOME=$ORACLE_BASE/product/11.2.0/dbhome_1
PATH=$ORACLE_HOME/bin:$PATH
export ORACLE_BASE ORACLE_SID ORACLE_HOME PATH
alias sqlplus='rlwrap sqlplus'
alias rman='rlwrap rman'
stty erase ^h
export LD_LIBRARY_PATH=$ORACLE_HOME/lib:/lib:/usr/lib
 
其次来添加grid用户的:
[grid@dbserver ~]$ cat .bash_profile
# .bash_profile
# Get the aliases and functions
if [ -f ~/.bashrc ]; then
        . ~/.bashrc
fi
# User specific environment and startup programs
export ORACLE_BASE=/u01/app/grid
export ORACLE_HOME=/u01/app/grid/11.2.0/product
export ORACLE_SID=+ASM
export LD_LIBRARY_PATH=$ORACLE_HOME/lib:/lib:/usr/lib
PATH=$ORACLE_HOME/bin:$PATH
export PATH