麻烦高手帮忙看一下分区表导出的问题,老是报错
环境是这样的:
这边生产库上有一个分区表(按月分区),但是每个分区还是特别大,300多G,每个月初的时候会将上个月的分区数据insert
到另一张表里面,走的是全表扫描,一条sql都执行了8个多小时,现在想导一个分区的的部分数据到测试库里面,看能不能加
索引或者拆分分区表,按天分区。
测试库是linux的(10.2.0.5,单实例),正式库AIX(10.2.0.5.11,RAC)
由于正式库本地没有足够的存储空间,测试库空间也不是很大,开始想通过db_link直接impdp进来,发现不支持分区表
然后尝试了一些方法,都报错:
[oracle@chinaunicom jzw]$ exp jzw/1234qwer@bill file=exp_err_p02.dmp tables=UCR_ERR.TG_CDR_PP_ERR_GS
02 indexes=n buffer=65536 feedback=10000 log=exp_0328.log query=UCR_ERR.TG_CDR_PP_ERR_GS:\"where month_id=\'02\' and INDB_TIME bewteen \'0201\' and \'0215\'\"
[oracle@chinaunicom jzw]$ exp jzw/1234qwer@bill file=exp_err_p02.dmp tables=UCR_ERR.TG_CDR_PP_ERR_GS
02 indexes=n buffer=65536 feedback=10000 log=exp_0328.log query=UCR_ERR.TG_CDR_PP_ERR_GS:\"where INDB_TIME bewteen \'0201\' and \'0215\'\"
[oracle@chinaunicom jzw]$ exp jzw/1234qwer@bill file=exp_err_p02.dmp tables=UCR_ERR.TG_CDR_PP_ERR_GS
02 indexes=n buffer=65536 feedback=10000 log=exp_0328.log query=UCR_ERR.TG_CDR_PP_ERR_GS:\"where month_id=\'02\' and to_number\(INDB_TIME\) bewteen 0201 and 0215\"
这3条导出语句的报错差不多都是下面这样
Export: Release 10.2.0.5.0 - Production on Tue Apr 1 21:35:03 2014
Copyright (c) 1982, 2007, Oracle. All rights reserved.
Connected to: Oracle Database 10g Enterprise Edition Release 10.2.0.5.0 - 64bit Production
With the Partitioning, Real Application Clusters, OLAP, Data Mining
and Real Application Testing options
Export done in ZHS16GBK character set and AL16UTF16 NCHAR character set
Note: indexes on tables will not be exported
About to export specified tables via Conventional Path ...
Current user changed to UCR_ERR
. . exporting table TG_CDR_PP_ERR_GS
. . exporting partition P02
EXP-00056: ORACLE error 933 encountered
ORA-00933: SQL command not properly ended
Export terminated successfully with warnings.
用expdp也是报错
[oracle@chinaunicom jzw]$ expdp jzw/1234qwer@bill query=UCR_ERR.TG_CDR_PP_ERR_GS:\"where month_id='02' and to_number\(INDB_TIME\) bewteen 201 and 215\" tables=UCR_ERR.TG_CDR_PP_ERR_GS
02 directory=jzw_dir dumpfile=jzw_dir:err2_p02.dmp logfile=jzw_dir
02.log job_name=jzw_job
Export: Release 10.2.0.5.0 - 64bit Production on Tuesday, 01 April, 2014 21:56:01
Copyright (c) 2003, 2007, Oracle. All rights reserved.
Connected to: Oracle Database 10g Enterprise Edition Release 10.2.0.5.0 - 64bit Production
With the Partitioning, Real Application Clusters, OLAP, Data Mining
and Real Application Testing options
Starting "JZW"."JZW_JOB": jzw/********@bill query=UCR_ERR.TG_CDR_PP_ERR_GS:"where month_id=02 and to_number(INDB_TIME) bewteen 201 and 215" tables=UCR_ERR.TG_CDR_PP_ERR_GS
02 directory=jzw_dir dumpfile=jzw_dir:err2_p02.dmp logfile=jzw_dir
02.log job_name=jzw_job
Estimate in progress using BLOCKS method...
Processing object type TABLE_EXPORT/TABLE/TABLE_DATA
Total estimation using BLOCKS method: 325.2 GB
Processing object type TABLE_EXPORT/TABLE/TABLE
Processing object type TABLE_EXPORT/TABLE/GRANT/OWNER_GRANT/OBJECT_GRANT
Processing object type TABLE_EXPORT/TABLE/STATISTICS/TABLE_STATISTICS
ORA-31693: Table data object "UCR_ERR"."TG_CDR_PP_ERR_GS":"P02" failed to load/unload and is being skipped due to error:
ORA-00920: invalid relational operator
Master table "JZW"."JZW_JOB" successfully loaded/unloaded
******************************************************************************
Dump file set for JZW.JZW_JOB is:
/oracle/jzw/err2_p02.dmp
Job "JZW"."JZW_JOB" completed with 1 error(s) at 21:56:25
[oracle@chinaunicom jzw]$
个人感觉导出语句应该没有太大问题的,麻烦高手或者有过类似操作的朋友帮忙分析一下