내용

글번호 71
작성자 heojk
작성일 2016-06-25 00:00:00
제목 CentOS 6.8에 preinstall후 Oracle ASM 설정하기
내용 CentOS 6.8에 preinstall후 Oracle ASM 설정하기 1. 그룹 및 사용자 추가 $ su Password: # groupadd asmadmin # groupadd asmdba # groupadd asmoper # useradd -g oinstall -G dba,asmadmin,asmdba,asmoper -d /home/grid grid # passwd grid Changing password for user grid. New password: ***** Retype new password: ***** passwd: all authentication tokens updated successfully. # mkdir -p /u01/app/grid # chown -R grid:oinstall /u01/app/grid # usermod -g oinstall -G dba,asmdba oracle 2. Security 설정 # cat >> /etc/pam.d/login <<EOF session required pam_limits.so EOF # vi /etc/security/limits.conf #oracle soft nproc 2047 #oracle hard nproc 16384 #oracle soft nofile 1024 #oracle hard nofile 65536 grid soft nproc 2047 grid hard nproc 16384 grid soft nofile 1024 grid hard nofile 65536 # cat >> /etc/profile <<EOF 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 EOF # cat >> /etc/csh.login <<EOF if ( \$USER == "oracle" || \$USER == "grid" ) then limit maxproc 16384 limit descriptors 65536 endif EOF 3. 오라클 Grid 설치를 위한 환경설정 # su - grid $ vi .bash_profile .bash_profile # Get the aliases and functions if [ -f ~/.bashrc ]; then . ~/.bashrc fi # User specific environment and startup programs PATH=$PATH:$HOME/bin export PATH # Oracle Configuration 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=$PATH:$ORACLE_HOME/bin; export PATH LD_LIBRARY_PATH=$ORACLE_HOME/lib:/lib:/usr/lib; export LD_LIBRARY_PATH CLASSPATH=:$ORACLE_HOME/jlib:$ORACLE_HOME/rdbms/jlib:$ORACLE_HOME/network/jlib export CLASSPATH 4. VMWare Guest OS instance에 HDD를 추가 5. ASM 디스크 추가(Installing and Configuring ASMLib: on Red Hat Enterprise Linux 6) # yum install kmod-oracleasm Loaded plugins: fastestmirror, refresh-packagekit, security Setting up Install Process Loading mirror speeds from cached hostfile * base: centos.mirror.cdnetworks.com * extras: centos.mirror.cdnetworks.com * updates: centos.mirror.cdnetworks.com Resolving Dependencies --> Running transaction check ---> Package kmod-oracleasm.x86_64 0:2.0.8-13.0.1.el6_8 will be installed --> Finished Dependency Resolution Dependencies Resolved ================================================================================ Package Arch Version Repository Size ================================================================================ Installing: kmod-oracleasm x86_64 2.0.8-13.0.1.el6_8 ol6_latest 35 k Transaction Summary ================================================================================ Install 1 Package(s) Total download size: 35 k Installed size: 117 k Is this ok [y/N]: y Downloading Packages: kmod-oracleasm-2.0.8-13.0.1.el6_8.x86_64.rpm | 35 kB 00:00 Running rpm_check_debug Running Transaction Test Transaction Test Succeeded Running Transaction Installing : kmod-oracleasm-2.0.8-13.0.1.el6_8.x86_64 1/1 Verifying : kmod-oracleasm-2.0.8-13.0.1.el6_8.x86_64 1/1 Installed: kmod-oracleasm.x86_64 0:2.0.8-13.0.1.el6_8 Complete! 6. Download oracleasmlib and oracleasm-support library from http://www.oracle.com/technetwork/server-storage/linux/asmlib/rhel6-1940776.html 7. install oracleasmlib & oracleasm-support library # cd Downloads/ # ls oracleasm-support-2.1.8-1.el6.x86_64.rpm oracleasmlib-2.0.4-1.el6.x86_64.rpm # rpm -Uvh oracleasmlib-2.0.4-1.el6.x86_64.rpm Preparing... ########################################### [100%] 1:oracleasmlib ########################################### [100%] # rpm -Uvh oracleasm-support-2.1.8-1.el6.x86_64.rpm Preparing... ########################################### [100%] 1:oracleasm-support ########################################### [100%] 8. Configure oracle asm library driver # oracleasm configure -i 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 <ENTER> 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 []: dba 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 9. Initialize oracleasm # oracleasm init Creating /dev/oracleasm mount point: /dev/oracleasm Loading module "oracleasm": oracleasm Configuring "oracleasm" to use device physical block size Mounting ASMlib driver filesystem: /dev/oracleasm [root@localhost Downloads]# 10. Disk partitioning # fdisk /dev/sdb n p 1 [Enter] [Enter] w # fdisk /dev/sdc # fdisk /dev/sdd # fdisk /dev/sde # fdisk /dev/sdf Device contains neither a valid DOS partition table, nor Sun, SGI or OSF disklabel Building a new DOS disklabel with disk identifier 0x5c5eba91. Changes will remain in memory only, until you decide to write them. After that, of course, the previous content won't be recoverable. Warning: invalid flag 0x0000 of partition table 4 will be corrected by w(rite) WARNING: DOS-compatible mode is deprecated. It's strongly recommended to switch off the mode (command 'c') and change display units to sectors (command 'u'). Command (m for help): n Command action e extended p primary partition (1-4) p Partition number (1-4): 1 First cylinder (1-652, default 1): Using default value 1 Last cylinder, +cylinders or +size{K,M,G} (1-652, default 652): Using default value 652 Command (m for help): w The partition table has been altered! Calling ioctl() to re-read partition table. Syncing disks. 11. create asm disk # oracleasm createdisk VOL01 /dev/sdb1 Writing disk header: done Instantiating disk: done # oracleasm createdisk VOL02 /dev/sdc1 Writing disk header: done Instantiating disk: done # oracleasm createdisk VOL03 /dev/sdd1 Writing disk header: done Instantiating disk: done # oracleasm createdisk VOL04 /dev/sde1 Writing disk header: done Instantiating disk: done # oracleasm createdisk VOL05 /dev/sdf1 Writing disk header: done Instantiating disk: done # oracleasm listdisks VOL01 VOL02 VOL03 VOL04 VOL05   crs-4124 oracle high availability services startup failed error 1.If you previously ran root.sh (not successfully), simply roll it back: # /u01/app/grid/product/11.2.0/grid/crs/install/roothas.pl -deconfig -force -verbose 2.edit $GRID_HOME/crs/install/s_crsconfig_lib.pm ( add the following command before # Start OHASD ) # vi /u01/app/grid/product/11.2.0/grid/crs/install/s_crsconfig_lib.pm my $UPSTART_OHASD_SERVICE = "oracle-ohasd"; my $INITCTL = "/sbin/initctl"; ($status, @output) = system_cmd_capture ("$INITCTL start $UPSTART_OHASD_SERVICE"); if (0 != $status) { error ("Failed to start $UPSTART_OHASD_SERVICE, error: $!"); return $FAILED; } 3. Create a file /etc/init/oracle-ohasd.conf # vi /etc/init/oracle-ohasd.conf # Oracle OHASD startup start on runlevel [35] stop on runlevel [!35] respawn exec /etc/init.d/init.ohasd run >/dev/null 2>&1 4.run the root.sh again then finish installation.