Query about connections to oracle by tnsnames - database

I am newbie to oracle connections. I would really appreciate it if you could tell me why before I was able to connect to oracle by cmd using:
c:\chris> sqlplus
c:\chris> Enter user name : system
c:\chris> Enter password:
However now I can't connect using system, instead I must use system#orcl
c:\chris> sqlplus
c:\chris> Enter user name : system#ORCL
c:\chris> Enter password:
My tnsnames is:
TNSNAMES
PD: Thank you.

Related

I inatalled Oracle db 19c and login as user sys as sysdba the error,"ORA-12154: TNS:could not resolve the connect identifier specified" accured

Error "ORA-12154: TNS:could not resolve the connect identifier specified" accuring while logging in as "sys as sysdba" with password . But then I read an article saying that,"admin privilages let's a sysdba login without a password." and I tried that and immediately got connected to sql server . Can anyone tell me why this happened ? and why login with password isn't working with this .
When you specify sqlplus sys as sysdba with the correct ORACLE_SID environment variable set from the DB server, Oracle uses OS-authentication to authenticate sys and BEQ protocol (no network) to connect. That's why it would work without a password.
Connecting to sqlplus sys/password#tnsname as sysdba connects across a network (your error indicates that your tnsname wasn't resolved) and requires that a separate password file be configured for authentication. See here: https://docs.oracle.com/database/121/ADMIN/dba.htm#ADMIN11056

How can I find all the information needed for a postgresql connection string?

I frequently run into the problem of trying to track down all the information such as the host, the user, the password, whether to use ssl, etc. Is there an easy way to retrieve this information from the psql terminal?
host = "localhost"
port = 5432
user = "postgres"
password = "password"
dbname = "database"
I typically create databases with createdb but I don't know what user or password it is using.
To find the host, port and user:
psql to open up terminal to postgres
\c database to connect to database
\conninfo to retrieve info about connection.
To reset the password:
psql to open terminal to postgres
\password to set new password (edited)

CQLSH Connecting to server

On my CQLSH command line I tried to login with my ID and password given by the university:
cqlsh> cqlsh -u username -p password whatever.university.ca;
But somehow it's not connecting. I was told by the provider that I should be able to connect to the database this way from my university server. But I wasn't. Can anyone please help on this? By the way, I installed Cassandra before starting cqlsh. Thanks in advance.

Oracle database login

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

Oracle SID and Service name; connection problems

I'm trying to connect to oracle db on remote server through sql developer. I copied the connection details to tnsnames and I'm able to connect to the db.
However i have another db application which is same as sqldeveloper and when I try to make a connection, I keep getting this error. This application uses oracle jdbc thin client which requires hostname and SID.
I got the below error:
java.sql.SQLException: Listener refused the connection with the following error:
ORA-12505, TNS:listener does not currently know of SID given in connect descriptor
While troubleshooting, I changed the tns option in sqldeveloper and I have selected basic option to find out what went wrong and I realized that I'm able to connect to it because of the correct service name and not able to connect to the db via SID name even through sqldeveloper.
I have used some db queries to find out SID name but still i keep getting the same error. Please help me troubleshoot.
Thanks for your time..
ORA-12505 means your client passed a SID that the listener on the server end
didn't recognize at all.
In 10G and above You can use EZ connect without configuring the server side
like this:
sqlplus hr#liverpool:1521/DEMO
hr is the user name
liverpool is the server name
1521 is the port the listener for the DB is listening on
DEMO is the database SID
(OR)
If you still want to use tnsnames.ora, try running tnsping SID from your client.
On LINUX, You can also have ORACLE read a tnsnames.ora file from a local
path - just set TNS_ADMIN to the directory where your tnsnames.ora file is.
Otherwise, you need to configure tnsnames.ora in $ORACLE_HOME/network/admin
on the client
If you need to know the database SID, use this:
select sys_context('userenv','db_name') from dual;
See this URL:
Checking oracle sid and database name
I'm facing this problem too. Linux with oracle 11.2.0.1.
What I found was that the connection string must be:
sqlplus hr#liverpool:1521:DEMO
and not
sqlplus hr#liverpool:1521/DEMO

Resources