首页
学习
活动
专区
工具
TVP
发布
精选内容/技术社群/优惠产品,尽在小程序
立即前往
  • 您找到你想要的搜索结果了吗?
    是的
    没有找到

    Oracle datapump expdp/impdp 导入导出数据库时hang住

    最近在导出schema级别的数据时被hang住,不得不停止当前的导出作业,如果你有类似的问题,请继续往下看。 1、问题描述     导出整个schema时数据库被hang住,如下所示     符号">"是由SecureCRT设定的每300秒发送一次 oracle@Dev-DB-04:~> expdp goex_admin/xxx directory=db_dump_dir dumpfile=gobo2.dmp logfile=gobo2.log schemas=goex_admin     Export: Release 10.2.0.4.0 - 64bit Production on Thursday, 23 May, 2013 9:30:52     Copyright (c) 2003, 2007, Oracle.  All rights reserved.     Connected to: Oracle Database 10g Release 10.2.0.4.0 - 64bit Production     Starting "GOEX_ADMIN"."SYS_EXPORT_SCHEMA_01":  goex_admin/******** directory=db_dump_dir dumpfile=gobo2.dmp      logfile=gobo2.log schemas=goex_admin     >>>>     -->查询超长时间的操作,没有任何结果,也就是说datapump压根啥也没有做 goex_admin@GOBO2> @long_ops     no rows selected     -->查询job产生的对象的表,表存在 goex_admin@GOBO2> @datapump_master_tb     STATUS   OBJECT_ID OBJECT_TYPE         OWNER_OBJECT     ------- ---------- ------------------- --------------------------------------------------     VALID       315838 TABLE               GOEX_ADMIN.SYS_EXPORT_SCHEMA_01 2、问题解决     参数fixed_date引起数据库导入导出被hang住 [ID 563171.1] goex_admin@GOBO2> show parameter fixed     NAME                                 TYPE        VALUE     ------------------------------------ ----------- ------------------------------     fixed_date                           string      20130506 16:00:00     -- Author : Robinson     -- Blog   : http://blog.csdn.net/robinson_0612 goex_admin@GOBO2> alter system set fixed_date=none;     System altered.     -->参数fixed_date被移除后,导出正常 oracle@Dev-DB-04:~> expdp goex_admin/xxx directory=db_dump_dir dumpfile=gobo2.dmp logfile=gobo2.log schemas=goex_admin     Export: Release 10.2.0.4.0 - 64bit Production on Thursday, 23 May, 2013 9:30:52     Copyright (c) 2003, 2007, Oracle.  All rights reserved.     Connected to: Oracle Database 10g Release 10.2.0.4.0 - 64bit Production     Starting "GOEX_ADMIN"."SYS_EXPORT_SCHEMA_01":  goex_admin/******** directory=db_dump_dir dumpfile=gobo2.dmp      logfile=gobo2.log schemas=goex_admin     >>>>     Esti

    02

    ORA-60死锁的实验

    SQL> create table tbl_ora_60 (      id number(5),      name varchar2(5)      ); SQL> insert into tbl_ora_60 values(1, 'a'); 1 row created. SQL> insert into tbl_ora_60 values(2, 'b'); 1 row created. SQL> commit; Commit complete. SQL> select * from tbl_ora_60;         ID NAME ---------- -----          1 a          2 b 实验开始 Session1: SQL> update tbl_ora_60 set name='c' where id=1; 1 row updated. Session2: SQL> update tbl_ora_60 set name='d' where id=2; 1 row updated. Session1: SQL> update tbl_ora_60 set name='e' where id=2; hang住 Session2: SQL> update tbl_ora_60 set name='f' where id=1; hang住 此时,Session1: SQL> update tbl_ora_60 set name='e' where id=2; update tbl_ora_60 set name='e' where id=2        * ERROR at line 1: ORA-00060: deadlock detected while waiting for resource 说明: Session1                                            Session2 获取id=1的资源锁                                                         获取id=2的资源锁 等待id=2的资源锁                                                         等待id=1的资源锁 id=2的SQL报ORA-60,自动rollback 1、因为id=2的资源锁是Session2先获取的,因此Oracle会自动rollback产生死锁时后需要资源锁的SQL,Session1的更新id=2操作被rollback。 2、从中可以发现,真正报ORA-60错误的SQL获取的资源(此例中id=2),并不是触发死锁产生的那个资源(此例中id=1),此例用的是同一个表的不同行,对不同表的相同行也如此,也可以解释之前夜维出现ORA-60时显示的SQL之间表是不同的原因,因为夜维执行的某个表更新与当前应用执行的某个表更新之间存在互锁的情况,因此可能导致夜维SQL报ORA-60或应用报ORA-60的错误。 此时,Session1: SQL> select * from tbl_ora_60;         ID NAME ---------- -----          1 c          2 b 说明:此处可以证明产生报错后,Oracle自动执行的rollback操作是基于单条SQL,不是整个事务的,所以这里只有id=2的记录被rollback,id=1的执行仍正常。 Session2: SQL> update tbl_ora_60 set name='f' where id=1; hang住 继续,Session1: SQL> commit; Commit complete. Session2: SQL> update tbl_ora_60 set name='f' where id=1; 1 row updated. Session1: SQL> select * from tbl_ora_60;         ID NAME ---------- -----          1 c          2 b 只有id=1更新成功。 Session2: SQL> select * from tbl_ora_60;         ID NAME ---------- -----          1 f          2 d id=1和id=2都更新成功,但未COMMIT。 SQL> commit; Commit complete. Sess

    02
    领券