Hi All' I want to get oracle memory info(SHOW PARAMETER MEMORY) and I tried with this:
#!/usr/bin/perl -w use strict; use DBI; my $dbh = DBI->connect( 'DBI:Oracle:charith', 'user', 'passwd', { RaiseError => 1, PrintError => 1 } ) || die "Database connection not made: $DBI::er +rstr"; my $sth = $dbh->prepare('SHOW PARAMETER MEMORY'); $sth->execute( ); my @row; while ( @row = $sth->fetchrow_array( ) ) { print "Row: @row\n"; } warn "Data fetching terminated early by error: $DBI::errstr\n" if $DBI::err; $sth->finish(); $dbh->disconnect();
But This gives Error:
DBD::Oracle::st execute failed: ORA-00900: invalid SQL statement (DBD +ERROR: OCIStmtExecute) [for Statement "SHOW PARAMETER MEMORY"] at ./t +estBase.pl line 26.
This works fine with SELECT commands, Badly I'm new to perl:DBI please give some help.
Expected OUT: SQL> SHOW PARAMETER MEMORY NAME TYPE VALUE ------------------------------------ ----------- --------------------- +--------- hi_shared_memory_address integer 0 memory_max_target big integer 11232M memory_target big integer 11232M shared_memory_address integer 0 SQL>
Thanks

In reply to How to use oracle SHOW commands with DBI by charithd

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.