ITPub博客

首页 > Linux操作系统 > Linux操作系统 > 跨平台表空间传输(windows到linux RAC)

跨平台表空间传输(windows到linux RAC)

原创 Linux操作系统 作者:ziling2011 时间:2011-12-21 14:02:48 0 删除 编辑
以下演示表空间从windows下传输到linux RAC下全过程

create tablespace test datafile 'D:\app\yichunmei\oradata\orcl\test_data01.dbf' size 20M
   extent management local uniform. size 128k;
  
  create user wumei identified by wumei default tablespace test;
  grant connect,resource,dba to wumei;
  conn wumei/wumei
  create table vhe_month as select * from t_vhe_prov_month@dblink;
  create table msprg_month as select * from t_msprg_prov_month@dblink;
  create table simmr_month as select * from t_simmr_prov_month@dblink;
 
  DOS:
  exp userid='sys/1 as sysdba' file=d:\test.dmp log=d:\test.log transport_tablespace=y tablespaces=test rows=0
 
  rman target /
  convert tablespace "TEST" to platform. 'Linux IA (32-bit)' format 'D:\test.dbf'
  --此处表空间名一定要大写,否则会报
  RMAN-20202:在恢复目录中未找到表空间
  RMAN-06019:无法转换表空间TEST
  之类的错误
  将test.dmp和test.dbf文件拷贝到RAC服务器上
  由于RAC数据文件在共享磁盘上,所以需将test.dbf转换到共享磁盘上去
 
  RMAN> convert datafile  '/opt/TEST.DBF' format '+DATA/rac/datafile/test.dbf';
 
Starting conversion at target at 21-DEC-11
using target database control file instead of recovery catalog
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=47 instance=RAC1 device type=DISK
channel ORA_DISK_1: starting datafile conversion
input file name=/opt/TEST.DBF
converted datafile=+DATA/rac/datafile/test.dbf
channel ORA_DISK_1: datafile conversion complete, elapsed time: 00:00:16
Finished conversion at target at 21-DEC-11
在RAC上建用户wumei
--表空间被所属的用户必需存在.
导入表空间
imp userid=\'sys/change_on_install as sysdba\' file=/opt/test.dmp transport_tablespace=y datafiles=('+DATA/rac/datafile/test.dbf')  tablespaces=test
SQL> conn wumei/wumei
Connected.
SQL> select name from v$datafile;
NAME
--------------------------------------------------------------------------------
+DATA/rac/datafile/system.256.770317103
+DATA/rac/datafile/sysaux.257.770317107
+DATA/rac/datafile/undotbs1.258.770317109
+DATA/rac/datafile/users.259.770317109
+DATA/rac/datafile/example.264.770317321
+DATA/rac/datafile/undotbs2.265.770317833
+DATA/rac/datafile/test.dbf
--查看表记录
SQL> select * from vhe_month where rownum<5;
TIME   PR PROVINCE_N CALLING_USERS CALLING_COUNT  COR_USERS  COR_COUNT
------ -- ---------- ------------- ------------- ---------- ----------
COR_RATE   CALLING_TIME   COR_TIME
---------- ------------ ----------
201109    8613000573          5226             2        182          0
0                     2          0
201109    8613254557 
     
至此表空间传输成功
  

 
 

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

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

注册时间:2011-07-18

  • 博文量
    52
  • 访问量
    112623