Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.server -> Re: sys as sysdba within a script?

Re: sys as sysdba within a script?

From: Howard J. Rogers <hjr_at_dizwell.com>
Date: Wed, 22 Dec 2004 21:58:14 +1100
Message-ID: <41c95348$0$4538$afc38c87@news.optusnet.com.au>


Rauf Sarwar wrote:
> "sys/password as sysdba" won't work. " must be escaped by a \ as
> \"sys/password as sysdba\". This works on *nix and Win* besides what
> Dave suggested in his post to surround ' with ".
>
> Regards
> /Rauf

Rauf: I realise the original post was about export, and as such your advice is sound... but there's no mention of export or import in your reply, which could lead to unfortunate conclusions being drawn by the unwary. You also used the "m" word: 'Double quotes MUST be escaped" -and that again makes no distinction on *when* they must.

My point is simply this:



C:\>sqlplus \"/ as sysdba\"
Usage: SQLPLUS [ [<option>] [<logon>] [<start>] ]
where <option> ::= -H | -V | [ [-L] [-M <o>] [-R <n>] [-S] ]
       <logon>  ::= <username>[/<password>][@<connect_string>] | / | /NOLOG
       <start>  ::= @<URI>|<filename>[.<ext>] [<parameter> ...]
         "-H" displays the SQL*Plus version banner and usage syntax
         "-V" displays the SQL*Plus version banner
         "-L" attempts log on just once
         "-M <o>" uses HTML markup options <o>
         "-R <n>" uses restricted mode <n>
         "-S" uses silent mode

C:\>exp \"/ as sysdba\"

Export: Release 9.2.0.1.0 - Production on Wed Dec 22 21:52:37 2004

Copyright (c) 1982, 2002, Oracle Corporation. All rights reserved.

Connected to: Oracle9i Enterprise Edition Release 9.2.0.1.0 - Production With the Partitioning, OLAP and Oracle Data Mining options JServer Release 9.2.0.1.0 - Production
Enter array fetch buffer size: 4096 >


That is: the escaping works on Windows *provided* you are talking ONLY about export/import -but for SQL*Plus, the escaping causes an error, at least on Windows, and is therefore definitely NOT a "must".

Regards
HJR Received on Wed Dec 22 2004 - 04:58:14 CST

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US