eygle.com   eygle.com
eygle.com  
 
Digest Net: August 2009 Archives

August 2009 Archives

原文地址: http://oracle.chinaitlab.com/serial/38969.html

Problem Description:
====================

        ORA-600 errors are internal exceptions handled by the RDBMS
        Kernel.  They consist of multiple arguments, the first of
        which is an identifier.  The identifyer ranges from 1 to 32767.
        Currently Oracle8 uses up to 20000 for exceptions.

Problem Explanation:
====================

        OSS has provided an internal index of ORA-600 errors since
        version 7.

Problem References:
===================

        Indexes exist for versions 7.2.2 and 8.0.3.

Author:  Richard Ware
Created: November 06, 1996
Updated: November 06, 1998

NOTE: | = new file for Oracle 8.

                  ORA-600 BASE INTERNAL ERROR INDEX
                        RDBMS VERSION 8.0.5
  1st
Argument   Module       Description

                        SERVICE LAYER COMPONENT

[  1]      ksc.c        Kernel Service Component notifier.
[1XX]      ksd.c        Kernel Service Debug internal errors.
[2XX]      ksdp.c       Kernel Service Debug Parser.
[3XX]      kse.c        Kernel Service Error manager.
[5XX]      ksl.c        Kernel Service layer Latching & Wait-post Implement.
[7XX]      ksm.c        Kernel Service Memory component implementation.
[9XX]      ksp.c        Kernel Service layer system Parameters component.
[110X]     kgg.c        Kernel Generic Generic lists.
[111X]     kgss.c       Kernel Generic Service State object manager.
[115X]     ksq.c        Kernel Service enQueues.
[119X]     ksi.c        Kernel Service layer Instance locks.
[12XX]     ksu.c        Kernel Service User management.
[13XX]     ksucln.c     Kernel Service User management CLeaNup process.
[14XX]     ksa.c        Kernel Service Asynchronous messages.
[15XX]     kkxwtp.c     Kernel Kompilation pl/sql Compiler.
           kpor.c       Kernel KPO RPC callback for streaming.
[16XX]     ksb.c        Kernel Service Background processes.
[17XX]     ksk.c        Kernel Service license Key component.
[18XX]     ksim.c       Kernel Service Instance Manager (registration).
[185X]     ksfh.c   |   Kernel Service File i/o Helper component.
[186X]     ksfq.c   |   Kernel Service seQuential File i/o interface.
[19XX]     ksfv.c   |   Kernel Service File i/o serVer component.

                        CACHE LAYER COMPONENT

[20XX]     kco.c        Kernel Cache Op(erations).
[21XX]     kcc.c        Kernel Cache layer Control file component.
[22XX]     kcm.c        Kernel Cache Miscellaneous functions (SCN).
           kcsm.c       Kernel Cache Shared Routines.
[23XX]     kcrf.c       Kernel Cache Redo File management component.
[24XX]     kcht.c       Kernel Cache buffer Hash Table.
[26XX]     kcrfr.c      Kernel Cache Redo File Read.
           kcrfrw.c     Kernel Cache Redo File Read.
[27XX]     kcrf.c       Kernel Cache Redo File management component.
[28XX]     kcf.c        Kernel Cache Files component.
[29XX]     kcf.c        Kernel Cache Files component.
[30XX]     kcra.c       Kernel Cache Redo Application/Access.
[30XX]     kcrp.c       Kernel Cache Recovery Parallel.
[32XX]     kcb.c        Kernel Cache Buffer management Implementation.
[33XX]     kcbz.c       Subroutines for kcb (cache layer).
[34XX]     kcrr.c       Kernel Cache Redo aRchival.
[35XX]     kcbl.c       Kernel Cache Buffer Load management.
[36XX]     kcv.c        Kernel Cache recoVery component.
[37XX]     kct.c        Kernel Cache Threads component (SQL layer).
[38XX]     kck.c        Kernel Cache Compatibility segment component.

                        TRANSACTION LAYER COMPONENT

[40XX]     ktu.c        Kernel Transaction Undo.
           kql.c        Kernel SQL Library manager.
[41XX]     ktur.c       Kernel Transaction Undo Recovery.
           ktuc.c       Kernel Transaction Undo called from Cache layer.
[42XX]     ktl.c        Kernel Tranaction List blocks changed.
           ktp.c    |   Kernel Transaction Parallel.
[43XX]     kts.c        Kernel Transaction Segment management.
           ktscbr.c     Kernel Transaction Segment CallBack Routines.
[44XX]     ktc.c        Kernel Transaction Control.
[445X]     ktdbas.h     Kernel Transaction Distributed option BASe.
[45XX]     ktb.c        Kernel Transaction Block code.
           ktbt.c       Kernel Transaction Block Table.
           ktr.c        Kernel Transaction Read.
           ktz.c        Kernel TranZaction testing.
[46XX]     kta.c        Kernel Transaction table Access definitions.
[47XX]     kkxrd.c      Kernel Transaction DBMS_ROWID package.
           ktsfx.c      Kernel Transaction Segment dataFile eXtension mgmt.
           ktsa.c       Kernel Transaction Segment Space analysis.
           ktsb.c   |   Kernel Transaction Segment Bitmap management.
           ktss.c       Kernel Transaction Space management segment procedures.
[48XX]     kqr.c        Kernel SQL Row cache management component.
[49XX]     ktm.c        Kernel Transaction Monitor Component (SMON).
[50XX]     ktec.c       Kernel Transaction Extent Concurrent operations.
[51XX]     ktt.c        Kernel Transaction Table Space.
[52XX]     kta.c        Kernel Transaction table Access definitions.
           ktst.c       Kernel Transaction Temporary Sort mgmnt implementation.
[53XX]     ktef.c       Kernel Transaction Extent Flush extent map.
           ktehw.c      Kernel Transaction Extent - High Water mark operations.
[54XX]     ktein.c      Kernel Transaction Extent - INformation operations.
           kteop.c      Kernel Transaction Extent - OPerations.

                        DATA LAYER COMPONENT

[60XX]     kdi.c        Kernel Data layer Index.
           kdil.c       Kernel Data layer Index Load.
           kdis.c       Kernel Data layer Index Split.
[61XX]     kdx.c        Kernel Data indeX block.
           kdeu.c       Kernel Data Export Unload.
[62XX]     kdxt.c       Kernel Data indeX block Temporary block.
           kueuld.c     Kernel Utility Export UnLoaDer routine.
[63XX]     kdk.c        Kernal Data layer search Key.
[65XX]     kdo.c        Kernel Data Operations.
[67XX]     kds.c        Kernel Data layer Seek/Scan.
           kda.c        Kernel Data Analyze driver.
           kdu.c        Kernel Data Update.
           kdt.c        Kernel Data Table insert.
           kdc.c        Kernel Data Cluster.
           kdd.c        Kernel Data Cluster.
[68XX]     kdn.c        Kernel Data layer sequence Number generator.
           kdb.c        Kernel Data Block structure and internal manipulation.
           kdg.c        Kernel Data Gathering services.
           kdq.c        Kernel Data Query component.
[69XX]     kdbl.c       Kernel Data Block formatting Loader interface.
[70XX]     kprc.c       Kernel Programatic interface Rpi Copy routines.
[79XX]     kdl.c    |   Kernel Data layer LOB implementation.

                        ACCESS LAYER

[80XX]     kaf.c        Kernel Access Fetch.
[81XX]     kau.c        Kernel Access Update.
[81XX]     kkri.c       Kernel parallel create Index.
[81XX]     kdic.c       Kernel Data Index Create.
[81XX]     kdso.c       Kernel Data layer Service Object support.

                        PARALLEL SERVER ERROR COMPONENT LAYER

[90XX]     kcl.c        Kernel Cache Lock background process.
[999X]     opigln.c     Oracle Program Interface: Get LoNg column.
[999X]     klcs.c       Kernel Loadable Character Set.
[99XX]     kkbl.c   |   Kernel Kompilation taBle with Lob support.

                        SQL LAYER (USER/ORACLE INTERFACE) COMPONENT

[12XXX]    rsoima.c     Kernel Row source SOrt IMplementation A.
[122XX]    opix.c       Oracle Program Interface Xfer command to remote.
           opitsk.c     Two Task Oracle Side Function Dispatcher.
           kprb.c       Kernel PRogrammatic interface Bundled operations.
           kprlob.c     Kernel Programmatic Recursive LOB functions.
           kpolob.c     Kernel KPP Lob operations.
           kpoal8.c |   Kernel Programmatic Oracle ALl Version 8.
[123XX]    kkm.c        Kernel Kompilation seMantic analysis.
           apai.c       Access Path Analysis Internal.
           kkqj.c       Kernel Kompile Query Join analysis.
           kpotx.c  |   Kernel Programmatic OCI Transaction.
           prsc.c       PaRSe Create DataBase.
           vop.c    |   View OPtimize.
[124XX]    rwsdef       RoW Source DEFinitions.
           rcoima.c     Row source: COunting IMPlementation A.
           rbfima.c     Row source: BuFfer IMPlementation A
           rfuima.c     Row source: For Update IMPlementation A.
           rixima.c     Row source (IndeX) IMplementation A.
           rtb.c        Row source TaBle.
           rae.c        Row source (And-Equal) implementation.
           kxrd.c       Kernel eXecution Row source Delete.
           kxpar.c      Kernel eXecute PArtition Row sources.
           kxru.c       Kernel eXecution Row source Update.
           qkajoi.c     Query Kernel Allocation: JOIn processing.
           qkadrv.c     Query Kernel buffer Allocate DRiVer.
           msqimb.c     Make SQl Implementation B.
[126XX]    dcl.c        Drop Cluster.
           csy.c        Create SYnonym.
           cvw.c        Create VieW.
           dsy.c        Drop SYnonym.
           dtb.c        Drop TaBle.
           seq.c        SEQuence numbers.
           ctc.c        Create Table or Cluster.
           tbsdrv.c     TaBle Space execution DRiVer.
           dbsdrv.c     DataBaSe DRiVer routines.
[127XX]    rtb.c        Row TaBle sources.
           ksul.c       Kernel Service User Language manager.
           psdbnd.c |   PSD bind variable management routines.
[128XX]    kkdc.c       Kernel Kompilation Dictionary support for Constraints.
           kkdl.c       Kernel Kompilation Dictionary Lookup.
           kkm.c        Kernel Kompilation seMantic analysis.
           kkn.c        Kernel Kompilation aNalyze support.
[129XX]    ddfnet.c     Dictionary DeFinition NETwork name.
[130XX]    sqn.c        SeQueNce reference parsing.
           kdic.c       Kernel Data Index Create.
           delexe.c     DELete EXEcute.
           updexe.c     UPDate EXEcute.
           insexe.c     INSert EXEcute.
           selexe.c     SELect EXEcute.
           kxcb.c   |   Kernel eXecute Constraints Backup.
           kxcc.c   |   Kernel eXecute Constraints Catch-all.
           kxcs.c   |   Kernel eXecute Constraints: SQL statements.
[131XX]    opiamr.c     Oracle Program Interface Archival and Media Recovery.
[132XX]    atb.c        Alter TaBle.
           ain.c        Alter INdex.
           aud.c        AUDit implementation file.
           ausdrv.c     AUdit Statement DRiVer.
           aop.c        Auditing OPtions implementation.
[133XX]    koki.c       Kernel Object Id generator.
           kkbo.c       Kernel Kompilation taBle with Object support.

                        SYSTEM DEPENDENT LAYER

[140XX]    kza.c        Kernel Zecurity layer Auditing.
[141XX]    scg.c        System-dependent Concurrency - Global locks.
[142XX]    sp.c         Unix operating System dependent Process functions.
[143XX]    ssexhd.c     System EXception Signal HanDler.
[145XX]    mem.c        MEMory component.

                        SECURITY LAYER

[150XX]    kzd.c        Kernel Security Dictionary routines.
           opilon.c     OPI LOgoN.
           kzr.c        Kernel Zecurity Resource routines.
           kzsr.c       Kernel Zecurity state for Remote logins.
[1508X]    kzl.c        Kernel Zecurity Label.
[151XX]    kkp.c        Kernel Kompilation Procedure/function/package manager.
[1516X]    kko.c        Kernel Kompile Optimizer.
[1519X]    kkocri.c |   Kernel Kompile Optimizer Create Index.
[152XX]    kks.c        Kernel Kompile Shared.
[1526X]    kkdo.c   |   Kernel Kompilation Dictionary support for Objects.
           kkbl.c   |   Kernel Kompilation taBle with Lob support.
[1540X]    kky.c        Kerner Kompilation sYstem/session.
[154XX]    kkxwtp.c     Kernel Kompilation pl/sql Compiler.
[155XX]    kkrp.c       Kernel Kompile Row source: Parallelizer (DFO tree).
           kkrh.c   |   Kernel Kompile Row Hash source.
           kxhf.c   |   Kernel eXecution: Hash join File and memory management.
           kxhr.c   |   Kernel eXecution: Hash join Row management.
[1560X]    kkfd.c       Kernel Kompile Fast Dataflow (PQDFO tree).
[1561X]    kkfr.c       Kernel Kompile Fast (parallel) Rowid range manager.
[1564X]    kkxa.c       Kernel Kompilation eXternal dbms_Asynchrpc.
           kncd.c       Kernel replicatioN Dequeue Generic functions.
[1566X]    kkj.c        Kernel Kompiletime Job queue.
           kkjp.c       Kernel Kompiletime Job Package.
[1567X]    kkfs.c       Kernel Kompile Fast SQL generator for DFO.
[1568X]    kkrt.c       Kernel Kompile Row source Table create-as-select.
[157XX]    kxfp.c       Kernel eXecute Fast (parallel) Process and buffer
                        queue manager.
[157XX]    kxfpb.c  |   Kernel eXecute Fast (parallel) Buffer Allocation.
[158XX]    kxfx.c       Kernel eXecute Fast (parallel) sql eXecution.
[1581X]    kxfq.c       Kernel eXecute Fast table Queue and message queues.
[1582X]    ksxa.c   |   Kernel Service eXecute Affinity.
[1583X]    kxfr.c       Kernel eXecute Fast Rowid range manager.
[1585X]    kxt.c        Kernel eXecute Trigger.
           kxti.c   |   Kernel eXecute Trigger - Instead-of trigger.
[1586X]    kxs.c        Kernel eXecute Shared cursor.

                        DIRECT LOADER LAYER

[1600X]    opiul.c      Oracle Programmable Interface for direct Loader.
[160XX]    klc.c        Kernel Loader Column array builder.
[161XX]    klllr.c      Kernel Loader Library Logical Record.
           klcli.c      Kernel Loader C Level Interface to loader.
           klm.c        Kernel Loader Memory.
[162XX]    kql.c        Kernel SQL Library manager.
[1623X]    kqlr.c       Kernel SQL Library Remote.
[163XX]    kmc.c        Kernel Multi-stated/multi-threaded server Circuit cmpt.
           kmn.c        Kernel Multi-threaded Network layer.
           kmd.c        Kernel Multi-threaded server's Dispatcher.
           kmm.c        Kernel Multi-threaded server/dispatcher Monitor.
[164XX]    kkb.c        Kernel Kompilation taBles (internal tables).
           kqlm.c       Kernel SQL Library Multi-instance manager.
[165XX]    kqd.c        Kernel Query processing layer Dictionary management.
[1655X]    kqf.c        Kernel SQL Fixed tables/views management.
           kqfrs.c      Kernel Query Fixed tables Row Source.
           kqfp.c       Kernel Query Fixed Packages.
[166XX]    kqld.c   |   KQL Dictionary callbacks.
           kqls.c   |   Kernel SQL subordinate Set manager.
[167XX]    kqlb.c   |   KQL Bootstrapping Support.

                        GENERIC LAYER

[170XX]    kgl.c        Kernel Generic Library cache manager.
           kgl2.c       Kernel Generic Library cache manager.
[1709X]    kge.c        Kernel Generic Error manager.
[171XX]    kgh.c        Kernel Generic shared Heap manager.
[172XX]    kglr.c       Kernel Generic Library Remote.
[1725X]    kkxpp.c      Kernel Kompile eXecute Pipe (Private).
[1727X]    kgi.c        Kernel Generic Instantiation manager.
[173XX]    kghx.c       Kernel Generic fiXed sized sHared memory manager.
[174XX]    kgh.c        Kernel Generic sHared Heap manager. (reserved chunk)
[175XX]    kgff.c       Kernel Generic direct File i/o adaptor.
           kgk.c        Kernel Generic toKen table manager.
           kgfd.c       Kernel Generic File i/o subsystem Driver.
[176XX]    kgl3.c    |  Kernel Generic Library cache manager.
[1799X]    kkxwtp.c     Kernel Kompilation pl/sql Compiler.
[1799X]    plsw.c       PL/Sql Wrapper.
           p2c.c        PL/SQL to .C file.
           p2icd.c      PL/SQL compiler, creates .EX*, .C, and .H files.

                        TWO PHASE COMMIT LAYER

[1800X]    xct.c        XaCTion (TRANSaCTion) management implementation.
[1802X]    k2.c         Kernel 2-phase commit misc functions.
[181XX]    k2i.c        Kernel 2-phase commit Indoubt table interface.
[180XX]    k2g.c        Kernel 2-phase commit Global tran id (Replication).
[1804X]    k2c.c        Kernel-2-kernel Capabilities.
[1806X]    k2d.c        Kernel 2-phase commit globally unique Database id.
[181XX]    k2l.c        Kernel 2-phase commit Log records and log interface.
[1826X]    k2r.c        Kernel 2-phase commit issue multiple RPCs.
[182XX]    npi.c        Network Program Interface (two task, MTS).
           ncodef.c     Network COnnection component's ncoDEF interfaces.
[183XX]    k2s.c        Kernel 2-phase commit Server (distributed).
           k2v.c        Kernel 2-phase commit recoVery (active portion).

                        OBJECT LAYER

[190XX]    kke.c        Kernel Kompile query Engine cost engine.
[191XX]    koc.c     |  Kernel Object Cache manager.
           koh.c     |  Kernel Object Heap manager.
[192XX]    koi.c     |  Kernel Object Interface.
[194XX]    kot.c     |  Kernel Open Type Manager.
           kotg.c    |  Kernel Open Type Manager accessor (Get) routines.
           kokt.c    |  Kernel Object Kompilation Type manager.
           kokt2.c   |  Kernel Object Kompilation Type manager 2.
           kokt3.c   |  Kernel Object Kompilation Type manager 3.
[195XX]    kod.c     |  Kernel Object generic Data manager.
           kokd.c    |  Kernel Object Kernel-side Driver.
           kokn.c    |  Kernel Object Kernel-side Naming.
[198XX]    kokv.c    |  RDBMS Kernel Object Kernel-side object View support.
[197XX]    kol.c     |  Kernel Object c Language interface.
[199XX]    koka.c    |  Kernel Object Kernel-side object Access.
           kokl.c    |  Kernel Object Kernel-side Lob access.
           kokl3.c   |  Kernel Object Kernel-side temporary LOB support.
[1999X]    stsima.c  |  SorT Support IMplementation A.
           kksdopt.c    Kernel Kompile Smart Disk No OPtion.
[200XX]    kos.c     |  Kernel Object Stream interfaces for images/objects.
           kdib.c       Bitmap Index general definitions.
           kdibc.c      Bitmap Index Compression stream.
           kdibco.c     Bitmap Index Compression stream, Output.
           kdibh.c      Bitmap index Hash-table.
           kdibi.c      Bitmap index Inversion item-Table.
           kdibq.c      KDIB Queue class.
           kdibr.c      KDIB Row source utility.
           kdibl.c      KDI Bitmap index maintenance for dml and direct load.
           kkrbi.c      Bitmap index creation row source.
           kkrbo.c      KKRB Or row source.
           kkrbt.c      Kernel Kompile Row source: Bob_dylan converTor.
           kkrbu.c      KKRB Unlimited-OR row source.
           kkrbx.c      KKRB indeX (kdi) access row source.
           kkrbc.c      Bitmap index Compaction row source.
[204XX]    kkpo.c    |  Kernel Kompilation of Partitioned Objects.
           kkpod.c   |  Kernel Kompilation Partitioned Objects Dictionary.
[2042X]    kkpoc.c   |  Kernel Kompilation Partition Objects cursor Compile.
[205XX]    krb.c        Kernel Backup/Restore miscellenaous functions.
           krbb.c       Kernel Recovery Backup/restore Backup set creation.
           krbc.c       Kernel Recovery backup/Restore controlfile.
           krbd.c       Kernel Recovery Backup/restore Device control.
           krbi.c       Kernel Recovery Backup/restore ICDs.
           krbm.c       Kernel Recovery Backup/restore Miscellaneous functions.
           krbr.c       Kernel Recovery Backup/restore Restore.
           krby.c       Kernel Recovery Backup/Restore image copY.
           kkrba.c      KKRB AND row source.

                        REPLICATION LAYER

[210XX]    knps.c    |  Kernel replicatioN Parallel propagation Slave.
           kkzp.c       Kernel K(mumble) Znapshot Pl/sql interface.
           kkz.c        Kernel K(mumble) Znapshots.  Table Replication.
           kkzg.c    |  Kernel Kompile Znapshot Generation.
           kkxt.c       Kernel Kompilation eXternal Trigger.

                        OLTP LAYER

[230XX]    kwqa.c    |  Kernel OLTP Queues Administration interface ICDs.
           kwqi.c    |  Kernel OLTP Queues Interface.
           kwqic.c   |  Kernel OLTP Queue Interface Common.
           kwqid.c   |  Kernel OLTP Queue Interface Dequeue.
           kwqie.c   |  Kernel OLTP Queues Interface Enqueue.
           kwqit.c   |  Kernel OLTP Queues Interface Time Management.
           kwqu.c    |  Kernel OLTP Queue Userdata.
[248XX]    npil.c       Kernel NPI Lob functions.
[250XX]    kft.c        Kernel File management Tablespace component.

 


Author:  Richard Ware
Created: November 06, 1996
Updated: November 06, 1998

NOTE: | = new file for Oracle 8.

                  ORA-600 BASE INTERNAL ERROR INDEX
                        RDBMS VERSION 8.0.5
  1st
Argument   Module       Description

                        SERVICE LAYER COMPONENT

[  1]      ksc.c        Kernel Service Component notifier.
[1XX]      ksd.c        Kernel Service Debug internal errors.
[2XX]      ksdp.c       Kernel Service Debug Parser.
[3XX]      kse.c        Kernel Service Error manager.
[5XX]      ksl.c        Kernel Service layer Latching & Wait-post Implement.
[7XX]      ksm.c        Kernel Service Memory component implementation.
[9XX]      ksp.c        Kernel Service layer system Parameters component.
[110X]     kgg.c        Kernel Generic Generic lists.
[111X]     kgss.c       Kernel Generic Service State object manager.
[115X]     ksq.c        Kernel Service enQueues.
[119X]     ksi.c        Kernel Service layer Instance locks.
[12XX]     ksu.c        Kernel Service User management.
[13XX]     ksucln.c     Kernel Service User management CLeaNup process.
[14XX]     ksa.c        Kernel Service Asynchronous messages.
[15XX]     kkxwtp.c     Kernel Kompilation pl/sql Compiler.
           kpor.c       Kernel KPO RPC callback for streaming.
[16XX]     ksb.c        Kernel Service Background processes.
[17XX]     ksk.c        Kernel Service license Key component.
[18XX]     ksim.c       Kernel Service Instance Manager (registration).
[185X]     ksfh.c   |   Kernel Service File i/o Helper component.
[186X]     ksfq.c   |   Kernel Service seQuential File i/o interface.
[19XX]     ksfv.c   |   Kernel Service File i/o serVer component.

                        CACHE LAYER COMPONENT

[20XX]     kco.c        Kernel Cache Op(erations).
[21XX]     kcc.c        Kernel Cache layer Control file component.
[22XX]     kcm.c        Kernel Cache Miscellaneous functions (SCN).
           kcsm.c       Kernel Cache Shared Routines.
[23XX]     kcrf.c       Kernel Cache Redo File management component.
[24XX]     kcht.c       Kernel Cache buffer Hash Table.
[26XX]     kcrfr.c      Kernel Cache Redo File Read.
           kcrfrw.c     Kernel Cache Redo File Read.
[27XX]     kcrf.c       Kernel Cache Redo File management component.
[28XX]     kcf.c        Kernel Cache Files component.
[29XX]     kcf.c        Kernel Cache Files component.
[30XX]     kcra.c       Kernel Cache Redo Application/Access.
[30XX]     kcrp.c       Kernel Cache Recovery Parallel.
[32XX]     kcb.c        Kernel Cache Buffer management Implementation.
[33XX]     kcbz.c       Subroutines for kcb (cache layer).
[34XX]     kcrr.c       Kernel Cache Redo aRchival.
[35XX]     kcbl.c       Kernel Cache Buffer Load management.
[36XX]     kcv.c        Kernel Cache recoVery component.
[37XX]     kct.c        Kernel Cache Threads component (SQL layer).
[38XX]     kck.c        Kernel Cache Compatibility segment component.

                        TRANSACTION LAYER COMPONENT

[40XX]     ktu.c        Kernel Transaction Undo.
           kql.c        Kernel SQL Library manager.
[41XX]     ktur.c       Kernel Transaction Undo Recovery.
           ktuc.c       Kernel Transaction Undo called from Cache layer.
[42XX]     ktl.c        Kernel Tranaction List blocks changed.
           ktp.c    |   Kernel Transaction Parallel.
[43XX]     kts.c        Kernel Transaction Segment management.
           ktscbr.c     Kernel Transaction Segment CallBack Routines.
[44XX]     ktc.c        Kernel Transaction Control.
[445X]     ktdbas.h     Kernel Transaction Distributed option BASe.
[45XX]     ktb.c        Kernel Transaction Block code.
           ktbt.c       Kernel Transaction Block Table.
           ktr.c        Kernel Transaction Read.
           ktz.c        Kernel TranZaction testing.
[46XX]     kta.c        Kernel Transaction table Access definitions.
[47XX]     kkxrd.c      Kernel Transaction DBMS_ROWID package.
           ktsfx.c      Kernel Transaction Segment dataFile eXtension mgmt.
           ktsa.c       Kernel Transaction Segment Space analysis.
           ktsb.c   |   Kernel Transaction Segment Bitmap management.
           ktss.c       Kernel Transaction Space management segment procedures.
[48XX]     kqr.c        Kernel SQL Row cache management component.
[49XX]     ktm.c        Kernel Transaction Monitor Component (SMON).
[50XX]     ktec.c       Kernel Transaction Extent Concurrent operations.
[51XX]     ktt.c        Kernel Transaction Table Space.
[52XX]     kta.c        Kernel Transaction table Access definitions.
           ktst.c       Kernel Transaction Temporary Sort mgmnt implementation.
[53XX]     ktef.c       Kernel Transaction Extent Flush extent map.
           ktehw.c      Kernel Transaction Extent - High Water mark operations.
[54XX]     ktein.c      Kernel Transaction Extent - INformation operations.
           kteop.c      Kernel Transaction Extent - OPerations.

                        DATA LAYER COMPONENT

[60XX]     kdi.c        Kernel Data layer Index.
           kdil.c       Kernel Data layer Index Load.
           kdis.c       Kernel Data layer Index Split.
[61XX]     kdx.c        Kernel Data indeX block.
           kdeu.c       Kernel Data Export Unload.
[62XX]     kdxt.c       Kernel Data indeX block Temporary block.
           kueuld.c     Kernel Utility Export UnLoaDer routine.
[63XX]     kdk.c        Kernal Data layer search Key.
[65XX]     kdo.c        Kernel Data Operations.
[67XX]     kds.c        Kernel Data layer Seek/Scan.
           kda.c        Kernel Data Analyze driver.
           kdu.c        Kernel Data Update.
           kdt.c        Kernel Data Table insert.
           kdc.c        Kernel Data Cluster.
           kdd.c        Kernel Data Cluster.
[68XX]     kdn.c        Kernel Data layer sequence Number generator.
           kdb.c        Kernel Data Block structure and internal manipulation.
           kdg.c        Kernel Data Gathering services.
           kdq.c        Kernel Data Query component.
[69XX]     kdbl.c       Kernel Data Block formatting Loader interface.
[70XX]     kprc.c       Kernel Programatic interface Rpi Copy routines.
[79XX]     kdl.c    |   Kernel Data layer LOB implementation.

                        ACCESS LAYER

[80XX]     kaf.c        Kernel Access Fetch.
[81XX]     kau.c        Kernel Access Update.
[81XX]     kkri.c       Kernel parallel create Index.
[81XX]     kdic.c       Kernel Data Index Create.
[81XX]     kdso.c       Kernel Data layer Service Object support.

                        PARALLEL SERVER ERROR COMPONENT LAYER

[90XX]     kcl.c        Kernel Cache Lock background process.
[999X]     opigln.c     Oracle Program Interface: Get LoNg column.
[999X]     klcs.c       Kernel Loadable Character Set.
[99XX]     kkbl.c   |   Kernel Kompilation taBle with Lob support.

                        SQL LAYER (USER/ORACLE INTERFACE) COMPONENT

[12XXX]    rsoima.c     Kernel Row source SOrt IMplementation A.
[122XX]    opix.c       Oracle Program Interface Xfer command to remote.
           opitsk.c     Two Task Oracle Side Function Dispatcher.
           kprb.c       Kernel PRogrammatic interface Bundled operations.
           kprlob.c     Kernel Programmatic Recursive LOB functions.
           kpolob.c     Kernel KPP Lob operations.
           kpoal8.c |   Kernel Programmatic Oracle ALl Version 8.
[123XX]    kkm.c        Kernel Kompilation seMantic analysis.
           apai.c       Access Path Analysis Internal.
           kkqj.c       Kernel Kompile Query Join analysis.
           kpotx.c  |   Kernel Programmatic OCI Transaction.
           prsc.c       PaRSe Create DataBase.
           vop.c    |   View OPtimize.
[124XX]    rwsdef       RoW Source DEFinitions.
           rcoima.c     Row source: COunting IMPlementation A.
           rbfima.c     Row source: BuFfer IMPlementation A
           rfuima.c     Row source: For Update IMPlementation A.
           rixima.c     Row source (IndeX) IMplementation A.
           rtb.c        Row source TaBle.
           rae.c        Row source (And-Equal) implementation.
           kxrd.c       Kernel eXecution Row source Delete.
           kxpar.c      Kernel eXecute PArtition Row sources.
           kxru.c       Kernel eXecution Row source Update.
           qkajoi.c     Query Kernel Allocation: JOIn processing.
           qkadrv.c     Query Kernel buffer Allocate DRiVer.
           msqimb.c     Make SQl Implementation B.
[126XX]    dcl.c        Drop Cluster.
           csy.c        Create SYnonym.
           cvw.c        Create VieW.
           dsy.c        Drop SYnonym.
           dtb.c        Drop TaBle.
           seq.c        SEQuence numbers.
           ctc.c        Create Table or Cluster.
           tbsdrv.c     TaBle Space execution DRiVer.


原文链接: http://space.itpub.net/17267437/viewspace-547181

摘要:

多线程的应用程序可充分利用计算机资源,能有效提高应用程序的运行效率。本文通过实例叙述了使用ORACLE OCI编写多线程的应用程序的方法和多线程应用程序的运行机制。

关键字:

 OCI 线程 互斥 应用程序

 

将一个较为复杂的应用软件按功能划分为若干执行不同操作的模块,再利用多线程机制使它们同时运行在多处理机或单处理机系统上,就能提高软件的运行效率。本文讨论多线程的实用性,并通过实例(二个线程反复轮流地交叉操作进程中二个缓冲区,以提高CPU的利用率)来说明多线程的运作机制和怎样利用Oracle提供的编程接口函数,编写运行在多线程环境中的数据库应用软件。

 

1多线程实用性

线程可以看作是由进程产生的一些可执行单位。它们能够共享进程中相同的代码段和数据段,但它们有自己的程序计数器,寄存器和堆栈。程序中的全局变量对所有线程来讲都是公用的。由于多个线程可能会同时访问这些公用的数据元素,所以要用互斥机制来管理对这些公用数据的访问,保证它们的正确性。该机制称为互斥锁,它能保证应用程序中同时访问共享资源的多个线程不发生矛盾冲突。

在多处理机系统中多个线程同时运行在不同的处理机上,显然可以提高软件的运行速度;在单处理机系统中,可用多个线程分开执行慢操作(如人机交互,I/O操作等)和快操作(数据计算处理),也可提高软件的运行效率。我们考虑显示地震勘探三维数据体程序。常规的程序流程是:

 

由 于地震勘探三维数据体的数据量较大,从数据库读数据到显示出图象的串行操作要花费一些时间。当数据少时,所花时间相对要少,人有时还感觉不到;但当数据量 很大时,这个过程需要花费很多时间。分析流程中四个步骤就会发现:读数据和显示部分主要是和外部设备打交道,读数据还需使用网络;而解压和三维图象处理部 分基本上是在主机内部作运算。我们知道对外设上数据的存取和计算机运算操作在速度上有很大差异,当外设与主存储器之间传输数据时,CPU有时可能会出现空闲。也就是说,在读数据和显示数据的过程中,可能会浪费一些CPU资 源。若采用多线程方式编写这个程序,就会提高程序的运行效率。将整个过程分二个线程:一个读数据线程专门负责从数据库中取数据;另一个显示线程负责数据的 解压,三维图象处理和显示输出。在程序中安排二个缓冲区,用于存放数据。读数据线程轮流地向这二个缓冲区中写数据,同样,显示线程也跟着轮流地使用缓冲区 中的数据。即,当读数据线程向缓冲区1中写数据时,显示线程可处理缓冲区2中的数据;而当读数据线程向缓冲区2中写数据时,显示线程可处理缓冲区1中的数据。这样,就将一个进程的串行操作改为二个线程的并行操作,可以充分地利用CPU资源。由于这二个线程可能会同时访问相同的缓冲区,这是不允许的,可用互斥锁机制来协调这二个线程之间的关系。

 

2OCIOCI线程安全性和线程函数包

OCI(Oracle Call Interface)ORACLE提供的面向程序员C语言编程接口,是开发ORACLE数据库应用软件的较好的工具。用它开发出的应用程序运行效率比用Pro*C/C++的要高。程序员利用其中提供的函数,能访问Oracle数据库服务器。OCI应用程序的主要任务之一是处理SQL语句或PL/SQL脚本,在程序执行的过程中将用户对数据库服务器的请求送到ORACLE服务器,并接收来自服务器的响应。

Oracle数据库服务器和OCI函数库的线程安全特征允许程序开发人员在多线程环境中使用OCI。有了线程安全特征,OCI函数代码才具有可重入性,因此从应用程序的多个线程中同时发出OCI调用才不会彼此产生不良影响。要实现多线程安全化,应用程序必须在调用OCI初始化函数时定义mode参数为OCI_THREADED,它告诉OCI接口层,本应用程序运行在安全的多线程方式中。

 

OCIOCIThread软件包提供了一些线程化函数,主要有三种类型。实际使用情况见后面的编程实例。

⑴初始化和结束函数

在调用其他函数之前必须调用OCIThreadProcessInit()函数,执行OCIThread软件包的初始化工作,然后再调用OCIThreadInit()函数,初始化OCIThread上下文,供其他OCIThread函数使用。调用OCIThreadTerm()函数,结束OCIThread接口层的处理,释放OCIThread上下文内存。

⑵线程管理函数

类型为OCIThreadHandle的线程句柄用于表示线程的内部数据结构。在使用之前,应该用OCIThreadHndInit()来分配和初始化,用完后应调用OCIThreadHndDestroy()来释放内存。用OCIThreadCreate()函数创建新线程。用OCIThreadId类型变量来标识一个线程。使用OCIThreadIdInit()来分配和初始化线程ID,而用OCIThreadIdDestroy()来释放线程ID的结构。用OCIThreadClose()函数关闭线程。OCIThreadJoin()函数允许调用者线程与其他线程连接,当要想连接的线程正在运行时,阻塞调用该函数的线程。直到指定的线程运行结束,这个调用者线程才被唤醒,方能继续执行下去。

⑶互斥锁管理函数

在应用程序中用类型OCIThreadMutex的变量来表示互斥锁。互斥锁在使用之前必须用OCIThreadMutexInit()初始化,用完后要用OCIThreadMutexDestroy()释放内存结构。一个线程可用OCIThreadMutexAcquire()来掌握一把互斥锁,任何时候至多只能有一个线程掌握这把互斥锁,掌握这把互斥锁的线程能够用OCIThreadMutexRelease()来释放它。当一个线程掌握这把互斥锁后,其它线程若想再掌握这把互斥锁,就会被阻塞。直到掌握这把锁的线程释放它,被阻塞的线程之一才能得到它,获得互斥锁的线程才能继续执行下去。

3.多线程应用软件的编制

下面用一个实例来讲述多线程方式ORACLE应 用程序的编写和多线程的运行机制,仍以显示地震三维数据体为例。将从数据库中读数据当作一个线程,数据解压,三维图象处理和显示当作另一个线程,在进程中 给出二个数据缓冲区,使这二个线程轮流交叉使用这二个缓冲区。并用二把互斥锁来协调这二个线程对缓冲区的使用。为能清楚而简单地说明线程和互斥锁的使用, 这里仅给出程序的主要代码段。

 

 

#include <oci.h>

struct thrs_data {

   OCIThreadMutex *mutex1; 缓冲区1互斥锁

   int buffer1[10240];     缓冲区1

   OCIThreadMutex *mutex2; 缓冲区2互斥锁

   int buffer2[10240];     缓冲区2

   int flag;               数据处理结束标志

   int start_read;         开始读数据标志

   int start_disp;         开始显示数据标志

};

 

OCIEnv    *envhp;   OCI环境句柄

OCIError  *errhp;   OCI错误记录句柄

void read_fun(dvoid *arg);

void disp_fun(dvoid *arg);

int main(int argc, char* argv[])

{

 OCIThreadId *tId1,*tId2;  线程ID句柄

 OCIThreadHandle *tHnd1,*tHnd2; 线程句柄

 struct thrs_data op_data;  定义数据

OCI初始化(线程安全性)和分配句柄:

 OCIEnvCreate((OCIEnv **) &envhp,OCI_THREADED,(dvoid *)0,

  (dvoid* (*)(dvoid*,size_t))0,(dvoid* (*)(dvoid*,dvoid*,size_t))0,

  (void (*)(dvoid *, dvoid *)) 0, (size_t) 0,(dvoid **) 0 );

 OCIHandleAlloc((dvoid *)envhp, (dvoid **)&errhp,

   OCI_HTYPE_ERROR,(size_t)0, (dvoid **)0);

线程软件包和线程初始化:

 OCIThreadProcessInit();

 OCIThreadInit(envhp,errhp);

初始化线程ID和线程句柄:

 OCIThreadIdInit(envhp,errhp,&tId1);

 OCIThreadHndInit(envhp,errhp,&tHnd1);

 OCIThreadIdInit(envhp,errhp,&tId2);

 OCIThreadHndInit(envhp,errhp,&tHnd2);

分配和初始化互斥锁:

 OCIThreadMutexInit(envhp,errhp,&(op_data.mutex1));

  OCIThreadMutexInit(envhp,errhp,&(op_data.mutex2));

创建新的线程,执行线程函数调用:

 op_data.start_read=0; 

 op_data.start_disp=0;

 OCIThreadCreate(envhp,errhp,read_fun,(dvoid *)&op_data,

          tId1,tHnd1);

 OCIThreadCreate(envhp,errhp,disp_fun,(dvoid *)&op_data,

          tId2,tHnd2);

参数read_fundisp_fun是二个线程函数,op_data是送给线程函数的变量。

等待线程执行完成并关闭线程句柄:

 OCIThreadJoin(envhp,errhp,tHnd1);

 OCIThreadClose(envhp,errhp,tHnd1);

 OCIThreadJoin(envhp,errhp,tHnd2);

 OCIThreadClose(envhp,errhp,tHnd2);

释放互斥锁内存:

 OCIThreadMutexDestroy(envhp,errhp,&(op_data.mutex1));

OCIThreadMutexDestroy(envhp,errhp,&(op_data.mutex2));

释放线程ID和线程句柄:

OCIThreadIdDestroy(envhp,errhp,&tId1);

 OCIThreadHndDestroy(envhp,errhp,&tHnd1);

 OCIThreadIdDestroy(envhp,errhp,&tId2);

 OCIThreadHndDestroy(envhp,errhp,&tHnd2);

释放线程上下文:

 OCIThreadTerm(envhp,errhp);

释放所有分配的句柄。

 OCIHandleFree((dvoid *)errhp, OCI_HTYPE_ERROR);

 OCIHandleFree((dvoid *)envhp, OCI_HTYPE_ENV);

}

下面是二个线程函数主要代码段:

void read_fun(dvoid* arg) {  读数据进缓冲区函数

 struct thrs_data *op_data;

 int n=0;

 op_data=(struct thrs_data *)arg;

 for(int k=0;k<5;k++) {在实际应用中,此处可为for(;;) ,让退出循环的

条件由要读的实际数据确定,这里用5次循环,是为

了能够运行给出的框架程序。

  OCIThreadMutexAcquire(envhp,errhp,op_data->mutex1);获得互斥锁

  op_data->start_read=1;告诉显示线程,读线程已使用缓冲区

  printf("read data into buffer1 ...\n");

在实际应用中,此处应调用"读数据进缓冲区1"的函数。

  OCIThreadMutexRelease(envhp,errhp,op_data->mutex1);释放互斥锁

在实际应用中,此处可为:当所有数据都读完时,使op_data->flag=1;并退出循环体

  OCIThreadMutexAcquire(envhp,errhp,op_data->mutex2);

  printf("read data into buffer2 ...\n");

在实际应用中,此处应调用"读数据进缓冲区2"的函数。

  if(n==0) while(op_data->start_disp==0);循环第一次结束时要等待显示线程启

  n=1;                                   动并使用缓冲区

  OCIThreadMutexRelease(envhp,errhp,op_data->mutex2);

  if(k==2) {         这里的代码段,是为了能演示框架程序;

    op_data->flag=2; 在实际应用中,此处可为:

    break;           当所有数据都读完时,使op_data->flag=2;

  }                  并退出循环体

 }

}

 

void disp_fun(dvoid* arg) { 处理和显示数据函数

 struct thrs_data *op_data;

 op_data=(struct thrs_data *)arg;

 

 for(;;) {

  while(op_data->start_read==0);开始时保证读数据线程先使用缓冲区

  OCIThreadMutexAcquire(envhp,errhp,op_data->mutex1);

  op_data->start_disp=1; 告诉读数据线程,显示线程已开始使用缓冲区

  printf(" display buffer1 ...\n");

在实际应用中,此处应调用"使用缓冲区1中数据,解压,图象处理和显示"的函数。

  OCIThreadMutexRelease(envhp,errhp,op_data->mutex1);

  if(op_data->flag==1) break; 退出循环体,返回

  OCIThreadMutexAcquire(envhp,errhp,op_data->mutex2);

  printf(" display buffer2 ...\n");

在实际应用中,此处应调用"使用缓冲区2中数据,解压,图象处理和显示"的函数。

  OCIThreadMutexRelease(envhp,errhp,op_data->mutex2);

  if(op_data->flag==2) break;退出循环体,返回

 }

}

  thrs_data结构中的几个变量用于读数据线程和显示线程的开始控制和结束控制。start_read:当二个线程同时启动或显示线程先启动时,保证读数据线程先使用缓冲区,=1表示读数据线程已使用了缓冲区;start_disp:在读数据线程对缓冲区进行第一轮操作时,当它已将2个缓冲区写满,而此时显示线程还没有启动或还没有使用过缓冲区,这时应将读数据线程阻塞住,防止它覆盖掉缓冲区中未显示的数据,=1表示显示线程已启动并已使用了缓冲区。在后续交替读数据和显示数据的过程中,由互斥锁来协调二个线程之间的关系。Flag:用于标识数据的结束,=1表示在缓冲区1上结束,=2表示在缓冲区2上结束。

   PCLINUX下,使用ORACLE 8i数据库,框架程序的编译连结命令为:

gcc -g -o thread thread.cpp \

-I$ORACLE_HOME/rdbms/demo -I/usr/i386-glibc20-linux/include \

-I$ORACLE_HOME/rdbms/public -I$ORACLE_HOME/network/public \

-L$ORACLE_HOME/lib -lclntsh

 

参考文献:

oracle技术资料:《Oracle Call Interface Programmer's Guide

Pages

Powered by Movable Type 6.3.2

About this Archive

This page is an archive of entries from August 2009 listed from newest to oldest.

July 2009 is the previous archive.

September 2009 is the next archive.

回到 首页 查看最近文章或者查看所有归档文章.