Beefy Boxes and Bandwidth Generously Provided by pair Networks
good chemistry is complicated,
and a little bit messy -LW
 
PerlMonks  

DBD::Oracle SQL query

by mrras (Initiate)
on Dec 27, 2002 at 22:18 UTC ( [id://222634]=perlquestion: print w/replies, xml ) Need Help??

mrras has asked for the wisdom of the Perl Monks concerning the following question:

Has anyone been able to shutdown or startup an Oracle database using DBI. If so what did you do to make DBI understand that we are not trying to issue a sql query. Any Help would be appreciated. Thank you, Robert

Replies are listed 'Best First'.
Re: DBD::Oracle SQL query
by dthacker (Deacon) on Dec 27, 2002 at 22:43 UTC
    As an Informix DBA, I'd use system to shut down the database locally and Expect.pm to shut it down remotely. Perhaps you could give us more details on the task you want to accomplish.

    Dave


    Code On!
Re: DBD::Oracle SQL query
by runrig (Abbot) on Dec 27, 2002 at 22:59 UTC
    Has anyone been able to shutdown or startup an Oracle database using DBI.

    That is beyond the scope of DBI. It simply makes calls to the OCI (Oracle Call Interface). It can make calls to stored procedures, but you can't make a stored procedure that does what you want either.

Re: DBD::Oracle SQL query
by osama (Scribe) on Dec 28, 2002 at 13:02 UTC

    why do it in dbi??? It's not portable to other databases anyway...

    try something like this...
    open sqlplus,'|sqlplus'; print <<THERE; system manager connect internal shutdown immediate quit THERE close sqlplus;
    make sure the user running the scripts is a dba... (for connect internal), or use another way.
Re: DBD::Oracle SQL query
by mrras (Initiate) on Dec 27, 2002 at 23:10 UTC
    I am trying to shutdown abort. We do not care about the database state when it is time to shutdown the database. When I issue $dbh->do('shutdown abort');. I get not a valid sql statement. I do know this. but how do we trick DBI to think this is a sql statement.
      DBI doesn't care whether its a sql statement or not. It just hands it off to Oracle. Oracle doesn't like that non-sql statement. Do as the first reply says and use system and call sqlplus or something else.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: perlquestion [id://222634]
Approved by Zaxo
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others having an uproarious good time at the Monastery: (4)
As of 2024-04-19 22:30 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found