centos 5.6 x86-64 安装oracle 10.2.0.1

 

一、安装图形界面(必须),可以启动selinux

echo "10.2.33.24 bristol1.hualu5.com hualu5.com" >>/etc/hosts

修改 /etc/sysconfig/network主机名为

HOSTNAME=bristol1.hualu5.com

 

二.准备安装的软件:

binutils

compat-libstdc++

elfutils-libelf

elfutils-libelf-devel

glibc

glibc-common

glibc-devel

gcc

gcc-c++

libaio

libaio-devel

libgcc

libstdc++

libstdc++-devel

make

sysstat

unixODBC

unixODBC-devel

 

这些软件直接用yum安装就可以。

yum -y install binutils compat-libstdc++ elfutils-libelf elfutils-libelf-devel glibc glibc-common glibc-devel gcc gcc-c++ libaio libaio-devel libgcc libstdc++ libstdc++-devel make sysstat unixODBC unixODBC-devel compat-libstdc++*

 

数据库软件:10201_database_linux_x86_64.cpio

 

三.建立用户和组

/usr/sbin/groupadd oinstall

/usr/sbin/groupadd dba

/usr/sbin/useradd -g oinstall -G dba oracle

passwd oracle

 

四.建立目录和权限

mkdir /oracle

chown -R oracle:oinstall /oracle

 

五.编辑变量

1.

vi /etc/sysctl.conf

kernel.shmall = 2097152

kernel.shmmax = 2147483648

kernel.shmmni = 4096

kernel.sem = 250 32000 100 128

net.ipv4.ip_local_port_range = 1024 65000

net.core.rmem_default=4194304

net.core.rmem_max=4194304

net.core.wmem_default=262144

net.core.wmem_max=262144

 

2.

vi /etc/security/limits.conf

oracle soft    nproc   2047

oracle hard    nproc   16384

oracle soft    nofile 1024

oracle hard    nofile 65536

 

3.

vi /etc/pam.d/login

session required /lib64/security/pam_limits.so

session required pam_limits.so

 

4.

vi /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

#LC_ALL="en_US"

 

5.

cd /home/oracle

vi .bash_profile

 

ORACLE_BASE=/oracle

ORACLE_HOME=$ORACLE_BASE/oracle/product/10.2.0/db_1

ORACLE_SID=bristol1

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

export ORACLE_BASE ORACLE_HOME ORACLE_SID PATH

 

6.安装libXp

yum -y install libXp


 

7.

cd /etc

cp redhat-release redhat-release.bak

echo "redhat 4"> redhat-release

 

vim /etc/sysconfig/i18n 修改字符集为

LANG="en_US.UTF-8"

 

 

 

重新启动服务器

 

安装oracle

cd /usr/local/src

cpio -idmv < 10201_database_linux_x86_64.cpio

chown oracle.oinstall database &ndash;R

mv database /home/

用图形界面安装oracle 10g:

使用yum来安装CentOS图形界面包  

yum grouplist    检查已安装的组
yum groupinstall "X Window System"

yum groupinstall "GNOME Desktop Environment"

yum groupinstall "Desktop"      #centos 6.5下gnome是Desktop

yum groupinstall "Chinese Support"

startX 就OK。

想要卸载:
yum groupremove "GNOME Desktop Environment"

 

 

 

 

 

8、以oracle用户登录图形界面:

打开终端:

cd /home/database

export LANG=en_US

./runInstaller

 

执行此命令后会启动图形一个界面

 

 

 

以上图片必须完全通过,即显示为 0 requirements to be verified. 否则以后安装过程中会出现问题。

 

以root身份执行途中的两个脚本,执行root.sh后,出现选项直接回车即可。

 

 

 


 

 

 

 

 

 

 

 

 

 

出现此画面证明已经安装成功,点exit退出即可。这是数据库已经启动。

 

登录shell,改回linux版本

cd /etc

cp redhat-release.bak redhat-release

 

六、修改em登录按钮字符集乱码问题:

em登录:http://bristol1.hualu5.com:1158/em

 

[oracle@bristol1 lib]$ cd $ORACLE_HOME/jdk/jre/lib

[oracle@bristol1 lib]$ pwd

/oracle/oracle/product/10.2.0/db_1/jdk/jre/lib

[oracle@bristol1 lib]$ ls font*zh_CN*

font.properties.zh_CN.Redhat font.properties.zh_CN.Redhat2.1 font.properties.zh_CN.Sun font.properties.zh_CN_UTF8.Sun

[oracle@bristol1 lib]$ cp font.properties font.properties.bak

[oracle@bristol1 lib]$ cp font.properties.zh_CN.Redhat font.properties

修改font.properties的最后一行filename.-misc-zysong18030-medium-r-normal--*-%d-*-*-c-*-iso10646-1=/usr/share/fonts/zh_CN/TrueType/zysong.ttf

为filename.-misc-zysong18030-medium-r-normal--*-%d-*-*-c-*-iso10646-1=/usr/share/fonts/chinese/TrueType/uming.ttf

[oracle@bristol1 lib]$ cd $ORACLE_HOME/jre/1.4.2/lib/

[oracle@bristol1 lib]$ pwd

/oracle/oracle/product/10.2.0/db_1/jre/1.4.2/lib

[oracle@bristol1 lib]$ ls font*zh_CN*

font.properties.zh_CN.Redhat font.properties.zh_CN.Redhat2.1 font.properties.zh_CN.Sun font.properties.zh_CN_UTF8.Sun

[oracle@bristol1 lib]$ cp font.properties font.properties.bak

[oracle@bristol1 lib]$ cp font.properties.zh_CN.Redhat font.properties

修改font.properties的最后一行filename.-misc-zysong18030-medium-r-normal--*-%d-*-*-c-*-iso10646-1=/usr/share/fonts/zh_CN/TrueType/zysong.ttf

为filename.-misc-zysong18030-medium-r-normal--*-%d-*-*-c-*-iso10646-1=/usr/share/fonts/chinese/TrueType/uming.ttf

 

清除cache缓存:

[oracle@bristol1 zhs]$ cd $ORACLE_HOME/oc4j/j2ee/oc4j_applications/applications/em/em/cabo/p_w_picpaths/cache/zhs 

[oracle@bristol1 zhs]$ pwd

/oracle/oracle/product/10.2.0/db_1/oc4j/j2ee/oc4j_applications/applications/em/em/cabo/p_w_picpaths/cache/zhs

[oracle@bristol1 zhs]$ rm -rf ./*.gif

 

重启em

emctl stop dbconsole

emctl start dbconsole

 

登录bristol1.hualu5.com:1158/em

 

 

 

七.安装后运行 :

oracle 随系统自启动

cd /etc/init.d/

touch oracle10g

chmod 700 oracle10g

 

vim oracle10g

 

# !/bin/bash

# whoami

# root

# chkconfig: 345 51 49

# /etc/init.d/oracle10g

# description: starts the oracle dabase deamons

#

ORA_HOME=/oracle/oracle/product/10.2.0/db_1/

ORA_OWNER=oracle

case "$1" in

start)

echo -n "Starting oracle10g: "

su - $ORA_OWNER -c "$ORA_HOME/bin/dbstart" &

su - $ORA_OWNER -c "$ORA_HOME/bin/lsnrctl start"

su - $ORA_OWNER -c "$ORA_HOME/bin/emctl start dbconsole"

touch /var/lock/subsys/oracle10g

echo

;;

 

stop)

echo -n "shutting down oracle10g: "

su - $ORA_OWNER -c "$ORA_HOME/bin/dbshut" &

su - $ORA_OWNER -c "$ORA_HOME/bin/lsnrctl stop"

su - $ORA_OWNER -c "$ORA_HOME/bin/emctl stop dbconsole"

rm -f /var/lock/subsys/oracle10g

echo

;;

 

restart)

echo -n "restarting oracle10g: "

$0 stop

$0 start

echo

;;

*)

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

exit 1

 

esac

exit 0

添加到自启动:

/sbin/chkconfig --add oracle10g

/sbin/chkconfig --list oracle10g

 

注意:

这样的脚本启动一般不会启动实例,如果想让实例也随脚本一起启动的话,就需要修改文件:/etc/oratab

如果这个文件不存在,那么就得运行脚本文件产生它

 

[root@bristol1 db_1]# cat /etc/oratab

#

 

 

 

# This file is used by ORACLE utilities. It is created by root.sh

# and updated by the Database Configuration Assistant when creating

# a database.

 

# A colon, ':', is used as the field terminator. A new line terminates

# the entry. Lines beginning with a pound sign, '#', are comments.

#

# Entries are of the form:

#   $ORACLE_SID:$ORACLE_HOME:<N|Y>:

#

# The first and second fields are the system identifier and home

# directory of the database respectively. The third filed indicates

# to the dbstart utility that the database should , "Y", or should not,

# "N", be brought up at system boot time.

#

# Multiple entries with the same $ORACLE_SID are not allowed.

#

#

bristol1:/oracle/oracle/product/10.2.0/db_1:N

 

 

把 N改成Y。

 

 

 

 

手动启动oracle

 

 su - oracle

 sqlplus /nolog

sql> conn sys / as sysdba

sql> startup

sql> exit

 

cd $ORACLE_HOME/bin

./lsnrctl start

 

八、Windows客户端连接:

安装oracle 10g for windows client

通过net configuration assistant 增加监听和

 

 

 

 

 

 

 

 

 

 

 

 

 

 

这里的网络服务器就是sid