oracle client linux版 静默安装

groupadd oinstall
groupadd oracle
useradd oracle 
usermod -g oinstall oracle
usermod -G oracle oracle
passwd oracle #输入密码
id oracle #确认结果如下即可
uid=1001(oracle) gid=1001(oinstall) groups=1001(oinstall),1003(oracle)

vim /etc/profile
#Oracle
export ORACLE_BASE=/u01/app/oracle
export ORACLE_HOME=$ORACLE_BASE/client
export PATH=$PATH:$ORACLE_HOME/bin
export TNS_ADMIN=$ORACLE_HOME/network/admin

mkdir -p /u01/app
chown -R oracle:oinstall /u01/app
chown -R oracle:oinstall /oracle  #安装包所在目录

重新以oracle用户登入,进入安装包所在目录
cd /oracle/client/

vim ./response/client_install.rsp 
ORACLE_HOSTNAME=gjy21  #通过hostname查看本机hostname
UNIX_GROUP_NAME=oinstall
INVENTORY_LOCATION=/u01/app/oraInventory
SELECTED_LANGUAGES=en,zh_CN
ORACLE_HOME=/u01/app/oracle/client
ORACLE_BASE=/u01/app/oracle
oracle.install.client.installType=Administrator

执行安装,注意/oracle/client/response/client_install.rsp要填绝对路径
./runInstaller -silent -responseFile /oracle/client/response/client_install.rsp 

事后可在$TNS_ADMIN下touch tnsname.ora,写入
test =
  (DESCRIPTION =
    (ADDRESS = (PROTOCOL = tcp)(HOST = 127.0.0.1)(PORT = 1521))
    (CONNECT_DATA =
      (SERVER = DEDICATED)
      (SERVICE_NAME = orcl)
    )
  )
即可使用sqlplus 'scott/"tigger"'@test 登录,sys用户要用sqlplus ... as sysdba
也可直接使用sqlplus 'scott/"tigger"'@127.0.0.1:1521/orcl

通过日志确认异常情况并解决---------------------------------------------------------------------
Users With Same UID: This test checks that multiple users do not exist with user id as "0".
cat /etc/passwd|grep 0:0  发现lz和root的id都为0
修改lz的uid
usermod -u 2000 lz

你可能感兴趣的:(oracle,linux,oracle)