为什么80%的码农都做不了架构师?>>>
最近两天需要使用到oracle数据库,于是在Linux主机上尝试安装oracle客户端。开始尝试是直接执行runInstaller,但是发现我是ssh连接到主机的,没有图形处理工具,无法完成安装。后面在一位专家指导下尝试oracle静默安装。以下为主要操作步骤:
(1)新建oracle用户及属组
/usr/sbin/useradd -u 300 -g oinstall -G dba -d /home/oracle -s /bin/bash -m oracle
(2)下载oracle客户端安装包,上传至linux主机,并解压
unzip linux.x64_11gR2_client.zip
(3)修改/etc/oraInst.loc,并修改权限chmod 644 /etc/oraInst.loc
vi /etc/oraInst.loc
inventory_loc=/home/oracle/app/oraInventory/
inst_group=oinstall
(4)修改解压缩文件夹下client/reponse/client_install.rsp文件
UNIX_GROUP_NAME=oinstall (安装组)
INVENTORY_LOCATION=/home/oracle/app/oraInventory (产品清单目录)
SELECTED_LANGUAGES=en,zh_CN (安装语言)
ORACLE_HOME=/u01/app/oracle/product/11.2.0.4/db ($ORACLE_HOME目录)
ORACLE_BASE=/u01/app/oracle ($ORACLE_BASE目录)
oracle.install.client.installType=Administrator (四种选择安装模式,我选择管理员模式)
(5)执行安装
/home/oracle/client/runInstaller -silent -noconfig -ignorePrereq -responseFile /home/oracle/client/response/client_install.rsp
(6)配置tnsnames.ora
vi /home/oracle/product/11.2.0.4/db/network/admin/tnsnames.ora
testdb =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.1.103)(PORT = 1521))
(ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.1.105)(PORT = 1521))
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = test)
)
)
(7)设置环境变量
vi /home/oracle/.profile
export ORACLE_BASE=/home/oracle
export ORACLE_HOME=/home/oracle/product/11.2.0.4/db
export LD_LIBRARY_PATH=$ORACLE_HOME/lib:/lib:/usr/lib:$ORACLE_HOME/rdbms/lib
export CLASSPATH=$ORACLE_HOME/JRE:$ORACLE_HOME/jlib:$ORACLE_HOME/rdbms/jlib
export PATH=$ORACLE_HOME/bin:/usr/sbin:$PATH:/usr/local/bin
export NLS_LANG=AMERICAN_AMERICA.AL32UTF8
(8)测试数据库连接
source $ORACLE_BASE/.profile;tnsping testdb