RMAN迁移数据库到ASM(一)创建ASM磁盘组
Migrating Databases To and From ASM with Recovery Manager
使用RMAN将文件系统中oracle 10g数据库文件迁移到ASM磁盘组。
文章分为三个部分:一、创建ASM磁盘组 二、切换数据文件到ASM 三、迁移临时文件、online log等到ASM
博文连接:http://blog.itpub.net/29475508/viewspace-1296443/
【实验环境】
操作系统 : AIX5.3
数据库版本:Oracle 10.2.0
存储设备 :SUN T3 光纤阵列
【文章目录】
【实验过程】
1.创建逻辑卷
1.1、查看AIX光纤适配卡Network Address
-
[root@aix227:/]#lsdev -c adapter | grep -i fc
- fcs0 Available 04-08 FC Adapter
- [root@aix227:/]#
- [root@aix227:/]#lscfg -vpl fcs0 | grep -i network
- Network Address.............10000000C945AA65
1.2、阵列上划分volslice ,绑定lun
- volslice create aix227_02 -z 30gb v01
- 查看新划分的aix227_02 的slice num
- :/:<4>volslice list
- Slice Slice Num Start Blk Size Blks Capacity Volume
- aix227_02 8 692186880 62926080 30.004 GB v01
- 绑定lun
- lun perm lun 8 rw wwn 10000000C945AA65
- :/:<8>lun perm list lun 8
- List of WWNs and their access right to lun 8
- -------------------------------------------------------------------------------------------------------
- lun slice WWN Group Name Group Perm WWN Perm Effective Perm
- --------------------------------------------------------------------------------------------------------
- 8 8 default -- -- none none
- 8 8 10000000c945aa65 -- -- rw rw
- -------------------------------------------------------------------------------------------------------
1.3、AIX上识别新磁盘
cfgmgr -v
lspv 查看
chdev -l hdisk1 -a pv=yes 识别pvid
1.4、smit
vg创建vg
1.5、创建lv
2、启动 ASM 实例
2.1、创建dump目录
[oracle@aix227:/u01/app/oracle/admin]$mkdir +ASM
[oracle@aix227:/u01/app/oracle/admin]$cd +ASM/
[oracle@aix227:/u01/app/oracle/admin/+ASM]$mkdir -p bdump cdump udump
[oracle@aix227:/u01/app/oracle/admin/+ASM]$ls
bdump cdump udump
[oracle@aix227:/u01/app/oracle/admin/+ASM]$
2.2、编辑init+ASM.ora
[oracle@aix227:/u01/app/oracle/product/10.2.0/db_1/dbs]$more init+ASM.ora
asm_diskstring='/dev/rlv*'
background_dump_dest='/u01/app/oracle/admin/+ASM/bdump'
core_dump_dest='/u01/app/oracle/admin/+ASM/cdump'
user_dump_dest='/u01/app/oracle/admin/+ASM/udump'
instance_type='ASM'
2.3、sqlplus登录ASM
[oracle@aix227:/home/oracle]$export ORACLE_SID=+ASM
[oracle@aix227:/home/oracle]$sqlplus '/as sysdba'
2.4、启动ASM实例
【报错ORA-29701 情况处理】
SYS@ +ASM>startup
ORA-29701: unable to connect to Cluster Manager
SYS@ +ASM>
CSS连接ASM实例和oracle实例
[oracle@aix227:/home/oracle]$cd $ORACLE_HOME/bin
[oracle@aix227:/u01/app/oracle/product/10.2.0/db_1/bin]$./localconfig delete
You must be logged in as root to run ./localconfig.
Log in as root and restart ./localconfig execution.
[root@aix227:/]#cd /u01/app/oracle/product/10.2.0/db_1/bin/
[root@aix227:/u01/app/oracle/product/10.2.0/db_1/bin]#./localconfig delete
/etc/oracle does not exist. Creating it now.
./localconfig[715]: /etc/init.cssd: not found
[root@aix227:/u01/app/oracle/product/10.2.0/db_1/bin]#./localconfig add
Successfully accumulated necessary OCR keys.
Creating OCR keys for user 'root', privgrp 'system'..
Operation successful.
Configuration for local CSS has been initialized
Adding to inittab
Startup will be queued to init within 30 seconds.
Checking the status of new Oracle init process...
Expecting the CRS daemons to be up within 600 seconds.
CSS is active on these nodes.
aix227
CSS is active on all nodes.
Oracle CSS service is installed and running under init(1M)
3、创建ASM磁盘组
3.1、创建ASM disk group
create diskgroup DATA normal redundancy failgroup fg1 disk '/dev/rlv1data' failgroup fg2 disk '/dev/rlv2data';
create diskgroup LOG normal redundancy failgroup fg1 disk '/dev/rlv3log' failgroup fg2 disk '/dev/rlv4log';
create diskgroup ARCH normal redundancy failgroup fg1 disk '/dev/rlv5arch', failgroup fg2 disk '/dev/rlv6arch';
create diskgroup RECOVERY normal redundancy failgroup fg1 disk '/dev/rlv7reco' failgroup fg2 disk '/dev/rlv8reco';
select group_number,name,state,type,total_mb,free_mb,usable_file_mb from v$asm_diskgroup;
3.2、生成spfile
使diskgroup在实例启动后能够自动挂载
SYS@ +ASM>create spfile from pfile;
SYS@ +ASM>shutdown immediate;
SYS@ +ASM>startup nomount;
SYS@ +ASM>alter diskgroup RECOVERY mount;
SYS@ +ASM>alter diskgroup ARCH mount;
SYS@ +ASM>alter diskgroup LOG mount;
SYS@ +ASM>alter diskgroup DATA mount;
SYS@ +ASM>startup force;
SYS@ +ASM>select group_number,name,state,type,total_mb,free_mb from v$asm_diskgroup;
生成spfile、手动mount一次后,再次重启已经可以自动mount
生成pfile查看,已经自动添加了一行
SYS@ +ASM>create pfile from
spfile;
吕星昊
2014.10.12