Call Interface :: OCIObjectSetAttr Performance Deteriorates When Binding Too Many Type Prams?
Nov 19, 2012
In my application, when I passed a Type Array as parameter to the stored procedure and when the Type Array is large enough(normally 3000 type objects, each objects has about 15 attributes), the OCIObjectSetAttr performance deteriorates large enough from below 1 millisecond to 1~3 miliseconds.
I am completely new to anything with Oracle or OCI,
Also, basic information:
Language: C Oracle DB version: 11g
Trying to use OCI
I am trying to write a client that connects to an Oracle database and gets some information (obviously). On the OCILogon() step, I need the username, password, and db address. However, someone said there will be a tnsnames.ora file, and that should be enough.I've searched online and I have not been able to find anything that relates OCILogon() to tnsnames.ora, so here are my questions:
1) Can OCILogon() use tnsnames.ora at all? 2) Is there any other function that I should use instead of OCILogon() that would work with the tnsnames.ora
Actually i am not using OCI directly. I have a Delphi application in which I would need to clone an open db connection. Not only username, password, and target database (this is easy and i already do that).
What I would need is also inherit context variables and global temporary tables content status at the moment in which the cloning operation takes place. It seems a very difficult, if not impossible, thing to achieve.
We have a occi application which is linked dynamically to occi lib on Solaris. Now during build we linked it with occi of Oracle 10.2.0.4 client but we want the same build to be able to run under Oracle 10G client as well as Oracle 11G client. But it seems that occi is not forward not backward compatible as name of dynamic occi lib has a version in it.
I am using OCI and instant_client (11.2.0.3.0) in my C++ program (on Windows 7) to connect remotely to 11G database. While doing a connection using server name as well as servername:port/service_name as connection strings, I am getting error of ORA-12504 TNS:listener was not given the SERVICE_NAME in CONNECT_DATA. According to instant client FAQ & white paper at [URL]..., no tnsnames.ora is required for instant client. Then why could I be getting this error? I ensured that only the instant client directory is in Path environment variable. There was a ODBC driver installed on this same host.
I wrote a simple OCCI program and ran valgrind with it. I got some memory leak in the program. I tried to search around but couldn't get any answers. I have tried to compile the program using gcc version 4.5, and icpc version 12.0.4 and they both gave the same errors. The OS I am using is RedHat Linux 6.1.
int main() { oracle::occi::Environment *theOCCIEnvPtr = NULL;
[Code] .......
and one of the leaks is :
==9744== 32 bytes in 1 blocks are definitely lost in loss record 61 of 224 ==9744== at 0x4A07279: malloc (vg_replace_malloc.c:263) ==9744== by 0x62D9147: slzsetevar (in /apps/oracle_client/libclntsh.so.11.1)...
I've the following function returning OBJECT type. how to call this function
CREATE OR REPLACE TYPE GET_EMP_OBJ is object ( emp_name varchar2(50) , mgr_id number, dept_id number );
[Code]...
The above function got created successfully. And i'm confused how to call this functions. I tried like below but didn't work
DECLARE t_emp_info_1 GET_EMP_OBJ ; BEGIN t_emp_info_1 := get_emp(7566) ; for i in 1..t_emp_info_1.COUNT LOOP DBMS_OUTPUT.put_line ('Values are'||i.emp_name ) ; END LOOP; END;
We have code that occasionally errors with ORA-12151, with tracing indicating some funk surrounding OCI calls to OCIPing(), OCIBreak(), and OCIReset(). What the code is trying to do here is release a connection from a pool (our implementation, not OCIPool) and before releasing it trying to make sure nothing is actively running on the connection etc. The environment is created in THREADED mode (ie not non-blocking).
Reading the documentation its not really clear to me if OCIBreak() and OCIReset() are really intended to be called while in THREADED mode.
Is it a bad idea to call break/reset as part of a general connection-reset routine?
The basic control flow (minus error handling etc) is:
I install Oracle instant client 11g in my Windows 7(32bit), and use MSVC6++ to test program occidml.cpp, compile is no problem, but when I run it, it crash on create Connection. I have tried to link with different version of OCCI library ( v8,v9), but all crash on create Connection.
I am trying to fetch the data from system table "FLOWS_020100.WWV_FLOW_ACTIVITY_LOG1$" in Oracle Express edition 10.2.0.3 database, using the OCI library on Windows with C++
This table has a TIMESTAMP column of date type.
I've the following query as below:
select TIME_STAMP from FLOWS_020100.WWV_FLOW_ACTIVITY_LOG1$ where TIME_STAMP > to_date('31/OCT/12 23:59:59', 'DD-MON-YY HH24:MI:SS') order by TIME_STAMP asc;
For this, first I am preparing the query as below:
select TIME_STAMP from FLOWS_020100.WWV_FLOW_ACTIVITY_LOG1$ where TIME_STAMP > :PKVAL order by TIME_STAMP asc;
Before calling OCIExecute(), I am setting the PKVAL buffer to following value:
I want to monitor the stream activity with strmmon tool. How to compile the strmmon.mk? I was seeing with visual studio command prompt but it does not work properly.
In Oracle 10.2 installation there are OCI headers in rdbms/public directory: 10.2.0/rdbms/public/ocidem.h 10.2.0/rdbms/public/ocidfn.h 10.2.0/rdbms/public/ocikpr.h 10.2.0/rdbms/public/oci.h 10.2.0/rdbms/public/oci1.h ...
What should be installed additionally to have OCI headers in rdbms/public in Oracle 9.2.0?
I am having an issue to connect my C++ application to my Oracle DB. When my code calls
oracle::occi::Environment::createEnvironment(),
I get an error "ORA-01804: failure to initialize timezone information".
The application works on other people's Windows machine with their Oracle DB. But it doesn't work from my machine connecting to their Oracle instance. So I guess the issue does not come from my instance but rather from my Oracle dlls maybe?
I am in the process of converting my skill in oracle and this time PRO*C from Windows to Linux. I have oracle 11g R2 installed on a UBUNTU (12.04) server and have installed the instant client as described in
[URL]
This has a query which will run in SQLPLUS but fails with PRO*C
:~/Projects/proc/proctest1$ proc INAME=proctest.pc SQLCHECK=NONE ONAME=proctest.c LNAME=proctest.lis LTYPE=long Pro*C/C++: Release 11.2.0.3.0 - Production on Mon Apr 22 21:00:18 2013 Copyright (c) 1982, 2011, Oracle and/or its affiliates. All rights reserved. System default option values taken from: /home/neill.rutherford/instantclient_11_2/precomp/admin/pcscfg.cfg PCC-W-02109, SQLCHECK=NONE is no longer supported.. using SYNTAX
I work with oracle 10g, on windows 7. sometime when i try to start my sqlplus in prompt command this message display.
C:UsersSony>sqlplus SP2-1503: Unable to initialize Oracle call interface SP2-0152: ORACLE may not be functioning properly
But the solution people have proposed into the forum are:
1 - check the environment variable Oracle_home and modify if it ending by ""
2 - or try tho run my promt command as Administrator.
I try the both, but only the second works. while now i don't understand why it works when i start the promt command as Administrator and why it no works when i don't run it like administrator. Another thing is i am the only user of my computer, i have only one session (administor session).
when i try to connect with sqlplus or toad then i get an error
Microsoft Windows [Version 6.1.7600] Copyright (c) 2009 Microsoft Corporation. All rights reserved. C:Users>sqlplus SP2-1503: Unable to initialize Oracle call interface SP2-0152: ORACLE may not be functioning properly C:Users>
and i want to tell what i do before it-my all files were be converted in .FLT then i shorted out this problem after that when i tried to connect with sqlplus or toad then i get above error.and i have restarted my system but throwing same error.
How to call a function with a row type return in an Oracle select statement.
For e.g. :
If I had this function with a rowtype return: ------------------------------ create function abc return xyz%rowtype is rec xyz%rowtype; begin select * into rec from xyz where col1 = n; return rec; end; -------------------------------- How could I use this in a select clause, as there is a multi column return by the function ?
I'm trying to use MULTISET UNION to append several collections into a single recordset.The select queries shown for the CURSOR are simple beta versions of the real queries which have about 350 fields to each of them. I will be appending data from 15 of these queries which each will with no more than 20 records per query into a new single recordset (not sure if 'recordset' is the correct phrase or term for what I mean, it could be ARRAY, OBJECT, COLLECTION or something else all together).
Here is text of the ERROR message:
ORA-06550: line 63, column 1: PLS-00306: wrong number or type of argument in call to 'MULTISET_UNION_ALL'
ORA-06550: line 62, column 1: PL/SQL: Statement ignored
ORA-06550: line 71, column 36: PLS-00487: Invalid reference to variable 'VARCHAR2'
ORA-06550: line 71, column 5: PL/SQL: Statement ignored
I think the error has to do with some defect in my declare statements.
DECLARE MyTID varchar2(10);
CURSOR Cursor_rst1 IS SELECT d_owner_internal_id, d_internal_id, d_tid, d_entity_name, d_form_seq FROM rtns.itas_rtn_ct_1120_cor tblRecords WHERE d_form_seq = '2710' --Tax Year =2003 AND D_TID = MyTID; [code]....
The following code is getting the 'Not all Variables bound' error. There are only two variables so I don't see the order being an issue. Assume the integers are assigned elsewhere.
DateTime beginDT = new DateTime(yearInt, monthInt, dayInt, hourInt, minuteInt, secondInt); DateTime endDT = new DateTime(yearInt, monthInt+1, dayInt, hourInt, minuteInt, secondInt);
SQL.Append(" WHERE DATE >= :beginDTParameter "); SQL.Append("AND DATE < :endDTParameter");
I am using Release 11.2.0.3.0 - 64bit Production version of oracle. Now we are having 3-tier architecture, (firewal/web/app/DB).Now i saw , some of the 'sql' queries, running till ~10hrs in my database and those are part of application(module JDBC THIN CLIENT). After had a talk java guys, they ask to kill the sessions specific to those queries. They are part of search TO, in which user put some large values for the date range and went to other TAB, but these queries gets running infinitely in the database, and user is not interested in the result set.
So how to avoid these things, as because in past, our database has suffered resource contention leading to application slowness. So i was planing to set different timeouts using 'database resource consumer group' for online user request and batch request depending on the app server(that is by machine names) request.
So i have done below set up in my local to test one scenario, in which i will try give a database call from difference machine, and it should get timeout after the specified duration. But its not working , as expected. The calls from the specified machine are not getting assigned to the created 'Consumer group'.
Begin -- create the pending area dbms_resource_manager.create_pending_area(); END; / BEGIN -- Create the consumer group
[code]....
After this when i am verifying calls from machine, 'LR9XY7T8' they are belongs to the consumer group 'OTHER_GROUPS' and sql query not getting timed out within 60 seconds as mentioned.
I have started reading ORACLE 11g R2 PL/SQL programming doc, and I am stuck at bind variable. I just copied the example in the books and found error -
First I have written below procedure and compiled successfully -
CREATE OR REPLACE PROCEDURE FORMAT_STRING ( string_in IN OUT VARCHAR2) AS BEGIN string_in := '[' || string_in || ']'; END FORMAT_STRING; Then I have written below function and also compiled successfully - create or replace function join_strings (str1 varchar2, str2 varchar2) [code]......
I have a pkg with a procedure that uses dbms_sql to process a varchar2_table. Each record in the table is a delimited string, such as "Priority^2", or "Destination^7". The goal is to split that string on the hat and update a record in the panelfield_users table. It works perfectly if I replace the first substr/instr on :pColumn with a hardcoded number, so I know that the binding is working to that point. It is only when I try to get the latter half of the string that it chokes. I keep getting a "invalid number" error. The displayorder field is an integer field and all values will be 3 digits or less. If I pull the sql string out into an editor, it runs just lovely.
The pertinent code is: C := DBMS_SQL.OPEN_CURSOR; DBMS_SQL.PARSE(C,'update panelfield_users set displayorder = to_number(substr(:pColumn, instr(:pColumn, ''^'') + 1)) where userid = :pUID and fieldid = (select fieldid from panel_fields where upper(panelname) = upper(:pPanel) and upper(modulename) = upper(:pModule) and upper(field_displayname) = upper(substr(:pColumn, 1, instr(:pColumn, ''^'')-1)) )
Getting Error while running my form after including toolbar, calendar and alerts etc..I've created a library and then attached it..but unfortunately nothing special is going.. When I run my program, it first compile and then gives error. When I reach the error, there is this script..
PROCEDURE date_choosen IS BEGIN copy(to_char(date_lov.current_lov_date,'dd-mon-yyyy'), date_lov.date_lov_return_item); go_item(date_lov.date_lov_return_item); if date_lov.lov_auto_skip = TRUE then next_item; end if; END;
And not moving further. I'm also attaching my this form here. I've to use the calendar on my other 45 forms.
I've got a problem with binding my selected data from one data block to another. When I'd finished selecting my data(subjects in this case),
and I clicked schedule button, my selected data were not bound into the textboxes in schedule datablock.this what happened.the code i used in when-checkbox-changed trigger:
BEGIN IF :NEWSTUDENTS.cb_subj = 'N' THEN Clear_record; ELSIF :NEWSTUDENTS.cb_subj = 'Y' THEN :SCHEDULE2.Subject := :newstudents.subject_code; END IF; END;