【資料遷移】RMAN遷移資料庫到ASM(一)建立ASM磁碟組

kingsql發表於2014-10-14
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

  1. [root@aix227:/]#lsdev -c adapter | grep -i fc
  2. fcs0 Available 04-08 FC Adapter
  3. [root@aix227:/]#
  4. [root@aix227:/]#lscfg -vpl fcs0 | grep -i network
  5.         Network Address.............10000000C945AA65

1.2、陣列上劃分volslice ,繫結lun

  1. volslice create aix227_02 -z 30gb v01
  2. 檢視新劃分的aix227_02 的slice num
  3. :/:<4>volslice list
  4. Slice Slice Num Start Blk Size Blks Capacity Volume
  5. aix227_02 8 692186880 62926080 30.004 GB v01
  6. 繫結lun
  7. lun perm lun 8 rw wwn 10000000C945AA65
  8. :/:<8>lun perm list lun 8
  9. List of WWNs and their access right to lun 8
  10. -------------------------------------------------------------------------------------------------------
  11. lun slice WWN Group Name Group Perm WWN Perm Effective Perm
  12. --------------------------------------------------------------------------------------------------------
  13. 8 8 default -- -- none none
  14. 8 8 10000000c945aa65 -- -- rw rw
  15. -------------------------------------------------------------------------------------------------------

1.3AIX上識別新磁碟

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.3sqlplus登入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



來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/28389881/viewspace-1298120/,如需轉載,請註明出處,否則將追究法律責任。

相關文章