linux as 4 虚拟机 oracle 10g安装

来源:互联网 发布:郑淳元多努力知乎 编辑:程序博客网 时间:2024/05/19 10:08

因为oracle10g 已经不提供下载地址了,可以根据 oracle下载 提供的下载地址去直接通过迅雷下载,第一次安装,我是根据老师的视频和自己的摸索,搞定了安装。

我结合我看的 那个甲骨论的老相视频 和   ORACLE数据库技术实用详解:教你如何成为10gocp.pdf  搞定了10g的安装。老相视频地址点击打开链接 第2、3部视频讲的就是安装,想学习安装的可以看看。

以下是我写的内容

1.首先肯定是打开官网安装文档 ,看看你的虚拟机上的条件是否满足,我根据多次蛋疼实验,建议硬盘搞个40g,内存1g


确认软件包都安装了,所有的哈,不然后面各种悲剧呀,后面的数字无所谓,可能版本区别。

官网上写的是这些:

查看是否安装,通过命令 rpm -qa |grep compat  来查看  compat 类似的包,其他的安装检测,就把 compat换成其他名字就行,如 rpm -qa |grep binutils

Red Hat Enterprise Linux 4.0 and Asianux 2.0:

binutils-2.15.92.0.2-13.EL4compat-db-4.1.25-9compat-libstdc++-296-2.96-132.7.2control-center-2.8.0-12gcc-3.4.3-22.1.EL4gcc-c++-3.4.3-22.1.EL44glibc-2.3.4-2.9glibc-common-2.3.4-2.9gnome-libs-1.4.1.2.90-44.1libstdc++-3.4.3-22.1libstdc++-devel-3.4.3-22.1make-3.80-5pdksh-5.2.14-30sysstat-5.0.5-1xscreensaver-4.18-5.rhel4.2setarch-1.6-1
但是千万要注意,你确定还有安装了这几个:

libao-0.8.5-2.EL.0.i386.rpm(这个我是安装在最前面的,注意 libao 和 libaio区别)

libaio-0.3.103-3.i386.rpm

libaio-devel-0.3.103-3.i386.rpm

2.确认这些安装成功后, vi  /etc/sysconfig/network-scripts/ifcfg-eth0查看 自己的ip地址情况,

需要修改的自己修改下,然后保存退出。service network restart 重启网络。

3. 编辑host文件  vi  /etc/hosts

在文件最后面输入如下内容:(rehat 是我的主机名   可以输入hostname 命令查看)

192.168.100.16    rehat127.0.0.1         localhost                 localhost.localdomain
保存退出。

4。增加组和oracle成员

groupadd oinstall

groupadd dba

useradd -g oinstall -G dba oracle


然后给oracle设置密码,命令如下:

passwd oracle

5.这个是根据官方文档上面的说法: vi /etc/sysctl.conf 文件的最后面输入最先面的那些参数值, 从kernel.shmall 那里开始,前面的一些事有助于理解的东西。

If the value of any kernel parameter is different from the recommended value, then complete the following procedure:Using any text editor, create or edit the /etc/sysctl.conf file, and add or edit lines similar to the following:Note:Include lines only for the kernel parameter values that you want to change. For the semaphore parameters (kernel.sem), you must specify all four values. However, if any of the current values are larger than the recommended value, then specify the larger value.kernel.shmall = 2097152kernel.shmmax = 2147483648kernel.shmmni = 4096kernel.sem = 250 32000 100 128fs.file-max = 65536net.ipv4.ip_local_port_range = 1024 65000net.core.rmem_default = 1048576net.core.rmem_max = 1048576net.core.wmem_default = 262144net.core.wmem_max = 262144

6.也是根据官方文档上 分别  编辑  /etc/security/limits.conf      /etc/pam.d/login     /etc/profile   (注意都是分别加到文件内容的最后面
/etc/pam.d/login

/etc/pam.d/login

To increase the shell limits:    Add the following lines to the /etc/security/limits.conf file:    oracle              soft    nproc   2047    oracle              hard    nproc   16384    oracle              soft    nofile  1024    oracle              hard    nofile  65536    Add or edit the following line in the /etc/pam.d/login file, if it does not already exist:    session    required     /lib/security/pam_limits.so    session    required     pam_limits.so    Depending on the oracle user's default shell, make the following changes to the default shell start-up file:        For the Bourne, Bash, or Korn shell, add the following lines to the /etc/profile file (or the file on SUSE systems)/etc/profile.local:        if [ $USER = "oracle" ]; then                if [ $SHELL = "/bin/ksh" ]; then                      ulimit -p 16384                      ulimit -n 65536                else                      ulimit -u 16384 -n 65536                fi        fi        For the C shell (csh or tcsh), add the following lines to the /etc/csh.login file (or the file on SUSE systems)/etc/csh.login.local:        if ( $USER == "oracle" ) then                limit maxproc 16384                limit descriptors 65536        endif
因为我的是linux 版本的,用的不是C shell ,最后一个文件的修改内容是

 if [ $USER = "oracle" ]; then                if [ $SHELL = "/bin/ksh" ]; then                      ulimit -p 16384                      ulimit -n 65536                else                      ulimit -u 16384 -n 65536                fi        fi

7.创建oracle软件安装的目录:(这个是视频上讲的,放到 /u01 下, 我的由于磁盘问题,最后放到了/oracledir 下面,大体上差不多,主要是创建目录,给oracle权限)

mkdir  /u01/app/oracle -p

chown -R oracle:oinstall /u01

chmod -R 775  /u01

8.切换到oracle用户下,

输入: su - oracle  (注意- 和oracle 有空格 ,上面的所有操作都在root用户下运行,现在su - oracle 切换到oracle用户环境下,)

给oracle用户配置环境变量:

vi  .bash_profile (注意.bash_profile 的那个.)

export ORACLE_BASE=/home/oracle
export ORACLE_HOME=$ORACLE_BASE/product/10.2.0/db_1
export ORACLE_SID=ora10g
export PATH=$PATH:$HOME/bin:$ORACLE_HOME/bin

export NLS_LANG=AMERICAN_AMERICA.ZHS16GBK

(注意最后一个NLS_LANG ,我开始设置成american_america.zhs16gbk 小写的,可是不行,建议先大写,如果后面安装出现NLS错误,请在网上找找问题。)

然后输入 source .bash_profile (刷新oracle的环境)

9.后面就可以开始安装了,

解压10201_database_linux32.zip  ,然后进入解压目录, 找到 runInstaller

输入   ./runInstaller


后面就是普通的安装,但是到了后面安装成功后,需要执行那两个 .sh文件

(1)我的是安装在  /oracledir/app/oracle/oraInventory    一般的应该是在(/u01/app/oracle/oraInventory)

进入到那个目录 执行   ./orainstRoot.sh

(2) /oracledir/app/oracle/product/10.2.0/db1   运行 ./root.sh


大致的就是这些了,如果那里有问题,请大家批评指正,谢谢。