oracle10g for linux 安装

来源:互联网 发布:混沌战域国宝进阶数据 编辑:程序博客网 时间:2024/05/16 04:39
 
一、Oracle 10g 10.2.0.1.zip可以从官方网站下载。(1CD,下载后做下checksum) 下载后是压缩文档,可以
unzip解压缩。
二、CentOS4.2安装过程中,选择全部安装。
另外还需要确认以下补丁包:
compat-db-4.1.25-9
compat-gcc-32-3.2.3-47.3
compat-gcc-32-c++-3.2.3-47.3
compat-oracle-rhel4-1.0-3
compat-libcwait-2.0-1
compat-libgcc-296-2.96-132.7.2
compat-libstdc++-296-2.96-132.7.2
compat-libstdc++-33-3.2.3-47.3
gcc-3.4.3-9.EL4
gcc-c++-3.4.3-9.EL4
gnome-libs-1.4.1.2.90-44
gnome-libs-devel-1.4.1.2.90-44
libaio-devel-0.3.102-1
libaio-0.3.102-1
make-3.80-5
openmotif21-2.1.30-11
其中compat-oracle-rhel4compat-libcwait可以在如下网站:
http://oss.oracle.com/projects/compat-oracle/files/RedHat/ 下载
检查是否符合oracle 10g 的安装要求,以表格的形式列出。首先是硬件情况。启动x-win32以root登录系
用下表命令输出的值大于或等于建议值。

检查项目                命令/方法                                     建议值
内存                      #grep MemTotal  /proc/meminfo      512MB
交换分区               #grep SwapTotal  /proc/meminfo     >1GB
/tmp目录空闲区     #df -k /tmp                                     400MB
硬盘空闲空间        #df -k                                            4GB
三、设置系统参数
在root用户下
a) 修改#vi /etc/sysctl.conf, 与以下内容一致
# Kernel sysctl configuration file for Red Hat Linux
#
# For binary values, 0 is disabled, 1 is enabled.  See sysctl(  and
# sysctl.conf(5) for more details.

# Controls IP packet forwarding
net.ipv4.ip_forward = 0

# Controls source route verification
net.ipv4.conf.default.rp_filter = 1

# Controls the System Request debugging functionality of the kernel
kernel.sysrq = 0

# Controls whether core dumps will append the PID to the core filename.
# Useful for debugging multi-threaded applications.
kernel.core_uses_pid = 1
kernel.shmmax = 536870912 / 268435456
kernel.shmmni = 4096
kernel.shmall = 2097152
kernel.sem = 250 32000 100 128
net.core.rmem_default = 262144
net.core.rmem_max = 262144
net.core.wmem_default = 262144
net.core.wmem_max = 262144

fs.file-max = 65536
net.ipv4.ip_local_port_range = 1024 65000
修改后运行#/sbin/sysctl -p命令使得内核改变立即生效;或者重启系统。
四,创建数据库安装的准备工作;
1,创建user和group
#groupadd dba
#groupadd oinstall
#groupadd oper
#useradd -g oinstall -G dba oracle
#passwd oracle
2,建立oracle安装文件夹;
#mkdir -p /usr/u01/app/oracle
#chown -R oracle:dba /usr/u01/app/oracle
#chmod -R 755 /usr/u01/app/oracle
#mkdir -p /usr/u01/app/oracle/product/10.2.0.1
#chown -R oracle:dba /usr/u01/app/oracle/product/10.2.0.1
#chmod -R 755 /usr/u01/app/oracle/product/10.2.0.1
2 配置环境变量;
切换Oracle用户:
#su oracle
#vi $HOME/.bashrc
配置文件的内容与以下内容一致
# .bash_profile

# Get the aliases and functions
if [ -f ~/.bashrc ]; then
        . ~/.bashrc
fi

# User specific environment and startup programs

PATH=$PATH:HOME/bin
export ORACLE_BASE=/usr/u01/app/oracle
export ORACLE_HOME=$ORACLE_BASE/product/10.2.0.1
export PATH=$PATH:$ORACLE_HOME/bin:$ORACLE_HOME/Apache/Apache/bin
export ORACLE_OWNER=oracle
export ORACLE_SID=test
export ORACLE_TERM=xterm
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:ORACLE_HOME/lib
export NLS_LANG=”American_america.zhs16gbk”
export ORA_NLS33=$ORACLE_HOME/ocommon/nls/admin/data
unset USERNAME
umask 022
存盘退出。

五.数据库系统的安装
oracle用户登录系统,进行Oracle的安装
#su oracle
到oracle解压缩目录下
运行#./runInstaller
一步一个脚印安装下去就行了!
.安装完成后的测试
[oracle@oracle oracle]$ lsnrctl start
[oracle@oracle oracle]$ sqlplus /nolog
SQL*Plus: Release 10.2.0.1.0 - Production on Sat Mar 12 22:58:53 2005
Copyright (c) 1982, 2004, Oracle Corporation.  All rights reserved.
SQL> connect / as sysdba
Connected.
SQL>; shutdown immediate  关闭数据库
Database closed.
Database dismounted.
ORACLE instance shut down.
SQL>startup;   启动数据库
ORACLE instance started.
Total System Global Area  236000356 bytes
Fixed Size                   451684 bytes
Variable Size             201326592 bytes
Database Buffers           33554432 bytes
Redo Buffers                 667648 bytes
Database mounted.
Database opened.