SUSE下安装oracle 11g



一、检查交换分区

[cpp] view plaincopy
grep SwapTotal /proc/meminfo 
        请确定在4G以上。若不够,可通过以下方法增加交换分区:

[cpp] view plaincopy
最好是关闭交换分区:swapoff  -a 
计算分区的大小,以KB为单位。 
执行命令:dd if=/dev/xero of=/swapfile bs=1024 count=5120000。执行后系统可能会重启。 
执行命令:mkswap /swapfile 
执行命令:swapon /swapfile 

二、检查需要使用的软件包。

        输入rpm -q 软件包名,检查系统是否已安装了以下需要使用的软件包。

RPM 包安装顺序,参考:http://blog.csdn.net/wujiang_oracle/article/details/7107335

软件包安名称

光盘存放路径

binutils-2.16.91.0.5

suse/x86_64/binutils-2.16.91.0.5-23.31.x86_64.rpm

compat-libstdc++-5.0.7-22.2

suse/x86_64/compat-libstdc++-5.0.7-22.2.x86_64.rpm

gcc-4.1.0

suse/x86_64/gcc-4.1.2_20070115-0.21.x86_64.rpm

gcc-c++-4.1.0

suse/x86_64/gcc-c++-4.1.2_20070115-0.21.x86_64.rpm

glibc-2.4-31.2

suse/x86_64/glibc-2.4-31.54.x86_64.rpm

glibc-32bit-2.4-31.2 (32 bit)

suse/x86_64/glibc-32bit-2.4-31.54.x86_64.rpm

glibc-devel-2.4

suse/x86_64/glibc-devel-2.4-31.54.x86_64.rpm

glibc-devel-32bit-2.4 (32 bit)

suse/x86_64/glibc-devel-32bit-2.4-31.54.x86_64.rpm

libaio-0.3.104

suse/x86_64/libaio-0.3.104-14.2.x86_64.rpm

libaio-32bit-0.3.104 (32 bit)

suse/x86_64/libaio-32bit-0.3.104-14.2.x86_64.rpm

libaio-devel-0.3.104

suse/x86_64/libaio-devel-0.3.104-14.2.x86_64.rpm

libelf-0.8.5

suse/x86_64/libelf-0.8.5-47.2.x86_64.rpm

libgcc-4.1.0

suse/x86_64/libgcc-4.1.2_20070115-0.21.x86_64.rpm

libstdc++-4.1.0

suse/x86_64/libstdc++-4.1.2_20070115-0.21.x86_64.rpm

libstdc++-devel-4.1.0

suse/x86_64/libstdc++-devel-4.1.2_20070115-0.21.x86_64.rpm

make-3.80

suse/x86_64/make-3.80-202.2.x86_64.rpm

sysstat-6.0.2

suse/x86_64/sysstat-8.0.4-1.4.x86_64.rpm

      如果表中的软件包未安装,请执行以下命令安装:

       rpm -ivh软件包绝对路径

        例如:

        mount /dev/sr0 /media

        rpm -ivh /media/suse/x86_64/ binutils-2.16.91.0.5-23.31.x86_64.rpm



三、检查网络配置。

        检查“/etc/hosts”文件中是否写入IP地址和主机名。

        vi /etc/hosts

        如果没有,需手工增加IP地址与主机名的对应关系,例如:

        10.71.124.53   mmgg


四、创建必要的用户组和用户。

         1 我喜欢直接改相关文件,如下:

[cpp] view plaincopy
//  /etc/group 
dba:!:1000:oracle 
oper:!:1001:oracle 
asmadmin:!:1002:oracle 
oinstall:!:1003: 
[cpp] view plaincopy
// /etc/passwd 
oracle:x:1001:1003::/home/oracle:/bin/bash 
并在/home中新建oracle这个目录。然后更改密码(passwd oracle)。oracle用户可能会无法使用/sbin中的命令,这时可以执行:

[cpp] view plaincopy
export PATH=$PATH:/sbin 
         2 建立oracle安装相关目录

[cpp] view plaincopy
mkdir -p /opt/oracle 
chown -R oracle:oinstall /opt/oracle 
chmod -R 755 /opt/oracle 
mkdir -p /opt/oraInventory 
chown -R oracle:oinstall /opt/oraInventory 
chmod -R 755 /opt/oraInventory 
          3   修改oracle用户的环境变量。

           修改“/home/oracle/”下的“.profile”文件,添加如下内容:

[cpp] view plaincopy
export ORACLE_BASE=/opt/oracle  
export ORACLE_HOME=$ORACLE_BASE/product/11g  
export ORACLE_SID=msgplus  
export LANG=en_US.UTF-8  
export NLS_LANG=AMERICAN_AMERICA.AL32UTF8  
export PATH=$ORACLE_HOME/bin:$PATH 
           4  修改oracle用户的Shell限制。

            修改“/etc/security/”下的“limits.conf”文件,添加以下4行内容:

[cpp] view plaincopy
oracle      soft      nproc     2047  
oracle      hard      nproc     16384  
oracle      soft      nofile    1024  
oracle      hard      nofile    65536 
            修改“/etc/pam.d/”下的“login”文件,添加以下内容:

[cpp] view plaincopy
session     required    pam_limits.so 

五、更新系统内核配置参数。

          1   编辑“/etc/”下的“sysctl.conf”文件,在文件中增加如下内容:

[cpp] view plaincopy
kernel.shmall = 2097152  
kernel.shmmax = 2147483647  
kernel.shmmni = 4096  
kernel.sem = 250 256000 100 1024  
  
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  为oinstall组赋予创建共享内存段的权限。

[cpp] view plaincopy
id oracle 
echo 1003 > /proc/sys/vm/hugetlb_shm_group 
  
1003为系统中oinstall组的组ID 
在“/etc/”下的“sysctl.conf”文件末尾添加以下内容: 
vm.hugetlb_shm_group=1003 
改变系统当前内核参数 
sbin/sysctl -p 

         3  输入如下命令,系统启动时自动读取“/etc/”下的“sysctl.conf”文件。

[cpp] view plaincopy
/sbin/chkconfig boot.sysctl on 

六、安装数据库软件

        1     修改oracle用户当前的语言设置。

[cpp] view plaincopy
export LANG=en_US.UTF-8 
        2     修改DISPLAY环境变量。

[cpp] view plaincopy
export DISPLAY=10.71.124.224:0.0 
        3  运行oracle安装程序“/media/runInstaller
        4选择“Basic Installation”,取消“Create Starter Database”复选框,单击“Next”



        5保持默认设置,单击“Next”



        6 在SUSE 10系统下安装oracle 11g可能会产生1个警告,可以忽略,继续进行安装。



         7 install



         8



           9  安装结束后,将弹出“Execute Configuration scripts”窗口,如图所示。根据窗口上的提示信息,新打开一个终端窗口,以root用户登录,执行以下命令。



[cpp] view plaincopy
1.  执行“orainstRoot.sh”脚本。 
/opt/oraInventory/orainstRoot.sh 
2.  显示如下信息: 
Changing permissions of /opt/oraInventory to 770.  
Changing groupname of /opt/oraInventory to oinstall.  
The execution of the script is complete 
3.  执行“root.sh”脚本。 
/opt/oracle/product/11g/root.sh 
4.  显示如下信息: 
Running Oracle 11g root.sh script  
The following environment variables are set as:  
    ORACLE_OWNER= oracle  
    ORACLE_HOME=  /opt/oracle/product/11g  
Enter the full pathname of the local bin directory: [/usr/local/bin]:   
    Copying dbhome to /usr/local/bin ...  
    Copying oraenv to /usr/local/bin ...  
    Copying coraenv to /usr/local/bin ...  
Creating /etc/oratab file...  
Entries will be added to the /etc/oratab file as needed by  
Database Configuration Assistant when a database is created  
Finished running generic part of root.sh script.  
Now product-specific root actions will be performed.  
  
Finished product-specific root actions.  
          10 然后继续安装。

             在“Execute Configuration scripts”对话框中单击“OK”。




好了,安装就这样完成了。

猜你喜欢

转载自joy-cz.iteye.com/blog/1988624