I am not able to connect with other user except using sys as sysdba. I am giving an error ORA-12154
While tnsping is working and trace route is also working.
sqlplus devtest#p7ru01.ab.com
Sqlplus 19.0.0.0.0
Enter password
Error
ORA -1254 :TNS could not resolve the connect identifier specified
But I am able to login to db using sysdba, but not other db user.
It appears you incorrectly transcribed the output instead of copying and pasting. The error code associated with ':TNS could not resolve the connect identifier specified' is ORA-12154, not 'ORA -1254'.
That said, the net is full of references to ORA-12154, including my own article on it, here.
In short, it could not resolve 'p7ru01.ab.com' to an actual connect string - host name or IP address, port number, and database service name. Either it couldn't find an entry for 'p7ru01.ab.com' in the tnsnames.ora file, or it could not locate a tnsnames.ora file.
Related
In the screenshot below you can see how I can successfully connect to the database but the command is rejected because... I'm not connected to the database...
I login into SQL*Plus and I receive the confirmation I'm connected: Connected to: Oracle Database 19c Enterprise Edition Release 19.0.0.0.0 - Production Version 19.3.0.0.0
Just to be sure I re-enter the connection: connect SYSTEM/SYSTEM#localhost:1521/ORCLCDB and I receive as a response Connected.
I follow the official instruction of Oracle Database Sample Schemas and I run #/home/oracle/db-sample-schemas-master/mksample.sql systempw syspw hrpw oepw pmpw ixpw shpw bipw users temp /var/opt/oracle/log/ localhost:1521/ORCLCDB and here is when things start to get nasty.
First I receive an ERROR: ORA-01017: invalid username/password; logon denied.
Then a Warning: You are no longer connected to ORACLE. SP2-0640: Not connected
How can it be, that is the Administrator password.
Should I grant anything else to this user?
The "no longer connected" warning is simply because the script issued its own connect that failed with ORA-01017. A connect attempt necessarily disconnects the current session first, so when the new connection fails there is no active connection at all. You have to reconnect successfully to be able to do anything useful.
The documentation you linked to says:
Start SQL*Plus and run the top level installation script as discussed in README.txt:
sqlplus system/systempw#connect_string
#mksample systempw syspw hrpw oepw pmpw ixpw shpw bipw users temp /your/path/to/log/ connect_string
Note: Use an absolute path and also append a trailing slash to the log directory name.
Use your current SYSTEM and SYS passwords, and also your actual default and temporary tablespace names. The passwords for the new HR, OE, PM, IX, SH and BI users will be set to the values you specify.
You have to supply your actual current password for the SYSTEM and SYS accounts, not the examples in that command; and sensible password for the new sample-schema accounts that will be created. For example, from your successful connect, the first argument to #mksample should be SYSTEM rather than the example systempw.
I was trying to load the sample schemas inside oracle database inside the docker container using the guide. What worked for me was to use localhost:1521/ORCLPDB1 as connection string in place of the SID. After this all of the tables got loaded.
while running a java application,I am getting ORA- 12154 error.
In the java application we have to Login using our Database credentials. For some user credentials the application is running successfuly but for others it's throwing error ORA-12154:TNS:could not resolve the connect identifer specified.
Can someone please help me with the issue.
The most usual cause for that is that database alias (you're connecting to) isn't included into the TNSNAMES.ORA file.
If you have several Oracle software products, there's a good chance that each of them has its own TNSNAMES.ORA file (usually located in its \network\admin directory). The way of it is to simultaneously edit all those files (which is stupid), or create a TNS_ADMIN environment variable which will point to a directory that contains your "master" TNSNAMES.ORA file, such as I have:
M:\>set tns_admin
TNS_ADMIN=C:\0_Oracle_library
Therefore, every time I have to add a new database, I edit that TNSNAMES.ORA file and all my Oracle programs (Forms, Reports, SQL Developer, TOAD, SQL*Plus, ...) access it and use it.
The Oracle error code documentation has some helpful troubleshooting tips (the following is from 12.1):
ORA-12154: TNS:could not resolve the connect identifier specified
Cause: A connection to a database or other service was requested using a connect identifier, and the connect identifier specified could not be resolved into a connect descriptor using one of the naming methods configured. For example, if the type of connect identifier used was a net service name then the net service name could not be found in a naming method repository, or the repository could not be located or reached.
Action:
If you are using local naming (TNSNAMES.ORA file):
- Make sure that "TNSNAMES" is listed as one of the values of the NAMES.DIRECTORY_PATH parameter in the Oracle Net profile (SQLNET.ORA)
- Verify that a TNSNAMES.ORA file exists and is in the proper directory and is accessible.
- Check that the net service name used as the connect identifier exists in the TNSNAMES.ORA file.
- Make sure there are no syntax errors anywhere in the TNSNAMES.ORA file. Look for unmatched parentheses or stray characters. Errors in a TNSNAMES.ORA file may make it unusable.
If you are using directory naming:
- Verify that "LDAP" is listed as one of the values of the NAMES.DIRETORY_PATH parameter in the Oracle Net profile (SQLNET.ORA).
- Verify that the LDAP directory server is up and that it is accessible.
- Verify that the net service name or database name used as the connect identifier is configured in the directory.
- Verify that the default context being used is correct by specifying a fully qualified net service name or a full LDAP DN as the connect identifier.
If you are using easy connect naming:
- Verify that "EZCONNECT" is listed as one of the values of the NAMES.DIRECTORY_PATH parameter in the Oracle Net profile (SQLNET.ORA).
- Make sure the host, port and service name specified are correct.
- Try enclosing the connect identifier in quote marks. See the Oracle Net Services Administrators Guide or the Oracle operating system specific guide for more information on naming.
Start by checking whether you can tnsping the specified service (tnsping is a utility included in the Oracle Client). For example, if connecting as x/y#zzz fails with ORA-12154, then
tnsping zzz
This will probably give
TNS-03505: Failed to resolve name
but it will also display the path of the local sqlnet.ora parameter file mentioned above. Depending on your setup there should be other .ora files in the same location.
There are a number of ways this can be configured depending on your OS, Oracle client and name resolution setup. (Note that a tnsnames.ora file is not the only naming method.) If you share some more details it should be straightforward to resolve the issue.
recently I had to change my computer name and now I am getting this error whenever I try to connect to my local oracle 11g express edition database via OracelSQL Developer.
I have already changed my listener and
tnsnames(D:\oraclexe\app\oracle\product\11.2.0\server\network\ADMIN) to reflect the my
computer's new name but I am still getting this error.
Any help would be appreciated.
Thank you
You must be using operating system authentication OPS$ prefixed username. Connect with sys or system and fix your DB user account. Search for OPS$ user in Oracle documentation for more details.
I use the command prompt to connect my Oracle database. All functions work, but when I try to use my Navicat to connect to the database, it shows the following error message:
ORA-12514:TNS:listener does not currently know of service requested in
connect descriptor.
My general settings for Navicat are:
host type:basic
ip address:127.0.0.1(also try my ip, but still have same problem)
port:1521
service name:orcl
By "all functions work", I assume you mean you are able to connect to the database and query.
Can you show us the connect that you use.
If you are using sqlplus in this fashion,
sqlplus userid/password#database1
it means your current client is pointing to the correct tnsnames.ora. May be navicat does not point to the correct tnsnames.ora file? The error indicates that you want to connect to, say database1, and Oracle is not able to map "database1" to the correct server, host and port number.
Have you gone through the connectiond details here?
http://www.navicat.com/en/products/navicat_oracle/oracle_detail_win.html
What is your operating system version and oracle version?
I'm trying to access an Oracle database on an old server we inherited for a client.
I'm confident I have the Oracle database and listener started and working, but when trying to access sqlplus or the exp commands, I'm getting the following error:
ORA-12162: TNS:net service name is incorrectly specified
I have edited the tnsnames.ora file to change the host to 127.0.0.1 rather than an external URL and I am able to successfully tnsping my connection, but am not getting much further.
Try setting the Oracle SID
set ORACLE_SID=database name
export ORACLE_SID=bvteng worked for me, where bvteng was the service name.
Are you trying a local connection (e.g. "sqlplus u/p") or a network connection (e.g. "sqlplus u/p#pnews10s.world")? Are they both giving you the same error?
The TNSPING by definition is using a network connection. I see some references that indicate you can get the 12612 error when using a local connection. So that is a possible explanation why you are seeing the error from SQLPlus but not TNSPING. If so, try doing a network connection instead.
The local connection not working is probably due to ORACLE_SID not being set correctly as John suggested, but his syntax may not be the right method for whatever shell you are using. Make sure you are using the correct method for the given shell, such as "export ORACLE_SID=name" or "setenv ORACLE_SID name".
I have edited the tnsnames.ora file to change the host to 127.0.0.1 rather
than an external url and am able to successfully tnsping my connection, but am not getting much further.
The last time that happened to me (tnsping works but sqlplus does not, same error message you got), the issue was that someone had copied the tnsnames.ora file from a Windows machine, and left the wrong line feed codes in.
If that is the case, you need to do some dos2unix.
These files are very sensitive to "correct" white-space and tabbing.
Someone should complain to Oracle about that.
Dave Costa has presented you with 2 important question. Are you trying to connect via net8 or locally via extproc? Is the listener on the local machine(127.0.0.1 -- loop back device) setup for extproc connection?
To use the net8 or tcp connection protocol, you need to specify user/pw#tns_alias. To connect locally via extproc you should specify the oracle_sid parameter and then connect via name/pw.
I also notice the tnsalias has the .world domain appended to it, but the sqlnet.ora file does not contain a reference to NAMES.DEFAULT_DOMAIN as being "world".
Also what is the env parameter for TNS_ADMIN? Make sure your tools are looking at the correct tnsnames.ora file. Too many time people modify one tnsnames.ora and the programs/software is looking at another.
Check the tnsnames.ora file, in my case, took me days to find out there were either tab characters in the connection string or other invisible special characters that were causing it to fail.
In my case, the problem was that the DSN and the ServiceName was configured as the same in the odbc.ini file.This should not be a problem, but only after changing the DSN name, I was able to connect to the database through isql.