ITPub博客

首页 > 数据库 > Oracle > Oracle9i RDBMS Install on linux

Oracle9i RDBMS Install on linux

原创 Oracle 作者:xxgoracle 时间:2008-01-23 19:24:44 0 删除 编辑
在 RatHat AS 3上安装Oracle 9.2.0.4的一些摘录[@more@]

一、实验元素

1. 硬件:

磁盘: RedHat OS: 1.5---3.0G

Oracle 9.2.0.4压缩包: 1.4G,解压后约: 1.6G

Oracle RDBMS 9.2.0安装: 2.49G

OS Swap: 物理内存的两倍

Linux OS /目录 预留空间: 至少 400M(用做temp空间)

DB: 1--2G

合计: 9G

内存: 推荐512M以上

CPU: 1.6GMHz

2. 软件:

OS: Linux 2.4.21-4.EL (RedHat AS 3)

DBMS: Oracle 9.2.0.4

OS_Patch: p3006854_9204_LINUX

Telnet工具: S-CRT

FTP: Xmanager 2.1 XFTP工具或其他FTP工具

j2sdk1.4.2_16

二、准备工作:

1. 规划存储

a. 规划好OS安装分区

b. 规划好Swap 分区

c. 规划好DB存储和归档存储

d. 规划好 介质存储和预留空间

2. 安装OS(装备介质,打齐开发工具),参考Oracle 文档A96167_01B13670_07

安装时会对OSSwap存储进行划分(建议依据规划使用合适的磁盘).

3. 划好介质存放空间和DB存储与归档存储.

4. 配置好Telnet FTP Server

5. 创建安装用户与组,安装好Java,并设置好环境变量,调整内核参数;打上Patch.

6. 上传RDBMS安装介质,解压好介质.

三、安装

1 .登陆终端,进入安装盘,运行./runIstaller,进行安装,开始只安装软件.

2.软件安装完毕,使用dbca工具创建建库脚本(dbca GUI界面对raw设备的支持性不太好,这次只使用他创建了建库脚本).

3.运行生成的建库shell脚本,进行建库(也可以自己手工配置脚本进行建库).

四、规划与配置相关脚本

1. 存储划分

a. 对新加磁盘进行检测

#fdisk –l

获取磁盘挂载的对应信息.

b. 进行磁盘划分

#fdisk /dev/sdc

c. 可以使用LVM管理工具进行存储划分

#vgscan

#pvcreate /dev/sdc /dev/sdd

#vgcreate oravg /dev/sdc /dev/sdd

划分DBMS安装区、归档存储与介质存放区

# lvcreate -L 5300m -n oracle_fs oravg

# lvcreate -L 524m -n archivelog oravg

挂载到文件系统中

格式化文件系统类型

# mkfs.ext3 /dev/oravg/oracle_fs

# mkfs.ext3 /dev/oravg/archivelog

创建挂载点

# mkdir /oracle

# mkdir /archivelog

挂载

# mount -t ext3 /dev/oravg/oracle_fs /oracle

# mount -t ext3 /dev/oravg/archivelog /archivelog

配置系统自动挂载

# vi /etc/fstab

LABEL=/ / ext3 defaults 1 1

LABEL=/boot /boot ext3 defaults 1 2

none /dev/pts devpts gid=5,mode=620 0 0

none /proc proc defaults 0 0

none /dev/shm tmpfs defaults 0 0

/dev/sda2 swap swap defaults 0 0

/dev/cdrom /mnt/cdrom udf,iso9660 noauto,owner,kudzu,ro 0 0

/dev/fd0 /mnt/floppy auto noauto,owner,kudzu 0 0

/dev/oravg/oracle_fs /oracle ext3 defaults 1 2

/dev/oravg/archivelog /archivelog ext3 defaults 1 2

修改访问权限用户与组

# chown -R oracle:dba /oracle

# chown -R oracle:dba /archivelog

划分DB 文件存储(数据、参数、控制与日志文件)

# lvcreate -L 12m -n lv_spfile oravg

# lvcreate -L 20m -n lv_control01 oravg

# lvcreate -L 20m -n lv_control02 oravg

# lvcreate -L 20m -n lv_control03 oravg

# lvcreate -L 50m -n lv_redo01 oravg

# lvcreate -L 50m -n lv_redo02 oravg

# lvcreate -L 50m -n lv_redo03 oravg

# lvcreate -L 500m -n lv_system01 oravg

# lvcreate -L 300m -n lv_undotbs01 oravg

# lvcreate -L 200m -n lv_temp01 oravg

# lvcreate -L 300m -n lv_users01 oravg

d. 对DB文件进行裸设备绑定和DBMS文件挂载分区进行设置

绑定裸设备:

raw /dev/raw/raw1 /dev/oravg/lv_control01

raw /dev/raw/raw2 /dev/oravg/lv_control02

raw /dev/raw/raw3 /dev/oravg/lv_control03

raw /dev/raw/raw4 /dev/oravg/lv_redo01

raw /dev/raw/raw5 /dev/oravg/lv_redo02

raw /dev/raw/raw6 /dev/oravg/lv_redo03

raw /dev/raw/raw7 /dev/oravg/lv_system01

raw /dev/raw/raw8 /dev/oravg/lv_temp01

raw /dev/raw/raw9 /dev/oravg/lv_undotbs01

raw /dev/raw/raw10 /dev/oravg/lv_users01

raw /dev/raw/raw11 /dev/oravg/lv_spfile

配置绑定raw设备,防止启动后丢失配置

通过配置文件/etc/sysconfig/rawdevices

#vi /etc/sysconfig/rawdevices

# raw device bindings

# format:

#

# example: /dev/raw/raw1 /dev/sda1

# /dev/raw/raw2 8 5

/dev/raw/raw1 /dev/oravg/lv_control01

/dev/raw/raw2 /dev/oravg/lv_control02

/dev/raw/raw3 /dev/oravg/lv_control03

/dev/raw/raw4 /dev/oravg/lv_redo01

/dev/raw/raw5 /dev/oravg/lv_redo02

/dev/raw/raw6 /dev/oravg/lv_redo03

/dev/raw/raw7 /dev/oravg/lv_system01

/dev/raw/raw8 /dev/oravg/lv_temp01

/dev/raw/raw9 /dev/oravg/lv_undotbs01

/dev/raw/raw10 /dev/oravg/lv_users01

/dev/raw/raw11 /dev/oravg/lv_spfile

配置raw的访问权限,配置/etc/rc.d/rc.local

#vi /etc/rc.d/rc.local

#!/bin/sh

#

# This script will be executed *after* all the other init scripts.

# You can put your own initialization stuff in here if you don't

# want to do the full Sys V style init stuff.

touch /var/lock/subsys/local

#

#**************************

#auto gets the user and group privs

#*******************************

chown -R oracle:dba /dev/raw/raw1

chown -R oracle:dba /dev/raw/raw2

chown -R oracle:dba /dev/raw/raw3

chown -R oracle:dba /dev/raw/raw4

chown -R oracle:dba /dev/raw/raw5

chown -R oracle:dba /dev/raw/raw6

chown -R oracle:dba /dev/raw/raw7

chown -R oracle:dba /dev/raw/raw8

chown -R oracle:dba /dev/raw/raw9

chown -R oracle:dba /dev/raw/raw10

chown -R oracle:dba /dev/raw/raw11

#

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

#auto gets the exec privs.

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

chmod 777 /dev/raw/raw1

chmod 777 /dev/raw/raw2

chmod 777 /dev/raw/raw3

chmod 777 /dev/raw/raw4

chmod 777 /dev/raw/raw5

chmod 777 /dev/raw/raw6

chmod 777 /dev/raw/raw7

chmod 777 /dev/raw/raw8

chmod 777 /dev/raw/raw9

chmod 777 /dev/raw/raw10

chmod 777 /dev/raw/raw11

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

e. 配置内核参数

# echo 100 256 100 100 > /proc/sys/kernel/sem

# echo 2147483648 > /proc/sys/kernel/shmmax

# echo 4096 > /proc/sys/kernel/shmmni

# echo 2097152 > /proc/sys/kernel/shmall

f. 配置安装用户环境变量

#vi $HOME/.bash_profile

# .bash_profile

# Get the aliases and functions

if [ -f ~/.bashrc ]; then

. ~/.bashrc

fi

# User specific environment and startup programs

PATH=$PATH:$HOME/bin

export PATH

unset USERNAME

# +------------------------------------------------------------+

# | FILE : .bash_profile |

# +------------------------------------------------------------+

umask 022

TERM=xterm; export TERM

TMPDIR=/tmp; export TMPDIR

# +--------------------------+

# | SETUP ORACLE ENVIRONMENT |

# +--------------------------+

export ORACLE_SID=ora9i

export ORACLE_BASE=/oracle

export ORACLE_HOME=/oracle/product/9.2.0

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

export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/lib

export TNS_ADMIN=$ORACLE_HOME/network/admin

export NLS_LANG=AMERICAN_AMERICA.ZHS16GBK

export ORA_NLS33=$ORACLE_HOME/ocommon/nls/admin/data

export ORACLE_OWNER=oracle

export ORACLE_TERM=xterm

export GCC_EXEC_PREFIX=/usr/i386-glibc21-linux/lib/gcc-lib/

# +--------------------------+

# | LINUX STUFF |

# +--------------------------+

export LD_ASSUME_KERNEL=2.4.1

#source /usr/i386-glibc2.1-linux/bin/i386-glibc21-linux-env.sh

# +--------------------------+ 2

#Install Oracle9IR2 on RedHat AS3_5

# | SETUP SEARCH PATH |

# +--------------------------+

PATH=$PATH:$ORACLE_HOME/bin:/opt/bin:/bin:/usr/bin:/usr/local/bin:/usr/sbin:/usr/X11R6/bin:/home/oracle/j2sdk1.4.2_16:.

export PATH

# +--------------------------+

# | SETUP JAVA ENVIRONMENT |

# +--------------------------+

export JAVA_HOME=/home/oracle/j2sdk1.4.2_16

export CLASSPATH=$ORACLE_HOME/jdbc/lib/classes12.zip:$ORACLE_HOME/JRE:$ORACLE_HOME/jlib:$ORACLE_HOME/rdbms/jlib:$ORACLE_HOME/network/jlib:.

# +-------------+

# | "GREETINGS" |

# +-------------+

#----------------+

#dbca raw config

#+------------------+

#DBCA_RAW_CONFIG=$HOME/rawtofile

#export DBCA_RAW_CONFIG

echo ".bash_profile executed"

g. 配置dbca使用时的raw设备配置文件(dbca gui运行在数据文件配置时,界面不太友好,所以只用它来生成脚本)

#vi rawtofile

control01=/dev/raw/raw1

control02=/dev/raw/raw2

control03=/dev/raw/raw3

redo1_1=/dev/raw/raw4

redo2_1=/dev/raw/raw5

redo3_2=/dev/raw/raw6

system=/dev/raw/raw7

temp=/dev/raw/raw8

undotbs1=/dev/raw/raw9

users=/dev/raw/raw10

spfile=/dev/raw/raw11

h. 在用户环境中设置了JAVA_HOME=/home/oracle/j2sdk1.4.2_16变量,指定了一个另行安装j2sdk,所以需要修改dbca工具执行脚本: $ORACLE_HOME/bin/dbca

#vi $ORACLE_HOME/bin/dbca

找到JRE_DIR变量

# Directory Variables

注释

#JRE_DIR=/oracle/product/9.2.0/JRE

添加为

JRE_DIR=/home/oracle/j2sdk1.4.2_16/jre

找到$JRE_DIR/bin/jre

# Run DBCA

注释

#$JRE_DIR/bin/jre -native -DORACLE_HOME=$OH -DJDBC_PROTOCOL=thin -mx64m -classpath $CLASSPATH oracle.sysman.assistants.dbca.Dbca $ARGUMENTS

添加为

$JRE_DIR/bin/java -native -DORACLE_HOME=$OH -DJDBC_PROTOCOL=thin -mx64m -classpath $CLASSPATH oracle.sysman.assistants.dbca.Dbca $ARGUMENTS

# Run DBCA

注释

#$JRE_DIR/bin/jre -DORACLE_HOME=$OH -DJDBC_PROTOCOL=thin -mx64m -classpath $CLASSPATH oracle.sysman.assistants.dbca.Dbca $ARGUMENTS

添加为

$JRE_DIR/bin/java -DORACLE_HOME=$OH -DJDBC_PROTOCOL=thin -mx64m -classpath $CLASSPATH oracle.sysman.assistants.dbca.Dbca $ARGUMENTS.

来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/20546452/viewspace-998277/,如需转载,请注明出处,否则将追究法律责任。

上一篇: 2007--->2008
请登录后发表评论 登录
全部评论
  • 博文量
    37
  • 访问量
    519459