当前位置:  数据库>oracle

Oracle 11g将数据库移动到不同的ASM磁盘组/修改ASM磁盘组的冗余属性

    来源: 互联网  发布时间:2017-05-31

    本文导语: Oracle使用ASM存储,建库时磁盘组的冗余属性使用了EXTERN,现在想将磁盘组改为NORMAL,以下是具体步骤: 1. 新建一个期望属性的新磁盘组 [root@Oracle-LAB~]# su - grid [grid@Oracle-LAB ~]$ asmca 或者用命令: [grid@Oracle-LAB~]$ sqlplus / as sysasm SQL >...

Oracle使用ASM存储,建库时磁盘组的冗余属性使用了EXTERN,现在想将磁盘组改为NORMAL,以下是具体步骤:

1. 新建一个期望属性的新磁盘组

[root@Oracle-LAB~]# su - grid

[grid@Oracle-LAB ~]$ asmca

或者用命令:

[grid@Oracle-LAB~]$ sqlplus / as sysasm

SQL > CREATE DISKGROUP DATA NORMAL REDUNDANCY DISK '/dev/raw/raw1'SIZE 5120 M DISK '/dev/raw/raw2'SIZE 5120 M DISK '/dev/raw/raw3' SIZE 5120 M;

2. 检查磁盘组

[grid@Oracle-LAB~]$ sqlplus / as sysasm

SQL> select state,name,type from v$asm_diskgroup;

STATE NAME TYPE

----------- ------------------------------ ------

MOUNTED DATA EXTERN

MOUNTED FRA EXTERN

MOUNTED DATA01 NORMAL

3. 备份现有的数据库

[oracle@Oracle-LAB ~]$ sqlplus /nolog

SQL> conn /as sysdba

SQL> show parameter db_name

NAME TYPE VALUE

--------------------------- ---------------

db_name string ORCL

查看当前控制文件的Value:

SQL> show parameter control

NAME TYPE VALUE

----------------------------------------------- ------------------------------

control_file_record_keep_time integer 7

control_files string +DATA/orcl/controlfile/current

.260.833734379

control_management_pack_access string DIAGNOSTIC+TUNING

在新磁盘组生成新控制文件有两种方法(推荐方法二):

方法一:通过备份现有控制文件来生成:

备份控制文件到新磁盘组

SQL> alter database backup controlfile to '+DATA01';

Database altered.

查看备份后的控制文件:

[root@Oracle-LABsoftware]# su - grid

[grid@Oracle-LAB ~]$ asmcmd

ASMCMD> ls +DATA01/ORCL/CONTROLFILE/

Backup.256.833381229

设定初始化参数:

SQL> alter system setcontrol_files='+DATA01/ORCL/CONTROLFILE/Backup.256.833381229' scope=spfile;

System altered.

关闭数据库并启动至nomount状态(用SQL或RAMAN)

[oracle@Oracle-LAB ~]$ rman target /

RMAN> shutdown immediate #如果是RAC,需要到另外的节点执行SHUTDOWN命令

using targetdatabase control file instead of recovery catalog

database closed

databasedismounted

Oracle instance shut down

RMAN> startup nomount

connected totarget database (not started)

Oracle instancestarted

Total SystemGlobal Area 1653518336 bytes

Fixed Size 2228904 bytes

VariableSize 973081944 bytes

DatabaseBuffers 671088640 bytes

Redo Buffers 7118848 bytes

从原控制文件生成现有控制文件:

RMAN> restore controlfile from'+DATA/orcl/controlfile/current.259.833372337';

Starting restoreat 05-DEC-13

allocatedchannel: ORA_DISK_1

channelORA_DISK_1: SID=13 device type=DISK

channelORA_DISK_1: copied control file copy

output file name=+DATA01/orcl/controlfile/backup.256.833381229

Finished restore at 05-DEC-13

方法二:使用添加控制文件的方法:

SQL> alter system set control_files='+DATA/orcl/controlfile/current.260.833734379','+DATA01'scope=spfile;

System altered.

SQL> shutdown immediate

Database closed.

Database dismounted.

ORACLE instanceshut down.

SQL> startup nomount

ORACLE instance started.

Total System Global Area 1653518336 bytes

Fixed Size 2228904 bytes

Variable Size 973081944 bytes

Database Buffers 671088640 bytes

Redo Buffers 7118848 bytes

SQL> quit

[oracle@Oracle-LAB~]$ rman target/

RMAN> restore controlfile from '+DATA/orcl/controlfile/current.260.833734379';

Starting restore at 09-DEC-13

using target database control file instead of recoverycatalog

allocated channel: ORA_DISK_1

channel ORA_DISK_1: SID=135 device type=DISK

channel ORA_DISK_1: copied control file copy

output file name=+DATA/orcl/controlfile/current.260.833734379

output filename=+DATA01/orcl/controlfile/current.256.833744103

Finished restore at 09-DEC-13

RMAN> quit

Recovery Manager complete.

[oracle@Oracle-LAB~]$ sqlplus /nolog

SQL> conn /as sysdba

Connected.

SQL> alter database mount;

Database altered.

SQL> alter database open;

Database altered.

SQL> show parameter control;

NAME TYPE VALUE

------------------------------------ -----------------------------------------

control_file_record_keep_time integer 7

control_files string +DATA/orcl/controlfile/current

.260.833734379,+DATA01/orcl/c

ontrolfile/current.256.833744103

control_management_pack_access string DIAGNOSTIC+TUNING

SQL> alter system setcontrol_files='+DATA01/orcl/controlfile/current.256.833744103' scope=spfile;

System altered.

SQL> shutdown immediate

Database closed.

Database dismounted.

ORACLE instance shut down.

SQL> startup

ORACLE instance started.

Total System Global Area 1653518336 bytes

Fixed Size 2228904 bytes

Variable Size 973081944 bytes

Database Buffers 671088640 bytes

Redo Buffers 7118848 bytes

Database mounted.

Database opened.

SQL> show parameter control;

NAME TYPE VALUE

------------------------------------ -----------------------------------------

control_file_record_keep_time integer 7

control_files string +DATA01/orcl/controlfile/curre

nt.256.833744103

control_management_pack_access string DIAGNOSTIC+TUNING

 

将数据库启动到mount状态:

RMAN> shutdown immediate

RMAN> startup nomount

RMAN> alter database mount ;

database mounted

released channel: ORA_DISK_1

启用RAMN工具,将数据库镜像备份到新磁盘组:

RMAN>backup as copy database format '+DATA01';

Starting backupat 05-DEC-13

allocatedchannel: ORA_DISK_1

channelORA_DISK_1: SID=13 device type=DISK

channelORA_DISK_1: starting datafile copy

input datafilefile number=00001 name=+DATA/orcl/datafile/system.264.833372265

output filename=+DATA01/orcl/datafile/system.257.833384045 tag=TAG20131205T153405 RECID=3STAMP=833384056

channelORA_DISK_1: datafile copy complete, elapsed time: 00:00:15

channelORA_DISK_1: starting datafile copy

input datafilefile number=00002 name=+DATA/orcl/datafile/sysaux.263.833372265

output filename=+DATA01/orcl/datafile/sysaux.258.833384061 tag=TAG20131205T153405 RECID=4STAMP=833384069

channelORA_DISK_1: datafile copy complete, elapsed time: 00:00:15

channelORA_DISK_1: starting datafile copy

input datafilefile number=00005 name=+DATA/orcl/datafile/example.268.833372347

output filename=+DATA01/orcl/datafile/example.259.833384075 tag=TAG20131205T153405 RECID=5STAMP=833384080

channelORA_DISK_1: datafile copy complete, elapsed time: 00:00:08

channelORA_DISK_1: starting datafile copy

input datafilefile number=00003 name=+DATA/orcl/datafile/undotbs1.267.833372265

output filename=+DATA01/orcl/datafile/undotbs1.260.833384083 tag=TAG20131205T153405RECID=6 STAMP=833384084

channelORA_DISK_1: datafile copy complete, elapsed time: 00:00:03

channelORA_DISK_1: starting datafile copy

copying currentcontrol file

output filename=+DATA01/orcl/controlfile/backup.261.833384087 tag=TAG20131205T153405RECID=7 STAMP=833384086

channel ORA_DISK_1:datafile copy complete, elapsed time: 00:00:01

channelORA_DISK_1: starting datafile copy

input datafilefile number=00004 name=+DATA/orcl/datafile/users.269.833372265

output filename=+DATA01/orcl/datafile/users.262.833384087 tag=TAG20131205T153405 RECID=8STAMP=833384087

channelORA_DISK_1: datafile copy complete, elapsed time: 00:00:01

channelORA_DISK_1: starting full datafile backup set

channelORA_DISK_1: specifying datafile(s) in backup set

including currentSPFILE in backup set

channel ORA_DISK_1:starting piece 1 at 05-DEC-13

channelORA_DISK_1: finished piece 1 at 05-DEC-13

piecehandle=+DATA01/orcl/backupset/2013_12_05/nnsnf0_tag20131205t153405_0.263.833384089tag=TAG20131205T153405 comment=NONE

channelORA_DISK_1: backup set complete, elapsed time: 00:00:01

Finished backup at 05-DEC-13

检查备份的数据库镜像

RMAN> list copy of database;


    
 
 
 
本站(WWW.)旨在分享和传播互联网科技相关的资讯和技术,将尽最大努力为读者提供更好的信息聚合和浏览方式。
本站(WWW.)站内文章除注明原创外,均为转载、整理或搜集自网络。欢迎任何形式的转载,转载请注明出处。












  • 相关文章推荐
  • Oracle ASM自动管理存储管理简介
  • Oracle ASM环境下怎么进行数据库冷备
  • 探索ORACLE之ASM概念(完整版)
  • Oracle 12c发布简单介绍及官方下载地址
  • 在linux下安装oracle,如何设置让oracle自动启动!也就是让oracle那个服务自动启动,不是手动的
  • oracle 11g最新版官方下载地址
  • 请问su oracle 和su - oracle有什么不同?
  • Oracle 数据库(oracle Database)Select 多表关联查询方式
  • 虚拟机装Oracle R12与Oracle10g
  • Oracle数据库(Oracle Database)体系结构及基本组成介绍
  • Oracle 数据库开发工具 Oracle SQL Developer
  • 如何设置让Oracle SQL Developer显示的时间包含时分秒
  • Oracle EBS R12 支持 Oracle Database 11g
  • Oracle 10g和Oracle 11g网格技术介绍
  • SCO unix下安装oracle,但没有光盘,请大家推荐一个oracle下载站点(unix版本的)。谢谢!!!!
  • oracle中如何把表中具有相同值列的多行数据合并成一行
  • 请问大家用oracle数据库, 用import oracle.*;下的东西么? 还是用标准库?
  • Oracle 数据库(oracle Database)性能调优技术详解
  • Linux /$ORACLE_HOME $ORACLE_HOME
  • ORACLE日期相关操作
  • Linux系统下Oracle的启动与Oracle监听的启动
  • ORACLE数据库常用字段数据类型介绍
  • 请问在solaris下安装ORACLE,用root用户和用oracle用户安装有什么区别么?
  • Oracle 12c的九大最新技术特性介绍
  • 网间Oracle的连接,远程连接Oracle服务器??


  • 站内导航:


    特别声明:169IT网站部分信息来自互联网,如果侵犯您的权利,请及时告知,本站将立即删除!

    ©2012-2021,