Oracle 11g單實例使用asm,並測試數據文件的遷移到其餘磁盤組

一. 配置/etc/hosts  網絡
vi /etc/hosts
192.168.1.181   asm   asm.oracle.com linux

1.關閉FIREWALL 網絡

2.Disable SElinux oracle

vi /etc/selinux/config   ==>SELINUX=disabled app

二. 建立用戶和組 測試

groupadd -g 5000 asmadmin
groupadd -g 5001 asmdba
groupadd -g 5002 asmoper
groupadd -g 6000 oinstall
groupadd -g 6001 dba
groupadd -g 6002 oper url


useradd -g oinstall -G asmadmin,asmdba,asmoper grid 
useradd -g oinstall -G dba,asmdba              oracle spa


passwd oracle .net

passwd grid server


mkdir /s01
mkdir /g01 blog

chown oracle:oinstall /s01

chown grid:oinstall   /g01

三. 安裝ORACLE須要的包
1.配置YUM
[root@vmac6 ~]# cd /etc/yum.repos.d

[root@vmac6 yum.repos.d]# mv public-yum-ol6.repo public-yum-ol6.repo.bak

[root@vmac6 yum.repos.d]# touch public-yum-ol6.repo

[root@vmac6 yum.repos.d]# vi public-yum-ol6.repo

[oel6]
name = Enterprise Linux 6.3 DVD
baseurl=file:///media/"OL6.3 x86_64 Disc 1 20120626"/Server
gpgcheck=0
enabled=1

2.安裝oracle包
[root@vmac1 ~]# yum install oracle-rdbms-server-11gR2-preinstall-1.0-6.el6

3.添加grid參數,oracle在安裝包的時候參數自動添加  vi /etc/security/limits.conf

# grid-rdbms-server-11gR2-preinstall setting for nofile soft limit is 1024
grid   soft   nofile    1024

# grid-rdbms-server-11gR2-preinstall setting for nofile hard limit is 65536
grid   hard   nofile    65536

# grid-rdbms-server-11gR2-preinstall setting for nproc soft limit is 2047
grid   soft   nproc    2047

# grid-rdbms-server-11gR2-preinstall setting for nproc hard limit is 16384
grid   hard   nproc    16384

# grid-rdbms-server-11gR2-preinstall setting for stack soft limit is 10240KB
grid   soft   stack    10240

# grid-rdbms-server-11gR2-preinstall setting for stack hard limit is 32768KB
grid   hard   stack    32768

3.
安裝圖形界面:

yum install xterm

 

五. 配置共享存儲


for i in b c ;
do
echo "KERNEL==\"sd*\", BUS==\"scsi\", PROGRAM==\"/sbin/scsi_id --whitelisted --replace-whitespace --device=/dev/\$name\", RESULT==\"`/sbin/scsi_id --whitelisted --replace-whitespace --device=/dev/sd$i`\", NAME=\"asm-disk$i\", OWNER=\"grid\", GROUP=\"asmadmin\", MODE=\"0660\""      >> /etc/udev/rules.d/99-oracle-asmdevices.rules
done

 

 /sbin/start_udev
 
cd /dev

ll asm*
 
 
六.配置grid 用戶profile

解壓grip unzip  -d grid_11r
 
mkdir /g01/orabase
 


export GRID_HOME=/g01/11.2.0/grid
export ORACLE_HOME=/g01/11.2.0/grid
export PATH=$GRID_HOME/bin:$GRID_HOME/OPatch:/sbin:/bin:/usr/sbin:/usr/bin

export ORACLE_SID=+ASM
export LD_LIBRARY_PATH=$GRID_HOME/lib:$GRID_HOME/lib32

export ORACLE_BASE=/g01/orabase
export ORA_NLS10=$ORACLE_HOME/nls/data
export NLS_LANG="Simplified Chinese"_China.AL32UTF8

root用戶的環境變量


export GRID_HOME=/g01/11.2.0/grid
export ORACLE_HOME=/g01/11.2.0/grid
export PATH=$GRID_HOME/bin:$GRID_HOME/OPatch:/sbin:/bin:/usr/sbin:/usr/bin
能夠直接安裝了沒任何問題


oracle用戶的環境變量

mkdir /s01/orabase

export ORACLE_HOME=/s01/oracle/app/oracle/product/11.2.0/dbhome_1
export PATH=$ORACLE_HOME/bin:$ORACLE_HOME/OPatch:/sbin:/bin:/usr/sbin:/usr/bin

export ORACLE_SID=SANSOM
export LD_LIBRARY_PATH=$ORACLE_HOME/lib:$ORACLE_HOME/lib32

export ORACLE_BASE=/s01/orabase
export ORA_NLS10=$ORACLE_HOME/nls/data
export NLS_LANG="Simplified Chinese"_China.AL32UTF8

具體測試方法可參考:http://my.oschina.net/sansom/blog/156786  

相關文章
相關標籤/搜索