由于源数据和目标数据的字符集不一致,导致无法导入,报错如下:

解决办法:
修改两个数据库为统一的字符集,之后重新导出再导入;
具体步骤如下:
a元数据库:
SQL> select tab1.aa||'_'||tab2.bb||'.'||tab3.cc from
2 (select VALUE$ aa from sys.props$ where name='NLS_LANGUAGE')tab1,
3 (select VALUE$ bb from sys.props$ where name='NLS_ISO_CURRENCY')tab2,
4 (select VALUE$ cc from sys.props$ where name='NLS_CHARACTERSET')tab3;
TAB1.AA||'_'||TAB2.BB||'.'||TAB3.CC
----------------------------------------------------------------------
AMERICAN_AMERICA.ZHS16GBK
b目标数据库:
SQL> select tab1.aa||'_'||tab2.bb||'.'||tab3.cc from
2 (select VALUE$ aa from sys.props$ where name='NLS_LANGUAGE')tab1,
3 (select VALUE$ bb from sys.props$ where name='NLS_ISO_CURRENCY')tab2,
4 (select VALUE$ cc from sys.props$ where name='NLS_CHARACTERSET')tab3;
TAB1.AA||'_'||TAB2.BB||'.'||TAB3.CC
----------------------------------------------------------------------
AMERICAN_AMERICA.AL32UTF8
原因:由于源和目标数据库的字符集不一致或不是子集和超集的关系,所以造成不能导入表空间的字符集。
解决方法:将源数据库和目标数据库的字符集调整为一致的字符集;或者源数据库的字符集是目标数据库的子集。
源数据库的修改:
SQL> alter database character set internal_use utf8;
alter database character set internal_use utf8
*
第1行出现错误:
ORA-12719:操作要求数据库处于RESTRICTED模式下
SQL> shutdown immediate;
数据库已经关闭。
已经卸载数据库。
ORACLE例程已经关闭。
SQL> startup mount;
ORACLE例程已启动
Total System Global Area 444596224 bytes
Fixed Size 1219904 bytes
Variable Size 138412736 bytes
Database Buffers 301989888 bytes
Redo Buffers 2973696 bytes
数据库已装载
SQL> alter system enable restricted session;
系统已更改
SQL> alter database open;
数据库已更改
SQL> alter database character set internal_use utf8;
数据库已更改
SQL> shutdown immediate;
数据库已经关闭。
已经卸载数据库。
ORACLE例程已经关闭。
SQL> startup mount;
ORACLE例程已启动
Total System Global Area 444596224 bytes
Fixed Size 1219904 bytes
Variable Size 138412736 bytes
Database Buffers 301989888 bytes
Redo Buffers 2973696 bytes
数据库已装载
SQL> alter system disable restricted session;
系统已更改
SQL> alter database open;
数据库已更改
SQL> select tab1.aa||'_'||tab2.bb||'.'||tab3.cc from
2 (select VALUE$ aa from sys.props$ where name='NLS_LANGUAGE')tab1,
3 (select VALUE$ bb from sys.props$ where name='NLS_ISO_CURRENCY')tab2,
4 (select VALUE$ cc from sys.props$ where name='NLS_CHARACTERSET')tab3;
TAB1.AA||'_'||TAB2.BB||'.'||TAB3.CC
----------------------------------------------------------------------
AMERICAN_AMERICA.UTF8
目标数据库修改:
SQL> alter database character set internal_use utf8;
alter database character set internal_use utf8
*
ERROR at line 1:
ORA-12719: operation requires database is in RESTRICTED mode
SQL> shutdown immediate;
Database closed.
Database dismounted.
ORACLE instance shut down.
SQL> startup mount;
ORACLE instance started.
Total System Global Area 444596224 bytes
Fixed Size 1219904 bytes
Variable Size 138412736 bytes
Database Buffers 301989888 bytes
Redo Buffers 2973696 bytes
Database mounted.
SQL> alter system enable restricted session;
System altered.
SQL> alter database open;
Database altered.
SQL> alter database character set internal_use utf8;
Database altered.
SQL> shutdown immediate;
Database closed.
Database dismounted.
ORACLE instance shut down.
SQL> startup mount;
ORACLE instance started.
Total System Global Area 444596224 bytes
Fixed Size 1219904 bytes
Variable Size 138412736 bytes
Database Buffers 301989888 bytes
Redo Buffers 2973696 bytes
Database mounted.
SQL> alter system disable restricted session;
System altered.
SQL> alter database open;
Database altered.
SQL> select tab1.aa||'_'||tab2.bb||'.'||tab3.cc from
2 (select VALUE$ aa from sys.props$ where name='NLS_LANGUAGE')tab1,
3 (select VALUE$ bb from sys.props$ where name='NLS_ISO_CURRENCY')tab2,
4 (select VALUE$ cc from sys.props$ where name='NLS_CHARACTERSET')tab3;
TAB1.AA||'_'||TAB2.BB||'.'||TAB3.CC
----------------------------------------------------------------------
AMERICAN_AMERICA.UTF8
修改完成,再重新导出/导入一遍,即可成功。
来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/29330852/viewspace-1078330/,如需转载,请注明出处,否则将追究法律责任。
转载于:http://blog.itpub.net/29330852/viewspace-1078330/
1万+

被折叠的 条评论
为什么被折叠?



