Connect to Oracle by Using the Oracle Wallet

An Oracle Wallet is an encrypted file that contains the database credentials that you use to connect to Oracle. When you use Oracle Wallet to control authentication, you are not required to store user IDs or passwords in your SAS programs.

Note: If you are connecting to a TLS-enabled Oracle server, then you might need to enable SAS_POD_USES_NSS_WRAPPER. For more information, see this Knowledge Base note.

Use the PATH= connection option to specify the location and other variables that you use to access the Oracle Wallet. The following example shows how you can save the connection information for accessing an Oracle Wallet in a macro variable called &Wallet_path. The USERNAME= and PASSWORD= options are shown in the LIBNAME statement, but these values might not be required if your wallet contains user authentication certificates. See your Oracle Wallet documentation for more information about how to configure and access a wallet.

%let wallet_path=(DESCRIPTION = 
                    (ADDRESS_LIST= 
                      (ADDRESS = 
                          (PROTOCOL = TCPS)
                          (HOST = <oracle-server>.com) 
                          (PORT = <port-value>)
                       )
                     )
                     (CONNECT_DATA = 
                        (SERVER = DEDICATED) 
                        (SERVICE_NAME = <service>)
                     )
                     (SECURITY = (MY_WALLET_DIRECTORY = <wallet-path>))
                  );

libname mydb oracle username='<my-userID>' password='<my-password>'
        path = "&wallet_path"
        schema = '<my-schema>';
Last updated: February 3, 2026