oracle / odpi

ODPI-C: Oracle Database Programming Interface for Drivers and Applications
https://oracle.github.io/odpi/
Other
268 stars 78 forks source link

dpiConn_startupDatabase() pfile parameter #41

Closed kubo closed 4 years ago

kubo commented 7 years ago

Do you have any plan to make dpiConn_startupDatabase() accept pfile as Data Provider for .NET does?

The priority of this feature is extremely low. I sometimes use startup pfile=xxx on sqlplus to check effect of initialization parameters without changing persistent parameters. However I could not imagine who use it in applications.

anthony-tuininga commented 7 years ago

I have no current plans, but I'll look into this further at some point. I agree that it is low priority.

ianmacl commented 5 years ago

Is there any way to accomplish this in cx_Oracle?

anthony-tuininga commented 5 years ago

Not currently. But once I've added this support here, adding it in cx_Oracle is quite straightforward.

ianmacl commented 5 years ago

Oh has this been implemented here? I see that the issue is still open.

anthony-tuininga commented 5 years ago

No, it hasn't been done here yet. I'm just saying that once I've added it here, adding it to cx_Oracle is straightforward. :-)

ianmacl commented 5 years ago

ah. Gotcha. Thanks.

anthony-tuininga commented 4 years ago

I've added support for this by adding a new method dpiConn_startupDatabaseWithPfile(). If you call this new function with a PFILE of NULL and a length of 0, it is equivalent to calling the existing function dpiConn_startupDatabase(). The documentation for the new function is as follows:

int dpiConn_startupDatabaseWithPfile(dpiConn *conn, const char *pfile, uint32_t pfileLength, dpiStartupMode mode)

Starts up a database with a parameter file (PFILE).

The function returns DPI_SUCCESS for success and DPI_FAILURE for failure.

conn [IN] – a reference to the connection to the database which is to be started up. If the reference is NULL or invalid an error is returned. The connection must be created with the authorization mode set to DPI_MODE_AUTH_PRELIM along with one of DPI_MODE_AUTH_SYSDBA or DPI_MODE_AUTH_SYSOPER.

pfile [IN] – a pointer to a byte string in the encoding used for CHAR data which identifies the name of the parameter file (PFILE) that will be used to startup the database. This value may be NULL if the pfileLength parameter is zero. In that case this function behaves identically to the dpiConn_startupDatabase() function.

pfileLength [IN] – the length of the pfile parameter, in bytes.

mode [IN] – one of the values from the enumeration dpiStartupMode.

anthony-tuininga commented 4 years ago

ODPI-C 4.0 was just released containing these changes.