CentOS5.5安装Oracle10g

更新时间:2023-08-20 05:01:01 阅读量: 高等教育 文档下载

说明:文章内容仅供预览,部分内容可能不全。下载后的文档,内容与下面显示的完全一致。下载之前请确认下面内容是否您想要的,是否完整无缺。

CentOS5.5安装Oracle10g

1、配置swap大小

在安装Linux划分分区的时候,请根据下表来设置Swap的大小。

2、修改host

在/etc/hosts里增加IP地址和电脑名,以便域名解析。

[root@centosCentOS]#vi /etc/hosts

# Do not remove the following line, or various programs

# that require network functionality will fail.

192.168.0.16 centos

3、安装rpm包

x64位版的Linux需要检查是否安装以后包,例如使用命令:rpm –qa |grepbinutils查询,如果没有,请使用命令:rpm –ivhbinutils-2.15.92.0.2-10.EL4安装。

binutils-2.15.92.0.2-10.EL4

compat-db-4.1.25-9

control-center-2.8.0-12

gcc-3.4.3-9.EL4

gcc-c++-3.4.3-9.EL4

glibc-2.3.4-2

glibc-common-2.3.4-2

libstdc++-3.4.3-9.EL4

libstdc++-devel-3.4.3-9.EL4

make-3.80-5

pdksh-5.2.14-30

sysstat-5.0.5-1

libXp-1.0.0-8.1.el5.x86_64.rpm

libXp-1.0.0-8.1.el5.i386.rpm

compat-libstdc++-33-3.2.3-61.i386.rpm

compat-libstdc++-33-3.2.3-61.x86_64.rpm

4、调整内核参数

编辑/etc/sysctl.conf加入以下内容。

kernel.shmall = 2097152

kernel.shmmax = 2147483648

kernel.shmmni = 4096

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命令重新加载内核

用vi命令编辑以下文件并加入内容。

1.)/etc/security/limits.conf

* softnproc 2047

* hardnproc 16384

* softnofile 1024

* hardnofile 65536

2.)/etc/pam.d/login

session required pam_limits.so

3. )/etc/profile

if [ $USER = "oracle" ]; then

if [ $SHELL = "/bin/ksh" ]; then

ulimit -p 16384

ulimit -n 65536

else

ulimit -u 16384 -n 65536

fi

fi

5、创建用户和组

[root@centos /]#groupaddoinstall

[root@centos /]# groupadddba

[root@centos /]# groupaddoper

[root@centos /]# useradd -g oinstall -G dba,oper oracle

[root@centos /]# id oracle

uid=500(oracle) gid=500(oinstall) groups=500(oinstall),501(dba),502(oper)

[root@centos /]# passwd oracle

Changing password for user oracle.

New UNIX password:

BAD PASSWORD: it does not contain enough DIFFERENT characters

Retype new UNIX password:

passwd: all authentication tokens updated successfully.

6、创建安装oracle的文件夹,并设置其相应权限给Oracle用户 mkdir -p /data/app/oracle/product/10.2.0.1

chown -R oracle:oinstall/data/app

chmod 775 /data/app

7、伪装cp /etc/redhat-release /etc/redhat-release.bak 使用vi命令编辑 /etc/redhat-release,替换为如下代码:

Red Hat Enterprise Linux AS release 4 (Nahant Update 4)

8、设置Oracle环境变量

使用命令vi /home/oracle/.bash_profile增加环境变量

LANG=en

DISPLAY=192.168.89.6:0.0

ORACLE_BASE=/data/app/oracle

ORACLE_SID=his

ORACLE_HOME=$ORACLE_BASE/product/10.2.0.1

PATH=$ORACLE_HOME/bin:$PATH:$HOME/bin

LD_LIBRARY_PATH=$ORACLE_HOME/lib:/lib:/usr/lib

CLASSPATH=$ORACLE_HOME/jre:$ORACLE_HOME/jlib:$ORACLE_HOME/rdbms/jlib

export PATH LANG DISPLAY ORACLE_BASE ORACLE_SID ORACLE_HOME LD_LIBRARY_PATH CLASSPATH

9、解压安装包文件,安装jdk

gunzip 10201_database_linux_x86_64.cpio.gz

cpio -idmv< 10201_database_linux_x86_64.cpio

[root@centos soft]# ./jdk-6u22-linux-x64-rpm.bin

10、以oracle身份登录图形界面进行安装

[root@centos ~]# xhost +

access control disabled, clients can connect from any host

[root@centos ~]# su - oracle

[oracle@centos ~]$ xclock

先安装软件

./runInstaller

安装完成后,以root用户执行

./orainstRoot.sh

./root.sh

安装数据库

dbca

配置监听

netca

11、设置oracle自动启动

1.)编辑dbstart

[root@centos /]#vi /data/app/oracle/product/10.2.0.1/bin/dbstart # Set this to bring up Oracle Net Listener

ORACLE_HOME_LISTNER=/ade/vikrkuma_new/oracle

应该是在78行,将其改为:

# Set this to bring up Oracle Net Listener

ORACLE_HOME_LISTNER=$ORACLE_HOME

2.)编辑 /etc/oratab

最下一行

his:/data/app/oracle/product/10.2.0.1:N

更改为:

his:/data/app/oracle/product/10.2.0.1:Y

3.)新建一个文件vi /etc/init.d/oracle

#!/bin/bash

#

# oracledb This Starts/Stops the Oracle Server

# chkconfig: 345 99 10

# description: script for the Oracle Instance, Listener

# /etc/init.d/oracledb

#

# Run-level Startup script for the Oracle Listener and Instances

# It relies on the information on /etc/oratab

export ORACLE_OWNR=oracle

export ORACLE_HOME=/data/app/oracle/product/10.2.0.1

echo "Oracle Script init.d"

if [ ! -f $ORACLE_HOME/bin/dbstart -o ! -d $ORACLE_HOME ]

then

echo "Oracle startup: cannot start"

exit 1

fi

case "$1" in

start)

# Oracle listener and instance startup

echo -n "Starting Oracle: "

su - $ORACLE_OWNR -c "$ORACLE_HOME/bin/lsnrctl start"

su - $ORACLE_OWNR -c "$ORACLE_HOME/bin/dbstart $ORACLE_HOME" su - $ORACLE_OWNR -c "$ORACLE_HOME/bin/emctl start dbconsole" touch /var/lock/oracle

echo "OK"

;;

stop)

# Oracle listener and instance shutdown

echo -n "Shutdown Oracle: "

su - $ORACLE_OWNR -c "$ORACLE_HOME/bin/emctl stop dbconsole" su - $ORACLE_OWNR -c "$ORACLE_HOME/bin/lsnrctl stop"

su - $ORACLE_OWNR -c "$ORACLE_HOME/bin/dbshut $ORACLE_HOME" rm -f /var/lock/oracle

echo "OK"

;;

reload|restart)

$0 stop

$0 start

;;

*)

echo "Usage: `basename $0` start|stop|restart|reload"

exit 1

esac

exit 0

4.)增加启动项

[root@centos /]# chmod +x /etc/rc.d/init.d/oracle

[root@centos /]# chkconfig --add oracle

[root@centos /]#chkconfig --list|grep oracle

oracle 0:关闭 1:关闭 2:关闭 3:启用 4:启用

[root@centos 10.2.0.1]# cd /usr/bin

[root@centos bin]# pwd 5:启用 6:关闭

/usr/bin

[root@centos bin]# ln -s /etc/rc.d/init.d/oracle

12、日常操作

上述已经设置好了服务器开机后会自动启动oracle服务,也可以用如下命令操作。

1.)启动oracle

oracle start

2.)关闭oracle

oracle stop

3.)重启oracle

oracle restart

本文来源:https://www.bwwdw.com/article/h76j.html

Top