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: Rauf Sarwar <rs_arwar_at_hotmail.com>
Date: 22 Dec 2004 04:45:25 -0800
Message-ID: <1103719525.555313.189650@f14g2000cwb.googlegroups.com>

Howard J. Rogers wrote:
> 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
Howard,

My reply was to Michel Cadot's post in which he had, "exp "sys/password as sysdba" transport_tablespace-y....."

Thus implying that my post was directly in reply to his. However, since I started using Google Beta, it gives an option of a quick "reply" which does not show quoted text.... I should get into the habit of using "reply" that includes the quoted text so your point is well taken about someone getting confused by my post.

BTW... Exp/Imp, AFAIK, are the only two Oracle command line tools that require escaping the " for all parameters with spaces... not just userid.

Regards
/Rauf Received on Wed Dec 22 2004 - 06:45:25 CST

Original text of this message

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