>> Tim On Sun, Jan 12, 2003 at 08:10:26PM -0800, Jared Still wrote: > > Georg, > > I don't think DBD::Oracle knows about the 'shutdown' and > 'startup' commands. These are database control features > that were previously available only svrmgrl, and are now > standard in sqlplus. > > It seems that you can't directly startup/shutdown a database > using DBD::Oracle. I just tried it, it doesn't work for me. > > Tim?
Who, me? :) I'd guess SQL*Plus is using different OCI calls/params when executing svrmgrl commands. If you're on Solaris (which I'm not right now) the very cool apptrace command can be used to see which OCI calls it's using. << Tim Hmmm, I haven't used apptrace on Solaris, but using ltrace on Linux: bash# ltrace -e `nm -D $ORACLE_HOME/lib/libclntsh.so.8.0 | awk '$3 ~ /^OCI/ { print $3 }' | perl -le 'print join(",", map { substr($_,0,length($_)-1) } <>)'` -n 1 -l $ORACLE_HOME/lib/libclntsh.so.8.0 sqlplus /nolog OCIInitialize(2, 0, 0, 0, 0) = 0 OCIEnvInit(0x080b2080, 0, 0, 0, 0) = 0 OCIHandleAlloc(0x080b9390, 0x080b2090, 2, 0, 0) = 0 OCIHandleAlloc(0x080b9390, 0x080b2094, 2, 0, 0) = 0 OCIHandleAlloc(0x080b9390, 0x080b2084, 8, 0, 0) = 0 OCIHandleAlloc(0x080b9390, 0x080b2088, 3, 0, 0) = 0 OCIHandleAlloc(0x080b9390, 0x080b2098, 9, 0, 0) = 0 OCIHandleAlloc(0x080b9390, 0x080b209c, 9, 0, 0) = 0 SQL*Plus: Release 8.1.6.0.0 - Production on Thu Jan 16 13:38:44 2003 (c) Copyright 1999 Oracle Corporation. All rights reserved. SQL> connect srhadmin/flibble@dev1 OCIServerAttach(0x080c638c, 0x080c6a64, 0x080cdb28, 4, 0) = 0 OCIAttrSet(0x080c631c, 3, 0x080c638c, 0, 6) = 0 OCIAttrSet(0x080c620c, 9, 0x080ceeb8, 8, 22) = 0 OCIAttrSet(0x080c620c, 9, 0x080ce4f0, 7, 23) = 0 OCIAttrSet(0x080c631c, 3, 0x080c620c, 0, 7) = 0 OCISessionBegin(0x080c631c, 0x080c6a64, 0x080c620c, 1, 0) = -1 OCIErrorGet(0x080c6a64, 1, 0, 0xbfffb2ac, 0xbfffb2f8) = 0 ERROR: OCIErrorGet(0x080c6a64, 1, 0, 0xbfffb284, 0xbfffb2d0) = 0 ORA-01034: ORACLE not available OCIErrorGet(0x080c6a64, 2, 0, 0xbfffb284, 0xbfffb2d0) = 100 SQL> connect srhadmin/flibble@dev1 as sysdba OCIServerDetach(0x080c638c, 0x080c6a64, 0, 0x080cdb28, 0x080b0ba0) = 0 OCIServerAttach(0x080c638c, 0x080c6a64, 0x080cdb28, 4, 0) = 0 OCIAttrSet(0x080c631c, 3, 0x080c638c, 0, 6) = 0 OCIAttrSet(0x080c620c, 9, 0x080ceeb8, 8, 22) = 0 OCIAttrSet(0x080c620c, 9, 0x080ce4f0, 7, 23) = 0 OCIAttrSet(0x080c631c, 3, 0x080c620c, 0, 7) = 0 OCISessionBegin(0x080c631c, 0x080c6a64, 0x080c620c, 1, 2) = -1 OCIErrorGet(0x080c6a64, 1, 0, 0xbfffb2ac, 0xbfffb2f8) = 0 OCISessionBegin(0x080c631c, 0x080c6a64, 0x080c620c, 1, 10) = 0 Connected to an idle instance. SQL> quit; OCISessionEnd(0x080c631c, 0x080c6a64, 0x080c620c, 0, 0x080b0ba0) = 0 Disconnected OCIServerDetach(0x080c638c, 0x080c6a64, 0, 0x080b0ba0, 0x080b0ba0) = 0 OCIHandleFree(0x080c6a64, 2, 0xbfffb96c, 0x080b0ba0, 0xbfffb9b4) = 0 OCIHandleFree(0x080c6544, 2, 0xbfffb96c, 0x080b0ba0, 0xbfffb9b4) = 0 +++ exited (status 0) +++ so it looks like when SQL*Plus connects as sysdba and gets ORA-01034, it retries creating the session with a different parameter, and produces the "Connected to an idle instance" message. "startup" and "shutdown" are SQL*Plus commands that execute other SQL statements in groups, e.g.: ALTER DATABASE content MOUNT ALTER DATABASE content OPEN although I don't know about how to start an instance in order to mount the db, or how to close/unmount/stop... Perhaps with apptrace you can get more useful info on what's being passed to the OCI calls, so you could extract the SQL string. maybe gdb could do it too... SRH Please note that: 1. This e-mail may constitute privileged information. If you are not the intended recipient, you have received this confidential email and any attachments transmitted with it in error and you must not disclose, copy, circulate or in any other way use or rely on this information. 2. E-mails to and from the company are monitored for operational reasons and in accordance with lawful business practices. 3. The contents of this email are those of the individual and do not necessarily represent the views of the company. 4. The company does not conclude contracts by email and all negotiations are subject to contract. 5. The company accepts no responsibility once an e-mail and any attachments is sent. http://www.activis.com This annotation was added by the e-scan service. http://www.activis.com ---------------------------------------------------------------------------------- This message has been checked for all known viruses by e:)scan. For further information please contact [EMAIL PROTECTED]