oracle client install

cat /etc/issue
uname -r 
grep MemTotal /proc/meminfo 
grep SwapTotal /proc/meminfo 
grep "model name" /proc/cpuinfo 
free 
df -k /tmp 
df -k
 
3.检查安装依赖系统包
操作系统依赖的具体包,请参考官方安装文档。
以下为 Asianux 3, Oracle Linux 5, Red Hat Enterprise Linux 5, CentOS 5 操作系统依赖的包
binutils-2.17.50.0.6
compat-libstdc++-33-3.2.3
compat-libstdc++-33-3.2.3 (32 bit)
elfutils-libelf-0.125
elfutils-libelf-devel-0.125
gcc-4.1.2
gcc-c++-4.1.2
glibc-2.5-24
glibc-2.5-24 (32 bit)
glibc-common-2.5
glibc-devel-2.5
glibc-devel-2.5 (32 bit)
glibc-headers-2.5
ksh-20060214
libaio-0.3.106
libaio-0.3.106 (32 bit)
libaio-devel-0.3.106
libaio-devel-0.3.106 (32 bit)
libgcc-4.1.2
libgcc-4.1.2 (32 bit)
libstdc++-4.1.2
libstdc++-4.1.2 (32 bit)
libstdc++-devel 4.1.2
make-3.81
sysstat-7.0.2
unixODBC-2.2.11 (32-bit) or later
unixODBC-devel-2.2.11 (64-bit) or later
unixODBC-2.2.11 (64-bit) or later
 
检查依赖包
 
rpm -q binutils compat-libstdc++-33 elfutils-libelf elfutils-libelf-devel gcc gcc-c++ glibc-2.5 glibc-common glibc-devel glibc-headers ksh libaio libaio-devel libgcc libstdc++ libstdc++-devel make sysstat unixODBC unixODBC-devel
如果包有显示is not installed(没安装),就用yum install 命令安装,如:
 
yum install compat-libstdc++-33
 
4.创建所需的操作系统组和用户
 
groupadd oinstall
groupadd dba
useradd -g oinstall -G dba oracle
设置oracle用户密码
 
passwd oracle
 
5.修改内核参数
在/sbin/sysctl.conf 文件中,使用文本编辑器或vi命令增加或修改以下参数
 
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.修改用户限制
在/etc/security/limits.conf 文件中,使用文本编辑器或vi命令增加或修改以下参数
 
oracle soft nproc 2047
oracle hard nproc 16384
oracle soft nofile 1024
oracle hard nofile 65536
oracle soft stack 10240
在/etc/pam.d/login 文件中,使用文本编辑器或vi命令增加或修改以下内容
 
session required /lib/security/pam_limits.so
session required pam_limits.so
在/etc/profile 文件中,使用文本编辑器或vi命令增加或修改以下内容
 
if [ $USER = "oracle" ]; then
if [ $SHELL = "/bin/ksh" ]; then
ulimit -p 16384
ulimit -n 65536
else
ulimit -u 16384 -n 65536
fi
fi
使设置生效
 
source /etc/profile
7.创建安装目录(可根据情况,选择比较多空间的目录创建)
 
mkdir -p /u01/app/
chown -R oracle:oinstall /u01/app/
chmod -R 775 /u01/app/
 
8.创建/etc/oraInst.loc文件,内容如下
 


$ su -
# vi /etc/oraInst.loc(加入或修改以下内容,其中/u01/app/oracle是ORACLE_BASE)
inventory_loc=/u01/app/oracle/oraInventory
inst_group=oinstall
# chmod 664 /etc/oraInst.loc
# exit


更改文件的权限
 
chown oracle:oinstall /etc/oraInst.loc
chmod 664 /etc/oraInst.loc
 
9.设置oracle环境变量
 
su - oracle
 
vi ~/.bash_profile
 
在最后加上以下内容
 
export ORACLE_BASE=/u01/app/oracle
export ORACLE_SID=orcl
注意,除了ORACLE_BASE和ORACLE_SID,( /etc/profile和.bash_profile中)不设置任何oracle相关环境变量(ORACLE_HOME, PATH, LD_LIBRARY_PATH等)。
 
使设置生效
 
source /home/oracle/.bash_profile
检查环境变量:
 
env

.建立oraInst.loc文件

# vi /etc/oraInst.loc

inventory_loc=/u01/app/oraInventory/

inst_group=oinstall

# chmod 664 /etc/oraInst.loc

说明:这一段是在网上看到别人这么做,具体什么意思不清楚

2.修改rsp文件

# pwd

/soft/client/response

# ls

client_install.rsp netca.rsp

# cp client_install.rsp client.rsp

# vi client.rsp

主要修改client_install.rsp脚本里面几个参数,这里非常简单

#-------------------------------------------------------------------------------

# This variable holds the hostname of thesystem as set by the user.

# It can be used to force the installationto use an alternative   

# hostname rather than using the firsthostname found on the system

# (e.g., for systems with multiplehostnames and network interfaces).

ORACLE_HOSTNAME=Ben.element        (执行hostname命令查看)

#-------------------------------------------------------------------------------

# Unix group to be set for the inventorydirectory.  

UNIX_GROUP_NAME=oinstall                  (安装组)

#-------------------------------------------------------------------------------

# Inventory location.

INVENTORY_LOCATION=/u01/app/oraInventory   (产品清单目录)

#-------------------------------------------------------------------------------

#-------------------------------------------------------------------------------

SELECTED_LANGUAGES=en,zh_CN         (安装语言)

#-------------------------------------------------------------------------------

# Complete path of the Oracle Home  

ORACLE_HOME=/u01/app/oracle/product/11.2.0.4/db_1    ($ORACLE_HOME目录)

#-------------------------------------------------------------------------------

# Complete path of the Oracle Base.

ORACLE_BASE=/u01/app/oracle     ($ORACLE_BASE目录)

#-------------------------------------------------------------------------------

#-------------------------------------------------------------------------------

#Name      : INSTALL_TYPE

#Datatype  : String

#Description: Installation type of thecomponent.

#

#            The following choices areavailable. The value should contain

#             only one of these choices.

#               - InstantClient

#               - Administrator

#               - Runtime

#               - Custom

#

#Example   : INSTALL_TYPE = "Administrator"

#------------------------------------------------------------------------------

oracle.install.client.installType=Administrator       (四种选择安装模式,我选择管理员模式)

#-------------------------------------------------------------------------------

#Name      racle.install.client.upgrading

#Datatype  : boolean

#Description: whether or not this is anupgrade installation

#

#             The following choices areavailable. The value should contain

#             only one of these choices.

#               - true

#               - false

#

#Example   : oracle.install.client.upgrading=true

#------------------------------------------------------------------------------

oracle.install.client.upgrading=false       (布尔值更新,选择false,不知道干嘛用的,估计可以不写,但是我这里写,也安装成功)

#------------------------------------------------------------------------------

#------------------------------------------------------------------------------

# Specify the auto-updates option. It canbe one of the following:

#   -MYORACLESUPPORT_DOWNLOAD

#   -OFFLINE_UPDATES

#   -SKIP_UPDATES

#------------------------------------------------------------------------------

oracle.installer.autoupdates.option=SKIP_UPDATES      (跳过更新)

以上是要求选择和配置的几个参数

3.安装client


$ /soft/client/runInstaller -silent-responseFile /soft/client/response/client.rsp

Starting Oracle Universal Installer...

Checking Temp space: must be greater than120 MB.   Actual 217203 MB    Passed

Checking swap space: must be greater than150 MB.   Actual 8195 MB    Passed

Preparing to launch Oracle UniversalInstaller from /tmp/OraInstall2013-09-08_01-14-28PM. Please wait...[oracle@GE_GameSrv_A ~]$ [WARNING] [INS-32016] The selected Oracle homecontains directories or files.

  CAUSE: The selected Oracle home contained directories or files.

  ACTION: To start with an empty Oracle home, either remove its contentsor choose another location.

You can find the log of this installsession at:

/u01/app/oraInventory/logs/installActions2013-09-08_01-14-28PM.log

The installation of Oracle Client 11g wassuccessful.     (客户端成功安装)

Please check'/u01/app/oraInventory/logs/silentInstall2013-09-08_01-14-28PM.log' for moredetails.

Successfully Setup Software.   (软件成功安装)

-silent 表示以静默方式安装,不会有任何提示

-noconfig 表示不运行配置助手netca

-responseFile 表示使用哪个响应文件client_install.rsp

注意:我这里没有使用-noconfig参数

安装结束后,以root用户执行$ORACLE_HOME下的root.sh(如果客户端类型是instantClient则不用,但是我选择instantClient安装模式,就没安装成功过)

#/u01/app/oracle/product/10.2.0/client_1/root.sh

4.验证安装有效性

$ sqlplus /nolog

SQL*Plus: Release 11.2.0.4.0 Production onSun Sep 8 07:54:40 2013

Copyright (c) 1982, 2013, Oracle.  All rights reserved.

SQL>

5.配置tnsnames.ora

也可以直接从数据库copy过来

# vi tnsnames.ora

# tnsnames.ora Network Configuration File:/u01/app/oracle/product/11.2.0.4/db_1/network/admin/tnsnames.ora

# Generated by Oracle configuration tools.

BEN =

(DESCRIPTION =

   (ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.1.8)(PORT = 1521))

   (ADDRESS = (PROTOCOL = TCP)(HOST = 8.8.8.129)(PORT = 1521))

   (CONNECT_DATA =

     (SERVER = DEDICATED)

     (SERVICE_NAME = ben)

    )

  )

6.登入验证

$ sqlplus scott/tiger@ben

SQL*Plus: Release 11.2.0.4.0 Production onSun Sep 8 08:27:18 2013

Copyright (c) 1982, 2013, Oracle.  All rights reserved.

Connected to:

Oracle Database 11g Enterprise EditionRelease 11.2.0.4.0 - 64bit Production

With the Partitioning, Automatic StorageManagement, OLAP, Data Mining

and Real Application Testing options

SQL>

结束语

虽然执行脚本静默安装的时候,有一点点警告,说一些环境不符合,一些条件不满足,但是看到提示说成功安装client,软件成功安装就没问题了。

7.安装中遇到的问题

invalid stored block lengths  

invalid stored block lengths此报错信息一般出现在oracledatabase 安装或者upgrade patch   

   

造成此错误的原因有以下几种  

a.)下载的安装包有问题  

b.)解压过程中出现问题  

c.)传输过程中存在问题  

  

  

解决方案  

a.)重新下载DB安装包  

b.)重新解压  

c.)重新上传到服务器中,默认开二进制传输  

d.)restart server  

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值