I want to connect to remote oracle DB using pro*c in C program.
I am able to connect to the DB using oracle sql developer using,
UserId : ABCD
Password: abcd
HostIP(Name): 123.45.67.890 (Qwerty)
Service Name: Asd03
Also Can someone share references on how to do it ?
I don't want to install oracle in my system (due to space constraints), Can it be done using oracle instant-client modules?
Yes, this can be done using the instant client.
To make debugging your installation easier I advice to also install the sqlplus client.
First get your sqlplus client connected. (This will learn you how to set ORACLE_HOME and path)
Next, with the setting from step 1, try to connect your pro*c client.
Related
I am not a Oracle DB expert.
I need to connect to a REMOTE Oracle 19c database server from VDI through Oracle Client or SQL*PLUS.
I only have the Database Name "Orcl" and the TNS Connect string "dev1".
Please advise what are all the pre-requisites that I need to have in my VDI, so I can connect to the remote DB.
What are the environmental variable I need to set in my VDI ?
Do I need to have Oracle client installed in my machine ? which version of Oracle client ?
If I have Oracle 12c client in my machine, will I be able to connect to Oracle 19C DB.
I don't think the vdi plays into it at all. You will be making a connection across a network interface (even if the client and database are on the same machine). Yes you will need an oracle client. I think a 12c client is the oldest client that is still certified for connection to 19c database. To be sure Refer to Oracle Support Document 207303.1. For the client, using a network connection, I believe the only environment variable required is ORACLE_HOME.
I am new on Oracle and stuck in a problem for almost a week, I am trying to connect to an oracle database through TOAD, i am able to direct login through SID and Service Name using toad Application itself .
But i have a requirement to use a custom launcher for toad which launches the application from command line which directly connects to OracleDB.
I am able to connect to Oracle DB using the following command through SID
C:\toad.exe -c Username/Passwd#host:port/SID (Works Perfectly)
The above command launches the TOAD app and connects me to the Oracle DB through SID.
But when I try to pass the DB Servicename instead of SID it is giving me the following error I did a lot of R&D and no relevant solution.
ora-12505 tns listener does not currently know of SID"given in connect descriptor
Discussion with DB Team
I discussed with DB team according to them Toad.exe is not accepting the "ServiceName" as an argument and according to them the issue is not at their end as toad application itself connects to the database through both SID and Service Name.
Please Help.
The syntax you have listed user/pass#host:port/service is for service connection only.
For SID connections it is user/pass#host:port:SID
You are probably already connecting using service name. To be sure, you can ask you DBA to provide you the DB SID and listing of parameter services_names from the database.
The issue was resolved by launching the toad using the following parameter
C:\toad.exe -c user/password#service_name
A database administrator has used to connect to oracle database on unix operating system by using the following:
$ sqlplus sys/sysPass1#orcl as sysdba
What are the big mistakes in the previous method to connect?
What do you suggest to avoid such mistakes?
Please help me ...
That it exposes the password to other users running a ps -e command.
I'd suggest using an Oracle wallet to avoid the need to specify a password/
It is not necessary to connect to the database in this way - unless you are using Oracle RAC.
If the environment variables ORACLE_HOME and ORACLE_SID are correctly used and the unix user is in the DBA group and you are on the DB server a
sqlplus / as sysdba
is still working.
If you are using a script it is always a good idea to connect with
sqlplus /nolog # script.sql
and in the script as first line
connect user/password#tnsnames
or, if the script is running on the database server
connect user/password
Can we create a database on remote machine in postgresql DB, if yes then how?
Yes. Assuming the remote server is Linux, and assuming you have sudo or root privileges on that server, you could SSH into the remote server and use a package manager (like yum, synaptic, or apt) to install the PostgreSQL server.
You can configure it using vi (or emacs or other text editor). Usually, the files you edit are found in the /var/lib/pgsql/data folder, and an /etc/init.d/postgresql startup script for whenever the server reboots. You'll usually need to edit the pg_hba.conf file to allow a connection from your client's subnet. That part can be troublesome if overlooked.
You'll be able to initially run psql as the postgres user, and can create datatabases, run scripts, etc from the command line. Once you allow a remote connection, you can do the same from the comfort of your own gui, such as PgAdminIII or any Java-based database manager that can use a JDBC connector.
Example:
psql -U postgres
create database foo;
\q
First, get your programming language. Let say it's PHP to make it simple.
Second, you get the PostGresql connector. Here is the link for PHP but you can get for all popular language.
Third, you open a connection and you do the command you want. You want to create a database so you call the create database YourDatabaseName command.
I made a program that accesses a firebird DB in network environment.
I access the DB via Network in two different points of the network normally.
But if I open the two programs simultaneously this exception is thrown on the second program, which tries to connect to DB:
"Your user name and password are not definied"
How to access the firebird DB with two connections simultaneously?
This could be caused by using the embedded versionof firebird, which only allows 1 connection. Look at the filename you installed.
If that is the problem then uninstall that and install the clasic or superserver version instead
MAke sure that the Firebird database is hosted on a computer that is running the Firebird server.
ie Install Firebird Server on the computer that has the database.
Then from your client PCs where your app is installed make sure that you are accessing the database by connecting to the Firebird server. This means that whichever component your Delphi app is using to connect to the database needs to have the 'server' property set to the hostname of the database server machine.
Once this is done your apps will be making requests to the Firebird database server which knows how to handle the connections and process the SQL requests and return results.
Most db connection components should allow you to precede the database path with an ip address or hostname like this for example
MyConnection.Database := '127.0.0.1:C:\Databases\testdb.fdb';
Obviously make sure both your programs point to the same ip address or hostname and make sure the login credentials they use are defined on that firebird server.
All firebird server installations (except embedded) can handle multiple connections by default (even using the same user), you shouldn't have to worry about that. Just make sure the client programs are using inputs (ie. db network path and firebird server login credentials) that apply on the server they are trying to connect to. You could just use SYSDBA until you get the connection under control, then start thinking about creating a unique login for your client apps to use.
In the TIBDatabase component, you have to fill the Params property with:
user_name=sysdba
password=masterkey
The Firebird installation in every computer in the LAN has to be set to this default parameters. The computer with problem must have a different access credential.
You have to uninstall Firebird and them reinstall the latest version using the service and super server options, and mark the "use gdi32.dll for retro..."
Tell me if that worked out for you.