Comments (9)
Sorry, but I cannot find how go-oci8 does it.
from ora.
Can you try the "sysdba" branch?
from ora.
Sorry I wasn't referring to go-oci8 - was referring to the oci.dll (windows) in oci.h the following exists:
/--------------------------- OCISessionGet Modes ---------------------------/
#define OCI_SESSGET_SPOOL 0x0001 /* SessionGet called in SPOOL mode /
#define OCI_SESSGET_CPOOL OCI_CPOOL / SessionGet called in CPOOL mode /
#define OCI_SESSGET_STMTCACHE 0x0004 / Use statement cache /
#define OCI_SESSGET_CREDPROXY 0x0008 / SessionGet called in proxy mode /
#define OCI_SESSGET_CREDEXT 0x0010
#define OCI_SESSGET_SPOOL_MATCHANY 0x0020
#define OCI_SESSGET_PURITY_NEW 0x0040
#define OCI_SESSGET_PURITY_SELF 0x0080
#define OCI_SESSGET_SYSDBA 0x0100 / SessionGet with SYSDBA privileges */
However, on further review I cannot find any OCI programs that enable connection using this flag (but many asking for it) and it does appear to be there. Such privilege is possible is JDBC using the "internal_logon" property. I was hoping you might know more?
And what is the "sysdba" branch?
from ora.
Ah I see you updated the sysdba branch not long ago - will give that a try, thx
from ora.
Thanks for the very quick response, btw.
OK have tried that. Didn't work :(
I used:
db, err := sql.Open("ora", "sys/[email protected]/XE AS SYSDBA") to attempt to connect to a standby database (which will only allow a SYSDBA connection - same as with a database in mount state) and it failed the same way as it does with a normal user connection.
SQLPlus with same string works.
from ora.
What is that "same way"? Connecting with SYSDBA privilege is not the same as connecting to a standby db...
Please check with a normal DB first, then we can try to work out the standby state.
I've added TestSysdba into z_db_test.go; you can set the username/password with GO_ORA_DRV_TEST_SYSDBA_USERNAME/GO_ORA_DRV_TEST_SYSDBA_PASSWORD env vars.
For me now it says "
z_db_test.go:323: "test/[email protected]:49161 AS SYSDBA": Drv.Open Env.OpenCon Srv.OpenSes Env.ociError ORA-01031: insufficient privileges
"
when I do a go test -run=Sysdba -v
.
from ora.
if I change lines 203-209 approx to be:
/*
mode := C.ub4(C.OCI_DEFAULT)
switch cfg.Mode {
case SysDba:
mode |= C.OCI_SYSDBA
case SysOper:
mode |= C.OCI_SYSOPER
}
*/
mode := C.ub4(C.OCI_SYSDBA)
then it works. (ie. just set the mode directly
Which implies that the "SysDba" is not being picked up
from ora.
Ah In srv.go that is
from ora.
OK Please ignore previous. My setup was not right. Have retested. All good now. :) 👍
Thank you very much.
from ora.
Related Issues (20)
- How to get the result of a function HOT 5
- Package 'oci8' has no Name: field HOT 4
- LastInsertId is returning 0, when using database/sql package with oracle driver
- exemple
- Getting error in the.Next() method HOT 5
- sql db.Exec fail to insert "" to blob,runtime error: index out of range HOT 2
- Dependencies HOT 3
- When run the program get That can not find bind point of OCIBindByPos2 in the dynamic link library HOT 8
- My code makes de select and prints <nil> for each row HOT 5
- Build in Bitbucket Pipelines HOT 2
- Stmt.exeC Env.ociError ORA-03135: connection lost contact\nProcess ID: 61366\nSession ID: 2867 Serial number: 6006 HOT 3
- Error during go get HOT 6
- Cannot build with instaclient 11.1 HOT 3
- Data Cartridge Development support HOT 3
- Support AQ HOT 1
- time.Time shows <nil> even if the value is present in the DB HOT 7
- remove lock on break HOT 1
- I am geting BLOB fields with extra content HOT 1
- v4.1.15 Data chaos bug HOT 1
- MAC OS ARM64
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from ora.