ORACLE EXPDP ORA-31626 问题

1,在执行expdp的时候,报错ORA-31637

在plsq界面,启动sql导入的方式是可行的,但是速度非常慢,同事以及客户着急这部分数据导入,尝试去服务器上面执行expdp导出,但是报错ora-31626了

[oracle@orct~]$ time expdp 'dw/"pw1817"'@PD1 DIRECTORY=DIR_DUMP_01 DUMPFILE=dw_20170622.dmp tables=ads_pd_zjsals_proj_m,ads_pd_sjyswc_proj_m LOGFILE=zhanghaoxiang.log;

Export: Release 11.2.0.4.0 - Production on Thu Jun 22 17:01:39 2017

Copyright (c) 1982, 2011, Oracle and/or its affiliates.  All rights reserved.

Connected to: Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
ORA-31626: job does not exist
ORA-31637: cannot create job SYS_EXPORT_TABLE_01 for user DW
ORA-06512: at "SYS.DBMS_SYS_ERROR", line 95
ORA-06512: at "SYS.KUPV$FT", line 1587
ORA-39062: error creating master process DM00
ORA-39105: Master process DM00 failed during startup. Master error:
ORA-01427: single-row subquery returns more than one row



real	0m1.784s
user	0m0.011s
sys	0m0.014s
[oracle@orct~]$ 
[oracle@orct~]$ 



2,赋予DBA权限,尽快导出数据

google了下,查到是权限不足的问题,尝试赋予dba权限,试试看
[oracle@orct~]$ rlwrap sqlplus / as sysdba

SQL*Plus: Release 11.2.0.4.0 Production on Thu Jun 22 17:02:27 2017

Copyright (c) 1982, 2013, Oracle.  All rights reserved.


Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options

SQL> grant dba to dw;

Grant succeeded.

SQL> exit
ERROR:
ORA-04088: error during execution of trigger 'TIMDBA.TRIG_LOGOFF_AUDIT'
ORA-01403: no data found
ORA-06512: at line 5


Disconnected from Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options (with complications)
[oracle@orct~]$ time expdp 'dw/"pw1817"'@PD1 DIRECTORY=DIR_DUMP_01 DUMPFILE=dw_20170622.dmp tables=ads_pd_zjsals_proj_m,ads_pd_sjyswc_proj_m LOGFILE=zhanghaoxiang.log;

Export: Release 11.2.0.4.0 - Production on Thu Jun 22 17:02:37 2017

Copyright (c) 1982, 2011, Oracle and/or its affiliates.  All rights reserved.

Connected to: Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
Starting "DW"."SYS_EXPORT_TABLE_01":  dw/********@PD1 DIRECTORY=DIR_DUMP_01 DUMPFILE=dw_20170622.dmp tables=ads_pd_zjsals_proj_m,ads_pd_sjyswc_proj_m LOGFILE=zhanghaoxiang.log 
Estimate in progress using BLOCKS method...
Processing object type TABLE_EXPORT/TABLE/TABLE_DATA
Total estimation using BLOCKS method: 7 MB
>>> DBMS_AW_EXP: BIN$TAsGFYCiGqfgUwwD+woJNg==$0 not AW$
>>> DBMS_AW_EXP: BIN$TAsGFYCkGqfgUwwD+woJNg==$0 not AW$
>>> DBMS_AW_EXP: BIN$TAsGFYCmGqfgUwwD+woJNg==$0 not AW$
>>> DBMS_AW_EXP: BIN$TAsGFYCoGqfgUwwD+woJNg==$0 not AW$
>>> DBMS_AW_EXP: BIN$TAsGFYCqGqfgUwwD+woJNg==$0 not AW$
>>> DBMS_AW_EXP: BIN$TAsGFYCsGqfgUwwD+woJNg==$0 not AW$
Processing object type TABLE_EXPORT/TABLE/TABLE
Processing object type TABLE_EXPORT/TABLE/GRANT/OWNER_GRANT/OBJECT_GRANT
>>> DBMS_AW_EXP: BIN$TAsGFYCiGqfgUwwD+woJNg==$0 not AW$
>>> DBMS_AW_EXP: BIN$TAsGFYCkGqfgUwwD+woJNg==$0 not AW$
>>> DBMS_AW_EXP: BIN$TAsGFYCmGqfgUwwD+woJNg==$0 not AW$
>>> DBMS_AW_EXP: BIN$TAsGFYCoGqfgUwwD+woJNg==$0 not AW$
>>> DBMS_AW_EXP: BIN$TAsGFYCqGqfgUwwD+woJNg==$0 not AW$
>>> DBMS_AW_EXP: BIN$TAsGFYCsGqfgUwwD+woJNg==$0 not AW$
. . exported "DW"."ADS_PD_ZJSALS_PROJ_M" 3.654 MB   39695 rows
. . exported "DW"."ADS_PD_SJYSWC_PROJ_M" 931.3 KB   10983 rows
Master table "DW"."SYS_EXPORT_TABLE_01" successfully loaded/unloaded
******************************************************************************
Dump file set for DW.SYS_EXPORT_TABLE_01 is:
  /oracle/expdir_tmp/dw_20170622.dmp
Job "DW"."SYS_EXPORT_TABLE_01" successfully completed at Thu Jun 22 17:02:42 2017 elapsed 0 00:00:04


real	0m5.643s
user	0m0.019s
sys	0m0.014s
[oracle@orct~]$ 
[oracle@orct~]$ 



blog来源地址:http://blog.youkuaiyun.com/mchdba/article/details/73613529,博主黄杉,谢绝转载。

3,收回DBA权限

[oracle@orct~]$ rlwrap sqlplus / as sysdba

SQL*Plus: Release 11.2.0.4.0 Production on Thu Jun 22 17:02:46 2017

Copyright © 1982, 2013, Oracle. All rights reserved.

Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options

SQL> revoke dba from dw;

Revoke succeeded.

SQL>




4,比较完善的办法

查看官方文档http://docs.oracle.com/cd/E11882_01/server.112/e22490/dp_import.htm
[外链图片转存中…(img-DN2kWYJn-1563027256696)]

里面有关于expdp的权限问题描述,需要DATAPUMP_EXP_FULL_DATABASE、DATAPUMP_IMP_FULL_DATABASE操作权限,一会可以采取赋予以下权限给普通用户,这样普通用户也可以通过expdp/impdp来导出导入数据了,如下所示:

SQL> grant DATAPUMP_EXP_FULL_DATABASE  to dw;

Grant succeeded.

SQL> 
SQL> grant DATAPUMP_IMP_FULL_DATABASE   to dw;

Grant succeeded.

SQL> 
### 解决 Oracle expdp ORA-12154 错误 ORA-12154 是一个常见的TNS (Transparent Network Substrate) 连接错误,表示客户端无法解析指定的连接标识符。这通常意味着客户端尝试通过网络访问数据库实例时遇到了配置问题。 #### 可能的原因分析 该错误可能由多种因素引起,包括但不限于: - TNSNAMES.ORA 文件中的条目不正确或不存在。 - 客户端计算机上的 `tnsnames.ora` 路径未设置正确。 - 数据库监听器服务没有启动或者存在异常。 - 使用了无效的服务名或主机名[^3]。 #### 验证当前环境配置 为了排查此问题,建议执行以下操作来验证现有环境配置的有效性: ```bash # 测试本地命名方法是否正常工作 tnsping ORCLDB ``` 如果上述命令返回失败,则表明可能是由于缺少必要的 TNS 名称映射文件或是其中的内容有误所造成的。 #### 修改 tnsnames.ora 文件 确保在 `$ORACLE_HOME/network/admin/` 目录下有一个有效的 `tnsnames.ora` 文件,并且包含了目标数据库实例的相关定义。例如: ```plaintext ORCLDB = (DESCRIPTION = (ADDRESS = (PROTOCOL = TCP)(HOST = your_host_name_or_ip)(PORT = 1521)) (CONNECT_DATA = (SERVER = DEDICATED) (SERVICE_NAME = orclpdb1) ) ) ``` 请注意替换为实际使用的 IP 地址、端口号和服务名称。 #### 检查监听器状态并重启监听器 确认监听器正在运行并且可以接受来自外部的应用程序请求: ```bash lsnrctl status ``` 如果不处于活动状态,可以通过下面的指令重新启动它: ```bash lsnrctl start ``` #### 设置正确的环境变量 对于 Linux 或 Unix 平台来说,还需要保证设置了合适的环境变量指向 Oracle 的安装位置以及网络管理工具的位置。可以在 shell 中临时设定这些参数以便即时生效: ```bash export ORACLE_HOME=/path/to/oracle_home_directory export PATH=$PATH:$ORACLE_HOME/bin export TNS_ADMIN=$ORACLE_HOME/network/admin/ ``` 完成以上步骤后再次尝试使用 Data Pump 导出功能应该能够解决问题。若仍然遇到困难,考虑查看更详细的日志记录以获取进一步诊断线索。
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值