[Oracle] Oracle单机配置 3.Oracle Client安装

1.应用用户登录后,修改tnsname.ora。示例:${HOME}/tnsname.ora

${DB_NAME}=
(DESCRIPTION=
(ENABLE=BROKEN)
(LOAD_BALANCE=off)
(FAILOVER=on)
(ADDRESS=(PROTOCOL=tcp)(HOST=${VIP1_IP})(PORT=11521))
(ADDRESS=(PROTOCOL=tcp)(HOST=${VIP2_IP})(PORT=11521))
(CONNECT_DATA=
(SERVICE_NAME=${DB_NAME})
(FAILOVER_MODE=(TYPE=select)(METHOD=basic))
(server = dedicated)
)
)

 

2、添加应用用户环境变量。修改.bash_profile加入以下内容

export ORACLE_BASE=/home/db/oracle
export ORACLE_HOME=$ORACLE_BASE/product/11.2.0
export LD_LIBRARY_PATH=:$ORACLE_HOME/lib:$ORACLE_HOME/lib32
export LIBPATH=$LD_LIBRARY_PATH
export PATH=$ORACLE_HOME/bin:$ORACLE_HOME/OPatch:/usr/bin:/etc:/usr/sbin:$PATH
export TNS_ADMIN=/home/ap/nft 

 

3.测试

$ sqlplus user/password@${DB_NAME}

 

4.卸载方法
删除 ORACLE_BASE目录和ora文件并删除环境变量即可

分类上一篇:     分类下一篇:

Leave a Reply