Connect With A Specified Instance Oracle
How do you connect to a remote server via IP address in the manner that TOAD, SqlDeveloper, are able to connect to databases with just the ip address, username, SID and password?
Connecting to Oracle instance in AWS RDS. Documentation somewhere that “the value for the Oracle SID will be the name of the DB instance’s database that you specified when you created the DB instance, not the name of the DB instance.”. Most of the posts online described people who were trying to connect to an Oracle DB on the the. In this topic, you connect to a DB instance that is running the Oracle database engine by using Oracle SQL Developer or SQL.Plus. For an example that walks you through the process of creating and connecting to a sample DB instance, see Creating an Oracle DB Instance and Connecting to a Database on an Oracle DB Instance. I am trying to connect an Oracle 11g database to ArcGIS 10, but it's not working and gives the following error: 'Failed to connect to the specified server. Operation Failed.' While I am sure about the inputs, and it's as the following: Database Platform: Oracle Instance: localhost/dbName Username and password are correct.
Whenever I try to specify and IP address, it seems to be taking it locally.
In other words, how should the string for cx_Oracle.connect() be formatted to a non local database?
There was a previous post which listed as an answer connecting to Oracle via cx_Oracle module with the following code:
Craig Trader5 Answers
I like to do it this way:
One of the main reasons I like this method is that I usually have a TNSNAMES.ORA file lying around someplace, and I can check that the dsn_tns
object will do the right thing by doing:
and comparing the output to my TNSNAMES.ORA
You can specify the server in the connection string, e.g.:
- 'server' is the server, or the IP address if you want.
- '1521' is the port that the database is listening on.
- 'orcl' is the name of the instance (or database service).
Instead of specifying the SID, you can create a dsn and connect via service_name like:
The benefit of using the service name instead of the specific instance identifier (SID), is that it will work in a RAC environment as well (using a SID won't). This parameter is available as of cx_Oracle version 5.1.1 (Aug 28, 2011)
GerratGerratI am following these instructions.
I have created a docker container like this:
The output is:
I kill it via ctrl+c. I then run:
I then attempt to connect like this:
The result is:
It then asks me for a username. Regardless of which user SYS, SYSTEM or PDBADMIN, I cannot connect. I have retyped the password (F1f@f23_) a multitude of times to make sure it was not a typo. Any thoughts on this would be appreciated.
3 Answers
I've encountered this with those images, too. You will first have to open the pluggable database before you can connect to it.
I do that with something like this:
Once the container has been started and the database created you can connect to it just like to any other database by one of the following methods:
Running SQL*Plus in a Docker container
You may use the same Docker image you used to start the database, to run sqlplus to connect to it, for example:
Another option is to use docker exec and run sqlplus from within the same container already running the database:
Connect With A Specified Instance Oracle File
To run your Oracle Database Docker image use the docker run command as follows:
useful: https://github.com/oracle/docker-images/tree/master/OracleDatabase
Yes, I got the same error after setting up Oracle database in docker too.
So first check the instance is running (and look for the ORACLE_SID):
The Oracle SID is ORCLCDB.
If you don't have the environment set for ORACLE_SID, you get:
Connection failed.
But after you set your ORACLE_SID:
And now you no longer get the connection failure error, but a different SYSDBA instead.
Just add '/ as sysdba' to your entire sqlplus command and you are good to go.
Peter TeohPeter Teoh