Oracle Disconneting SQLPlus Session? - session

I am using sqlplus to connect to an 10g server and execute an anonymous block which takes a while to run. For some reason my connection is consistently dropped. Is there anything I should check in the Oracle configuration that might cause this to happen?

I'm not sure how to reference another question with SO, but here's another viable scenario...
Settings of connection timeout for Oracle database

Related

Oracle Privilege - User can create table but cannot write rows

A user has been configured on Oracle. Via this user, I can create an ODBC connection and an OCI connection, and these both test fine in Win10. Using Alteryx with the ODBC and OCI connection, we try to write data to a new table.
The table is created and appears in PL/SQL with the expected column names. However, the rows are never written and the connection just hangs at this point.
What could be wrong? I am not an Oracle Admin
Based on comments you were expecting oracle to commit without executing "commit" command explicitly. It's not enabled by default in oracle so you have to turn it on.
It's not possible to turn this on for the database, but on client apps only.
E.g. "set autocommit on" command in SQL Plus.
So you need to check docs for the client application you're connected with (presumably Alteryx is the one). It might have such a feature.

How can I connect to Oracle Database with SQLcl and SQLPlus, but without a TNSNames.ORA file?

You have:
an Oracle database
an Oracle Client installation, including SQL*Plus
the TNS information for #1
BUT NO TNSNames.ORA file or the desire to create and maintain one
How can you get your SQL*Plus connection going?
sqlplus user/password#(description=(address_list=(address=.......ODS)))
The text in the () is the information you would see for your service in a TNSNames file. So you can simply use the TNS entry explicitly
Note, use quotes if in Unix else the () are interpreted by the shell.
Or you can use the EZconnect syntax (my preferred method)
sqlplus user/password#//hostname/service_name
sqlplus user/password#//hostname:port/service_name
Note that for Oracle Database 12/18c multitenant architecture databases, you MUST use the /service_name and not the /SID if you want to connect to a pluggable database.
Note also that we have 2 command-line interfaces now.
SQL*Plus and SQLcl.
SQLcl is java based, and a stripped down version of Oracle SQL Developer. It supports TNS based connections, and also supports the EZConnect syntax. One significant advantage it has over SQL*Plus is that it does not require an Oracle Client installation.
This question was originally answered by Tom on AskTom.
I've updated his answer here to address Oracle 12c Multitenant and SQLcl.
If you don't want to leave password in bash history, use this:
# connect
sql user#host:port/database
# will ask password later
# then connect to your database
sql > conn database
Assuming, sqlcl executable is present in the current directory, you can use
./sql user/password#host:port/service_name
Using a tnsnames.ora file is just one out of four different naming methods, see Parameters for the sqlnet.ora File
Usually ldap and nis are suitable only when you have many Oracle databases running in your premises. Other methods are already provided by #thatjeffsmith

Can Oracle SQL Developer be made to reconnect as needed?

Is there an option in Oracle SQL Developer (I use version 4.1.5) to make it reconnect to the DB when needed?
For example, if I start an SQL script but the DB was disconnected, then it should reconnect with minimum hassle and execute the script instead of giving a SQL Error: Closed Connection message.
Note: I'm not interested in keep-alive (what most related questions discuss). If I don't use it today, then it is OK to disconnect. I just want it to reconnect next time I use it.
No.
Auto-connecting dropped connections sounds good in theory, but the 'auto' part is where the trouble begins.
I have a standing ER to add the reconnect button to the dropped connection ERROR message.
In at least SQL Developer version 20.2 this is implemented:
when running an SQL operation when the DB was disconnected after a while, the connection is restored and the operation is executed (there is also a dialog shown telling about the fact).

How to replicate existing OracleRDB ODBC connection in Oracle's SQL Developer application?

I am new to Oracle database in general, but I'm attempting to get Oracle's SQL Developer running on a workstation that has pre-configured System DSNs created for an OracleRDB database. I've confirmed the ODBC connections are working because I can use MS Access to connect and link to the tables. The "test" options within ODBC also succeed. Now I am trying to get a similar connection created using SQL Developer so I can see the column types and write queries in a more useful editor.
Here's what I have available when examining the ODBC connection properties:
Now I'm trying to create a duplicate connection in SQL Developer, but I'm at a loss for why things don't work. I first tried using the default SQL Developer installation, but couldn't get things working. Then I discovered there's an OracleRDB extension available, so I installed that, but I keep getting this error when attempting to use similar values:
As I stated, these ODBC connections were pre-configured on the workstation I'm using, so I don't know anything more than what is provided by the Oracle ODBC driver window.
Is there something obvious I'm not seeing or doing to replicate this connection in SQL Developer? Or perhaps something else I can do to debug this to learn more?
UPDATE
On the advice of one answer I'm trying to make the connection with JDBC, but having a hard time understanding what I'm doing wrong. Here's another screenshot with the connection parameters I have available, but with the server and database names changed:
With these values (the port came from my tnsnames.ora file), if I try to make a JDBC connection I keep getting the following error from SQL Developer:
One final attempt I did was to use the proper values in the Oracle RDB tab, and when I use them and click 'test' the Testing Connection dialog just spins and never seems to return:
So I apologize for the long post here, but I'm struggling because there's just something I am really not understanding about how this all works. I appreciate everyone who took the time to read this question.
Oracle SQL Developer is a Java Application. You'll need to get the JDBC Driver for RDB.
Once you have that, in the SQL Developer preferences, find the Third Party JDBC section, and then use that to add an entry and point to the JAR for what you just installed.
Step by step instructions here.
Working connection string for RDB Thin Driver:
RDB_DB_CONN_STR = "jdbc:rdbThin://node.myplace.com:1707/";
where node.myplace.com is the name of the OpenVMS node hosting the RDB Thin Driver, 1707 is the port number assigned to the RDB Thin Driver.

Oracle ALTER DATABASE OPEN

Im having some trouble with an oracle database. Every time i try to connect, i get this message.
ORA-01033: ORACLE initialization or
shutdown in progress
I searched the web, and found that the solution is to execute an alter database open command, but what I dont understand is where should i execute if, since I cant connect to the database.
Am I missing something?
Thanks in advance
You should connect AS SYSDBA:
sqlplus "sys/pwd AS SYSDBA"
An ORA-01033 would also be thrown if the connection attempt were made against a mounted standby database (Oracle Data Guard environment) by a non-sysdba user. Maybe a database role change (switchover or failover) has occurred since your last connection attempt.
Which OS are you using? The database is still shutting down - check the alert log as to the status of where it is at. Sometimes there are sessions hanging around that need to manually be killed off, there should be an indication of this in the alert log. It also depends how the database was shutdown, NORMAL, TRANSACTIONAL, IMMEDIATE. Even with a SHUTDOWN IMMEDIATE the sessions hanging around may still happen. To find the sessions on UNIX use the 'ps' to list all processes on the server ('ps -eaf' on Solaris) command and 'grep' for the ORACLE_SID name.

Resources