- 最后登录
- 2023-8-16
- 在线时间
- 1686 小时
- 威望
- 2135
- 金钱
- 50532
- 注册时间
- 2011-10-12
- 阅读权限
- 200
- 帖子
- 5207
- 精华
- 39
- 积分
- 2135
- UID
- 2
|
5#
发表于 2011-12-15 20:13:00
1. 你的做法是可行的, 也可以直接利用rman来实施,如:- RMAN> report schema;
- using target database control file instead of recovery catalog
- Report of database schema
- List of Permanent Datafiles
- ===========================
- File Size(MB) Tablespace RB segs Datafile Name
- ---- -------- -------------------- ------- ------------------------
- 1 3470 SYSTEM *** /s01/oradata/G10R21/datafile/o1_mf_system_7ch8004t_.dbf
- 2 1165 UNDOTBS1 *** /s01/oradata/G10R21/datafile/o1_mf_undotbs1_7ch80081_.dbf
- 3 310 SYSAUX *** /s01/oradata/G10R21/datafile/o1_mf_sysaux_7ch8004x_.dbf
- 4 8985 USERS *** /s01/oradata/G10R21/datafile/o1_mf_users_7ch80085_.dbf
- 5 171 EXAMPLE *** /s01/oradata/G10R21/datafile/o1_mf_example_7ch81ch3_.dbf
- 6 10 REC *** /s01/oradata/G10R21/datafile/o1_mf_rec_7gflyjwd_.dbf
- 7 10 REC *** /s01/oradata/G10R21/datafile/o1_mf_rec_7gflyt05_.dbf
- List of Temporary Files
- =======================
- File Size(MB) Tablespace Maxsize(MB) Tempfile Name
- ---- -------- -------------------- ----------- --------------------
- 1 2968 TEMP 32767 /s01/oradata/G10R21/datafile/o1_mf_temp_7ch81b2t_.tmp
- RMAN> copy datafile 7 to '/s01/rec_71.dbf';
- Starting backup at 15-DEC-11
- allocated channel: ORA_DISK_1
- channel ORA_DISK_1: sid=144 devtype=DISK
- channel ORA_DISK_1: starting datafile copy
- input datafile fno=00007 name=/s01/oradata/G10R21/datafile/o1_mf_rec_7gflyt05_.dbf
- output filename=/s01/rec_71.dbf tag=TAG20111215T230819 recid=2 stamp=769993699
- channel ORA_DISK_1: datafile copy complete, elapsed time: 00:00:01
- Finished backup at 15-DEC-11
- RMAN> sql 'alter database datafile 7 offline';
- sql statement: alter database datafile 7 offline
- RMAN> switch datafile 7 to copy;
- datafile 7 switched to datafile copy "/s01/rec_71.dbf"
- RMAN> recover datafile 7;
- Starting recover at 15-DEC-11
- using channel ORA_DISK_1
- starting media recovery
- media recovery complete, elapsed time: 00:00:01
- Finished recover at 15-DEC-11
- RMAN> sql 'alter database datafile 7 online';
- sql statement: alter database datafile 7 online
复制代码 这样操作 其实更简单一点, 因为如果是裸设备 你手动copy的话是需要用dd的,而且如果你不了解裸设备的结构的话,如果其头部具有某些原信息meta data的话可能被你的dd操作覆盖, 而使用rman copy命令则不会
2. 也可以考虑2楼的做法, 但是复杂度可能更高一些, 停机时间视乎迁移对象的多少而定 |
|