oracle 11g 客户端安装

下载链接:http://download.csdn.net/download/chenshijie2011/10013332
 下载Version 11.2.0.1.0 ,以rpm为后缀名的包(注意:basiclite包和basic包只能选一个,这里选择下载basic包),如下:
oracle-instantclient11.2-basic-11.2.0.1.0-1.x86_64.rpm
oracle-instantclient11.2-sqlplus-11.2.0.1.0-1.x86_64.rpm
oracle-instantclient11.2-jdbc-11.2.0.1.0-1.x86_64.rpm
oracle-instantclient11.2-odbc-11.2.0.1.0-1.x86_64.rpm
oracle-instantclient11.2-devel-11.2.0.1.0-1.x86_64.rpm
oracle-instantclient11.2-tools-11.2.0.1.0-1.x86_64.rpm
mkdir /opt/oracle //新建临时上传文件目录
cd /opt/oracle
 上传上述安装包到目录 /opt/oracle
 使用rpm -ivh [包名] 分别安装上述6个包:
rpm -ivh oracle-instantclient11.2-basic-11.2.0.1.0-1.x86_64.rpm
 创建文件夹:
mkdir -p /usr/lib/oracle/11.2/client64/network/admin/
 创建监听文件
vi /usr/lib/oracle/11.2/client64/network/admin/tnsnames.ora
 在监听文件中添加如下内容
ORCL =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = IP)(PORT = 1521)) //ip为实际ip
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = SID) //实例名
)
)
 配置环境变量
vim ~/.bashrc //在.bashrc文件中添加下面内容
export ORACLE_HOME=/usr/lib/oracle/11.2/client64
export TNS_ADMIN=${ORACLE_HOME}/network/admin
export NLS_LANG=’simplified chinese_china’.AL32UTF8 //根据服务端实际的字符集修改
export LD_LIBRARY_PATH=${ORACLE_HOME}/lib
export PATH=${ORACLE_HOME}/bin:$PATH
 使环境变量生效
source ~/.bashrc
 连接数据库测试
sqlplus /nolog
SQL>conn xxxx/xxxx@orcl

你可能感兴趣的:(oracle)