1

I am trying to access oracle server (I use sqldeveloper) through SAS studio and not able to figure out the right path

libname oralib clear;
libname oralib oracle path=?  user=myuserid password=mypass connection=global; 

I am not sure what the path must contain (I have the following info of the oracle DB - hostname, service name and port)

Any help would be appreciated.

Dirk Horsten
  • 3,753
  • 4
  • 20
  • 37
Giri
  • 11
  • 1

1 Answers1

0

The documentation page that should help you is Libname - Oracle:

If you have a path alias already created (service name), you can refer to it with the language you use above:

libname mydblib oracle user=myusr1 password=mypwd1 path=mysrv1;

There, mysrv1 is the alias defined for the path you have defined; most commonly those are defined in tsnames.ora. See this Oracle documentation for the relevant information as to how to define those.

You can also explicitly provide the information like so:

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

However, if you already use SQLDeveloper, you may already have a tsnames.ora file and are best off using that, as if you have to update things from that file you will want to do it only once, not in both your SQLDeveloper and your SAS code.

Since you say you already have the service name, this is the name that would go in path by itself.

Joe
  • 62,789
  • 6
  • 49
  • 67