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: connecting automatically as sys

Re: connecting automatically as sys

From: jonathan <ttyp32000_at_yahoo.com>
Date: 19 Jul 2004 12:31:50 -0700
Message-ID: <f05e664d.0407191131.1aaac696@posting.google.com>


Hans Forbrich <forbrich_at_yahoo.net> wrote in message news:<cMJJc.46901$Rf.29802_at_edtnps84>...
> jonathan wrote:
>
> >
> > I have a bizarre one - I want to automate a script that uses the 'sys'
> > user, but when I try to log in via sqlplus:
> >
>
> <grumble>
> I percieve that you are using downloaded Oracle9i Release 2, 9.2.0.1 on
> Linux Fedora Core 1. (This based on the fact that you did not tell us the
> version of the database, but you are talking about the process table.
> Therefore I conclude you are a recent refugee from Windows-land and THEY
> never talk about versions <g>).

no.. this is actually a cross-version question. 9.2.0.1 and 8.1.7 and come to think of it 7.3.4. OSes are solaris 2.6, 2.8, and windows xp tablet edition.

Why confuse the issue with extraneous information that isn't relevent to the problem at hand?

> However, my crystal ball is cloudy (or dirty) .... Version & OS Please???
> </grumble>
>
>
> Logging in as SYS would generally be considered a bad thing, but I suppose
> you have a valid reason. Would you mind sharing that reason with us?
> (There are very few things that can not be accomplished with a regular
> DBA.)
Yes, i have a valid reason - I need to recreate a function in another database which - for security reasons - is made as sysdba rather than dba.

Since I need to recreate it in another database, I need to automatically supply the sysdba password. I suppose I could do it via Expect, but that's a bit of a kludge, isn't it.

> Also, is there a reason why setting this up as a job from within the
> database (see DBMS_JOBS) would not not work?

Given that this is running from the command-line and runs against multiple end databases - and maybe created 1 to many times depending on circumstances and/or mods to the underlying functions, it doesn't make sense to put it inside the database.

In any case, all this is irrelevant to my question. I asked *how to do it* not whether it is a good idea or not to do. It would be trivial to do this securely if you could set an environmental variable and have this environmental variable read by sql scripts - or even have a private key set up to connect to the oracle database (as you can do with ssl connecting to another machine). From your response, I'm assuming you can do neither.

jon Received on Mon Jul 19 2004 - 14:31:50 CDT

Original text of this message

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