On Wed, 15 May 2002 19:57:30 -0700 (PDT) Anand Kumar <[EMAIL PROTECTED]> wrote:
> I had to issue a UNIX command "source DBINST* " from a
> perl program.
>
> I was using OPS$ account in perl DBI. Soon after I
> login using system account it will point to default
> database. Now I want to issues some unix command on
> the commandprompt to direct the sqlplus / to the
> Database of my need.
>
> so I need to run these two command from perl program.
>
> chdir("/oracle"); -- for changing the dir to Oracle
> "source ora_INST" -- for pointing the OPS$accnt to
> database INST
>
> how can I run these unix commands in a perl program?
Unfortunately, because of the basic architecture of Unix, 'source'ing
ora_INST will __NOT__ set any environment variables in your Perl program.
It shouldn't be necessary in any case, DBD::Oracle can connect to other
Oracle instances besides the current default one by specifying the
instance in the first argument to DBI->connect(). Just make sure that any
Oracle home of the same version used to build DBD::Oracle is pointed to
before starting Perl.
If you absolutely must run SQL*Plus from a DBI script, call it through a
wrapper script that takes the target directory and instance as arguments
and then does what is needed before starting SQL*Plus.
--
Mac :})
** I normally forward private questions to the appropriate mail list. **
Ask Smarter: http://www.tuxedo.org/~esr/faqs/smart-questions.html
Give a hobbit a fish and he eats fish for a day.
Give a hobbit a ring and he eats fish for an age.