Skip to content

Trying to startup force mount with a pfile. Please advise how to do this through cx_oracle #295

@ianmacl

Description

@ianmacl

For general questions:

I am trying to do the equivalent of "startup force mount pfile='/tmp/pfile.ora'" from a cx_oracle connection.

When I try to do this, I get DatabaseError: ORA-00900: invalid SQL statement both with a PRELIM_AUTH connection and a normal connection.

There is also the startup command, but it does not allow one to specify a pfile.

  1. What is your version of Python? Is it 32-bit or 64-bit?
    Python 2.6.6 64 bit

  2. What is your cx_Oracle version?
    5.1.2

  3. What exact command caused the problem (e.g. what command did you try to install with)? Who were you logged in as?
    cur.execute("startup force mount pfile='/tmp/pfile.ora'")

  4. What error(s) you are seeing?
    DatabaseError: ORA-00900: invalid SQL statement

  5. What OS (and version) is Python executing on?
    RHEL 6.3

  6. What is your version of the Oracle client (e.g. Instant Client)? How was it installed? Where is it installed?
    Client version 11.2.0.3.0
    Installed via custom RPM.
    Installed at
    /usr/lib64/*
    /usr/include/oracle/11.2/client64/*

  7. What is your Oracle Database version?
    11.2.0.4

  8. What is the PATH environment variable (on Windows) or LD_LIBRARY_PATH (on Linux) set to? On macOS, what is in ~/lib?
    not set

  9. What Oracle environment variables did you set? How exactly did you set them?
    None

  10. Do you have a small, single Python script that immediately runs to show us the problem?

conn_perm = cx_Oracle.connect(conn_string % (user, password, conn_protocol, cname, port, service_name, cert_dn), mode=cx_Oracle.SYSDBA | cx_Oracle.PRELIM_AUTH, threaded=threaded)
cur = conn.cursor()
cur.execute("create spfile='/tmp/spfile.ora' from pfile")
cur.execute("alter system set spfile='/tmp/spfile.ora'")
cur.execute("create pfile='/tmp/pfile.ora' from spfile='/tmp/spfile.ora'")
# all the above work fine

cur.execute("startup force mount pfile='/tmp/pfile.ora'")  # This statement causes an error

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions