Wednesday, May 25, 2016

CHEF - Sequel - RuntimeError: unknown privilege type SYSDBA

I explained in my previous post how to install Sequel Ruby gem to interact with Oracle databases in CHEF. However, there's little documentation on Sequel's website about connecting to Oracle databases.

I had two issues, (1) I couldn't figure out the connection string pattern for the database and (2) Once I did, I had issues connecting to the database using elevated privileges (e.g. connecting as SYSDBA).

Issue 1
The correct format for Oracle database is, you must quote the whole thing.
DB = Sequel.connect('oracle://user:password@hostname:port/service_name')
e.g.
DB = Sequel.connect('oracle://scott:tiger@oel1.mydomain.com:1523/orcl.mydomain.com')

Issue 2
If you want to connect with SYS user, the above syntax needs to be changed to

DB = Sequel.connect('oracle://sys:mypassword@oel1.mydomain.com:1523/orcl.mydomain.com', :privilege => :SYSDBA)


No comments:

Post a Comment