一、下载安装包
下载链接 p13390677_112040_Linux-x86-64_4of7.zip
二、服务器配置
1.安装依赖
yum install -y binutils compat-libstdc++-33 elfutils-libelf elfutils-libelf-devel gcc gcc-c++ glibc glibc-common glibc-devel libaio libaio-devel libgcc libstdc++ libstdc++-devel make sysstat ld-linux.so.2
2.创建组和用户
groupadd -g 2001 oinstall
groupadd -g 2002 dba
groupadd -g 2003 oper
useradd -u 2001 -g oinstall -G dba oracle
3.创建目录
mkdir -p /app/oracle/oraInventory
chown -R oracle:oinstall /app/oracle/oraInventory
chmod -R 770 /app/oracle/oraInventory
mkdir -p /app/oracle/database/11.2.0.4/client
chown -R oracle:dba /app/oracle/
chmod -R 775 /app/oracle/
chmod -R 755 /app/oracle/database/11.2.0.4
三、客户端安装
1.上传安装包并解压
[root]
chown -R oracle:oinstall /app/oracle/
chmod -R 775 /app/oracle/
su - oracle
[oracle]
unzip p13390677_112040_Linux-x86-64_client_4of7.zip
2.配置响应文件
响应文件默认在 "解压目录/client/response"下,编辑client_install.rsp文件
cd /app/oracle/client/response/
cp client_install.rsp client_install.rsp.bak
vi client_install.rsp
#修改以下项【示例】
ORACLE_HOSTNAME=test-app-client
UNIX_GROUP_NAME=oinstall
INVENTORY_LOCATION=/app/oracle/oraInventory
ORACLE_HOME=/app/oracle/database/11.2.0.4/client
ORACLE_BASE=/app/oracle/database
oracle.install.client.installType=Administrator
3.静默安装
切换到安装目录下,执行下面的命令静默安装客户端
cd /app/oracle/client/
./runInstaller -silent -responseFile /app/oracle/client/response/client_install.rsp
【oracle】
[oracle@test-app client]$ ./runInstaller -silent -responseFile /app/oracle/client/response/client_install.rsp
Starting Oracle Universal Installer...
Checking Temp space: must be greater than 120 MB. Actual 45427 MB Passed
Checking swap space: must be greater than 150 MB. Actual 16383 MB Passed
Preparing to launch Oracle Universal Installer from /tmp/OraInstall2023-11-27_02-32-59PM. Please wait ...[oracle@test-app client]$ You can find the log of this install session at:
/app/oracle/oraInventory/logs/installActions2023-11-27_02-32-59PM.log
The installation of Oracle Client 11g was successful.
Please check '/app/oracle/oraInventory/logs/silentInstall2023-11-27_02-32-59PM.log' for more details.
As a root user, execute the following script(s):
1. /app/oracle/oraInventory/orainstRoot.sh
Successfully Setup Software.
[oracle@test-app client]$
安装完成后根据提示执行脚本,root用户执行:
【root】
[root@test-app ~]# /app/oracle/oraInventory/orainstRoot.sh
Changing permissions of /app/oracle/oraInventory.
Adding read,write permissions for group.
Removing read,write,execute permissions for world.
Changing groupname of /app/oracle/oraInventory to oinstall.
The execution of the script is complete.
[root@test-app ~]#
4.配置环境变量
vi .bash_profile
#添加
ORACLE_HOME=/app/oracle/database/11.2.0.4/client
LD_LIBRARY_PATH=$ORACLE_HOME/lib
PATH=$PATH:$ORACLE_HOME/bin:$HOME/bin
export ORACLE_HOME LD_LIBRARY_PATH PATH
#执行
source .bash_profile
5.编辑tnsnames.ora文件
cd /app/oracle/database/11.2.0.4/client/network/admin
vi tnsnames.ora
#输入
MYDB =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.7.120)(PORT = 1521))
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = mydb)
)
)
6.运行sqlplus测试
sqlplus sys/oracle@192.168.12.220:1521/mydb as sysdba