VB6 user requested cancel of current operation Oracle error - oracle

I'm currently troubleshooting a VB6 application that sporadically comes up with the following error:
[Oracle][ODBC][Ora]ORA-01013: user requested cancel of current operation
All of the research I've done on this error states that it is either an actual request for cancellation by the user or a timeout. It can't be a request for cancellation because the input is coming in from an automated source, so it must be a timeout. One thing I read online was to un-check the query timeout checkbox in the DSN configuration box but my program uses a DSN-less connection to the database, which is an Oracle 10g database.
There are several queries in this program but it always fails on one query in particular, however I can't reproduce the error in a test environment using all of the same input to the program that caused the error in the first place.
A co-worker of mine suggested doing a rollback after each query even though the queries are read only because some kind of buffer might be getting filled up or something of the like, but this didn't work. At this point I don't even know how to continue troubleshooting it because I can't reproduce the error. If someone could give me any idea of what is going on and how to fix the problem I'd greatly appreciate it. Thanks in advance!

All of the options that you can choose when setting up a DSN can be specified in the connection string if you are using a DSN-less connection. If you want to disable query timeouts, you would add
QTO=F
to the connection string. So your new connection string would be something like
DRIVER={Oracle ODBC Driver};UID=Kotzwinkle;PWD=whatever;DBQ=instl_alias;QTO=F;

Related

oracle - Schemas issues when migration from discoverer to OBIEE

I'm working on migrating some reports from Oracle Discoverer to OBIEE. I've already exported the layouts from discoverer to OBIEE. I have all I need in the OBIEE Admin tool now, but when I try to perform this operation:
I got this message:
I've read in many forums that this is because of the query (enter link description here) but I've executed the query in SQL Developer and all is fine.
Any idea?
Thanks,
I can see from the icon on your object that it is an Opaque View that your trying to run View Data on.
This is probably because of a syntax issue in your opaque view. Make sure the code in the opaque view doesn't end with a semi-colon or slash, that will cause problems. Try eliminating any blank lines, if there are any. However, without knowing exactly the syntax of the code it's impossible to say exactly what the cause is.
It's also possible that there is a connection script attached to the connection pool you are using to View Data, running on connection or before execution with bad syntax.
Otherwise have a look in the Admin Tool log to see if there's more information about what is causing the error. It will usually contain more detailed information than is passed back through the GUI.

Read only ODBC connection

Good Morning!
I'm working on a VB6 project which reads/writes to its database via an ODBC data source stored in the system. What I'm hoping to accomplish, is to temporarily set the ODBC connection to "Read Only" so that I can see what SQL the system would generate in particular scenario without it actually writing the change to the database. The application already takes care of logging all SQL queries. Is there a way to set the system ODBC connection to "Read Only" (within the "ODBC Data Source Administrator") immediately before I perform the action I care about within the system?
I appreciate any insight!
There is no connection parameter you can set to make the session read only. Your best bet is to either use a different user ID (that has only SELECT authority), although it would seem that this might cause your app to fail when it gets errors trying to perform inserts, updates and/or deletes.

Getting JDBC user permissions for active connection

I'm trying to come up with proper error codes for connecting to a SQL database via JDBC. Providing the wrong server name or sql instance is very easy since there's an exception to catch. Likewise with invalid username/credentials...
But my problem is that if I get a valid connection, I want to get the user's permissions for a specific database. I could have missed it, but there doesn't seem to be connection.getPermissionsForUser() method or some such thing.. Only thing I can think of is to fire off an insert query to see if I have write permissions or a select query to see if I have read permissions. Those don't seem very eloquent so I was hoping there might be a better way to do this.
Specifically, is there some way to get the permissions of the user in the connection string?

ORA-03113 end of file communication

I am running a long query(having lot of subqueries) with rownum from VB6 which is giving ORA-03113 end of file on communication after approximately 1 minute. The query run fine from Toad. When the same query is run from VB6 without ROWNUM then query works fine. Also this is parameterised query, if i remove parameters and enter the values directly in query, then also query run fines from vb6.
This query was running fine few days back. Now it is not.
I tried increasing the connection timeout but still i am getting error after 1 minute. Could anyone suggest what could be the problem?
This often indicates that an ORA-00600 internal error has been thrown on the server. Check the alert log and trace files.
ORA-03113 on the client side is one of the oracle catch-all error that is thrown. You need to see if there is any additional error that accompany that error to give you an idea of the problem. The problem can be server side if there is an ORA-00600 that accompanies the ORA-03113 with the same sid/serial of the session. Check the server logs for both the ORA-03113 and any addition error. If there are no server side error, then the error is client side. Check for any network/connection related issue, but since the query works without the rownum network is probably not the cause. That means its probably a client side bug, now comes the need to enable client side tracing of the connection and see if you can generate a consistent issue and trace that you can then use to raise a case with oracle support to see if there is a bug you can get patch/fixed on the client.

ORA-03113: end-of-file on communication channel after long inactivity in ASP.Net app

I've got a load-balanced (not using Session state) ASP.Net 2.0 app on IIS5 running back to a single Oracle 10g server, using version 10.1.0.301 of the ODAC/ODP.Net drivers. After a long period of inactivity (a few hours), the application, seemingly randomly, will throw an Oracle exception:
Exception: ORA-03113: end-of-file on communication channel at
Oracle.DataAccess.Client.OracleException.HandleErrorHelper(Int32
errCode, OracleConnection conn, IntPtr opsErrCtx, OpoSqlValCtx*
pOpoSqlValCtx, Object src, String procedure) at
Oracle.DataAccess.Client.OracleCommand.ExecuteReader(Boolean requery,
Boolean fillRequest, CommandBehavior behavior) at
Oracle.DataAccess.Client.OracleCommand.System.Data.IDbCommand.ExecuteReader()
...Oracle portion of the stack ends here...
We are creating new connections on every request, have the open & close wrapped in a try/catch/finally to ensure proper connection closure, and the whole thing is wrapped in a using (OracleConnection yadayada) {...} block. This problem does not appear linked to the restart of the ASP.Net application after being spun down for inactivity.
We have yet to reproduce the problem ourselves. Thoughts, prayers, help?
More: Checked with IT, the firewall isn't set to kill connections between those servers.
ORA-03113: end-of-file on communication channel
Is the database letting you know that the network connection is no more. This could be because:
A network issue - faulty connection, or firewall issue
The server process on the database that is servicing you died unexpectedly.
For 1) (firewall) search tahiti.oracle.com for SQLNET.EXPIRE_TIME. This is a sqlnet.ora parameter that will regularly send a network packet at a configurable interval ie: setting this will make the firewall believe that the connection is live.
For 1) (network) speak to your network admin (connection could be unreliable)
For 2) Check the alert.log for errors. If the server process failed there will be an error message. Also a trace file will have been written to enable support to identify the issue. The error message will reference the trace file.
Support issues can be raised at metalink.oracle.com with a suitable Customer Service Identifier (CSI)
Add Validate Connection=true to your connection string.
Look at this blog to find more about.
DETAILS:
After OracleConnection.Close() the real database connection does not terminate. The connection object is put back in connection pool. The use of connection pool is implicit by ODP.NET. If you create a new connection you get one of the pool. If this connection is "yet open" the OracleConnection.Open() method does not really creates a new connection. If the real connection is broken (for any reason) you get a failure on first select, update, insert or delete.
With Validate Connection the real connection is validated in Open() method.
Check that there isn't a firewall that is ending the connection after certain period of time (this was the cause of a similar problem we had)
end-of-file on communication channel:
One of the course of this error is due to database fail to write the log when its in the stage of opening;
Solution check the database if its running in ARCHIVELOG or NOARCHIVELOG
to check use
select log_mode from v$database;
if its on ARCHIVELOG try to change into NOARCHIVELOG
by using sqlplus
startup mount
alter database noarchivelog;
alter database open;
if it works for this
Then you can adjust your flashrecovery area its possibly that your flashrecovery area is full
-> then after confirm that your flashrecovery area has the space you can alter your database into the ARCHIVELOG
This error message can be thrown in the application logs when the actual issue is that the oracle database server ran out of space.
After correcting the space issue, this particular error message disappeared.
You could try this registry hack:
[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters]
"DeadGWDetectDefault"=dword:00000001
"KeepAliveTime"=dword:00120000
If it works, just keep increasing the KeepAliveTime. It is currently set for 2 minutes.
The article previously mentioned is good. http://forums.oracle.com/forums/thread.jspa?threadID=191750 (as far as it goes)
If this is not something that runs frequently (don't do it on your home page), you can turn off connection pooling.
There is one other "gotcha" that is not mentioned in the article. If the first thing you try to do with the connection is call a stored procedure, ODP will HANG!!!! You will not get back an error condition to manage, just a full bore HANG! The only way to fix it is to turn OFF connection pooling. Once we did that, all issues went away.
Pooling is good in some situations, but at the cost of increased complexity around the first statement of every connection.
If the error handling approach is so good, why don't they make it an option for ODP to handle it for us????
//First start the database in mount mode
startup mount
//Disable archivelog
alter database noarchivelog
//Then put db in open
alter database open

Resources