ITPub博客

首页 > Linux操作系统 > Linux操作系统 > FROM ASM Migrating to FILE SYSTEM Using RMAN(三)

FROM ASM Migrating to FILE SYSTEM Using RMAN(三)

原创 Linux操作系统 作者:yanyp 时间:2009-05-19 18:07:27 0 删除 编辑
From:
http://space.itpub.net/?uid-7199859-action-viewspace-itemid-374367

有时候我们从文件系统迁移到了ASM存储后 因为某些原因,需要重新用回到文件系统

 以下步骤就是操作方法:

[oracle@localhost orcl]$sqlplus / as sysdba
SQL*Plus: Release 10.2.0.1.0 - Production on Mon Jul 7 12:45:36 2008

Copyright (c) 1982, 2005, Oracle.  All rights reserved.


Connected to:
Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - Production
With the Partitioning, OLAP and Data Mining options

SQL> alter system set db_create_file_dest='' scope=spfile;

System altered.


SQL> alter system set db_create_online_log_dest_1='' scope=spfile;

System altered.

SQL>  alter system set db_create_online_log_dest_2='' scope=spfile;

System altered.

 

SQL> alter system set control_files='/oracle/oradata/orcl/control01.ctl' scope=spfile;

System altered.

SQL> shutdown
Database closed.
Database dismounted.

[oracle@localhost orcl]$ rman target /

Recovery Manager: Release 10.2.0.1.0 - Production on Mon Jul 7 12:56:17 2008

Copyright (c) 1982, 2005, Oracle.  All rights reserved.

connected to target database (not started)

RMAN> startup nomount;

Oracle instance started

Total System Global Area     167772160 bytes

Fixed Size                     1218316 bytes
Variable Size                 62916852 bytes
Database Buffers             100663296 bytes
Redo Buffers                   2973696 bytes

RMAN> restore controlfile from '+DISKGROUP/orcl/control01.ctl' ;

Starting restore at 07-JUL-08
using target database control file instead of recovery catalog
allocated channel: ORA_DISK_1
channel ORA_DISK_1: sid=156 devtype=DISK

channel ORA_DISK_1: copied control file copy
output filename=/oracle/oradata/orcl/control01.ctl
Finished restore at 07-JUL-08

RMAN> alter database mount;

database mounted
released channel: ORA_DISK_1
RMAN> copy datafile '+DISKGROUP/orcl/datafile/system.256.659448231' to '/oracle/oradata/orcl/system01.dbf';

Starting backup at 07-JUL-08
allocated channel: ORA_DISK_1
channel ORA_DISK_1: sid=156 devtype=DISK
channel ORA_DISK_1: starting datafile copy
input datafile fno=00001 name=+DISKGROUP/orcl/datafile/system.256.659448231
output filename=/oracle/oradata/orcl/system01.dbf tag=TAG20080707T125746 recid=15 stamp=659451492
channel ORA_DISK_1: datafile copy complete, elapsed time: 00:00:35
Finished backup at 07-JUL-08

RMAN> copy datafile '+DISKGROUP/orcl/datafile/undotbs1.262.659448267' to '/oracle/oradata/orcl/undotbs1.dbf';

Starting backup at 07-JUL-08
using channel ORA_DISK_1
channel ORA_DISK_1: starting datafile copy
input datafile fno=00002 name=+DISKGROUP/orcl/datafile/undotbs1.262.659448267
output filename=/oracle/oradata/orcl/undotbs1.dbf tag=TAG20080707T125852 recid=16 stamp=659451551
channel ORA_DISK_1: datafile copy complete, elapsed time: 00:00:25
Finished backup at 07-JUL-08

RMAN> copy datafile '+DISKGROUP/orcl/datafile/sysaux.269.659448291' to '/oracle/oradata/orcl/sysaux01.dbf';

Starting backup at 07-JUL-08
using channel ORA_DISK_1
channel ORA_DISK_1: starting datafile copy
input datafile fno=00003 name=+DISKGROUP/orcl/datafile/sysaux.269.659448291
output filename=/oracle/oradata/orcl/sysaux01.dbf tag=TAG20080707T125929 recid=17 stamp=659451577
channel ORA_DISK_1: datafile copy complete, elapsed time: 00:00:15
Finished backup at 07-JUL-08

RMAN> copy datafile '+DISKGROUP/orcl/datafile/users.268.659448307' to '/oracle/oradata/orcl/users01.dbf';

Starting backup at 07-JUL-08
using channel ORA_DISK_1
channel ORA_DISK_1: starting datafile copy
input datafile fno=00004 name=+DISKGROUP/orcl/datafile/users.268.659448307
output filename=/oracle/oradata/orcl/users01.dbf tag=TAG20080707T130002 recid=18 stamp=659451606
channel ORA_DISK_1: datafile copy complete, elapsed time: 00:00:05
Finished backup at 07-JUL-08


RMAN> switch datafile 1 to copy;

datafile 1 switched to datafile copy "/oracle/oradata/orcl/system01.dbf"

RMAN> switch datafile 2 to copy;

datafile 2 switched to datafile copy "/oracle/oradata/orcl/undotbs1.dbf"

RMAN> switch datafile 3 to copy;

datafile 3 switched to datafile copy "/oracle/oradata/orcl/sysaux01.dbf"

RMAN> switch datafile 4 to copy;

datafile 4 switched to datafile copy "/oracle/oradata/orcl/users01.dbf"

RMAN> alter database open;

database opened

SQL> alter tablespace temp add tempfile '/oracle/oradata/orcl/temp01.dbf' size 100M;

Tablespace altered.

SQL> alter tablespace temp drop tempfile '+DISKGROUP/orcl/tempfile/temp.260.659448493';

Tablespace altered.

SQL> alter database add logfile group 1 '/oracle/oradata/orcl/redo01.log' size 20M;

Database altered.

SQL>  alter database add logfile group 2 '/oracle/oradata/orcl/redo02.log' size 20M;

Database altered.

SQL>  alter database add logfile group 3 '/oracle/oradata/orcl/redo03.log' size 20M;

Database altered.
SQL> alter system switch logfile;

System altered.
sql>/

System altered.

SQL> alter system switch logfile;

System altered.

SQL>  alter database drop logfile group 4;

Database altered.

SQL>  alter database drop logfile group 5;

Database altered.
SQL>  alter database drop logfile group 6;

Database altered.

  SQL> select member from v$logfile;

MEMBER
--------------------------------------------------------------------------------
/oracle/oradata/orcl/redo01.log
/oracle/oradata/orcl/redo02.log
/oracle/oradata/orcl/redo03.log

SQL> select name from v$datafile;

NAME
--------------------------------------------------------------------------------
/oracle/oradata/orcl/system01.dbf
/oracle/oradata/orcl/undotbs1.dbf
/oracle/oradata/orcl/sysaux01.dbf
/oracle/oradata/orcl/users01.dbf

SQL> select name from v$tempfile;

NAME
--------------------------------------------------------------------------------
/oracle/oradata/orcl/temp01.dbf

SQL> select name from v$controlfile;

NAME
--------------------------------------------------------------------------------
/oracle/oradata/orcl/control01.ctl

来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/230160/viewspace-600484/,如需转载,请注明出处,否则将追究法律责任。

请登录后发表评论 登录
全部评论

注册时间:2009-04-12

  • 博文量
    139
  • 访问量
    172241