当前位置:数据库 > Oracle >>

Oracle 11g单实例使用asm,并测试数据文件的迁移到其他磁盘组

Oracle 11g单实例使用asm,并测试数据文件的迁移到其他磁盘组
 
一. 配置/etc/hosts  网络
vi /etc/hosts
192.168.1.181   asm   asm.oracle.com
 
1.关闭FIREWALL
 
2.Disable SElinux
 
vi /etc/selinux/config   ==>SELINUX=disabled
 
二. 创建用户和组
 
groupadd -g 5000 asmadmin
groupadd -g 5001 asmdba
groupadd -g 5002 asmoper
groupadd -g 6000 oinstall
groupadd -g 6001 dba
groupadd -g 6002 oper
 
 
useradd -g oinstall -G asmadmin,asmdba,asmoper grid  
useradd -g oinstall -G dba,asmdba              oracle
 
 
passwd oracle
 
passwd grid
 
 
mkdir /s01
mkdir /g01
 
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
CopyRight © 2022 站长资源库 编程知识问答 zzzyk.com All Rights Reserved
部分文章来自网络,