OCI Direct Path Using Shared Connections?

Hello there. A co-worker and I are working on developing a system using direct path. I designed it to follow the very basic direct path approach, and he suggested I try and share the database connection. I then wrote a class for sharing the connection, and everything seems to work fine until the OCIDirPathFinishLoad() is called. I get a 00600 code, which basically means some internal error code, and that I should contact Oracle about it. My question is whether I should be able to do two direct path loads using a single connection, or do I need to use multiple connections/multithread?
I'd appreciate responses to [email protected] Thank you!

Hi
Need ur help.
I am using OCI Direct path loads. It is working fine.
But when I try to do the parallel mode, it is not working.
For parallel mode, the only extra things that happens is:-
if (tblp->parallel_tbl) /* set table level parallel option */
OCI_CHECK(ctlp->errhp_ctl, OCI_HTYPE_ERROR, ociret, ctlp,
OCIAttrSet((dvoid *)dpctx, (ub4)OCI_HTYPE_DIRPATH_CTX,
(dvoid *)&tblp->parallel_tbl,
(ub4)0, (ub4)OCI_ATTR_DIRPATH_PARALLEL,
ctlp->errhp_ctl));
But when I do this, the following calls returns a zero value for "ctlp->nrow_ctl" (it returns a value > 0 when I dont do the parallel thing above)
/* get number of rows in the column array just allocated */
OCI_CHECK(ctlp->errhp_ctl, OCI_HTYPE_ERROR, ociret, ctlp,
OCIAttrGet((CONST dvoid *)(ctlp->dpca_ctl),
OCI_HTYPE_DIRPATH_COLUMN_ARRAY,
(dvoid *)(&ctlp->nrow_ctl), (ub4 *)0,
OCI_ATTR_NUM_ROWS, ctlp->errhp_ctl));
I'm using the sample code given by oracle, with minimal changes.
Thanks in advance

Similar Messages

  • OCI direct path loading

    Hi all,
    I wrote sample program for test OCI direct path mechanism.
    I created partitioned table with 90 columns and 5 local indexes.
    Program's blocks are:
    1.init - allocate and initialize DP context + prepare
    2.load data
    2.1 fill data - OCIDirPathStreamReset + OCIDirPathColArrayReset + OCIDirPathColArrayEntrySet + OCIDirPathColArrayToStream + OCIDirPathLoadStream
    2.2 OCIDirPathDataSave(OCI_DIRPATH_DATASAVE_SAVEONLY)
    3.finish - OCIDirPathFinish - committ and free server structures
    Point 2.1 prepares records package (i.e. 20000) and point 2.2 executes save point. Load data procedure (point 2) can be executed in loop.
    All works fine but...
    It is possible to execute committ in point 2.2 without re-initialization?
    I try SQL Loader and it loads 10000 rec/sec - my program 3900 rec/sec. Why there is so big divergence.
    Can I control/set moment when indexes are rebuilded (i.e. after committ , save point or never).
    Why OCIDirPathPrepare takes too much time ~40[sec] when table has indexes and ~2[sec] when they are dropped?
    I use Oracle10g if someone has experience with OCI dp ... thanks for help.

    Found the problem. When I set the number of columns, I was using a ULong32 which corresponds to a ub4 type, however, this should be passed as a ub2 type instead.

  • Memory leak in OCI Direct Path sample program in threaded mode

    I have a slightly (okay, more than slightly) modified version of the sample program cdemodp.c, which uses OCI to do a Direct Path load. Since my eventual aim is to make a C++ module that loads a table from a file as part of a multithreaded program, I made the necessary changes so that cdemodp.c would compile with g++ (v3.3.1, on Solaris 2.8), and I put in the following in place of the OCIInitialize() and OCIEnvCreate() calls (since the docs say those are deprecated):
    OCI_CHECK(0, 0, ociret, ctlp, OCIEnvCreate(&ctlp->envhp_ctl, OCI_THREADED, (void *) 0, 0, 0, 0, (size_t) 0, (void **) 0));
    When I compile and run this version of the program using Purify, I get a 60-byte memory leak inside the OCI code (meaning I can't see the source-code line that is causing the leak). I am pretty sure it's not anything in my code (i.e., me failing to free all handles or something) because when I change the above line so that the mode parameter is OCI_DEFAULT and recompile, there is no memory leak. Since this will be part of a threaded application that is always running, it is critical to make sure there are no leaks.
    Purify says that the leaked memory was allocated from:
    malloc [rtlib.o]
    calloc [rtlib.o]
    nlepeinit [nlepe.c]
    nlstdggo [nlstdgo.c]
    nlstdgg [nlstdgo.c]
    nigini1 [nigini.c]
    I am using Oracle 10g (client version 10.1.0).
    Anyone else had this happen?
    Thanks,
    --Tina Mancuso                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   

    This sounds very similar to the memory leak I have in Oracle 9i using Pro*C++. Everytime a connect is made memory appears to leak and it only happens in multithreaded mode not default mode. There is a thread about this under the Oracle C++ call interface. Under 9i it appears to leak about 60K per connect rather than 60 bytes.
    Paul

  • Direct Path Loading Issues with Global Temporary Tables - OCI & OCILib

    I am writing some code to import data into a warehouse from a CPU grid which computes risk data. Due to the fact a computing grid is used there will be many clients which can load the data concurrently and at any point in time.
    Currently the import uses Binding in OCCI and chunking with a prepared statement to import the data into a global temporary table in a staging area after which a stored procedure is called within the same session which will process the data and load the data into a star schema.
    The GTT has the advantage that if any clients have issues no dirty data will be left and each client only sees their own instance of the data.
    I have been looking at using direct path loading to increase the performance of the load and have written some OCI code to perform the same task. I have manged to import the data into a regular heap based table using the OCI direct path apis. However when I try and use the same code to import against a Global Temporary Table I get an OCI Error (ORA-00600: internal error code, arguments: [6979], [16], [1], [1318528], [], [], [], [], [], [], [], [])
    I get error when the function OCIDirPathPrepare is executed. The same issue occurs in both OCI and OCILib.
    Is it not possible to use Direct Path Loading against a Global Temporry Table ? Because you can use the /*+ APPEND */ hint and load global temporary tables this way from tools like SQL Devloper / toad which is surely informing the SQL Engine to use Direct Path ?
    Looking at the table USER_OBJECTS I can see that for a Global Temporary Table the DATA_OBJECT_ID is null. Does this mean that it is impossible to us a direct path load into Global Temporary Tables ?
    Any ideas / suggestions would be really appreciated. If this means redesigning the application then I would appreciate suggestions which would allow many client to quick write processes in a parallel fashion. If this means creating a new parition in a Heap Table for each writer and direct path loading into this table then so be it.
    Thanks
    H
    Edited by: 813640 on 19-Nov-2010 11:08

    Replying to my own message in case anyone else is interested.
    I have now managed to successfully load data using direct path into a global temporary table with OCI. There appears to be no reason why this approach will not work.
    I loaded data into the temporary table and then issued a select count(*) on the table from within the session and from a new session. The results were as expected.
    The resaon for the ORA-006000 error was due to the fact that I had enabled table level parallel loading
    ie
    OCIAttrSet((dvoid *) context, (ub4) OCI_HTYPE_DIRPATH_CTX, *(ub1) 1*, (ub4)0, (ub4) OCI_ATTR_DIRPATH_PARALLEL, errhp)
    When loading a Global Temporary Table the OCI_ATTR_DIRPATH_PARALLEL attribute needs to be zero
    This makes sense, since the temp table does not have any partitions so it would not be possible to write in parallel to multiple paritions.
    Edited by: 813640 on 22-Nov-2010 08:42

  • Dedicated or shared connections with tomcat?

    Tomcat does it's own connection pooling. That being the case, should I use dedicated or shared connections in Oracle? If Tomcat can properly maintain a small number of dedicated connections, then I'd prefer to avoid the setup/teardown overhead of using shared connections. I'm not sure if Tomcat (5.5.17) will operate properly in this regard or not, though. Does anyone have any experience with this?

    Using shared server or dedicated server is just a matter of which kind of applications you are planning to use. Shared server architecture is meant as a resource saver, considering the OLTP applications spend most of the CPU and network time idle. There is no reason to allocate private and exclusive resources to a connection. On the other hand, dedicated connections are meant for batch and reporting (Full Table Scans) operation, which are mostly found on DDS and DWH systems.
    If you use shared servers (no matter the client) and the application starts to behave in a DDS fashion, you will find Oracle Server will have to dispatch more processes to perform the operation, causing a raise in the High Water Mark resource usage.
    Shared servers is a more complex architecture than the dedicated server, for a few number of connections it is not worth to use it. But in the long run you'll find a meaningful memory and cpu consumption reduction, which is the main goal of this connection mode.
    ~ Madrid

  • Hyperion Strategic Finace are not listed under Smart View Shared Connections (EPMS 11.1.2.3)

    Dears,
    I'm can't access Hyperion Strategic Finance trhough SmartView because are not listed under Smart View Shared Connections.
    But if I try connect trhough Private Connections it's work fine.
    I've tried reconfigure Providers Services, but didn't work.
    Anyone could help me?
    Thanks in advance

    It should be possible using a Shared connection to Strategic Finance as it is documented - Creating a connection using Shared Connections , as far as I am aware it is only OBIEE where you have to use the XML method.
    It might be worth checking in workspace under workspace settings and enabled products to see if Strategic Finance is enabled.
    Cheers
    John
    http://john-goodwin.blogspot.com/

  • Cannot get Oracle sequence to be used with SQL Loader direct path load.

    I attempted to load approximately 3 million rows from a flat file into a 10g database using SQL Loader direct path load. In order to generate a primary key for each of these rows I used a simple SQL expression which gets the next number of an Oracle sequence and assigned that to my primary key column inside the control file. The strange thing is no primary key was generated for each of these columns as I see the sequence was not advanced. Furthermore when I try to run a query to find the count on those rows which have this column as NOT NULL ,I get the total of all the rows even though on inspection this column is empty in each of the rows.
    As far as I know, in the control file for a direct path load I am able to use a SQL Expression that returns simple scalar data which a NEXTVAL on a sequence does. (Oreilly Oracle SQL Loader The Definitive Guide p.184)
    Does anybody why my primary key was not generated and furthermore why is this column in a query appear to be NOT NULL when in fact it has nothing in it?

    Daniel,
    I appreciate your response alot.
    Now a follow on. You say that SQL*Loader is the fastest way to get data into Oracle Spatial even though the conventional path. How does SQL*Loader do this? Doesn't it use OCI?
    I just can't help but think that coverting my data to SQL*Loader format, and then having it parse it and send it to the database in some form must be slower than me just sending whatever SQL Loader sends to the DB myself using OCI. Am I missing something?
    The SQL Loader documentation seems to suggest that SQL*Loader just turns the input into alot of INSERT stateemnts. If so, can't I just do this?
    My performance with OCI and INSERT statements isn't very good, but I believe I am doing one transaction per insert. Might I be as well off to concentrate on fine tuning my OCI based code using INSERTs?
    I will actually do some time tests myself, but I would appreciate your opinion.
    Once again thanks for the great info you have provided.

  • Suggestions on how to connect iMac *directly* to Maxtor Shared Storage?

    i know that using Time Machine to back up to my Maxtor Shared Storage over my network isn't an option right now... So in the meantime, I would like to just connect my Maxtor drive directly to my iMac -- but I can't figure out how.
    There is no way to connect it via USB, and there is no firewire port. The Apple guy at Best Buy said to use the ethernet cable to connect the external hard drive to my iMac, but I can't get my iMac to recognize the drive that way.
    Any suggestions?
    Thanks!

    Right now my Maxtor drive is connected via a router no problem... But In order to use Time Machine, the drive needs to be directly (via cable,etc) connected to my iMac...
    There is no firewire port on my Maxtor drive.
    I did go to Best Buy (and Office Max, and Office Depot) to buy a USB cable... The cable I need doesn't exist... For example they are like this:
    http://www.coolgear.com/images/as340823as.jpg
    But BOTH my iMac and Maxtor drive have ports that take the USB cable-end shown on the left in the image above. There is no cable that is the same on both ends...
    So, how do I get my computer to recognize/mount my Maxtor drive when I connect it directly to the iMac via ethernet cable (that is what the Apple guy at Best Buy told me to do)? I can't find anything at all in the Maxtor documentation about this...
    Thanks for reading...

  • Errors when using sql loader direct path with a nvl functin on a date field

    I thought I read in 10g that all sql functions now work in direct path mode.
    the following function works without direct path mode. When we turn direct path mode on the load fails. When we take the function out in direct path mode it works.
    mydate DATE "YYYY-MM-DD" "nvl(:mydatedate,to_date('9999-01-01','YYYY-MM-DD'))"
    with direct path mode I get:
    EVERY record gets rejected with this error.
    Record 10: Rejected - Error on table MYTABLE
    ORA-00604: error occurred at recursive SQL level 1
    ORA-01861: literal does not match format string
    again works fine without direct=true, works fine with direct=true if i get rid of the function.
    any ideas?
    Message was edited by:
    Guess2
    Message was edited by:
    Guess2

    like usual your posts are completely useless daniel.
    I could have swarn that oracle advertised that you can use functions with 9i or 10g release in the new features guys or the first releases.

  • Index is unusable after using Direct path of SQL Loader

    When using the Direct path of SQL Loader to load records from a comma(,) seperated file into a table, the index which I specify the records are sorted in becomes unusable. In the log file created by SQL Loader the error: "ORA-01409: NOSORT option may not be used; rows are not in ascending order" occurs. I am pre sorting the data in the order of the index, the index is a multi column index. The index and table prior to initiating SQL Loader are not empty and contain existing records.
    Can anybody suggest a reason as to why this is happening even thought I am pre sorting the data in ascending order as per the index?
    Brad.

    Thanks for reply Gerald!
    After further investigation I kind of answered my own question and found that the data I was loading was not in the order that Oracle was expecting. The problem stems from how the UNIX command SORT works compared to how data is ordered by in Oracle by the ORDER BY statement. I was using UNIX's SORT command to pre sort my data before loading it directly into Oracle.
    UNIX's SORT seems to order Null's before anything else in ascending order, where as Oracle's ORDER BY order's Null values last for ascending order!
    I got around this by putting in my pre-sorted data the highest printing ASCII character when ever a field was Null. The highest printing ASCII character is 'tilde' (~). As UNIX's SORT uses the ASCII collating sequence to determine the sort order the post-sorted data was sorted as per Oracle expected. And to not actually load up "~" into my Oracle table I just specified in the SQL*Loader control file for these fields, NULLIF (field_name = "~").

  • Using functions with direct path load

    When loading data with sqlldr is it possible to have functions ( to alter the data) when loading in a direct path? Thanks

    When loading data with sqlldr is it possible to have functions ( to alter the data) when loading in a direct path?Did you try it? Which version do you use?
    How can I speed up the load?
    Did you study chapter 11 in the utilities guide Conventional and Direct Path Loads?
    http://download.oracle.com/docs/cd/B28359_01/server.111/b28319/ldr_modes.htm#i1011553

  • SQL*Loader-273: READBUFFERS may be used only in direct path.

    Hi,
    I am trying to upgrade from OWB 10G to 11G. y map from flat file to stage maps work fine in 10G. when i upgrade the maps to 11G i get the error:
    Error
    RPE-01013: SQL Loader reported error condition, number 1.
    SQL*Loader: Release 11.1.0.7.0 - Production on Fri May 8 15:10:20 2009
    Copyright (c) 1982, 2007, Oracle. All rights reserved.
    SQL*Loader-273: READBUFFERS may be used only in direct path.
    SQL*Loader: Release 11.1.0.7.0 - Production on Fri May 8 15:10:20 2009
    Copyright (c) 1982, 2007, Oracle. All rights reserved.
    SQL*Loader-273: READBUFFERS may be used only in direct path.
    if i go to configure and make the READBUFFERS to = 0 then the map works fine. this used to work fine in 10G. I compared the .CTL file of sql loder and i notice the 10G sql loader file did not care for this property being set. while in 11G .ctl file i see the readbuffer property being set. though i can make the map run in 11G i can not go to each map and then reset it. ...Please help.
    Thanks

    IN 10 G environment
    a.)Direct path = False.
    b.) Read buffers = 4 (defaults to 4)
    10G Code generated :
    -- Oracle Warehouse Builder
    -- Generator Version : 10.1.0.4.0
    -- Created Date : Mon May 11 10:16:31 CDT 2009
    -- Modified Date : Mon May 11 10:16:31 CDT 2009
    -- Created By : owb_repository
    -- Modified By : owb_repository
    -- Generated Object Type : SQL*Loader Control File
    -- Generated Object Name : GFHGF
    -- © 2003 Oracle Corporation. All Rights Reserved.
    OPTIONS ( ERRORS=50, BINDSIZE=50000, ROWS=200, READSIZE=65536)
    LOAD DATA
    CHARACTERSET WE8MSWIN1252
    INFILE 'C:\EAND.dat'
    INTO TABLE "{{ORACLE10G.Schema}}"."EAND"
    APPEND
    REENABLE DISABLED_CONSTRAINTS
    FIELDS
    "PERSON_SSN_SOURCE" POSITION (3:3) CHAR
    IN 11 G environment
    a.)Direct path = False.
    b.) Read buffers = 4 (for new maps crated defaults to 0)
    -- Generator Version : 11.1.0.7.0
    -- Created Date : Mon May 11 10:06:37 CDT 2009
    -- Modified Date : Mon May 11 10:06:37 CDT 2009
    -- Created By : OWB_WUSER
    -- Modified By : OWB_WUSER
    -- Generated Object Type : SQL*Loader Control File
    -- Generated Object Name : "GFHGF"
    -- Copyright © 2000, 2007, Oracle. All rights reserved.
    OPTIONS (BINDSIZE=50000,ERRORS=50,ROWS=200,READSIZE=65536)
    LOAD DATA
    CHARACTERSET WE8MSWIN1252
    INFILE '{{ETL_FILE_LOC.RootPath}}{{}}EAND.dat''
    BADFILE '{{ETL_FILE_LOC.RootPath}}{{}}EAND'
    READBUFFERS 4
    CONCATENATE 1
    INTO TABLE "STAG"."EAND"
    TRUNCATE
    REENABLE DISABLED_CONSTRAINTS
    "PERSON_SSN_SOURCE" POSITION (3:3) CHAR
    my question is even as both the properties in 10G and 11G are same why does .ctl file generated in 11G has statement "READBUFFERS 4" while this is neglected in owb 10G generated .ctl file? Please Help.
    Edited by: user591315 on May 11, 2009 8:14 AM
    Edited by: user591315 on May 11, 2009 8:16 AM

  • Why parallel query use direct path read ??

    I think because access buffer cache needs latch and buffer block lock,if parallel query don't use direct path read ,parallel query will be impacted by Serialization mechanism such as latch and lock .so oracle choose direct path read to avoid it .
    anybody have a good idea ??
    Edited by: jinyu on Dec 8, 2008 7:52 AM

    jinyu wrote:
    I think because access buffer cache needs latch and buffer block lock,if parallel query don't use direct path read ,parallel query will be impacted by Serialization mechanism such as latch and lock .so oracle choose direct path read to avoid it .Jinyu,
    basically, yes I think that's it. The purpose of parallel query is to scan a very large segment, because the overhead of communication between the processes and maintaining/starting up the parallel slave renders the operation inefficient for small segments.
    Therefore I guess the assumption is that the segment to scan is probably very large, the fraction of the blocks in the buffer cache would be only very small in comparison to the blocks to scan, and therefore the reduced overhead of directly reading the blocks bypassing all the serialization issues of the buffer cache should outweigh the "un-buffered" blocks issue and save the buffer cache for objects that benefit more from being cached.
    Regards,
    Randolf
    Oracle related stuff blog:
    http://oracle-randolf.blogspot.com/
    SQLTools++ for Oracle (Open source Oracle GUI for Windows):
    http://www.sqltools-plusplus.org:7676/
    http://sourceforge.net/projects/sqlt-pp/

  • How can I tell if direct-path insert is really being used?

    I have a number of INSERT statements with /*+ APPEND */ hints, that I suspect are not using direct-path insert processing. How can I tell (via the plan, via Enterprise Manager, whatever) if direct-path is being used?
    If it is not being used, then I can research why that might be, and try to resolve the obstacles there. But if it is being used, then I want to know that so I can focus elsewhere.
    Thanks,
    Mike

    mtefft wrote:
    The question of whether direct-path is possible with multi-table inserts has been on my mind...
    Moreover, in another forum post, we have eyewitnesses that it has happened at least once:
    APPEND Hint in Multi-table insert
    So I think that post (giving examples of Explain plans with multi-table inserts successfully using direct-path) answers my question.
    Mike,
    Thanks for that link. When I checked my example again I realised that it had a foreign key constraint between the two tables I was inserting into. (It was a demonstration of how to normalise an incoming denormalised address table, so converted a flat table into address/address lines). When I removed the constraint I got the multi-table insert.
    However, I followed this up with a check on the execution plans and for the 10.2.0.3 I was running noted the following:
    Plan reported after running the insert and select from dbms_xplan.display_cursor()
    | Id  | Operation           | Name | Rows  | Bytes | Cost  |
    |   0 | INSERT STATEMENT    |      |       |       |    30 |
    |   1 |  MULTI-TABLE INSERT |      |       |       |       |
    |   2 |   TABLE ACCESS FULL | T3   | 10000 |  1240K|    30 |
    ------------------------------------------------------------Plan reported after explain plan / select from dbms_xplan.display()
    | Id  | Operation           | Name | Rows  | Bytes | Cost  |
    |   0 | INSERT STATEMENT    |      | 10000 |  1240K|    30 |
    |   1 |  MULTI-TABLE INSERT |      |       |       |       |
    |   2 |   DIRECT LOAD INTO  | T1   |       |       |       |
    |   3 |   DIRECT LOAD INTO  | T2   |       |       |       |
    |   4 |    TABLE ACCESS FULL| T3   | 10000 |  1240K|    30 |
    ------------------------------------------------------------If you try to check for direct path inserts by looking at the in-memory plans, you might not see the direct load that is really happening. (Perhaps the a check that both / all the target tables are locked with TM mode 6 may give you a clue.)
    Regards
    Jonathan Lewis

  • I used to connect the iphone to computer to make the backup . I need to know where is the backup path on computer?

    i used to connect the ipad or iphone to computer to make the backup . I need to know where is the backup path on computer?

    The following quotation is from iTunes: About iOS backups
    Where are iTunes backups stored on your computer
    The folder where your backup data is stored depends on your computer's operating system. Make sure the backup folder is included in your data-backup routine. iTunes places the backup files in these places:
    Mac: ~/Library/Application Support/MobileSync/Backup/
    The "~" represents your Home folder. If you don't see Library in your Home folder, hold Option and click the Go menu.
    Windows XP:\Documents and Settings\(username)\Application Data\Apple Computer\MobileSync\Backup\
    To quickly access the Application Data folder, click Start, and choose Run. Type %appdata% and click OK.
    Windows Vista, Windows 7, and Windows 8:\Users\(username)\AppData\Roaming\Apple Computer\MobileSync\Backup\
    To quickly access the AppData folder, click Start. In the search bar, type %appdata% and press Return.

Maybe you are looking for