oracle idl_ub1,IDL_UB1$ – 提供7*24专业数据库(Oracle,SQL Server,MySQL等)恢复和Oracle技术服务@Tel:+86 13429648788 - 惜...

世界之大无奇不有,已经记不清这是第几个客户咨询IDL_UB1$ 被truncate之后导致数据库无法启动的case了.idl_ub1$表是用来存储PL/SQL的代码单元的,包括DIANA等,IDL在这里代表Interface Definition Language. 在数据库的启动过程中通过10046跟踪可以知道,有类似:select /*+ index(idl_ub1$ i_idl_ub11) +*/ piece#,length,piece from idl_ub1$ where obj#=:1 and part=:2 and version=:3 order by piece#的查询语句,由于该表被truncate之后,导致数据库启动无法绕过该sql,而hang住无法完全open成功.下午闲着没事通过模拟,可以对该故障实现正常open,并且导出数据

模拟业务数据

create user xff identified by oracle;

grant dba to xff;

conn xff/oracle

create table t_xifenfei as select * from dba_objects;

create index i_xifenfei on t_xifenfei(object_id);

create view v_xifenfei as select * from t_xifenfei;

create or replace procedure proc1(

para1 varchar2,

para2 out varchar2,

para3 in out varchar2

) as

v_name varchar2(20);

begin

v_name :='xifenfei';

para3 := v_name;

dbms_output.put_line('para3:'||para3);

end;

/

alter system checkpoint;

创建xff账户,并且创建有代表性的表,索引,存储过程,视图等.

模拟truncate IDL_UB1$表

SQL> conn / as sysdba

Connected.

SQL> truncate table IDL_UB1$;

truncate table IDL_UB1$

*

ERROR at line 1:

ORA-03113: end-of-file on communication channel

Process ID: 31325

Session ID: 177 Serial number: 7

重启数据库

SQL> conn / as sysdba

Connected.

SQL> shutdown immediate;

Database closed.

Database dismounted.

ORACLE instance shut down.

SQL>

SQL>

SQL>

SQL>

SQL> startup

ORACLE instance started.

Total System Global Area 7499329536 bytes

Fixed Size 2267832 bytes

Variable Size 1409287496 bytes

Database Buffers 6073352192 bytes

Redo Buffers 14422016 bytes

Database mounted.

数据库在mount之后,一直处于hang住状态,查看alert日志

Sun May 20 17:02:34 2018

Exception [type: SIGSEGV, Address not mapped to object] [ADDR:0x18] [PC:0x98D94A7, hshuid()+273] [flags: 0x0, count: 1]

Errors in file /home/u01/app/oracle/diag/rdbms/test/test/trace/test_ora_31325.trc (incident=21781):

ORA-07445: exception encountered: core dump [hshuid()+273] [SIGSEGV] [ADDR:0x18] [PC:0x98D94A7] [Address not mapped to object] []

Incident details in: /home/u01/app/oracle/diag/rdbms/test/test/incident/incdir_21781/test_ora_31325_i21781.trc

Use ADRCI or Support Workbench to package the incident.

See Note 411.1 at My Oracle Support for error and packaging details.

Sun May 20 17:02:37 2018

Sweep [inc][21781]: completed

Sweep [inc2][21781]: completed

Sun May 20 17:02:37 2018

Dumping diagnostic data in directory=[cdmp_20180520170237], requested by (instance=1, osid=31325), summary=[incident=21781].

Sun May 20 17:02:55 2018

Exception [type: SIGSEGV, Address not mapped to object] [ADDR:0x18] [PC:0x98D94A7, hshuid()+273] [flags: 0x0, count: 1]

Errors in file /home/u01/app/oracle/diag/rdbms/test/test/trace/test_m000_31373.trc (incident=21821):

ORA-07445: exception encountered: core dump [hshuid()+273] [SIGSEGV] [ADDR:0x18] [PC:0x98D94A7] [Address not mapped to object] []

Incident details in: /home/u01/app/oracle/diag/rdbms/test/test/incident/incdir_21821/test_m000_31373_i21821.trc

Use ADRCI or Support Workbench to package the incident.

See Note 411.1 at My Oracle Support for error and packaging details.

Sun May 20 17:02:56 2018

Dumping diagnostic data in directory=[cdmp_20180520170256], requested by (instance=1, osid=31373 (M000)), summary=[incident=21821].

这类问题比较明显,正常方法无法打开,通过工具分析system文件,发现虽然truncate IDL_UB1$操作报错了,但是IDL_UB1$和对应的index I_IDL_UB11 obj#,dataobj#均已经改变,而且相关对象的segment header也变化为新dataobj#(truncate之后的),也就是说truncate在数据库中的主要更改操作已经完成.现在在缺少记录的情况下,数据库执行如下sql无法获取记录,从而无法open

PARSING IN CURSOR #140342551421712 len=132 dep=2 uid=0 oct=3 lid=0 tim=1526843464635335 hv=4260389146 ad='21af73218' sqlid='cvn54b7yz0s8u'

select /*+ index(idl_ub1$ i_idl_ub11) +*/ piece#,length,piece from idl_ub1$ where obj#=:1 and part=:2 and version=:3 order by piece#

END OF STMT

PARSE #140342551421712:c=0,e=14,p=0,cr=0,cu=0,mis=0,r=0,dep=2,og=4,plh=3246118364,tim=1526843464635335

BINDS #140342551421712:

Bind#0

oacdty=02 mxl=22(22) mxlc=00 mal=00 scl=00 pre=00

oacflg=08 fl2=0001 frm=00 csi=00 siz=24 off=0

kxsbbbfp=7fa40bec7d80 bln=22 avl=03 flg=05

value=1310

Bind#1

oacdty=02 mxl=22(22) mxlc=00 mal=00 scl=00 pre=00

oacflg=08 fl2=0001 frm=00 csi=00 siz=24 off=0

kxsbbbfp=7fa40bec7d50 bln=24 avl=01 flg=05

value=0

Bind#2

oacdty=02 mxl=22(22) mxlc=00 mal=00 scl=00 pre=00

oacflg=08 fl2=0001 frm=00 csi=00 siz=24 off=0

kxsbbbfp=7fa40bec7d20 bln=24 avl=06 flg=05

value=184549376

EXEC #140342551421712:c=0,e=76,p=0,cr=0,cu=0,mis=0,r=0,dep=2,og=4,plh=3246118364,tim=1526843464635449

FETCH #140342551421712:c=0,e=4,p=0,cr=1,cu=0,mis=0,r=0,dep=2,og=4,plh=3246118364,tim=1526843464635462

STAT #140342551421712 id=1 cnt=0 pid=0 pos=1 obj=225 op='TABLE ACCESS BY INDEX ROWID IDL_UB1$ (cr=1 pr=0 pw=0 time=4 us cost=3 size=44 card=2)'

STAT #140342551421712 id=2 cnt=0 pid=1 pos=1 obj=236 op='INDEX RANGE SCAN I_IDL_UB11 (cr=1 pr=0 pw=0 time=4 us cost=2 size=0 card=2)'

CLOSE #140342551421712:c=0,e=2,dep=2,type=0,tim=1526843464635496

通过对数据库采用技术欺骗手段,让数据库启动相关sql能够获取到记录(和正常查询的相同),从而实现数据库正常open

SQL> startup mount

ORACLE instance started.

Total System Global Area 7499329536 bytes

Fixed Size 2267832 bytes

Variable Size 1409287496 bytes

Database Buffers 6073352192 bytes

Redo Buffers 14422016 bytes

Database mounted.

SQL> alter database open;

Database altered.

open成功之后,后台报大量的ORA-08103: object no longer exists,通过分析是由于truncate IDL_UB1$没有完全成功,导致出现该错误.解决方法就是对Oracle数据字典进行人工更新,把没有完成的truncate操作在数据库中给予完成.

导出数据

exp导出数据成功

00b2435503af5797b84002e382fd423e.png

但是expdp无法执行

[oracle@bogon oradata]$ expdp '"/ as sysdba"' schemas=xff file=1.dmp

Export: Release 11.2.0.4.0 - Production on Sun May 20 17:10:53 2018

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

UDE-31623: operation generated ORACLE error 31623

ORA-31623: a job is not attached to this session via the specified handle

ORA-06512: at "SYS.DBMS_DATAPUMP", line 3326

ORA-06512: at "SYS.DBMS_DATAPUMP", line 4551

ORA-06512: at line 1

暂时未去研究对这个表进行重建,使用exp导出然后再imp导入是比较理想的办法

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
IDL_IDLBridge是一个用于在IDL中启动子进程并执行代码的对象。通过创建IDL_IDLBridge对象并调用Execute方法,可以在IDL中启动子进程并执行指定的IDL代码。[1] 使用IDL_IDLBridge可以实现在异步计算中使用多进程加速数据处理的目的。通过在一个IDL进程等待的同时完成更多的处理,充分利用PC的CPU算力。 以下是使用IDL_IDLBridge的代码示例: compile_opt idl2 obridge = obj_new('IDL_IDLBridge') childprofile1='Full path to your IDL file' obridge->Execute,'.compile "' childprofile1 '"' obridge->Execute,'IDL file name',/NOWAIT IDL_IDLBridge还可以实现并行算法,特别适用于逐行计算的处理问题。可以通过设置回调函数来获取具体的执行信息,或者使用dialog_message函数来模拟print语句的效果。下面是一个示例代码: function_position = 'C:\Users\DN\Documents\IDL\mult2.pro' b='xpnp' oBridge2 = OBJ_NEW('IDL_IDLBridge',CALLBACK='demo_bridge_call') oBridge2->Execute,".compile " "'" Function_position "'" oBridge2->Setvar,"str",b oBridge2->Execute,"xxx=mult(str)",/nowait print,'xgggx',oBridge2->status() while(1) do begin sg=oBridge2->status() if(sg eq 0) then break endwhile pro demo_bridge_call, status, error, oBr CASE status of 2: str="Completed" 3: str="Error: " error 4: str=error ; Aborted message ENDCASE print,'str::',str END 另外,IDL_IDLBridge还可以同时开启多个进程来处理数据。以下是一个示例代码: pro MultiProcesses ;开启3个进程同时处理数据 compile_opt idl2 obridge1 = obj_new('IDL_IDLBridge') childprofile1='F:\Mekong_MultiRun\mekong_2010.pro' obridge1->Execute,'.compile "' childprofile1 '"' obridge1->Execute,'mekong_2010',/NOWAIT obridge2 = obj_new('IDL_IDLBridge') childprofile2='F:\Mekong_MultiRun\mekong_2011.pro' obridge2->Execute,'.compile "' childprofile2 '"' obridge2->Execute,'mekong_2011',/NOWAIT obridge3 = obj_new('IDL_IDLBridge') childprofile3='F:\Mekong_MultiRun\mekong_2012.pro' obridge3->Execute,'.compile "' childprofile3 '"' obridge3->Execute,'np_mekong_2012',/NOWAIT END 总结:IDL_IDLBridge是一个用于在IDL中启动子进程并执行代码的对象。它可以实现异步计算和多进程加速数据处理,并提供了一些回调函数和工具函数来获取执行信息和模拟print语句的效果。可以根据需要创建多个IDL_IDLBridge对象来同时处理多个任务。<span class="em">1</span><span class="em">2</span><span class="em">3</span><span class="em">4</span>
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值