1.下载安装软件包:
oracle-instantclient11.2-basic-11.2.0.1.0-1.x86_64.rpm oracle-instantclient11.2-sqlplus-11.2.0.3.0-1.x86_64.rpm
2.rpm安装
[[email protected] ~]# rpm -ihv oracle-instantclient11.2-basic-11.2.0.1.0-1.x86_64.rpm --nodeps [[email protected] ~]# rpm -ihv oracle-instantclient11.2-sqlplus-11.2.0.3.0-1.x86_64.rpm --nodeps
3.配置连接信息
[[email protected] ~]# vi /usr/lib/oracle/11.2/client64/tnsnames.ora Oracletest= #要连接Oracle库的库名 (DESCRIPTION = (ADDRESS_LIST = (ADDRESS = (PROTOCOL = TCP)(HOST = 110.103.211.310)(PORT = 1521)) #数据库IP,开放的端口 ) (CONNECT_DATA = (SERVICE_NAME=Oracletest ) #要连接Oracle库的库名 ) )
4.环境变量 配置
[[email protected] ~]# vi /etc/profile #在文件末尾添加下面配置 export ORACLE_HOME=/usr/lib/oracle/11.2/client64 export TNS_ADMIN=$ORACLE_HOME export PATH=$PATH:$ORACLE_HOME/bin export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$ORACLE_HOME/lib
5.验证配置
[[email protected] ~]# sqlplus 账户名/密码 as 角色名 #登录进数据说明配置成功。
时间: 2024-10-03 15:01:33