You can use #sqlcl with #mkstore

I was struggling last week getting mkstore and sqlcl to work together. sqlcl is Oracle’s new command line interface. For more on sqlcl see http://www.oracle.com/technetwork/issue-archive/2015/15-sep/o55sql-dev-2692807.html. I have been using sqlcl almost exclusively for the past year and love it. I also have a lot of my connections in keystore to handle cron jobs along with a few other use cases.

To get sqlcl and keystore to work together is quite easy.

  • Add the wallet location and sqlnet.wallet_override=true to sqlnet.ora
    • WALLET_LOCATION = (SOURCE = (METHOD = FILE) (METHOD_DATA = (DIRECTORY =/u01/app/oracle/wallet)))
    • WALLET_OVERRIDE=true

01mkstore

  • Create a keystore
    • mkstore -wrl $ORACLE_BASE/wallet –create
    • enter the password and verify.
  • add the username/password@service to keystore
    • mkstore -wrl $ORACLE_BASE/wallet -createCredential localhost:1521/orcl rlockard mySecretPassword
    • enter the wallet password

Then connect

  • sql /@localhost:1521/orcl

02mkstore

Easy.

This entry was posted in Database Stuff, encryption, infosec. Bookmark the permalink.

Leave a Reply