SQL> alter database character set internal_use WE8MSWIN1252;
alter database character set internal_use WE8MSWIN1252
*
ERROR at line 1:
ORA-00604: error occurred at recursive SQL level 1
ORA-01109: database not open
SQL> alter database open;
Database altered.
SQL> alter database character set internal_use WE8MSWIN1252;
Database altered.
SQL> shutdown immediate
Database closed.
Database dismounted.
ORACLE instance shut down.
SQL> startup mount
ORACLE instance started.
Total System Global Area 1235959808 bytes
Fixed Size 2175288 bytes
Variable Size 956305096 bytes
Database Buffers 268435456 bytes
Redo Buffers 9043968 bytes
Database mounted.
SQL> alter system disable restricted session;
System altered.
SQL> alter database open;
Database altered.
SQL> select userenv('language') from dual;
USERENV('LANGUAGE')
----------------------------------------------------
AMERICAN_AMERICA.WE8MSWIN1252
再次使用impdp导入
D:\dd>impdp system/oracle@orcl directory=dp dumpfile=dmpfile.dmp nologfile=y transport_datafiles='d:\dd\tt01.dbf'
Import: Release 11.2.0.1.0 - Production on Thu Mar 6 15:59:43 2014
Copyright (c) 1982, 2009, Oracle and/or its affiliates. All rights reserved.
Connected to: Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
Master table "SYSTEM"."SYS_IMPORT_TRANSPORTABLE_01" successfully loaded/unloaded
Starting "SYSTEM"."SYS_IMPORT_TRANSPORTABLE_01": system/********@orcl directory=dp dumpfile=dmpfile.dmp nologfile=y transport_datafiles='d:\dd\tt01.dbf'
Processing object type TRANSPORTABLE_EXPORT/PLUGTS_BLK
Processing object type TRANSPORTABLE_EXPORT/TABLE
Processing object type TRANSPORTABLE_EXPORT/POST_INSTANCE/PLUGTS_BLK
Job "SYSTEM"."SYS_IMPORT_TRANSPORTABLE_01" successfully completed at 15:59:57
impdp执行,你可以运行impscrpt.sql,也是成功。因为两种方式报的错误都是一样的。
D:\dd>sqlplus / as sysdba
SQL*Plus: Release 11.2.0.1.0 Production on Thu Mar 6 16:02:02 2014
Copyright (c) 1982, 2010, Oracle. All rights reserved.
Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
SQL> alter user tt1 defalut tablespace tt1;
alter user tt1 defalut tablespace tt1
*
ERROR at line 1:
ORA-00922: missing or invalid option
SQL> alter user tt1 default tablespace tt1;
User altered.
目标端导入的表空间默认是READ-ONLY;将表空间改为READ WRITE
SQL> select tablespace_name,status from dba_tablespaces where tablespace_name = 'TT1';
TABLESPACE_NAME STATUS
------------------------------ ---------
TT1 READ ONLY
SQL> alter tablespace tt1 read write;
Tablespace altered.
SQL> select tablespace_name,status from dba_tablespaces where tablespace_name = 'TT1';
TABLESPACE_NAME STATUS
------------------------------ ---------
TT1 ONLINE
SQL> conn tt1/oracle
Connected.
SQL> select count(*) from t;
COUNT(*)
----------
21293
至此表空间从linux ASM磁盘组迁移到win FS系统下。
遇到的问题以及注意项
1.源数据库表空间的名字不能为test,因为test是RMAN的关键字。
RMAN> transport tablespace test tablespace destination "/s01/dd" auxiliary destination "/s01/dd";
RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-00558: error encountered while parsing input commands
RMAN-01009: syntax error: found "test": expecting one of: "double-quoted-string, identifier, single-quoted-string"
RMAN-01007: at line 1 column 22 file: standard input
#RCMRF909有说明
2.如果两个平台的字节顺序不一致,可以使用rman进行转化。
RMAN> convert tablespace tt1 to platform 'Microsoft Windows IA (32-bit)' format '/tmp/%N_%F';
RMAN> convert datafile '/tmp/BOOKS_5' db_file_name_convert '/tmp/BOOKS_5','/tmp/books01.dbf';
3.创建传输集过程报错如下
ORA-19502: write error on file "/s01/dd/HJJ/datafile/o1_mf_system_9kj14qc1_.dbf", block number 82816 (block size=8192)
ORA-27072: File I/O error
Linux Error: 25: Inappropriate ioctl for device
Additional information: 4
Additional information: 82816
Additional information: 344064
auxiliary instance file /s01/dd/HJJ/controlfile/o1_mf_9kj148lp_.ctl deleted
RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-03002: failure of transport tablespace command at 03/05/2014 21:18:59
RMAN-03015: error occurred in stored script Memory Script
RMAN-06136: ORACLE error from auxiliary database: ORA-01180: can not create datafile 1
ORA-01110: data file 1: '+DATA_DG/hjj/datafile/system.260.837919351'
因为创建传输集时,需要一个临时目录/s01/dd,会将备份集中的datafile,onlinelog,controlfile存放于此,所以要提前估算好空间。
这个错误就是因为空间不足引起的。