Chinaunix首页 | 论坛 | 博客
  • 博客访问: 3324824
  • 博文数量: 631
  • 博客积分: 10716
  • 博客等级: 上将
  • 技术积分: 8397
  • 用 户 组: 普通用户
  • 注册时间: 2008-04-01 22:35
文章分类

全部博文(631)

文章存档

2020年(2)

2019年(22)

2018年(4)

2017年(37)

2016年(22)

2015年(1)

2013年(12)

2012年(20)

2011年(19)

2010年(20)

2009年(282)

2008年(190)

分类: Oracle

2017-01-09 07:56:42

使用VBOX模拟存储迁移的环境,OS:RHEL5.9,DB:Oracle 10.2.0.4 RAC ASM 2Nodes。

ASM使用Extern Redundancy,不使用ASM的rebalance功能,ocr和votedisk存放在raw里。

迁移包括controlfile,datafile,tempfile,spfile,ocr,votedisk。


迁移前路径

ocr               /dev/sdf1  /dev/raw/raw1,    /dev/sdf2  /dev/raw/raw2

votedisk          /dev/sdg1  /dev/raw/raw3,    /dev/sdg2  /dev/raw/raw4,    /dev/sdg3  /dev/raw/raw5

ASM    +DATA      /dev/sdb

ASM    +FRA       /dev/sdc


迁移后路径


ocr               /dev/sdh1  /dev/raw/raw6,    /dev/sdh2  /dev/raw/raw7

votedisk          /dev/sdi1  /dev/raw/raw8,    /dev/sdi2  /dev/raw/raw9,    /dev/sdi3  /dev/raw/raw10

ASM    +DATAFG    /dev/sdd

ASM    +FRADG     /dev/sde



迁移votedisk和ocr


[plain] view plain copy
 print?在CODE上查看代码片派生到我的代码片
  1. [oracle@racdb1 ~]$ ocrcheck  
  2. Status of Oracle Cluster Registry is as follows :  
  3.          Version                  :          2  
  4.          Total space (kbytes)     :     497744  
  5.          Used space (kbytes)      :       4360  
  6.          Available space (kbytes) :     493384  
  7.          ID                       :  803449477  
  8.          Device/File Name         : /dev/raw/raw1  
  9.                                     Device/File integrity check succeeded  
  10.          Device/File Name         : /dev/raw/raw2  
  11.                                     Device/File integrity check succeeded  
  12.   
  13.          Cluster registry integrity check succeeded  
  14.   
  15. [oracle@racdb1 ~]$   
  16. [oracle@racdb1 ~]$ crsctl query css votedisk  
  17.  0.     0    /dev/raw/raw3  
  18.  1.     0    /dev/raw/raw4  
  19.  2.     0    /dev/raw/raw5  
  20.   
  21. located 3 votedisk(s).  
关闭RAC环境的crs
[plain] view plain copy
 print?在CODE上查看代码片派生到我的代码片
  1. [root@racdb1 ~]# /etc/init.d/init.crs stop  
  2. Shutting down Oracle Cluster Ready Services (CRS):  
  3. Nov 24 16:06:49.700 | INF | daemon shutting down  
  4. Stopping resources. This could take several minutes.  
  5. Successfully stopped CRS resources.  
  6. Stopping CSSD.  
  7. Shutting down CSS daemon.  
  8. Shutdown request successfully issued.  
  9. Shutdown has begun. The daemons should exit soon.  
[plain] view plain copy
 print?在CODE上查看代码片派生到我的代码片
  1. [root@racdb2 ~]# /etc/init.d/init.crs stop  
  2. Shutting down Oracle Cluster Ready Services (CRS):  
  3. Nov 24 16:07:11.360 | INF | daemon shutting down  
  4. Stopping resources. This could take several minutes.  
  5. Successfully stopped CRS resources.  
  6. Stopping CSSD.  
  7. Shutting down CSS daemon.  
  8. Shutdown request successfully issued.  
  9. Shutdown has begun. The daemons should exit soon.  
备份votedisk


[plain] view plain copy
 print?在CODE上查看代码片派生到我的代码片
  1. [root@racdb1 ~]# dd if=/dev/raw/raw3 of=/u01/votedisk.bak  
添加votedisk


[plain] view plain copy
 print?在CODE上查看代码片派生到我的代码片
  1. [root@racdb1 ~]# /u01/app/oracle/product/10.2.0/db_1/bin/crsctl add css votedisk /dev/raw/raw8 -force  
  2. Now formatting voting disk: /dev/raw/raw8  
  3. successful addition of votedisk /dev/raw/raw8.  
  4. [root@racdb1 ~]# /u01/app/oracle/product/10.2.0/db_1/bin/crsctl add css votedisk /dev/raw/raw9 -force  
  5. Now formatting voting disk: /dev/raw/raw9  
  6. successful addition of votedisk /dev/raw/raw9.  
  7. [root@racdb1 ~]# /u01/app/oracle/product/10.2.0/db_1/bin/crsctl add css votedisk /dev/raw/raw10 -force  
  8. Now formatting voting disk: /dev/raw/raw10  
  9. successful addition of votedisk /dev/raw/raw10.  
删除旧的votedisk



[plain] view plain copy
 print?在CODE上查看代码片派生到我的代码片
  1. [root@racdb1 ~]# /u01/app/oracle/product/10.2.0/db_1/bin/crsctl delete css votedisk /dev/raw/raw3 -force  
  2. successful deletion of votedisk /dev/raw/raw3.  
  3. [root@racdb1 ~]# /u01/app/oracle/product/10.2.0/db_1/bin/crsctl delete css votedisk /dev/raw/raw4 -force  
  4. successful deletion of votedisk /dev/raw/raw4.  
  5. [root@racdb1 ~]# /u01/app/oracle/product/10.2.0/db_1/bin/crsctl delete css votedisk /dev/raw/raw5 -force  
  6. successful deletion of votedisk /dev/raw/raw5.  
启动crs
[plain] view plain copy
 print?在CODE上查看代码片派生到我的代码片
  1. [root@racdb1 ~]# /u01/app/oracle/product/10.2.0/db_1/bin/crsctl start crs  
  2. Attempting to start CRS stack   
  3. The CRS stack will be started shortly  
[plain] view plain copy
 print?在CODE上查看代码片派生到我的代码片
  1. [root@racdb2 ~]# /u01/app/oracle/product/10.2.0/db_1/bin/crsctl start crs  
  2. Attempting to start CRS stack   
  3. The CRS stack will be started shortly  
检查crs状态,votedisk路径
[plain] view plain copy
 print?在CODE上查看代码片派生到我的代码片
  1. [oracle@racdb1 ~]$ crsctl check crs  
  2. CSS appears healthy  
  3. CRS appears healthy  
  4. EVM appears healthy  
  5. [oracle@racdb1 ~]$ crs_stat -t  
  6. Name           Type           Target    State     Host          
  7. ------------------------------------------------------------  
  8. ora....SM1.asm application    ONLINE    ONLINE    racdb1        
  9. ora....B1.lsnr application    ONLINE    ONLINE    racdb1        
  10. ora.racdb1.gsd application    ONLINE    ONLINE    racdb1        
  11. ora.racdb1.ons application    ONLINE    ONLINE    racdb1        
  12. ora.racdb1.vip application    ONLINE    ONLINE    racdb1        
  13. ora....SM2.asm application    ONLINE    ONLINE    racdb2        
  14. ora....B2.lsnr application    ONLINE    ONLINE    racdb2        
  15. ora.racdb2.gsd application    ONLINE    ONLINE    racdb2        
  16. ora.racdb2.ons application    ONLINE    ONLINE    racdb2        
  17. ora.racdb2.vip application    ONLINE    ONLINE    racdb2        
  18. ora.zhongwc.db application    ONLINE    ONLINE    racdb2        
  19. ora....c1.inst application    ONLINE    ONLINE    racdb1        
  20. ora....c2.inst application    ONLINE    ONLINE    racdb2        
  21. ora.....zwc.cs application    ONLINE    ONLINE    racdb1        
  22. ora....wc1.srv application    ONLINE    ONLINE    racdb1        
  23. [oracle@racdb1 ~]$   
  24. [oracle@racdb1 ~]$ crsctl query css votedisk  
  25.  0.     0    /dev/raw/raw8  
  26.  1.     0    /dev/raw/raw9  
  27.  2.     0    /dev/raw/raw10  
  28.   
  29. located 3 votedisk(s).  
备份ocr


[plain] view plain copy
 print?在CODE上查看代码片派生到我的代码片
  1. [root@racdb1 bin]# /u01/app/oracle/product/10.2.0/crs/bin/ocrcheck  
  2. Status of Oracle Cluster Registry is as follows :  
  3.          Version                  :          2  
  4.          Total space (kbytes)     :     497744  
  5.          Used space (kbytes)      :       4360  
  6.          Available space (kbytes) :     493384  
  7.          ID                       :  803449477  
  8.          Device/File Name         : /dev/raw/raw1  
  9.                                     Device/File integrity check succeeded  
  10.          Device/File Name         : /dev/raw/raw2  
  11.                                     Device/File integrity check succeeded  
  12.   
  13.          Cluster registry integrity check succeeded  
  14.   
  15. [root@racdb1 bin]#   
  16. [root@racdb1 bin]# /u01/app/oracle/product/10.2.0/crs/bin/ocrconfig -export /u01/ocr_bak -s online  
迁移ocr
[plain] view plain copy
 print?在CODE上查看代码片派生到我的代码片
  1. [root@racdb1 bin]# /u01/app/oracle/product/10.2.0/crs/bin/ocrconfig -replace ocr /dev/raw/raw6  
  2. [root@racdb1 bin]# /u01/app/oracle/product/10.2.0/crs/bin/ocrconfig -replace ocrmirror /dev/raw/raw7  
check ocr


[plain] view plain copy
 print?在CODE上查看代码片派生到我的代码片
  1. [oracle@racdb2 ~]$ ocrcheck  
  2. Status of Oracle Cluster Registry is as follows :  
  3.          Version                  :          2  
  4.          Total space (kbytes)     :     497744  
  5.          Used space (kbytes)      :       4360  
  6.          Available space (kbytes) :     493384  
  7.          ID                       :  803449477  
  8.          Device/File Name         : /dev/raw/raw6  
  9.                                     Device/File integrity check succeeded  
  10.          Device/File Name         : /dev/raw/raw7  
  11.                                     Device/File integrity check succeeded  
  12.   
  13.          Cluster registry integrity check succeeded  


迁移datafile,controlfile,logfile,spfile


创建ASM DISKGROUP

asm_diskgroups='DATA','FRA','DATADG','FRADG'


[plain] view plain copy
 print?在CODE上查看代码片派生到我的代码片
  1. [oracle@racdb1 ~]$ export ORACLE_SID=+ASM1  
  2. [oracle@racdb1 ~]$ sqlplus / as sysdba  
  3.   
  4. SQL*Plus: Release 10.2.0.4.0 - Production on Sun Nov 24 16:40:05 2013  
  5.   
  6. Copyright (c) 1982, 2007, Oracle.  All Rights Reserved.  
  7.   
  8.   
  9. Connected to:  
  10. Oracle Database 10g Enterprise Edition Release 10.2.0.4.0 - 64bit Production  
  11. With the Partitioning, Real Application Clusters, OLAP, Data Mining  
  12. and Real Application Testing options  
  13.   
  14. SQL> col name for a8  
  15. SQL> col path for a15  
  16. SQL> select a.path,b.name,b.state from v$asm_disk a,v$asm_diskgroup b where a.group_number=b.group_number(+) order by 1;  
  17.   
  18. PATH            NAME     STATE  
  19. --------------- -------- ----------------------  
  20. /dev/asm-diskb  DATA     MOUNTED  
  21. /dev/asm-diskc  FRA      MOUNTED  
  22. /dev/asm-diskd  
  23. /dev/asm-diske  
  24.   
  25. SQL> create diskgroup datadg external redundancy disk '/dev/asm-diskd';  
  26.   
  27. Diskgroup created.  
  28.   
  29. SQL> create diskgroup fradg external redundancy disk '/dev/asm-diske';  
  30.   
  31. Diskgroup created.  
  32.   
  33. SQL> select a.path,b.name,b.state from v$asm_disk a,v$asm_diskgroup b where a.group_number=b.group_number(+) order by 1;  
  34.   
  35. PATH            NAME     STATE  
  36. --------------- -------- ----------------------  
  37. /dev/asm-diskb  DATA     MOUNTED  
  38. /dev/asm-diskc  FRA      MOUNTED  
  39. /dev/asm-diskd  DATADG   MOUNTED  
  40. /dev/asm-diske  FRADG    MOUNTED  
rac2



[plain] view plain copy
 print?在CODE上查看代码片派生到我的代码片
  1. SQL> alter diskgroup datadg mount;  
  2.   
  3. Diskgroup altered.  
  4.   
  5. SQL> alter diskgroup fradg mount;  
  6.   
  7. Diskgroup altered.  
RAC1,RAC2 rdbms instance 启动 到mount



[plain] view plain copy
 print?在CODE上查看代码片派生到我的代码片
  1. [oracle@racdb1 ~]$ sqlplus / as sysdba  
  2.   
  3. SQL*Plus: Release 10.2.0.4.0 - Production on Sun Nov 24 16:47:06 2013  
  4.   
  5. Copyright (c) 1982, 2007, Oracle.  All Rights Reserved.  
  6.   
  7.   
  8. Connected to:  
  9. Oracle Database 10g Enterprise Edition Release 10.2.0.4.0 - 64bit Production  
  10. With the Partitioning, Real Application Clusters, OLAP, Data Mining  
  11. and Real Application Testing options  
  12.   
  13. SQL> shutdown immediate  
  14. Database closed.  
  15. Database dismounted.  
  16. ORACLE instance shut down.  
  17. SQL> startup mount  
  18. ORACLE instance started.  
  19.   
  20. Total System Global Area  599785472 bytes  
  21. Fixed Size                  2085776 bytes  
  22. Variable Size             167775344 bytes  
  23. Database Buffers          423624704 bytes  
  24. Redo Buffers                6299648 bytes  
  25. Database mounted.  
[plain] view plain copy
 print?在CODE上查看代码片派生到我的代码片
  1. [oracle@racdb2 ~]$ sqlplus / as sysdba  
  2.   
  3. SQL*Plus: Release 10.2.0.4.0 - Production on Sun Nov 24 16:47:18 2013  
  4.   
  5. Copyright (c) 1982, 2007, Oracle.  All Rights Reserved.  
  6.   
  7.   
  8. Connected to:  
  9. Oracle Database 10g Enterprise Edition Release 10.2.0.4.0 - 64bit Production  
  10. With the Partitioning, Real Application Clusters, OLAP, Data Mining  
  11. and Real Application Testing options  
  12.   
  13. SQL> shutdown immediate  
  14. Database closed.  
  15. Database dismounted.  
  16. ORACLE instance shut down.  
  17. SQL> startup mount  
  18. ORACLE instance started.  
  19.   
  20. Total System Global Area  599785472 bytes  
  21. Fixed Size                  2085776 bytes  
  22. Variable Size             163581040 bytes  
  23. Database Buffers          427819008 bytes  
  24. Redo Buffers                6299648 bytes  
  25. Database mounted.  
使用RMAN迁移datafile



[plain] view plain copy
 print?在CODE上查看代码片派生到我的代码片
  1. [oracle@racdb1 ~]$ rman target /  
  2.   
  3. Recovery Manager: Release 10.2.0.4.0 - Production on Sun Nov 24 16:55:26 2013  
  4.   
  5. Copyright (c) 1982, 2007, Oracle.  All rights reserved.  
  6.   
  7. connected to target database: ZHONGWC (DBID=207169202, not open)  
  8.   
  9. RMAN> run{  
  10. 2> copy datafile 1 to '+DATADG/zhongwc/datafile/system.dbf';  
  11. 3> copy datafile 2 to '+DATADG/zhongwc/datafile/undotbs1.dbf';  
  12. 4> copy datafile 3 to '+DATADG/zhongwc/datafile/sysaux.dbf';  
  13. 5> copy datafile 4 to '+DATADG/zhongwc/datafile/users.dbf';  
  14. 6> copy datafile 5 to '+DATADG/zhongwc/datafile/example.dbf';  
  15. 7> copy datafile 6 to '+DATADG/zhongwc/datafile/undotbs2.dbf';  
  16. 8> }  
  17.   
  18. Starting backup at 24-NOV-13  
  19. using target database control file instead of recovery catalog  
  20. allocated channel: ORA_DISK_1  
  21. channel ORA_DISK_1: sid=859 instance=zhongwc1 devtype=DISK  
  22. channel ORA_DISK_1: starting datafile copy  
  23. input datafile fno=00001 name=+DATA/zhongwc/datafile/system.256.832285129  
  24. output filename=+DATADG/zhongwc/datafile/system.dbf tag=TAG20131124T165656 recid=2 stamp=832352228  
  25. channel ORA_DISK_1: datafile copy complete, elapsed time: 00:00:15  
  26. Finished backup at 24-NOV-13  
  27.   
  28. Starting backup at 24-NOV-13  
  29. using channel ORA_DISK_1  
  30. channel ORA_DISK_1: starting datafile copy  
  31. input datafile fno=00002 name=+DATA/zhongwc/datafile/undotbs1.258.832285129  
  32. output filename=+DATADG/zhongwc/datafile/undotbs1.dbf tag=TAG20131124T165712 recid=3 stamp=832352233  
  33. channel ORA_DISK_1: datafile copy complete, elapsed time: 00:00:01  
  34. Finished backup at 24-NOV-13  
  35.   
  36. Starting backup at 24-NOV-13  
  37. using channel ORA_DISK_1  
  38. channel ORA_DISK_1: starting datafile copy  
  39. input datafile fno=00003 name=+DATA/zhongwc/datafile/sysaux.257.832285129  
  40. output filename=+DATADG/zhongwc/datafile/sysaux.dbf tag=TAG20131124T165714 recid=4 stamp=832352241  
  41. channel ORA_DISK_1: datafile copy complete, elapsed time: 00:00:15  
  42. Finished backup at 24-NOV-13  
  43.   
  44. Starting backup at 24-NOV-13  
  45. using channel ORA_DISK_1  
  46. channel ORA_DISK_1: starting datafile copy  
  47. input datafile fno=00004 name=+DATA/zhongwc/datafile/users.259.832285129  
  48. output filename=+DATADG/zhongwc/datafile/users.dbf tag=TAG20131124T165729 recid=5 stamp=832352249  
  49. channel ORA_DISK_1: datafile copy complete, elapsed time: 00:00:01  
  50. Finished backup at 24-NOV-13  
  51.   
  52. Starting backup at 24-NOV-13  
  53. using channel ORA_DISK_1  
  54. channel ORA_DISK_1: starting datafile copy  
  55. input datafile fno=00005 name=+DATA/zhongwc/datafile/example.264.832285185  
  56. output filename=+DATADG/zhongwc/datafile/example.dbf tag=TAG20131124T165730 recid=6 stamp=832352253  
  57. channel ORA_DISK_1: datafile copy complete, elapsed time: 00:00:07  
  58. Finished backup at 24-NOV-13  
  59.   
  60. Starting backup at 24-NOV-13  
  61. using channel ORA_DISK_1  
  62. channel ORA_DISK_1: starting datafile copy  
  63. input datafile fno=00006 name=+DATA/zhongwc/datafile/undotbs2.265.832285281  
  64. output filename=+DATADG/zhongwc/datafile/undotbs2.dbf tag=TAG20131124T165737 recid=7 stamp=832352258  
  65. channel ORA_DISK_1: datafile copy complete, elapsed time: 00:00:01  
  66. Finished backup at 24-NOV-13  
  67.   
  68. RMAN>   
[plain] view plain copy
 print?在CODE上查看代码片派生到我的代码片
  1. SQL> alter database rename file '+DATA/zhongwc/datafile/system.256.832285129' to '+DATADG/zhongwc/datafile/system.dbf';  
  2.   
  3. Database altered.  
  4.   
  5. SQL> alter database rename file '+DATA/zhongwc/datafile/undotbs1.258.832285129' to '+DATADG/zhongwc/datafile/undotbs1.dbf';  
  6.   
  7. Database altered.  
  8.   
  9. SQL> alter database rename file '+DATA/zhongwc/datafile/sysaux.257.832285129' to '+DATADG/zhongwc/datafile/sysaux.dbf';  
  10.   
  11. Database altered.  
  12.   
  13. SQL> alter database rename file '+DATA/zhongwc/datafile/users.259.832285129' to '+DATADG/zhongwc/datafile/users.dbf';  
  14.   
  15. Database altered.  
  16.   
  17. SQL> alter database rename file '+DATA/zhongwc/datafile/example.264.832285185' to '+DATADG/zhongwc/datafile/example.dbf';  
  18.   
  19. Database altered.  
  20.   
  21. SQL> alter database rename file '+DATA/zhongwc/datafile/undotbs2.265.832285281' to '+DATADG/zhongwc/datafile/undotbs2.dbf';  
  22.   
  23. Database altered.  
[plain] view plain copy
 print?在CODE上查看代码片派生到我的代码片
  1. SQL> select file#,name from v$datafile;  
  2.   
  3.      FILE# NAME  
  4. ---------- --------------------------------------------------  
  5.          1 +DATADG/zhongwc/datafile/system.dbf  
  6.          2 +DATADG/zhongwc/datafile/undotbs1.dbf  
  7.          3 +DATADG/zhongwc/datafile/sysaux.dbf  
  8.          4 +DATADG/zhongwc/datafile/users.dbf  
  9.          5 +DATADG/zhongwc/datafile/example.dbf  
  10.          6 +DATADG/zhongwc/datafile/undotbs2.dbf  
  11.   
  12. 6 rows selected.  


迁移tempfile


[plain] view plain copy
 print?在CODE上查看代码片派生到我的代码片
  1. SQL> select file#,name from v$tempfile;  
  2.   
  3.      FILE# NAME  
  4. ---------- ---------------------------------------------  
  5.          1 +DATA/zhongwc/tempfile/temp.263.832285181  
[plain] view plain copy
 print?在CODE上查看代码片派生到我的代码片
  1. [oracle@racdb1 ~]$ rman target /  
  2.   
  3.   
  4. Recovery Manager: Release 10.2.0.4.0 - Production on Sun Nov 24 17:15:38 2013  
  5.   
  6.   
  7. Copyright (c) 1982, 2007, Oracle.  All rights reserved.  
  8.   
  9.   
  10. connected to target database: ZHONGWC (DBID=207169202, not open)  
  11.   
  12.   
  13. RMAN> run{  
  14. 2> set newname for tempfile 1 to '+DATA/zhongwc/tempfile/temp.dbf';  
  15. 3> switch tempfile all;  
  16. 4> }  
  17.   
  18.   
  19. executing command: SET NEWNAME  
  20. using target database control file instead of recovery catalog  
  21.   
  22.   
  23. renamed temporary file 1 to +DATADG/zhongwc/tempfile/temp.dbf in control file  
[plain] view plain copy
 print?在CODE上查看代码片派生到我的代码片
  1. SQL> select file#,name from v$tempfile;  
  2.   
  3.      FILE# NAME  
  4. ---------- ---------------------------------------------  
  5.          1 +DATADG/zhongwc/tempfile/temp.dbf  


迁移logfile


[plain] view plain copy
 print?在CODE上查看代码片派生到我的代码片
  1. SQL> select a.member,a.group#,b.status,b.thread# from v$logfile a,v$log b where a.group#=b.group# order by 2;  
  2.   
  3.   
  4. MEMBER                                                 GROUP# STATUS              THREAD#  
  5. -------------------------------------------------- ---------- ---------------- ----------  
  6. +FRA/zhongwc/onlinelog/group_1.257.832285173                1 CURRENT                   1  
  7. +DATA/zhongwc/onlinelog/group_1.261.832285173               1 CURRENT                   1  
  8. +FRA/zhongwc/onlinelog/group_2.258.832285175                2 INACTIVE                  1  
  9. +DATA/zhongwc/onlinelog/group_2.262.832285175               2 INACTIVE                  1  
  10. +DATA/zhongwc/onlinelog/group_3.266.832285329               3 CURRENT                   2  
  11. +FRA/zhongwc/onlinelog/group_3.259.832285329                3 CURRENT                   2  
  12. +DATA/zhongwc/onlinelog/group_4.267.832285331               4 INACTIVE                  2  
  13. +FRA/zhongwc/onlinelog/group_4.260.832285331                4 INACTIVE                  2  
  14.   
  15.   
  16. 8 rows selected.  
[plain] view plain copy
 print?在CODE上查看代码片派生到我的代码片
  1. SQL> alter database add logfile thread 1 group 5 '+DATADG' size 500M;  
  2.   
  3. Database altered.  
  4.   
  5. SQL> alter database add logfile thread 1 group 6 '+DATADG' size 500M;  
  6.   
  7. Database altered.  
  8.   
  9. SQL> alter database add logfile thread 1 group 7 '+DATADG' size 500M;  
  10.   
  11. Database altered.  
  12.   
  13. SQL> alter database add logfile thread 2 group 8 '+DATADG' size 500M;  
  14.   
  15. Database altered.  
  16.   
  17. SQL> alter database add logfile thread 2 group 9 '+DATADG' size 500M;  
  18.   
  19. Database altered.  
  20.   
  21. SQL> alter database add logfile thread 2 group 10 '+DATADG' size 500M;  
  22.   
  23. Database altered.  
[plain] view plain copy
 print?在CODE上查看代码片派生到我的代码片
  1. SQL> alter database open;  
  2.   
  3. Database altered.  
  4.   
  5. SQL> !srvctl start service -d zhongwc -s zwc -i zhongwc1  
[plain] view plain copy
 print?在CODE上查看代码片派生到我的代码片
  1. SQL> alter database drop logfile group 1;  
  2.   
  3. Database altered.  
  4.   
  5. SQL> alter database drop logfile group 2;  
  6.   
  7. Database altered.  
  8.   
  9. SQL> alter database drop logfile group 3;  
  10.   
  11. Database altered.  
  12.   
  13. SQL> alter database drop logfile group 4;  
  14.   
  15. Database altered.  
  16.   
  17. SQL> select a.member,a.group#,b.status,b.thread# from v$logfile a,v$log b where a.group#=b.group# order by 2;  
  18.   
  19. MEMBER                                                 GROUP# STATUS              THREAD#  
  20. -------------------------------------------------- ---------- ---------------- ----------  
  21. +DATADG/zhongwc/onlinelog/group_5.263.832353821             5 INACTIVE                  1  
  22. +DATADG/zhongwc/onlinelog/group_6.262.832353833             6 CURRENT                   1  
  23. +DATADG/zhongwc/onlinelog/group_7.264.832353849             7 INACTIVE                  1  
  24. +DATADG/zhongwc/onlinelog/group_8.265.832353867             8 INACTIVE                  2  
  25. +DATADG/zhongwc/onlinelog/group_9.266.832353879             9 INACTIVE                  2  
  26. +DATADG/zhongwc/onlinelog/group_10.267.832353891           10 CURRENT                   2  
  27.   
  28. 6 rows selected.  
迁移controlfile



[plain] view plain copy
 print?在CODE上查看代码片派生到我的代码片
  1. SQL> shutdown immediate  
  2. Database closed.  
  3. Database dismounted.  
  4. ORACLE instance shut down.  
  5. SQL> startup nomount  
  6. ORACLE instance started.  
  7.   
  8. Total System Global Area  599785472 bytes  
  9. Fixed Size                  2085776 bytes  
  10. Variable Size             163581040 bytes  
  11. Database Buffers          427819008 bytes  
  12. Redo Buffers                6299648 bytes  
[plain] view plain copy
 print?在CODE上查看代码片派生到我的代码片
  1. [oracle@racdb1 oracle]$ rman target /  
  2.   
  3. Recovery Manager: Release 10.2.0.4.0 - Production on Sun Nov 24 17:51:08 2013  
  4.   
  5. Copyright (c) 1982, 2007, Oracle.  All rights reserved.  
  6.   
  7. connected to target database: zhongwc (not mounted)  
  8.   
  9. RMAN> run{  
  10. 2> restore controlfile to '+DATADG/zhongwc/controlfile/control01.ctl' from '+DATA/zhongwc/controlfile/current.260.832285171';  
  11. 3> restore controlfile to '+FRADG/zhongwc/controlfile/control02.ctl' from '+FRA/zhongwc/controlfile/current.256.832285171';  
  12. 4> }  
  13.   
  14. Starting restore at 24-NOV-13  
  15. using target database control file instead of recovery catalog  
  16. allocated channel: ORA_DISK_1  
  17. channel ORA_DISK_1: sid=863 instance=zhongwc1 devtype=DISK  
  18.   
  19. channel ORA_DISK_1: copied control file copy  
  20. Finished restore at 24-NOV-13  
  21.   
  22. Starting restore at 24-NOV-13  
  23. using channel ORA_DISK_1  
  24.   
  25. channel ORA_DISK_1: copied control file copy  
  26. Finished restore at 24-NOV-13  
[plain] view plain copy
 print?在CODE上查看代码片派生到我的代码片
  1. SQL> alter system set control_files='+DATADG/zhongwc/controlfile/control01.ctl','+FRADG/zhongwc/controlfile/control02.ctl' scope=spfile sid='*';  
  2.   
  3. System altered.  
  4.   
  5. SQL> shutdown immediate  
  6. ORA-01507: database not mounted  
  7.   
  8.   
  9. ORACLE instance shut down.  
  10. SQL> startup  
  11. ORACLE instance started.  
  12.   
  13. Total System Global Area  599785472 bytes  
  14. Fixed Size                  2085776 bytes  
  15. Variable Size             167775344 bytes  
  16. Database Buffers          423624704 bytes  
  17. Redo Buffers                6299648 bytes  
  18. Database mounted.  
  19. Database opened.  
  20. SQL> show parameter control_files  
  21.   
  22. NAME                                 TYPE        VALUE  
  23. ------------------------------------ ----------- ------------------------------  
  24. control_files                        string      +DATADG/zhongwc/controlfile/co  
  25.                                                  ntrol01.ctl, +FRADG/zhongwc/co  
  26.                                                  ntrolfile/control02.ctl  
  27. SQL> !srvctl start service -d zhongwc -s zwc -i zhongwc1  
修改db_create_file_dest,db_recovery_file_dest,log_archive_dest_1参数



[plain] view plain copy
 print?在CODE上查看代码片派生到我的代码片
  1. SQL> alter system set db_create_file_dest='+DATADG';  
  2.   
  3. System altered.  
  4.   
  5. SQL> alter system set db_recovery_file_dest='+FRADG';  
  6.   
  7. System altered.  
  8.   
  9. SQL> alter system set log_archive_dest_1='location=+FRADG';  
  10.   
  11. System altered.  
迁移spfile,修改ocr


[plain] view plain copy
 print?在CODE上查看代码片派生到我的代码片
  1. [oracle@racdb1 ~]$ srvctl config database -d zhongwc -a  
  2. racdb1 zhongwc1 /u01/app/oracle/product/10.2.0/db_1  
  3. racdb2 zhongwc2 /u01/app/oracle/product/10.2.0/db_1  
  4. DB_NAME: zhongwc  
  5. ORACLE_HOME: /u01/app/oracle/product/10.2.0/db_1  
  6. SPFILE: +DATA/zhongwc/spfilezhongwc.ora  
  7. DOMAIN: null  
  8. DB_ROLE: null  
  9. START_OPTIONS: null  
  10. POLICY:  AUTOMATIC  
  11. ENABLE FLAG: DB ENABLED  
[plain] view plain copy
 print?在CODE上查看代码片派生到我的代码片
  1. [oracle@racdb1 ~]$ srvctl modify database -d zhongwc -p '+DATADG/zhongwc/spfilezhongwc.ora'  
  2. [oracle@racdb1 ~]$   
  3. [oracle@racdb1 ~]$ srvctl config database -d zhongwc -a  
  4. racdb1 zhongwc1 /u01/app/oracle/product/10.2.0/db_1  
  5. racdb2 zhongwc2 /u01/app/oracle/product/10.2.0/db_1  
  6. DB_NAME: zhongwc  
  7. ORACLE_HOME: /u01/app/oracle/product/10.2.0/db_1  
  8. SPFILE: +DATADG/zhongwc/spfilezhongwc.ora  
  9. DOMAIN: null  
  10. DB_ROLE: null  
  11. START_OPTIONS: null  
  12. POLICY:  AUTOMATIC  
  13. ENABLE FLAG: DB ENABLED  
最后删除旧的DISKGROUP

on rac2


[plain] view plain copy
 print?在CODE上查看代码片派生到我的代码片
  1. SQL> alter diskgroup data dismount;  
  2.   
  3. Diskgroup altered.  
  4.   
  5. SQL> alter diskgroup fra dismount;  
  6.   
  7. Diskgroup altered.  
on rac1



[plain] view plain copy
 print?在CODE上查看代码片派生到我的代码片
  1. SQL> drop diskgroup fra;  
  2.   
  3. Diskgroup dropped.  
  4.   
  5. SQL> drop diskgroup data;  
  6.   
  7. Diskgroup dropped.  
阅读(1514) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~