码迷,mamicode.com
首页 > 数据库 > 详细

Suse11部署Oracle 11gR2

时间:2015-05-21 06:43:53      阅读:779      评论:0      收藏:0      [点我收藏+]

标签:oracle 11gr2   suse11 sp3   

环境:Suse11 sp3                 oracle 11gR2

suse:~ # free -m
             total       used       free     shared    buffers     cached
Mem:          1865       1788         77          0         14       1647
-/+ buffers/cache:        127       1738
Swap:         5241          0       5241
suse:~ # zypper sa 
file:///mnt/suse/x86_64
 local
suse:~ # zypper lr
# | Alias                                            | Name                                             | Enabled | Refresh
--+--------------------------------------------------+--------------------------------------------------+---------+--------
1 | SUSE-Linux-Enterprise-Server-11-SP3 11.3.3-1.138 | SUSE-Linux-Enterprise-Server-11-SP3 11.3.3-1.138 | Yes     | No     
suse:~ #

 
安装依赖包:

suse:~ # zypper install binutils libstdc++ gcc gcc-c++ glibc glibc-devel glibc-devel-32bit libaio libaio-devel libaio-devel-32bit libgcc libstdc++ libstdc++-devel make sysstat unixODBC unixODBC-devellibstdc++43-devel-32bit libcap1 libcap1-32bit gcc-32bit
suse:~ # rpm -qa|grep libelf
libelf1-0.152-4.7.86
libelf0-0.8.12-1.1.52
suse:~ #
suse:~ # egrep -w oracle /etc/hosts
172.24.16.1        oracle
suse:~ #

 

技术分享

suse:~ # groupadd oinstall
suse:~ # groupadd oper
suse:~ # groupadd dba
suse:~ # groupadd asmadmin
suse:~ # groupadd asmoper
suse:~ # groupadd asmdba
suse:~ # useradd -g oinstall -G dba,asmdba,oper -d /home/oracle -m -s /bin/bash oracle
suse:~ # useradd -g oinstall -G asmadmin,asmdba,asmoper,dba -d /home/grid -m -s /bin/bash grid
suse:~ # passwd oracle
suse:~ # passwd grid
suse:~ # mkdir -p /data/app/oracle
suse:~ # mkdir -p /data/app/grid
suse:~ # chown grid:oinstall /data/ -R
suse:~ # chown oracle:oinstall /data/app/oracle/ -R
suse:~ # chmod 775 /data/ -R
suse:~ # tail -n 12 /etc/security/limits.conf
#for oracle
oracle soft nproc 2047
oracle hard nproc 16384
oracle soft nofile 1024
oracle hard nofile 65536
oracle soft stack 10240
#for grid
grid soft nproc 2047
grid hard nproc 16384
grid soft nofile 1024
grid hard nofile 65536
grid soft stack 10240
suse:~ #
suse:~ # tail -n 1 /etc/pam.d/login
session  required       pam_limits.so
suse:~ #
suse:~ # tail -n 12 /etc/sysctl.conf
#
fs.aio-max-nr = 1048576
fs.file-max = 6815744
kernel.shmall = 2097152
kernel.shmmax = 4294967295
kernel.shmmni = 4096
kernel.sem = 250 32000 100 128
net.ipv4.ip_local_port_range = 9000 65500
net.core.rmem_default = 262144
net.core.rmem_max = 4194304
net.core.wmem_default = 262144
net.core.wmem_max = 1048576
suse:~ # sysctl -p
suse:~ # su - oracle
oracle@suse:~> tail -n 6 .profile
export ORACLE_BASE=/data/app/oracle
export ORACLE_SID=oracle
export ORACLE_HOME=$ORACLE_BASE/product/11.2.0/db_1
export LD_LIBARY_PATH=$ORACLE_HOME/lib
export PATH=$ORACLE_HOME/bin:$PATH
umask 022
oracle@suse:~> urce .profile
oracle:~> echo $ORACLE_BASE
/data/app/oracle
oracle@suse:~> echo $ORACLE_HOME
/data/app/oracle/product/11.2.0/db_1
suse:~ # su - grid
grid@suse:~> tail -n 6 .profile
export ORACLE_BASE=/data/app/grid
export ORACLE_SID=+ASM
export ORACLE_HOME=$ORACLE_BASE/product/11.2.0/grid
export LD_LIBRARY_PATH=$ORACLE_HOME/lib
export PATH=$ORACLE_HOME/bin:$PATH
umask 022
grid@suse:~> source .profile
grid@suse:~> echo $ORACLE_BASE
/data/app/grid
grid@suse:~> echo $ORACLE_HOME
/data/app/grid/product/11.2.0/grid
grid@suse:~>

 
给suse11添加5块磁盘做ASM+FRA

技术分享

suse:~ # fdisk /dev/sdb
suse:~ # fdisk /dev/sdc
suse:~ # fdisk /dev/sdd
suse:~ # fdisk /dev/sde
suse:~ # fdisk /dev/sdf
suse:~ # partprobe /dev/sd{b..f}
suse:~ # cat /proc/partitions
major minor  #blocks  name 
   8        0   52428800 sda
   8        1    2095104 sda1
   8        2    3148800 sda2
   8        3   31455232 sda3
   8        4          1 sda4
   8        5   15718400 sda5
   8       16   20971520 sdb
   8       17   20970496 sdb1
   8       32   20971520 sdc
   8       33   20970496 sdc1
   8       48   20971520 sdd
   8       49   20970496 sdd1
   8       64   20971520 sde
   8       65   20970496 sde1
   8       80   20971520 sdf
   8       81   20970496 sdf1
suse:~ #

 制作ASM磁盘:
http://www.oracle.com/technetwork/server-storage/linux/asmlib/index-101839.html
oracleasm:http://yunpan.cn/cj7aKYaNpYfG5  访问密码 2405

suse:/software # ls |grep oracleasm
oracleasm-support-2.1.8-1.el5.x86_64.rpm
oracleasmlib-2.0.4-1.el5.x86_64.rpm
suse:/software # zypper install oracleasm-support-2.1.8-1.el5.x86_64.rpm oracleasmlib-2.0.4-1.el5.x86_64.rpm

 技术分享

suse:/software # /etc/init.d/oracleasm createdisk DISK1 /dev/sdb1
Marking disk "DISK1" as an ASM disk:                                                done
suse:/software # /etc/init.d/oracleasm createdisk DISK2 /dev/sdc1
Marking disk "DISK2" as an ASM disk:                                                done
suse:/software # /etc/init.d/oracleasm createdisk DISK3 /dev/sdd1
Marking disk "DISK3" as an ASM disk:                                                done
suse:/software # /etc/init.d/oracleasm createdisk DISK4 /dev/sde1
Marking disk "DISK4" as an ASM disk:                                                done
suse:/software # /etc/init.d/oracleasm createdisk DISK5 /dev/sdf1
Marking disk "DISK5" as an ASM disk:                                                done
suse:/software # /etc/init.d/oracleasm listdisks
DISK1
DISK2
DISK3
DISK4
DISK5
suse:/software #

 安装grid:

suse:/software # unzip linux.x64_11gR2_grid.zip
suse:/software # cd grid/
suse:/software/grid # xhost +
access control disabled, clients can connect from any host
suse:/software/grid #

切换到grid用户登录,而不是su - grid
grid@suse:~> cd /software/grid/
grid@suse:/software/grid> ./runInstaller
Starting Oracle Universal Installer...

技术分享技术分享技术分享

技术分享

技术分享

技术分享

技术分享

技术分享

技术分享

技术分享

suse:~ # /data/app/oraInventory/orainstRoot.sh
Changing permissions of /data/app/oraInventory.
Adding read,write permissions for group.
Removing read,write,execute permissions for world.
 
Changing groupname of /data/app/oraInventory to oinstall.
The execution of the script is complete.
suse:~ # /data/app/grid/product/11.2.0/grid/root.sh
Running Oracle 11g root.sh script...
 
The following environment variables are set as:
    ORACLE_OWNER= grid
    ORACLE_HOME=  /data/app/grid/product/11.2.0/grid
 
Enter the full pathname of the local bin directory: [/usr/local/bin]: y
Creating y directory...
   Copying dbhome to y ...
   Copying oraenv to y ...
   Copying coraenv to y ...
 
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.
2015-05-18 23:11:07: Checking for super user privileges
2015-05-18 23:11:07: User has super user privileges
2015-05-18 23:11:07: Parsing the host name
Using configuration parameter file: /data/app/grid/product/11.2.0/grid/crs/install/crsconfig_params
Creating trace directory
-bash: /bin/env: No such file or directory
LOCAL ADD MODE
Creating OCR keys for user ‘grid‘, privgrp ‘oinstall‘..
Operation successful.
CRS-4664: Node suse successfully pinned.
Adding daemon to inittab
CRS-4123: Oracle High Availability Services has been started.
ohasd is starting
ADVM/ACFS is not supported on SUSE
 
suse     2015/05/18 23:11:37     /data/app/grid/product/11.2.0/grid/cdata/suse/backup_20150518_231137.olr
Successfully configured Oracle Grid Infrastructure for a Standalone Server
Updating inventory properties for clusterware
Starting Oracle Universal Installer...
 
Checking swap space: must be greater than 500 MB.   Actual 5236 MB    Passed
The inventory pointer is located at /etc/oraInst.loc
The inventory is located at /data/app/oraInventory
‘UpdateNodeList‘ was successful.

技术分享 

创建FRA磁盘组:

grid@suse:~> asmca

技术分享

技术分享

安装数据库:

suse:/software # unzip linux.x64_11gR2_database_1of2.zip && unzip linux.x64_11gR2_database_2of2.zip

用oracle用户登录:

oracle@suse:~> cd /software/database/
oracle@suse:/software/database> ./runInstaller

技术分享技术分享

技术分享

技术分享

技术分享

技术分享

技术分享

技术分享

技术分享

suse:~ # /data/app/grid/product/11.2.0/dbhome_1/root.sh
Running Oracle 11g root.sh script...
 
The following environment variables are set as:
    ORACLE_OWNER= grid
    ORACLE_HOME=  /data/app/grid/product/11.2.0/dbhome_1
 
Enter the full pathname of the local bin directory: [/usr/local/bin]: y
Creating y directory...
   Copying dbhome to y ...
   Copying oraenv to y ...
   Copying coraenv to y ...
 
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.
suse:~ #

技术分享

建库:

用Oracle用户登录,非su - oracle

oracle@suse:/software/database>
dbca



网速不好,正在一点点上传ing

本文出自 “鹏城-酱油瓶” 博客,谢绝转载!

Suse11部署Oracle 11gR2

标签:oracle 11gr2   suse11 sp3   

原文地址:http://yfshare.blog.51cto.com/8611708/1653368

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!