Connecting to database,expdp without supplying username/password

  Configuring client to use external password Store



Saving password in a plain text file is a security risk and SOC will not accept using clear text password in scripts. This can be solved by using external password stores. Utilities like sqlplus,expdp,etc can pass db connection string to connect to database.

There are four steps to achieve this

  1. Create a TNS entry

  2.  Add necessary entries in sqlnet.ora

  3. Create wallet

  4. Add/Create credential



  1. Create a tns entry (this is going to be used while connecting to the database )


tnsnames.ora


exp_bkp=

(DESCRIPTION =

    (ADDRESS = (PROTOCOL = TCP)(HOST = hol)(PORT = 1521))

    (CONNECT_DATA =

      (SERVER = DEDICATED)

      (SERVICE_NAME = PDB_TST)

    )

  )







2 Modify sqlnet.ora



WALLET_LOCATION =

 (SOURCE = (METHOD = FILE)

 (METHOD_DATA =

 (DIRECTORY = /home/oracle/19_hm_2/wallet)))


SQLNET.WALLET_OVERRIDE = TRUE


SSL_CLIENT_AUTHENTICATION = FALSE





3 Create wallet


Create a directory for wallet


mkdir /home/oracle/19_hm_2/wallet 


mkstore -wrl  /home/oracle/19_hm_2/wallet -create



Keep the wallet password safe(it's required to manage wallet)


Use -listCredential to list existing credentials in the wallet

mkstore -wrl /home/oracle/19_hm_2/wallet -listCredential


4. Add credential with the same name as previously created tns alias


mkstore -wrl /home/oracle/19_hm_2/wallet -createCredential exp_bkp system <password>




Now @exp_bkp can be used in connection(this will connect as system user)


This way db_connect_string(ie: exp_bkp) can be used for any user 


Connect to the database


sqlplus /@exp_bkp




Now expdp can be run using connection aliases. This will eliminate need to save password in the script or parameter file


expdp /@exp_bkp schema=HR



Configuring a Client to Use the External Password Store

 

Comments

Popular posts from this blog

Error processing request - Contact your application administrator apex 20.1

APP-FND-01436: List of Values cannot find any values for you to choose error from concurrent request program parameter (R12 12.1.3)

WEB ADI - issues encountered during initial access