Linux centos6.5 64下oracle10g_静默安装完整版

http://www.360doc.com/content/11/0116/09/2054285_86835998.shtml# oracle10g图形化界面安装全过程
-----------------------oracle10g 命令行安装全过程------------------------------
1.下载并解压文件
在Oralce官网上下载个Oralce10g for Linux,分i386和x86_64两种。
10201_database_linux32.zip、10201_database_linux_x86_64.cpio.gz
10201_database_linux32.zip 安装包解压命令
unzip 10201_database_linux32.zip
10201_database_linux_x86_64.cpio.gz 安装包解压命令
gunzip 10201_database_linux_x86_64.cpio.gz
cpio -idmv < 10201_database_linux_x86_64.cpio

2.参数设置
OS参数要求vi /etc/sysctl.conf , 在行末添加以下内容
kernel.shmall = 2097152
kernel.shmmax = 2147483648
kernel.shmmni = 4096

semaphores: semmsl, semmns, semopm, semmni

kernel.sem = 250 32000 100 128
fs.file-max = 65536
net.ipv4.ip_local_port_range = 1024 65000
net.core.rmem_default=262144
net.core.rmem_max=262144
net.core.wmem_default=262144
net.core.wmem_max=262144
运行sysctl -p应用以上参数, /sbin/sysctl -p

vi /etc/security/limits.conf 行末添加以下内容:
#use for oracle
oracle soft nproc 2047
oracle hard nproc 16384
oracle soft nofile 1024
oracle hard nofile 65536

vi /etc/pam.d/login 行末添加以下内容
session required /lib/security/pam_limits.so
注意如果你的操作系统是x64的则为session required /lib64/security/pam_limits.so
否则系统拒绝登录

vi /etc/selinux/config 确保以下内容,关闭SELIINUX
SELINUX=disabled
如果是c shell,则环境变量文件 /etc/csh.login的修改值如下:
if ( \$USER == "oracle" ) then
limit maxproc 16384
limit descriptors 65536
umask 022
endif

在/etc/profile里添加如下行
export LIBXCB_ALLOW_SLOPPY_LOCK=true
if [ \$USER = "oracle" ]; then
if [ \$SHELL = "/bin/ksh" ]; then
ulimit -p 16384
ulimit -n 65536
else
ulimit -u 16384 -n 65536
fi
umask 022
fi

在root用户下,使用命令source profile使环境变量生效

3.创建用户及组
[root@localhost ~]# groupadd oinstall
[root@localhost ~]# groupadd dba
[root@localhost ~]# useradd -g oinstall -G dba oracle
[root@localhost ~]# passwd oracle

4.创建目录
mkdir -p /home/oracle/product/10.2.0/db_1

5.设置环境变量
[oracle@localhost /]$ su - oracle
[oracle@localhost /]$ vi home/oracle/.bash_profile 用oracle用户编辑加入以下内容
#Oracle Settings
umask 022;
export ORACLE_BASE=/home/oracle;
export ORACLE_HOME=$ORACLE_BASE/product/10.2.0/db_1;
export ORACLE_SID=TSH1;
export PATH=$ORACLE_HOME/bin:$PATH;
如果在编辑的过程中出现乱码则用一下命令
export LANG=en_US.UTF-8
export NLS_LANG="SIMPLIFIED CHINESE_CHINA".ZHS16GBK --该行可以不加
使环境变量生效
$ source .bash_profile

然后再设置本地字符集类型
$ export LANG=en_US.UTF-8

6.安装依赖包
安装kernel-devel和kernel-headers,并且在更新系统时,禁止更新kernel:
yum -y install kernel-devel kernel-headers && echo exclude=kernel* >> /etc/yum.conf

更新系统:
yum -y update
安装常用软件:
yum -y install autoconf automake binutils-devel bison cpp dos2unix ftp gcc gcc-c++ lrzsz python-devel
安装Oracle必需软件:
yum -y install compat-db compat-gcc-34 compat-gcc-34-c++ compat-libstdc++-33 glibc- glibc-.i686 libXpm-*.i686 libXp.so.6 libXt.so.6 libXtst.so.6 libgcc_s.so.1 ksh libXp libaio-devel numactl numactl-devel unixODBC unixODBC-devel

  1. 修改/etc/redhat-release文件,加入
    编辑install目录下面的oraparam.ini文件,在“Certified Versions”的项目中添加“redhat-6”。
    vim /home/oracle/Downloads/database/install/oraparam.ini
    添加红色部分内容。
    [Certified Versions]
    Linux=redhat-6,redhat-3,SuSE-9,redhat-4,UnitedLinux-1.0,asianux-1,asianux-2

8.配置静态ip
linux系统在安装时若无更改,系统的网络默认为DHCP,若想将IP设置为静态的IP该怎么办呢?如安装Oracle时,就被要求配置静态IP(Oracle吃内存,吃硬盘容量,需要一堆rpm包支持,IP也是那么的挑剔,苦哇~)。

今天在自己的笔记本上对RedHat Linux进行了上网配置,一切还算顺利。原来在Linux下配置网络也挺简单的。步骤如下:

配置文件位于:
/etc/sysconfig/network-scripts/ifcfg-eth0
DEVICE=eth0
ROOTPROTO=static
HWADDR=00:0C:29:A3:2C:FB
ONBOOT=yes
NETMASK=255.255.255.0 -- redhat linux 子网掩码
IPADDR=192.168.0.6 -- redhat linux 的IP地址
GATEWAY=192.168.0.1 -- redhat linux的默认网关跟windows主机的默认网关是一致的
TYPE=Ethernet
USERCTL=no
IPV6INIT=no
PEERDNS=yes

将上面的IPADDR和GATEWAY换成自己的就可以了。也可以设置MAC的逻辑地址(地址欺骗),在上面的配置文件中加一行HWADDR=你想填的MAC地址。

最后运行两个命令使新的设置生效
/sbin/ifdown ifcfg-eth0
/sbin/ifup ifcfg-eth0

还需配置DNS的主机名为 localhost.localdomain
主DNS解析域名为:202.96.209.5
第二DNS为:202.96.209.133
DNS搜寻路径:localdomain
不然在安装的过程中同样会报checking network configuration requirements is: Not executed的错误提示

还需修改 vi /etc/hosts 文件

在安装oracle 10g的过程中,遇到了checking network configuration requirements is: Not executed的错误提示。发现是/etc/hosts中没有指定静态ip地址导致,检测/etc/hosts发现果真如此,修改如下配置
127.0.0.1 localhost.localdomain localhost
#::1
192.168.18.192 localhost6.localdomain6 localhost6
---192.168.18.192是linux redhat 的ip地址不是windows ip 地址
重新检测,显示正常

需要将虚拟机连接方式设置为:桥接,而不是NAT,Host-only 的连接方式,不然也不能上网

9.配置enterprise.rsp文件,需使用自带的enterprise.rsp 配置再按照
静态安装文件是预先设置好参数了,那么等oracle安装的时候要手工输入的都可以直接读取静态安装文件(当然是x界面的啦)。如果你用x界面的操作系统那么,按着界面提示一步步完成也是一样的。
把10201_database_linux32.zip文件解压后得到database目录,
/home/oracle/database/response下有有enterprise.rsp、standard.rsp和custom.rsp三个应答文件,分别对应企业版、标准版和定制的安装。
我们以以enterprise.rsp为例:<Value Unspecified>基本上是要填的有些可以不填
RESPONSEFILE_VERSION=2.2.1.0.0
UNIX_GROUP_NAME="oinstall"
ORACLE_HOME_NAME="OraDb10g_home1"
ORACLE_HOME="/home/oracle/product/10.2.0/db_1"
SHOW_INSTALL_PROGRESS_PAGE= true
SHOW_END_OF_INSTALL_MSGS= true
COMPONENT_LANGUAGES={"zh_CN"}
s_nameForDBAGrp= "dba"
s_nameForOPERGrp="dba"
INSTALL_TYPE="EE"
n_configurationOption=3
RESTART_SYSTEM=false
RESTART_REMOTE_SYSTEM=false

说明:这几项要视情况而定比如说 UNIX_GROUP_NAME="oinstall"
和s_nameForDBAGrp= "dba" s_nameForOPERGrp="dba"
还有环境变量都要参照前面自己定义好的来填

10.正式安装
切换oracle用户安装
su - oracle

换oracle用户登录:注意文件位置视自己刚刚修改的文件位置而定
./runInstaller -silent -responseFile /home/oracle/database/response/enterprise.rsp

Installation in progress (Mon Sep 21 23:37:00 CST 2009)
............................................................... 18% Done.
............................................................... 36% Done.
............................................................... 54% Done.
............................................................... 72% Done.
................ 76% Done.
Install successful
Linking in progress (Mon Sep 21 23:39:49 CST 2009)
Link successful
Setup in progress (Mon Sep 21 23:43:11 CST 2009)
.............. 100% Done.
Setup successful
End of install phases.(Mon Sep 21 23:43:20 CST 2009)
WARNING:A new inventory has been created in this session. However, it has not yet been registered as the central inventory of this system.
To register the new inventory please run the script '/home/oracle/oraInventory/orainstRoot.sh' with root privileges.
If you do not register the inventory, you may not be able to update or patch the products you installed.
The following configuration scripts
/home/oracle/product/10.2.0/db_1/root.sh
need to be executed as root for configuring the system. If you skip the execution of the configuration tools, the configuration will not be complete and the product wont function properly. In order to get the product to function properly, you will be required to execute the scripts and the configuration tools after exiting the OUI.
The installation of Oracle Database 10g was successful.(恭喜你成功了如果没这个提示就看看他说的日志继续修改下ok)
Please check '/home/oracle/oraInventory/logs/silentInstall2009-09-21_11-36-22PM.log' for more details.

11.接下来按提示操作, root身份登录
/home/oracle/oraInventory/orainstRoot.sh
/home/oracle/product/10.2.0/db_1/root.sh

12.安装网络监听器
编辑 oracle 安装目录下的 netca.rsp 应答文件,地址为: /database/response/netca.rsp ,主要查看以下参数配置:
INSTALL_TYPE=""custom"" 安装的类型
LISTENER_NUMBER=1 监听器数量
LISTENER_NAMES={"LISTENER"} 监听器的名称列表
LISTENER_PROTOCOLS={"TCP;1521"} 监听器使用的通讯协议列表
LISTENER_START=""LISTENER"" 监听器启动的名称
运行安装命令:
$ORACLE_HOME/bin/netca /silent /responseFile /home/oracle/database/response/netca.rsp

注意:在此处可能会有错误 oracle 需要的软件包不全。请根据 1 中列出的软件包,确保所有的软件包都已经正确安装( 2 ) 6 中对 gennttab 文件的修改不正确,本人就是没有去掉 n 后的空格导致了该错误。
如下报的缺少libXtst包
Exception in thread "main" java.lang.UnsatisfiedLinkError: /home/oracle/product/10.2.0/db_1/jdk/jre/lib/i386/libawt.so: libXtst.so.6: cannot open shared object file:
用yum下载安装即可解决 [root@oraclebk ~]# yum install libXp

  1. 修改 dbstart
    vi $ORACLE_HOME/bin/dbstart

    ORACLE_HOME_LISTNER=/ade/vikrkuma_new/oracle
    改为:
    ORACLE_HOME_LISTNER=$ORACLE_HOME
    确保数据库启动时,网络监听器同时启动。

  2. 增加数据实例
    首先添加/etc/hosts
    然后添加/etc/sysctl.conf
    vm.hugetlb_shm_group = 510 ##(510为orinstall的组id)
    修改/home/oracle/database/response/dbca.rsp(就是解压安装文件目录下的)
    根据数据库建立方式的不同编辑不同的数据库库选项。
    比如在本次安装过程中设置了下列参数:(注意下面参数视情况而定啦不要照抄该选项原文件都有说明的)
    RESPONSEFILE_VERSION = "10.0.0"
    OPERATION_TYPE = "createDatabase"
    GDBNAME = "orcl" -- 数据库全局名称
    SID = "TSH1" --这个sid 必须要和前面的/home/oracle/.bash_profile文件中的sid相同
    TEMPLATENAME = "New_Database.dbt"
    SYSPASSWORD = "system" -- SYS 用户的初始密码
    SYSTEMPASSWORD = "system"--SYSTEM 用户的初始密码
    DATAFILEDESTINATION ="/home/oracle/oradata/"
    RECOVERYAREADESTINATION="/home/oracle/flash_recovery_area"
    STORAGETYPE=FS
    CHARACTERSET = "ZHS16GBK"--数据库字符集(中文为 ZHS16GBK )
    MEMORYPERCENTAGE = "40"
    SCRIPTDESTINATION ="/home/oracle/admin/ora10g/scripts"
    EMCONFIGURATION=”LOCAL”
    SYSMANPASSWORD = "system"
    DBSNMPPASSWORD = "system"
    其中最后1项不是必须的,这个的目的是在建立数据库的同时生成脚本。
    下面就可以开始SILENT模式的数据库创建了。

[root@localhost oradisk]# id oracle
uid=500(oracle) gid=500(oinstall) groups=500(oinstall),501(dba)
用root执行下面的命令,将dba组添加到系统内核中
[root@localhost oradisk]# echo 501 > /proc/sys/vm/hugetlb_shm_group

Vi /etc/hosts
Ip hostname

dbca -silent -responseFile /home/oracle/dbca.rsp --这个与下面那个是一样的

[oracle@localhost6 database]$ $ORACLE_HOME/bin/dbca -silent -responseFile /home/oracle/database/response/dbca.rsp

Creating and starting Oracle instance
1% complete
4% complete
Creating database files
8% complete
Creating data dictionary views
9% complete
10% complete
12% complete
13% complete
14% complete
15% complete
17% complete
18% complete
20% complete
21% complete
Adding Oracle JVM
22% complete
28% complete
34% complete
40% complete
42% complete
Adding Oracle Data Mining
43% complete
44% complete
46% complete
Adding Oracle Text
47% complete
49% complete
50% complete
Adding Oracle XML DB
52% complete
53% complete
54% complete
58% complete
Adding Oracle Intermedia
59% complete
60% complete
71% complete
Adding Oracle OLAP
72% complete
73% complete
74% complete
75% complete
Adding Oracle Spatial
76% complete
77% complete
78% complete
83% complete
Adding Enterprise Manager Repository
84% complete
86% complete
88% complete
Completing Database Creation
89% complete
90% complete
91% complete
95% complete
99% complete
100% complete
Look at the log file "/home/oracle/product/10.2.0/db_1/cfgtoollogs/dbca/orcl/orcl.log" for further details.
最后提示创建成功后
数据库创建成功后需要修改一些信息:

vi /etc/oratab
ora10g:/home/oracle/product/10.2.0.1/db_1:N
改为:
ora10g:/home/oracle/product/10.2.0.1/db_1:Y

保证数据库实例能自动启动。

15.创建数据库和监听器自启动的服务
$su - root

cd /etc/rc.d/init.d/

#touch oradbstart

vi oradbstart

脚本内容如下:

#!/bin/bash

chkconfig: 345 99 10

description: Startup Script for Oracle Databases

/etc/rc.d/init.d/oradbstart

export ORACLE_BASE=/home/oracle/
export ORACLE_HOME=/home/oracle/product/10.2.0/db_1
export ORACLE_SID=TSH1
export PATH=$ORACLE_HOME/bin:$PATH
case "$1" in
start)
su oracle -c $ORACLE_HOME/bin/dbstart
touch /var/lock/oracle
echo "OK"
;;
stop)
echo -n "Shutdown Oracle: "
su oracle -c $ORACLE_HOME/bin/dbshut
rm -f /var/lock/oracle
echo "OK"
;;
*)
echo "Usage: 'basename $0' start|stop"
exit 1
esac
exit 0

16.修改脚本的运行权限
$su - root
#chown oracle.oinstall /etc/rc.d/init.d/oradbstart
#chmod 775 /etc/rc.d/init.d/oradbstart

17.把oradbstart 服务添加到 chkconfig 中
chkconfig --add oradbstart
chkconfig --list oradbstart

  1. 启动数据库实例
    $ORACLE_HOME/bin/dbstart

  2. 测试
    [oracle@localhost ~]$sqlplus "/as sysdba"

  3. 安装完毕测试下:
    [root@localhost ~]# su - oracle
    [oracle@localhost ~]$ sqlplus /nolog
    SQL> connect /as sysdba
    SQL> startup
    SQL> quit
    测试成功,大功告成!

转载于:https://blog.51cto.com/1362336072/2086716

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值