I connected to a remote database on a server from PC, but the following error occurs:
TNS: Listener could not solve the SID given in connect descriptorI checked both listener.ora in server and tnsnames.ora in my PC and found that the SID in these two files are the same, but I doubt that the SID was changed by someone else, and all backup file of listener.ora and tnsnames.ora were lost. Through my experiences I know that the service name in these two files can be changed as long as they are the same, but the SID cannot be changed, it should be the same as the SID name at the time I created database. Do you think that my above idea is correct? And please help me to get the SID of database that I forgot. Thank you very much.
You are correct. You can call your TNS alias anything you want. But the SID in the TNS alias definition must match a SID that the listener is listening for. So there are two places to look.
First, check your database server. Note the SID, port, and hostname (or IP number) of this server. Ensure that the LISTENER.ORA is correct.
Second, check your TNSNAMES.ORA file. Make sure all of the information matches. If you still haven't solved the problem, make sure that you are using this TNSNAMES.ORA file by setting your TNS_ADMIN environment variable to point to the directory that holds your TNSNAMES.ORA file.
For More Information
- Dozens more answers to tough Oracle questions from Brian Peasland are available.
- The Best Oracle Web Links: tips, tutorials, scripts, and more.
- Have an Oracle or SQL tip to offer your fellow DBAs and developers? The best tips submitted will receive a cool prize. Submit your tip today!
- Ask your technical Oracle and SQL questions -- or help out your peers by answering them -- in our live discussion forums.
- Ask the Experts yourself: Our SQL, database design, Oracle, SQL Server, DB2, metadata, object-oriented and data warehousing gurus are waiting to answer your toughest questions.
Dig Deeper on Oracle database design and architecture
Have a question for an expert?
Please add a title for your question
Get answers from a TechTarget expert on whatever's puzzling you.