sijms / go-ora

Pure go oracle client
MIT License
767 stars 168 forks source link

Connect "/ as sysdba" #560

Open PaulWalkerUK opened 1 month ago

PaulWalkerUK commented 1 month ago

In Linux, I can logon to a local database with SQL*Plus using sqlplus / as sydba. I'm trying to do similar with this package.

I can make it work by specifying the username and password:

hostname := "myhostname"
port := 1521
service := ""
username := "sys"
password := "correct_password"

urlOptions := map[string]string{
    "SID":           "MYSID",
    "dba privilege": "sysdba",
}

connectionString := go_ora.BuildUrl(hostname, port, service, username, password, urlOptions)

I've tried various combinations of no password/any password, setting "AUTH TYPE": "OS" etc but haven't managed to find anything that works without specifying the sys password.

Is there a way I can connect as SYS using this package similar to sqlplus / as sysdba ?

sijms commented 3 days ago

still os authentication doesn't work with linux (only windows)