Oracle 11gR2 for Linux 初次安裝體驗

尛樣兒發表於2010-01-17

今天體驗了一把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部落格 ” ,連結:http://blog.itpub.net/23135684/viewspace-625285/,如需轉載,請註明出處,否則將追究法律責任。

相關文章