Skip to main content

How to create library for Oracle in SAS?


In this article, you will get details about creating a new library using SAS Management Console. Here, I have provided the procedure for creating library for Oracle database. However, the steps will be same for other databases like SQL server, Teradata etc. 
  

Creating connection to Oracle database:

To create library, you must first create a connection to Oracle database in your host machine. Host machine is the physical location where your SAS platform is installed. Details like Oracle database hostname/IP address and DSN/SID name is needed. Those details should be entered in tsnnames.ora file.

For more details check this article

Creating library in SAS Management Console:

The steps for creating library for Oracle using SAS Management Console (SMC) can used for other database like SQL Server, My SQL etc.

New library wizard:

Expand Data Library Manager plug-in, right click on the Libraries and click New Library to start library wizard. 

You will be asked to choose the Library type. Here we are focusing on Oracle library, so I’m choosing it.

Name and Metadata location of Library:

Next step is to give the Name and metadata folder location.

Selecting server:

The Available Server shows the list of workspace server created. For example, if you assign SalesApp to this library, then only members who have access to SalesApp can access the library.

Libref:

Libref is the nickname of library. You can give any name you want. You can change the libref later.

Choosing Database server:

For each library you need a database server. You can either use exiting one or create a new one. I am creating a new one.  This can be done by clicking on the ‘New’ button.


Oracle version:

Here you need to mention the version of Oracle database. For example, 10g or 11g. Associated machine will be the hostname.


Oracle Path and Authentication Domain:

Oracle path will be provided by your developer or DB admin. You need to create new authentication domain.  The Oracle DB username and password will be stored under this authentication domain.


Note: For authentication domain choose name without spaces.

Database Schema name and connection:

Here database server will be same and schema name information will be available from DB Admin. You need to create new connection. The connection will hold the information about authentication domain. For Default Login you can give (None).

 Create new group:

In the new group, you will save the user id and password of Oracle database in accounts tab. Don’t forget to assign the user id and password to the new authentication domain.

Only the members added in this group will have access to the library you create.

Scope of SAS Admin and Oracle DB:

Without enough information from Oracle DB you can’t make a successful connectivity. You need following information from Oracle DB team:

  • Path
  • Schema
  • User id and Password

SAS Admin scope:


  • Will create new Oracle Database server
  • Will create new Connection to the new Oracle database you created before
  • Will create new authentication domain.


First time it will be very confusing to create a new library. But believe me, if you do this activity once you will get clear about it. Leave comments if you face any issues while creating new library.

Comments

Popular posts from this blog

Insufficient authorization to access PIPE error in SAS EG

Issue: When I tried to run SAS code in SAS Enterprise Guide it throws following errors: ERROR: Insufficient authorization to access PIPE. ERROR: Error in the FILENAME statement. Screenshot of error: Solution: This error occurs when you try to run OS commands in SAS code. To run the OS commands in SAS code you need to enable XCMD option. You check it in SAS Management Console by following below steps.   Open SMC -> Expand Servers -> Expand   In SASApp , expand Logical Workspace Server -> right click on Workspace Server. Click properties -> option tab -> advanced options -> launch properties. Check whether Allow XCMD is checked. The issue arises if the Allow XCMD is not checked. In above image, Allow XCMD option is not checked. It should be checked to run OS commands from SAS code. In Unix /Linux machines, this XCMD option can be enabled by using system option XCMD in sasv9 config file or workspaceserver.sh script file. Us

The authentication server is not SETUID ROOT error in SAS

Question: When validating the SAS Server from SAS Management Console, I received the following error: The authentication server is not SETUID ROOT.  So, I ran the setuid.sh utility and restarted the services many times. I just checked the elssrv sasauth sasperm setuid bit. There were no error in sasauth-debug.log, sasauth-access.log, sasauth-error.log.  Any suggestions? Answer: Please do the following:    1) Run /<SASConfig>/Lev<X>/ObjectSpawner/ObjectSpawner.sh stop  2) Edit /<SASConfig>/Lev<X>/ObjectSpawner/ObjectSpawner.sh and add the code shown below right after SCRIPT=`basename $0`:  if [ -n ""$TKPATH"" ]; then  unset TKPATH  fi   if [ -n ""$TK_PATHLIST"" ]; then  unset TK_PATHLIST  fi    3) Run /<SASConfig>/Lev<X>/ObjectSpawner/ObjectSpawner.sh start  The above code change in ObjectSpawner.sh should fix the issue.

SAS - CLI error trying to establish connection

Issue: User asked me to make a database connectivity to SQL Server. They provided following details SQL server hostname and ip address Database/DSN name Username Password I made entry in ODBC.ini file. You know, SQL Server entries were made in ODBC.ini and Oracle entries were made in TNS.ora file. Everything went fine, took back up of odbc.ini, made entry and saved the file. So to test this connection I ran the libname statement in SAS Enterprise Guide 6.1. It throwed following error. Error Message: My DB team showed that they are able to login   14 GOPTIONS ACCESSIBLE; 15 LIBNAME test ODBC DATASRC=SGE_DS SCHEMA=VST USER=sales PASSWORD=XXXXXXXXX; ERROR: CLI error trying to establish connection: [SAS/ACCESS to SQL Server][ODBC SQL Server Legacy Driver][SQL Server]Login failed for user 'sales'. Solution: First I suspected that Login failed for user 'sales' meant the password provided by DB team was wrong. They responded that they were able to login wi