ITPub博客

首页 > Linux操作系统 > Linux操作系统 > Oracle 11gR2 for Linux 初次安装体验

Oracle 11gR2 for Linux 初次安装体验

原创 Linux操作系统 作者:尛样儿 时间:2010-01-17 00:35:05 0 删除 编辑

今天体验了一把Oracle 11gR2的安装,Linux单机+ASM存储,还是有一些变化,记录了安装的过程。

参考:http://www.itpub.net/viewthread.php?tid=1214806&extra=&page=1

从11gR2开始, 如果要安装RAC, ASM, ACFS(11gR2最新支持的ASM集群文件系统), 必须先从安装包Grid Infrastructure下手, 然后才安装Oracle Database.
Oracle Grid Infrastructure includes the following features:
Oracle Clusterware
Application monitoring, restart, and failover
Cluster membership services
Server monitoring and fencing
Single Client Access Name (SCAN)
Server Pools
Grid Naming Services
Oracle Automatic Storage Management
Dynamic storage rebalancing
Storage mirroring
Online disk add/drop
ASM Cluster File System
Shared file system with concurrent access to files from multiple nodes
Local file system
ASM Dynamic Volumes
Volume management services for ACFS
Volume management services for 3rd-party file systems


一.安装准备:

需要安装的rpm包:
make
binutils
gcc
libgomp
libaio
glibc
compat-libstdc++
elfutils-libelf
elfutils-libelf-devel
elfutils-libelf-devel-static
glibc-common
glibc-devel
glibc-headers
kernel-headers
gcc-c++
libaio-devel
libgcc
libstdc++
libstdc++-devel
sysstat
unixODBC
unixODBC-devel
ksh


创建用户和组:
#以下皆使用root用户执行
/usr/sbin/groupadd -g 501 oinstall
/usr/sbin/groupadd -g 502 dba
/usr/sbin/groupadd -g 503 oper
/usr/sbin/groupadd -g 504 asmadmin
/usr/sbin/groupadd -g 505 asmoper
/usr/sbin/groupadd -g 506 asmdba
/usr/sbin/useradd -g oinstall -G dba,asmdba,oper oracle
/usr/sbin/useradd -g oinstall -G asmadmin,asmdba,asmoper,oper,dba grid

mkdir -p /u01/app/oracle/product/11.2.0/dbhome_1
mkdir -p /u01/app/grid/product/11.2.0/grid
chown -R oracle:oinstall /u01/app/
chown -R grid:oinstall /u01/app/grid
chmod -R 775 /u01/

# passwd grid
# passwd oracle

修改系统参数:
# vi /etc/security/limits.conf
#ORACLE SETTING
grid                 soft    nproc   2047
grid                 hard    nproc   16384
grid                 soft    nofile  1024
grid                 hard    nofile  65536
oracle               soft    nproc   2047
oracle               hard    nproc   16384
oracle               soft    nofile  1024
oracle               hard    nofile  65536

# vi /etc/pam.d/login
#ORACLE SETTING
session    required     pam_limits.so

# vi /etc/sysctl.conf
#ORACLE SETTING
fs.aio-max-nr = 1048576
fs.file-max = 6815744
kernel.shmall = 2097152
kernel.shmmax = 536870912
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 = 1048586


gird时间同步所需要的设置(11gR2新增检查项)
#Network Time Protocol Setting
/sbin/service ntpd stop
chkconfig ntpd off
rm /etc/ntp.conf
or, mv /etc/ntp.conf to /etc/ntp.conf.org.

修改gird、oracle用户的.bash_profile文件:
#grid 用户配置文件 ORACLE_HOSTNAME请自行设置
TMP=/tmp; export TMP
TMPDIR=$TMP; export TMPDIR

ORACLE_HOSTNAME=UMI; export ORACLE_HOSTNAME
ORACLE_SID=+ASM; export ORACLE_SID
ORACLE_BASE=/u01/app/grid; export ORACLE_BASE
ORACLE_HOME=$ORACLE_BASE/product/11.2.0/grid; export ORACLE_HOME

PATH=$ORACLE_HOME/bin:$PATH; export PATH

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

#oracle用户配置文件 ORACLE_HOSTNAME请自行设置
# Oracle Settings oracle
TMP=/tmp; export TMP
TMPDIR=$TMP; export TMPDIR

ORACLE_HOSTNAME=UMI; export ORACLE_HOSTNAME
ORACLE_BASE=/u01/app/oracle; export ORACLE_BASE
ORACLE_HOME=$ORACLE_BASE/product/11.2.0/dbhome_1; export ORACLE_HOME
ORACLE_SID=ORCL; export ORACLE_SID
ORACLE_TERM=xterm; export ORACLE_TERM

PATH=/usr/sbin:$PATH; export PATH
PATH=$ORACLE_HOME/bin:$PATH; export PATH

LD_LIBRARY_PATH=$ORACLE_HOME/lib:/lib:/usr/lib; export LD_LIBRARY_PATH
CLASSPATH=$ORACLE_HOME/JRE:$ORACLE_HOME/jlib:$ORACLE_HOME/rdbms/jlib; export CLASSPATH

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


二.安装过程:
1.安装配置asmlib,创建好asm磁盘:
内核:
Linux rhel3 2.6.18-164.el5
下载:
oracleasm-2.6.18-164.el5-2.0.5-1.el5.i686.rpm
oracleasmlib-2.0.4-1.el5.i386.rpm
oracleasm-support-2.1.3-1.el5.i386.rpm

安装:
[root@rhel3 asmlib]# rpm -ivh *.rpm
Preparing...                ########################################### [100%]
   1:oracleasm-support      ########################################### [ 33%]
   2:oracleasm-2.6.18-164.el########################################### [ 67%]
   3:oracleasmlib           ########################################### [100%]


配置:
[root@rhel3 asmlib]# /etc/init.d/oracleasm configure
Configuring the Oracle ASM library driver.

This will configure the on-boot properties of the Oracle ASM library
driver.  The following questions will determine whether the driver is
loaded on boot and what permissions it will have.  The current values
will be shown in brackets ('[]').  Hitting without typing an
answer will keep that current value.  Ctrl-C will abort.

Default user to own the driver interface []: grid
Default group to own the driver interface []: asmadmin
Start Oracle ASM library driver on boot (y/n) [n]: y
Scan for Oracle ASM disks on boot (y/n) [y]: y
Writing Oracle ASM library driver configuration: done
Initializing the Oracle ASMLib driver:                     [  OK  ]
Scanning the system for Oracle ASMLib disks:               [  OK  ]


磁盘划分分区:
[root@rhel3 proc]# cat partitions
major minor  #blocks  name

   8     0   41943040 sda
   8     1   39841168 sda1
   8     2    2096482 sda2
   8    16   10485760 sdb
[root@rhel3 proc]# fdisk /dev/sdb
Device contains neither a valid DOS partition table, nor Sun, SGI or OSF disklabel
Building a new DOS disklabel. Changes will remain in memory only,
until you decide to write them. After that, of course, the previous
content won't be recoverable.


The number of cylinders for this disk is set to 1305.
There is nothing wrong with that, but this is larger than 1024,
and could in certain setups cause problems with:
1) software that runs at boot time (e.g., old versions of LILO)
2) booting and partitioning software from other OSs
   (e.g., DOS FDISK, OS/2 FDISK)
Warning: invalid flag 0x0000 of partition table 4 will be corrected by w(rite)

Command (m for help): m
Command action
   a   toggle a bootable flag
   b   edit bsd disklabel
   c   toggle the dos compatibility flag
   d   delete a partition
   l   list known partition types
   m   print this menu
   n   add a new partition
   o   create a new empty DOS partition table
   p   print the partition table
   q   quit without saving changes
   s   create a new empty Sun disklabel
   t   change a partition's system id
   u   change display/entry units
   v   verify the partition table
   w   write table to disk and exit
   x   extra functionality (experts only)

Command (m for help): n
Command action
   e   extended
   p   primary partition (1-4)
e
Partition number (1-4): 1
First cylinder (1-1305, default 1):
Using default value 1
Last cylinder or +size or +sizeM or +sizeK (1-1305, default 1305):
Using default value 1305

Command (m for help): n
Command action
   l   logical (5 or over)
   p   primary partition (1-4)
l
First cylinder (1-1305, default 1):
Using default value 1
Last cylinder or +size or +sizeM or +sizeK (1-1305, default 1305): +2048M

Command (m for help): w
The partition table has been altered!

Calling ioctl() to re-read partition table.
Syncing disks.


创建ASM磁盘:
[root@rhel3 /]# fdisk -l /dev/sdb

Disk /dev/sdb: 10.7 GB, 10737418240 bytes
255 heads, 63 sectors/track, 1305 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

   Device Boot      Start         End      Blocks   Id  System
/dev/sdb1               1        1305    10482381    5  Extended
/dev/sdb5               1         250     2008062   83  Linux
[root@rhel3 /]# /etc/init.d/oracleasm createdisk VOL1 /dev/sdb5
Marking disk "VOL1" as an ASM disk:                        [  OK  ]
[root@rhel3 /]# /etc/init.d/oracleasm scandisks
Scanning the system for Oracle ASMLib disks:               [  OK  ]

2.用grid用户登录执行grid infrastructure包解压文件中的./runInstaller对grid infrastrucute进行安装配置(Install and Configure Grid Infrastructure for a Standalone Server)(包括了对asm磁盘的初始化配置工作)。
3.用grid用户登录执行netca创建和配置监听器并启动运行。
4.用oracle用户登录执行database解压文件中的./runInstaller安装DBMS。
5.用oracle用户登录执行dbca创建数据库(使用初始化好了的asm磁盘组作为存储)。

三.安装注意事项:
1. 在安装数据库之前需要先将监听器配置、启动成功(grid用户下的netca)。
2. 如果安装grid infrastructure时候是单独进行的安装,那么在使用asmca配置asm之前需要先对grid infrastructure进行相关的配置(配置方法见最后),其他方式不需要。配置完成后执行以下$GRID_HOME/root.sh。然后就可以使用asmca配置了。

 

如果只安装了grid infrastructure软件而没有对其进行配置可以按照下述方法在完成安装后进行配置:
To configure Grid Infrastructure for a Stand-Alone Server run the following command as the root user:
/u01/app/grid/product/11.2/grid/perl/bin/perl -I/u01/app/grid/product/11.2/grid/perl/lib -I/u01/app/grid/product/11.2/grid/crs/install /u01/app/grid/product/11.2/grid/crs/install/roothas.pl

To configure Grid Infrastructure for a Cluster perform. the following steps:
1. Provide values for Grid Infrastructure configuration parameters in the file - /u01/app/grid/product/11.2/grid/crs/install/crsconfig_params. For details on how to do this, see the installation guide.
2. Run the following command as the root user:
 /u01/app/grid/product/11.2/grid/perl/bin/perl -I/u01/app/grid/product/11.2/grid/perl/lib -I/u01/app/grid/product/11.2/grid/crs/install /u01/app/grid/product/11.2/grid/crs/install/rootcrs.pl
To update inventory properties for Grid Infrastructure, perform. the following
steps. If a pre-11.2 home is already configured, execute the following:
11.2_Home/oui/bin/runInstaller -updateNodeList -silent -local CRS=false ORACLE_HOME=pre-11.2_Home
Always execute the following to register the current home:
11.2_Home/oui/bin/runInstaller -updateNodeList -silent -local CRS=true ORACLE_HOME=11.2_Home.
If either home is shared, provide the additional argument -cfs.

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

请登录后发表评论 登录
全部评论
Oracle数据库管理员,Oracle数据库系统构架员;2012年7月出版《构建最高可用Oracle数据库系统:Oracle 11gR2 RAC管理、维护与性能优化》一书;Oracle 10g OCM。

注册时间:2010-01-05

  • 博文量
    483
  • 访问量
    5651545