手机版
你好,游客 登录 注册
背景:
阅读新闻

Oracle DB 使用RMAN将数据库移植到ASM存储区

[日期:2013-11-04] 来源:Linux社区  作者:rlhua [字体:大 中 小]

另一种转换方法:

RMAN> backup tablespace users;

Starting backup at 24-OCT-13
using target database control file instead of recovery catalog
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=163 device type=DISK
allocated channel: ORA_DISK_2
channel ORA_DISK_2: SID=226 device type=DISK
allocated channel: ORA_DISK_3
channel ORA_DISK_3: SID=9 device type=DISK
channel ORA_DISK_1: starting full datafile backup set
channel ORA_DISK_1: specifying datafile(s) in backup set
input datafile file number=00004 name=/u01/app/Oracle/oradata/test0924/users01.dbf
channel ORA_DISK_1: starting piece 1 at 24-OCT-13
channel ORA_DISK_1: finished piece 1 at 24-OCT-13
piece handle=/u01/app/oracle/fast_recovery_area/TEST0924/backupset/2013_10_24/o1_mf_nnndf_TAG20131024T101748_96lc0dxh_.bkp tag=TAG20131024T101748 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:07
Finished backup at 24-OCT-13

Starting Control File and SPFILE Autobackup at 24-OCT-13
piece handle=/u01/app/oracle/fast_recovery_area/TEST0924/autobackup/2013_10_24/o1_mf_s_829649875_96lc0obm_.bkp comment=NONE
Finished Control File and SPFILE Autobackup at 24-OCT-13

RMAN> run
2> {sql 'alter tablespace users offline immediate';
3> set newname for datafile 4 to '+DATA';
4> restore tablespace users;
5> switch datafile 4;
6> recover tablespace users;
7> sql 'alter tablespace users online';
8> }

sql statement: alter tablespace users offline immediate

executing command: SET NEWNAME

Starting restore at 24-OCT-13
using channel ORA_DISK_1
using channel ORA_DISK_2
using channel ORA_DISK_3

channel ORA_DISK_1: starting datafile backup set restore
channel ORA_DISK_1: specifying datafile(s) to restore from backup set
channel ORA_DISK_1: restoring datafile 00004 to +DATA
channel ORA_DISK_1: reading from backup piece /u01/app/oracle/fast_recovery_area/TEST0924/backupset/2013_10_24/o1_mf_nnndf_TAG20131024T101748_96lc0dxh_.bkp
channel ORA_DISK_1: piece handle=/u01/app/oracle/fast_recovery_area/TEST0924/backupset/2013_10_24/o1_mf_nnndf_TAG20131024T101748_96lc0dxh_.bkp tag=TAG20131024T101748
channel ORA_DISK_1: restored backup piece 1
channel ORA_DISK_1: restore complete, elapsed time: 00:00:07
Finished restore at 24-OCT-13

datafile 4 switched to datafile copy
input datafile copy RECID=6 STAMP=829650049 file name=+DATA/test0924/datafile/users.260.829650045

Starting recover at 24-OCT-13
using channel ORA_DISK_1
using channel ORA_DISK_2
using channel ORA_DISK_3

starting media recovery
media recovery complete, elapsed time: 00:00:01

Finished recover at 24-OCT-13

sql statement: alter tablespace users online

 

sys@TEST0924> select file_name from dba_data_files;

FILE_NAME
----------------------------------------------------------------------------------------------------
+DATA/test0924/datafile/users.260.829650045
/u01/app/oracle/oradata/test0924/sysaux01.dbf
/u01/app/oracle/oradata/test0924/system01.dbf
/u01/app/oracle/oradata/test0924/example01.dbf
/u01/app/oracle/oradata/test0924/undotbs02.dbf
/u01/app/oracle/oradata/test0924/undotbs01.dbf
/u01/app/oracle/oradata/test0924/inventory01.dbf

7 rows selected.

更多Oracle相关信息见Oracle 专题页面 http://www.linuxidc.com/topicnews.aspx?tid=12

linux
相关资讯       Oracle RMAN 
本文评论   查看全部评论 (0)
表情: 表情 姓名: 字数

       

评论声明
  • 尊重网上道德,遵守中华人民共和国的各项有关法律法规
  • 承担一切因您的行为而直接或间接导致的民事或刑事法律责任
  • 本站管理人员有权保留或删除其管辖留言中的任意内容
  • 本站有权在网站内转载或引用您的评论
  • 参与本评论即表明您已经阅读并接受上述条款