最新再做oracle10g的迁移,使用的exp、imp工具,但是却发现两个问题。

导出时:

[oracle@sunsyk u01]$exp userid=system/sunsyk full=Y file='/u01/bak/exp_full_data.dmp' log='/u01/bak/exp_full_data.log'

Connected to: Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - Production
With the Partitioning, OLAP and Data Mining options
Export done in US7ASCII character set and AL16UTF16 NCHAR character set
server uses AL32UTF8 character set (possible charset conversion)
About to export the entire database ...
. exporting tablespace definitions
. exporting profiles
. exporting user definitions
. exporting roles
. exporting resource costs
. exporting rollback segment definitions
. exporting database links
. exporting sequence numbers
. exporting directory aliases
. exporting context namespaces
. exporting foreign function library names
. exporting PUBLIC type synonyms
. exporting private type synonyms
. exporting object type definitions
. exporting system procedural objects and actions
. exporting pre-schema procedural objects and actions
. exporting cluster definitions
. about to export SYSTEM's tables via Conventional Path ...
. . exporting table                    DEF$_AQCALL          0 rows exported
. . exporting table                   DEF$_AQERROR          0 rows exported
. . exporting table                  DEF$_CALLDEST          0 rows exported
EXP-00091: Exporting questionable statistics.
EXP-00091: Exporting questionable statistics.
EXP-00091: Exporting questionable statistics.
. . exporting table               DEF$_DEFAULTDEST          0 rows exported
EXP-00091: Exporting questionable statistics.
EXP-00091: Exporting questionable statistics.
. . exporting table               DEF$_DESTINATION          0 rows exported

解决方法:

SQL> select * from nls_database_parameters t where t.parameter='NLS_CHARACTERSET';

PARAMETER
------------------------------
VALUE
--------------------------------------------------------------------------------
NLS_CHARACTERSET
AL32UTF8

SQL> select * from v$nls_parameters  where parameter='NLS_CHARACTERSET';

PARAMETER
----------------------------------------------------------------
VALUE
----------------------------------------------------------------
NLS_CHARACTERSET
AL32UTF8


SQL>

SQL> show parameter nls

NAME                                 TYPE        VALUE
------------------------------------ ----------- ------------------------------
nls_calendar                         string
nls_comp                             string
nls_currency                         string
nls_date_format                      string
nls_date_language                    string
nls_dual_currency                    string
nls_iso_currency                     string
nls_language                         string      AMERICAN
nls_length_semantics                 string      BYTE
nls_nchar_conv_excp                  string      FALSE
nls_numeric_characters               string

NAME                                 TYPE        VALUE
------------------------------------ ----------- ------------------------------
nls_sort                             string
nls_territory                        string      AMERICA
nls_time_format                      string
nls_time_tz_format                   string
nls_timestamp_format                 string
nls_timestamp_tz_format              string

[oracle@sunsyk u01]$export NLS_LANG=AMERICAN_AMERICA.AL32UTF8

[oracle@sunsyk u01]$exp userid=system/sunsyk full=Y file='/u01/bak/exp_full_data.dmp' log='/u01/bak/exp_full_data.log'

在这个过程中只报了一个错误,我只抓错误信息出来,错误如下

EXP-00079: Data in table "PURCHASEORDER" is protected. Conventional path may only be exporting partial table.

三种办法解决:

一是导出的时候指定direct=y;二是exp sys/password as sysdba 这种方式导出;三:grant exempt access policy to xxx用户

测试如下:

[oracle@sunsyk u01]$exp system/sunsyk file=/u01/bak/exp_0224.dmp log=/u01/bak/exp_0224.log full=y compress=n direct=y

此方法可以,过程我就不抓了。

exp sys/password as sysdba 这种方法我没测试成功,谁成功请告知下。

SQL> grant exempt access policy to system;

然后再导出

[oracle@sunsyk u01]$exp system/sunsyk file=/u01/bak/exp_0224.dmp log=/u01/bak/exp_0224.log full=y compress=n

此方法成功,过程我也不抓了。

上面的问题解决感谢:鸽子(1102578918)的大力帮忙。