We have a Node.js web application that connects to an Oracle DB instance, The problem is after some inactivity, connections of the database is turned to read-only mode. It means SELECT operations work but INSERT and UPDATE transactions encounter this error:
"Error: ORA-03114: not connected to ORACLE"
This problem solves after restarting the application. We use the last version of knex(0.20.1) and node-oracledb(4.1.0) library to connect to the database.
The error means that something (probably a firewall) has expired a connection. You should track down the cause and eliminate it. There may be work arounds such as configuring the Oracle Net layer to send occasional pings across the network to stop idle connections from being terminated, see https://oracle.github.io/node-oracledb/doc/api.html#connectionha
Both queries and DMLs will be equally affected on the connection that gives the error - all will fail. I suspect you are using a different (new) connection for the query.
If you are using 19c client libraries (which, by the way, connect to Oracle DB 11.2 or later), then your connection string could use Easy Connect syntax like:
"mydbmachine.example.com/orclpdb1?expire_time=2"
This will perform a keep alive operation on idle connections, sending probes every two minutes. The general recommendation is to set the period to just less than half the time that connections will be terminated (e.g. by a firewall). See the tech article Oracle Database 19c Easy Connect Plus Configurable Database Connection
Syntax.
Other syntaxes can be used in older versions, or in tnsnames.ora files; check the doc.
I have faced same problem and found the solution.
Add environment variables (system variables)
ORACLE_HOME=installation path in my case F:\app\krushna\product\11.2.0\dbhome_1
and ORACLE_SID= orcl or xe .
Which ever you have.
It worked for me.
Related
I've successfully installed the Pervasive 13's 64bit Client onto Ubuntu Server 18.04.
How can I now establish a connection to the Pervasive 13 server (which is installed on a Windows 2008 R2 server) and perform a sql query?
I'm extremely confused by the documentation, which directs me to the bcfg tool after client installation. I'm not clear if that tool is for configuring the server or for setting up the client connection. Ether way, the documentation is too abstract for my comprehension; I need concrete examples of someone successfully establishing a connection to (at least a hypothetical Pervasive server located at some hypothetical ip address) and NOT JUST abstract syntax that never shows an example of SQL statement being submitted from command line Linux.
Seriously, the documentation covers so much detail of stuff I don't immediately care about, that I can never seem to figure out my practical needs which are to simply establish a connection to the database, perform a SQL query, and get a result set.
The installation of the client should have sensible defaults, and the documentation, after installation, should focus on getting you connected and running sql statements as quickly as possible, instead of going on and on about details that are only of interest if the defaults aren't sensible. Let me connect first! Then if I have a problem, only then do I care to learn further detail about other aspects of configuring the connection.
Pervasive is such an obscure database server, that I'm left with only this documentation to figure this out. Any other database would probably have YouTube videos that show you how to install the client, and start making some SQL queries and getting result sets.
Someone at Actian, ought to be kind enough to make a quick start video for the client on Ubuntu Server that quickly covers installation and finishes where you're submitting sql queries and get result sets. After all, that's the purpose of database client.
Can someone please provide some concrete examples of how I can turn this successful installation into a relationship with the database server where I can submit SQL queries and receive result sets?
I'm not sure why the documentation points to bcfg.
If the Client is installed and didn't display any errors, you need to add an ODBC DSN using dsnadd (https://docs.actian.com/psql/PSQLv13/index.html#page/uguide%2Fuguide.dsnadd.htm%23ww68699). An example of creating a client side DSN pointing to a remote database is:
dsnadd -dsn=clientDemodata -db=Demodata -host=WindowsServerName
(where clientDemodata is the DSN created on the Linux box, Demodata is the PSQL database on the remote server called WindowsServerName).
Once the DSN has been added, you should be able to use isql or isql64 (https://docs.actian.com/psql/PSQLv13/index.html#page/uguide%2Fuguide.isql.htm%23ww138933) to execute a query.
Running isql / isql64 with just the DSN will let you execute SQL queries interactively:
isql64 clientDemodata
An example of running isql using a file as input for the SQL statement(s) is:
cat two-queries.sql | isql clientDemodata -b
If you've done all that, what errors or behavior are you seeing?
I have PostgreSQL database engine running on MS-Windows 7 Cz. A client program, which communicates with this pgsql database, runs the MS-Windows 7 Cz, too. The program is installed with US-English language mutation.
In this default configuration everything goes well. But I want to pair the Windows client program with the PostgreSQL database running on Linux.
The first try failed, but on both sides no reasonable information was logged.
I made some comparisons of the Linux db. crated fractions vs. the MS-Windows db. I only found the difference in the COLLATION settings. On Linux db. the default is "cs_CZ.UTF-8", but on the MS-W db. there is "Czech_Czech Republic.1250".
I do really not know what the COLLATION is for, because on the both OS in the dbs. the default internal encoding is utf-8. Does it means the that the MS-W client speaks to db. using cp1250, while the Linux db. expects the utf8? (Every explanation of COLLATIN speaks about the locale alphabet order?)
It is impossible to change the client behavior, but due to the stability and other database parameters it is highly important to migrate to the Linux server platform.
Can somebody give me some helpful guidelines, how to prepare the Linux PostgreSQL database in ought to be accepted by the MS-Windows client program? The program support team did not (cannot or may be must not) helped me over two month discussion.
Thanks in advance
Yes, finally it was very easy: the critical difference between the MS-Windows configuration and the Linux one, it was the Authentication conf module: pg_hba.conf! Its content is by default in Linux more tolerant to developer working on locahost connection:
host all all 127.0.0.1/32 trust
but in MS-Windows the connection rules are very strict:
host all all 127.0.0.1/32 md5
host all all 0.0.0.0/0 md5
The client program has no configuration file that may change its behavior.
Lots of polling with Wire-Shark was made to note such simple difference.
We have multiple virtual activity enabled in our Lotus notes LEI server.
All the connections are between Lotus notes form and Sybase table.
Note: the LEI connection category is ODBC not sybase connection.
Both are using the same user id and password of the Sybase server.
It is happening in rare situation, not often, but monthly once atleast.
The problem is,
From lotus notes form we have customized error handler. It is throwing Timed out error. Network operation could not be completed. Hope everyone familiar with this error message. I do not see any error log on LEI activity as well as lotus notes server log.
But in the Sybase system's server log, we can see multiple sessions are opened and one of those sessions are in Lock Sleep state.
Whenever this issue comes, we need to restart the sybase server. till it has been restarted we can not access lotus notes database as well.
Please suggest me, how to resolve this issue without restarting the Sybase server. If the connection terminated abnormally from sybase, is their any way to close the LEI activity automatically?
Thanks in advance
If this is happening regularly, then it's probably due to the processes trying tripping over each other and causing a deadlock.
Since you can't really change the application logic, you may need to look at changing the locking scheme/granularity on the Sybase DB.
For more information on locking schemes, check out this Q/A on Sybase ASE Locking
I have installed SQL Workbench/J Build 118 and I logged into the HSQL database of Liferay Portal.
Then I closed the SQL Workbench without making any changes to the database.
I restarted Liferay tomcat server and then I get the following errors:
ERROR [localhost-startStop-1][DialectDetector:124] java.sql.SQLException:
Connections could not be acquired from the underlying database!
and this warnings:
WARN [C3P0PooledConnectionPoolManager[identityToken->3c8jofUN]-HelperThread-#4][BasicResourcePool:1851]
com.mchange.v2.resourcepool.BasicResourcePool$ScatteredAcquireTask#3249a129 --
Acquisition Attempt Failed!!! Clearing pending acquires.
While trying to acquire a needed new resource, we failed to succeed more than
the maximum number of allowed acquisition attempts (3).
Last acquisition attempt exception:
java.sql.SQLException: error in script file line:
7 unexpected token: CONFLICT required: DEADLOCK
ps. I am using the latest version of HSQL JDBC Driver (v.2.3.3)
I resolved the issue by changing this line in the %LIFERAY_DIR%/data/hsql/lportal.script file :
SET DATABASE TRANSACTION ROLLBACK ON CONFLICT TRUE
to
SET DATABASE TRANSACTION ROLLBACK ON DEADLOCK TRUE
then I deleted this line:
SET DATABASE SQL AVG SCALE 0
And I started the server successfully.
hsql in Liferay is good for a quick demo. For anything that goes beyond this, I'd recommend a separate database. With MySql and Postgresql there are two free options that are readily available. hsql stores in a file, I'm not sure about backwards compatibility (in case your workbench uses a different driver version than Liferay) and two processes can't access one file at the same time.
Granted, you can also operate hsql as a server application, but IMHO that would be stretching it too far. Just install a proper database and you have all the tooling you need. There's no real overhead on today's computers.
I am doing a side by side upgrade from 2k8 to 2k12. The original machine is a named instance and the new machine is a default instance. The goal is to not change connection strings from applications.
If I were going from a default instance to a default instance I could change the DNS A record and have it connect. However, the application are storing the connection string as OLDSERVER\OLDINSTANCE. The A record is only going to change the OLDSERVER name but the connection is still looking for the \OLDINSTANCE.
Can SQL Server 2012 be configured to have the default instance accept connections when they are made to an instance that does not exist?
Thanks,
Chris
A default instance, as far as the client connecting to it is concerned, is the one listening on 1433.
If you install a named instance with the same name on the new server, and then change it's port to 1433, a client would be able to connect using both NEWSERVER\OLDINSTANCE and NEWSERVER, as long as the browser is running.
I went through this exact process a few weeks ago, and what I found out sadly is that it does not appear to be possible without uninstalling the old instance (which I wanted nothing to do with). Here were some of the many links that I found on the subject and which I imagine you have probably been through as well.
StackOverflow
SQLServerCentral
MSDN
I tried a number of different things on my local and not one of them worked for me. In my case, if I could have upgraded the server (downtime would have happened) I would have done it, but we were going from SQL 2K8 Enterprise to SQL 2K12 Standard so that was not possible either.
I will be interested in seeing if anyone comes up with a way that this can be done outside of an uninstall, but I could not come up with one and everything that I read seemed to back that up. Maybe someday we will get an sp_dropserver/sp_addserver that will change instance names.