Hello, all!
I'm having slow performance reading from a cursor that is returned from a
stored procedure. Network tracing and strace confirms that a round-trip is
being done to the Oracle DB to fetch each row, with no pre-caching. Using
DBI-1.52, DBD-Oracle-1.18 on Linux with Perl 5.8.5 and
Joel,
To really know understand the problem, you should gather an extended SQL
trace (event 10046) at the DB level at level 8 or higher -
http://orafaq.com/faqdbain.htm#EVENTS
After the program has completed, you will need to get the trace file
from the server's udump directory and format it
Oscar,
Short answer - you cannot (sort of). This is because your shell script
will execute in a sub shell of your perl program.
However, you can do something like this:
# untested
system(export VAR=val; /path/to/your/shell/script.sh);
I think that might work for you.
--
Ron Reidy
Lead DBA
Reidy, Ron wrote:
Oscar,
Short answer - you cannot (sort of). This is because your shell script
will execute in a sub shell of your perl program.
However, you can do something like this:
# untested
system(export VAR=val; /path/to/your/shell/script.sh);
The shell also takes a series of zero
The solution I proposed works - and I tested it.
#!/bin/perl -w
$ENV{MY_ENVIRONMENT_VARIABLE} = Quixotic Response;
system(env);
However, this is Perl - TMTOWTDI!
If you want to undo the setting after running the shell, either localize
%ENV or delete the new variable.
{
local(%ENV) = %ENV;
The standard Unix semantics is this: a child process inherits the
environment from its parent. Therefore if you (export and) set an
environment variable in a process and then run a script, it will see
that environment variable.
Furthermore, _Programming Perl, 3rd ed_ by Wall et all says this
On Wed, Jan 17, 2007 at 8:59AM, Oscar Gomez wrote:
how can i export a variable from program perl to shell script through
environment variable.
This is not really a DBI question, so you will have better luck
posting this type of question to perl-monks
(http://www.perlmonks.org/) or similar
Once more, there is more than one way to do it ...
Modifying %ENV, perhaps with local, seems to be the cleanest and fastest
way. do { local $ENV{'FOO'}='bar'; local $ENV{'GOD'}='Larry';
system('/usr/local/bin/shellscript.sh','--do-something'); };
Fiddling with the shell in system() looks AT
Some other folks may be interested in the patches I've published for
DBD::Multi recently:
http://rt.cpan.org/Public/Dist/Display.html?Name=DBD-Multi
Perhaps most interesting might be a benchmarking script I made, and
related optimization patches:
http://rt.cpan.org/Ticket/Display.html?id=24460
Thanks -- will give that a try.
Can I assume this means you believe that DBD::Oracle/DBI should
indeed be pre-caching rows in the reading from the cursor that was
received from the procedure? That is, it is reasonable to think that
it should be doing pre-caching and that it's a bug
On 1/19/07, Jonathan Leffler [EMAIL PROTECTED] wrote:
The solution I proposed works [...]
I sent it on the 17th. Unfortunately, I only sent it to Oscar, not to
dbi-users as well.
Sorry - my mistake - both then and earlier today.
This subject should now be closed.
--
Jonathan Leffler
On Fri, 19 Jan 2007 13:52:40 -0600, David Dooling wrote:
Hi David
If you want the Perl program to alter the environment of the
process that executed it (a shell, cron, another script, etc.),
that is not possible.
Errr, actually it is possible, at least under Windows.
And that's another good
12 matches
Mail list logo