【ASM】使用RMAN迁移数据库至ASM实例

本篇演示将单实例下的数据库迁移至ASM环境。

一 软件环境
  • Oracle VM Virtualbox 5.2.8
  • Oracle Linux 6.5
  • Oracle 11.2.0.4
二 主机设置

1 创建用户和组
[root@strong ~]# groupadd asmadmin
[root@strong ~]# groupadd asmdba
[root@strong ~]# groupadd asmoper
[root@strong ~]# useradd -g oinstall -G asmadmin,asmdba,asmoper,oper,dba grid
[root@strong ~]# passwd grid
Changing password for user grid.
New password: 
BAD PASSWORD: it is too short
BAD PASSWORD: is too simple
Retype new password: 
passwd: all authentication tokens updated successfully.
2 修改Oracle用户组
[root@strong ~]# id oracle
uid=500(oracle) gid=500(oinstall) groups=500(oinstall),501(dba),502(oper)
[root@strong ~]# usermod -G dba,asmadmin,asmdba,oper oracle
[root@strong ~]# id oracle
uid=500(oracle) gid=500(oinstall) groups=500(oinstall),501(dba),502(oper),503(asmadmin),504(asmdba)
3 配置内核参数
在 /etc/security/limits.conf配置文件增加下面的内容。
[root@strong ~]# vim /etc/security/limits.conf
grid soft nproc 2047  
grid hard nproc 16384  
grid soft nofile 1024  
grid hard nofile 65536  
4 创建目录
[root@strong ~]# mkdir -p /u01/app/grid
[root@strong ~]# chown -R grid:oinstall /u01/app/grid/
[root@strong ~]# chmod -R 775 /u01/app/grid/
5 设置环境变量
[root@strong ~]# su - grid
在.bash_profile增加如下内容。
[grid@strong ~]$ vim .bash_profile
ORACLE_BASE=/u01/app/grid
export ORACLE_BASE
ORACLE_SID=+ASM
export ORACLE_SID

export ORACLE_TERM=xterm
ORACLE_HOME=/u01/app/grid/product/11.2.0/grid
export ORACLE_HOME
PATH=$ORACLE_HOME/bin:$PATH 
export PATH  
[grid@strong ~]$ . .bash_profile 
[grid@strong ~]$ echo $ORACLE_SID 
+ASM
三 ASM配置(udev)

1 Linux系统关闭情况下增加4块磁盘

2 创建分区
[root@strong ~]# fdisk /dev/sdb 
Device contains neither a valid DOS partition table, nor Sun, SGI or OSF disklabel
Building a new DOS disklabel with disk identifier 0xc5819521.
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-1566, default 1): 
Using default value 1
Last cylinder, +cylinders or +size{K,M,G} (1-1566, default 1566): 
Using default value 1566

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

Calling ioctl() to re-read partition table.
Syncing disks.
[root@strong ~]# 
注:同样的方法分别对/dev/sdc、/dev/sdd、/dev/sde创建分区。
创建完后查看磁盘配置
[root@strong ~]# fdisk -l |grep /dev/
  • 1
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值