NAME TYPE VALUE
------------------------------------ ---------------------- ---------
db_block_size integer 8192
11.在目标数据上创建用户
C:\>sqlplus / as sysdba
SQL*Plus: Release 11.2.0.1.0 Production on Thu Mar 6 14:25:09 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> create user tt1 identified by oracle;
User created.
SQL> grant connect,resource to tt1;
Grant succeeded.
运行impscrpt.sql脚本
SQL> @D:\dd\impscrpt.sql
Directory created.
Directory created.
DECLARE
*
ERROR at line 1:
ORA-06512: at "SYS.DBMS_STREAMS_TABLESPACE_ADM", line 1854
ORA-06512: at line 18
Directory dropped.
Directory dropped.
查看dmpfile.alg文件,发现
Master table "SYS"."SYS_IMPORT_TRANSPORTABLE_04" successfully loaded/unloaded
Starting "SYS"."SYS_IMPORT_TRANSPORTABLE_04":
Processing object type TRANSPORTABLE_EXPORT/PLUGTS_BLK
ORA-39123: Data Pump transportable tablespace job aborted
ORA-29345: cannot plug a tablespace into a database using an incompatible character set
Job "SYS"."SYS_IMPORT_TRANSPORTABLE_04" stopped due to fatal error at 14:58:40
提示不能将表空间导入到字符集不兼容的数据库
查看源数据库和目标数据库的字符集
源数据库:
SQL> select userenv('language') from dual;
USERENV('LANGUAGE')
----------------------------------------------------
AMERICAN_AMERICA.WE8MSWIN1252
目标数据库:
SQL> select userenv('language') from dual;
USERENV('LANGUAGE')
------------------------------------------
AMERICAN_AMERICA.AL32UTF8
字符集确实不一致,但是我可以使用impdp手动导入设置,在win下设置NLS_LANG
按照自己的想法试试
SQL> create directory dp as 'd:\dd';
Directory created.
D:\dd>impdp system/oracle@orcl directory=dp dumpfile=dmpfile.dmp nologfile=y transport_datafiles='tt01.dbf';
Import: Release 11.2.0.1.0 - Production on Thu Mar 6 14:51:07 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='tt01.dbf';
Processing object type TRANSPORTABLE_EXPORT/PLUGTS_BLK
ORA-39123: Data Pump transportable tablespace job aborted
ORA-29345: cannot plug a tablespace into a database using an incompatible character set
Job "SYSTEM"."SYS_IMPORT_TRANSPORTABLE_01" stopped due to fatal error at 14:51:15
发现报同样的错误,字符集不兼容。修改目标数据库的字符集为源数据库字符集
SQL> conn / as sysdba
Connected to an idle instance.
SQL> alter database character set INTERNAL_USE WE8MSWIN1252;
alter database character set INTERNAL_USE WE8MSWIN1252
*
ERROR at line 1:
ORA-01034: ORACLE not available
Process ID: 0
Session ID: 0 Serial number: 0
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 database character set INTERNAL_USE WE8MSWIN1252;
alter database character set INTERNAL_USE WE8MSWIN1252
*
ERROR at line 1:
ORA-12719: operation requires database is in RESTRICTED mode
SQL> alter system enable restricted session;
System altered.