Linux下安装Oracle客户端

时间:2023-02-12 08:15:12
1.创建用户名和组名
/usr/sbin/groupadd oinstall
/usr/sbin/groupadd dba
/usr/sbin/useradd -m -g oinstall -G dba oracle
passwd oracle


2.创建目录
mkdir -p /u01/app/oracle
chown -R oracle:oinstall /u01/app/oracle 
chmod -R 775 /u01/app/oracle


3.用Oracle用户登录终端
su - oracle
vi  ~/.bash_profile
umask 022 
export ORACLE_BASE=/u01/app/oracle;
export ORACLE_HOME=$ORACLE_BASE/product/11.2.0/client_1;
export PATH=$ORACLE_HOME/bin:$PATH;


保存退出,执行如下命令
source ~/.bash_profile


4.切换到arcgis用户下
vi ~/.bash_profile
umask 022 
export ORACLE_BASE=/u01/app/oracle;
export ORACLE_HOME=$ORACLE_BASE/product/11.2.0/client_1;
export PATH=$ORACLE_HOME/bin:$PATH;


保存退出,执行如下命令
source ~/.bash_profile


5.将如下内容添加到文件/etc/sysctl.conf


fs.aio-max-nr = 1048576
fs.file-max = 6815744
kernel.shmall = 2097152
kernel.shmmax = 536870912
kernel.shmmni = 4096
kernel.sem = 250 32000 100 128
net.ipv4.ip_local_port_range = 9000 65500
net.core.rmem_default = 262144
net.core.rmem_max = 4194304
net.core.wmem_default = 262144
net.core.wmem_max = 1048576


使修改生效
/sbin/sysctl -p


6.安装依赖包
yum -y install libaio.i686 libaio-devel.i686
yum -y install libstdc++.i68 libstdc++-devel.i686 compat-libstdc++-33.i686  elfutils-libs.i686 glibc.i686  unixODBC.i686  unixODBC-devel.i686


7.root用户:
yum -y  install vnc vnc-server  
yum -y  install   xorg-x11*
vncserver
export DISPLAY=:1.0
xhost +


oracle用户:
export DISPLAY=192.168.1.100:1


PS:这里的192.168.1.100是远程主机的地址,后面的:1要和前面export DISPLAY的值一致




7.使用oracle用户,并切换到oracle客户端的安装文件的目录,执行./runInstaller
cd /home/oracle/client