BookmarkSubscribeRSS Feed
Dmitriy1
Calcite | Level 5

Hi!
In the SAS Manadment Console, when the server is configured, the Path field is filled in as follows
(DESCRIPTION = (ADDRESS_LIST = (ADDRESS = (PROTOCOL = TCP) (HOST = XXX.XXX.XXX.XXX) (PORT = 1521))) (CONNECT_DATA = (sid = orc1))).
When I try to view the library that accesses this server in SAS Enterprisse Guide, I get an error

Exception type: SAS.EG.SDS.SDSException
SAS Message: [Error] ORACLE connection error: ORA-12505: TNS: listener does not know of SID given in connect descriptor.

Raw Message: <? Xml version = '1.0'?> <Exceptions> <Exception> <SASMessage severity = 'Error'> ORACLE connection error: ORA-12505: SIN given in connect descriptor. / SASMessage> </ Exception> </ Exceptions>
Source: SAS.EG.SDS.Model
Target Site: Assign

Stack Trace:
   at SAS.EG.SDS.Model.Library.Assign ()
   at SAS.EG.SDS.Model.Library.PopulateDatasets (Collection & collection)
   at SAS.EG.SDS.Model.Broker.PopulateCollection (Collection collection)
   at SAS.EG.SDS.Model.Collection.DoPopulate ()
   at SAS.EG.SDS.Views.View.DoPopulate (DisplayOperation & op).

 

The SID field is taken from the tnsnames.ora file. oracle client works normally using the tnsnames.ora file.

Tell me what can be wrong.

3 REPLIES 3
LinusH
Tourmaline | Level 20
Do you have any Oracle connection that works?
If no, be sure that have performed all configuration steps for SAS/ACCESS to Oracle.
If yes, have an Oracle DBA look through your tnsnames file and libname options.
Data never sleeps
SASKiwi
PROC Star

I find it easier to test database connection strings in a LIBNAME statement first before setting up libraries in metadata. Have you tried that? From what I can see it looks like you are trying to bypass the TNSNAMES.ORA definition by defining everything in the connection string - is that correct? It might be easier to try a LIBNAME with the PATH= option to reference an existing TNSNAMES.ORA defined database.

AhmedAl_Attar
Ammonite | Level 13

Hi @Dmitriy1 Try to Right Click on the Library/Libname in SAS Management Console and selecting "Display Libname Statement". You'll see the Generated Libname Statement does not match the syntax of your definition! Hence you are getting the Error!

 

While the SAS/ACCESS to ORACLE Documentation shows an example on how connects to Oracle without updating the TNSNAMES.ORA file

libname x oracle user=myusr1 pw=mypwd1 
  path="(DESCRIPTION= 
          (ADDRESS_LIST=
            (ADDRESS= (PROTOCOL=TCP)(HOST=pinkfloyd)(PORT=1521))
             )
              (CONNECT_DATA= 
       "  	     (SID=alien)
       "   )
       " )
       " ";

That doesn't mean, the SAS Management Console would translate the library definition the same way!

 

It's safer to modify the TNSNAMES.ora file accessible to your SAS Server(s) to include the Oracle connection settings.

Just my 2 cents,

Ahmed

 

SAS Innovate 2025: Save the Date

 SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!

Save the date!

SAS Enterprise Guide vs. SAS Studio

What’s the difference between SAS Enterprise Guide and SAS Studio? How are they similar? Just ask SAS’ Danny Modlin.

Find more tutorials on the SAS Users YouTube channel.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 3 replies
  • 1893 views
  • 0 likes
  • 4 in conversation