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: Passing pameter which has spaces sqlplus

Re: Passing pameter which has spaces sqlplus

From: Paul Brewer <paul_at_paul.brewers.org.uk>
Date: Wed, 22 Jan 2003 23:04:44 -0000
Message-ID: <3e2f23bd$2_1@mk-nntp-1.news.uk.worldonline.com>

"Abhijit Bhosale" <abhijitbhosale_at_hotmail.com> wrote in message news:c7d01eb4.0301221041.755658ab_at_posting.google.com...
> Hi,
> I want to execute the following command on 9i Server
>
> sqlplus -S /NOLOG @ora.sql "sys/change_on_install_at_ORAID1 as sysdba"
>
> Since 9i allows sys user login only if it's connected as sysdba or
> sysoper.
> So the paramater I want to pass should have the 'as sysdba' part.
> Now I want this parameter to be passed to the script ora.sql.
>
> My pboblem is, when I use Oracle 8i sqlplus client to execute the
> above command, it works only if I put the '\' as the escape chrater
> before ".
> e.g.
> sqlplus -S /NOLOG @ora.sql \"sys/change_on_install_at_ORAID1 as sysdba\"
>
> And if I run using Oracle 9i sqlplus client, it works without using
> the '\'
> as escape charater.
>
> e.g.
> sqlplus -S /NOLOG @ora.sql "sys/change_on_install_at_ORAID1 as sysdba"
>
> I want same command to be executed with both the sqlplus clients.
> How can I do that?
>
>
> I found one command, "SET ESC ON", which sets the '\' as the escape
> charater.
> Will it be useful in this case? How can I use it?
>
> Thanks,
> Abhijit

Abhijit,

This has partly to do with O7_DICTIONARY_ACCESSIBILITY, which IMHO should always be FALSE, but FALSE wasn't the default till 9i.

I suggest you log on to the server, set your ORACLE_SID, then use: sqlplus '/ as sysdba' @ora.sql on unix

or the same with double quotes on Windows

There is another complication, but IMHO, the SYS account shouldn't be avaiable from client sessions anyway, unless there's a damn good reason.

select * from sys.link$, anyone?

Regards,
Paul Received on Wed Jan 22 2003 - 17:04:44 CST

Original text of this message

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