RE: help with my perl script
This tells me there is something not set in your environment. Have you tried setting the environment like I specified? rr From: joe bayer [mailto:[EMAIL PROTECTED] Sent: Friday, March 23, 2007 7:28 PM To: Reidy, Ron; RaviChandra Chelikam; dbi-users@perl.org Subject: RE: help with my perl script Yes, DB is running. If I run ./test.sh, there is no problem. The problem comes only when I put it in cron. Reidy, Ron [EMAIL PROTECTED] wrote: Then there is something wrong with your environment. Have you tried using oraenv to set you environment vs. setting the %ENV hash? In cron, it would look like this: (export ORAENV_ASK=NO export ORACLE_SID=test . oraenv /path/to/rman/script) There are other environment variables that are set in oraenv. Another question I have to ask - is the DB running? -- Ron Reidy Lead DBA Array BioPharma, Inc. From: joe bayer [mailto:[EMAIL PROTECTED] Sent: Friday, March 23, 2007 4:25 PM To: Reidy, Ron; RaviChandra Chelikam; dbi-users@perl.org Subject: RE: help with my perl script Thanks for your prompt response. I tried $ENV{ORACLE_SID}=$ORACLE_SID or $ENV{ORACLE_SID}=test It did not work. Reidy, Ron [EMAIL PROTECTED] wrote: See below ... From: joe bayer [mailto:[EMAIL PROTECTED] Sent: Friday, March 23, 2007 3:33 PM To: Reidy, Ron; RaviChandra Chelikam; dbi-users@perl.org Subject: help with my perl script Dear group, I know it is not DBI related problem, but it is hard to find some one who knows perl, shell and Oracle. I am trying to write a RMAN script, == #!/usr/bin/perl my $ORACLE_HOME = /opt/oracle/product_10g/test/10.2; $ENV{ORACLE_HOME}=$ORACLE_HOME; my $ORACLE_SID=test; $ENV{ORACLE_SID}=test; # what is this? Shouldn't this read $ENV{ORACLE_SID}=$ORACLE_SID or $ENV{ORACLE_SID}=test my $backup_log = /backup/backup_log.log; open RMAN, | /opt/oracle/product_10g/eratest/10.2/bin/rman target=sys/temp log=$backup_log or die Can't pipe to $!; print RMAN exit\n; close RMAN; == It works in command line, but when I put it into crontab job, I always get === connected to target database (not started) RMAN === The script does not recognize the sid, what can I do to fix it? Thanks very much for your help. No need to miss a message. Get email on-the-go http://us.rd.yahoo.com/evt=43910/*http:/mobile.yahoo.com/mail%0d%0a with Yahoo! Mail for Mobile. Get started. http://us.rd.yahoo.com/evt=43910/*http:/mobile.yahoo.com/mail%0d%0a size=2 width=100% align=center This electronic message transmission is a PRIVATE communication which contains information which may be confidential or privileged. The information is intended to be for the use of the individual or entity named above. If you are not the intended recipient, please be aware that any disclosure, copying, distribution or use of the contents of this information is prohibited. Please notify the sender of the delivery error by replying to this message, or notify us by telephone (877-633-2436, ext. 0), and then delete it from your system. No need to miss a message. Get email on-the-go http://us.rd.yahoo.com/evt=43910/*http:/mobile.yahoo.com/mail%0d%0a with Yahoo! Mail for Mobile. Get started. http://us.rd.yahoo.com/evt=43910/*http:/mobile.yahoo.com/mail%0d%0a TV dinner still cooling? Check out Tonight's Picks http://us.rd.yahoo.com/evt=49979/*http:/tv.yahoo.com/ on Yahoo! TV.
RE: help with my perl script
Because you pointed your ORACLE_HOME variable at this new install and then issued startup nomount in your script, it just naturally follows you would have a second instance up and running. So, obviously, perl is working and so is your script. So, let's start over. You are trying to mimic an interactive session with RMAN. I assume you are a DBA and you have read the Oracle backup and recovery and RMAN documents. If you are not familiar with these, you should read and understand them. Next, I suggest the following: 1. Open a session on your server and Set your environment using oraenv 2. Start RMAN like you would in your script. 3. Issue the commands you are trying to get your script to the RMAN process you are running. Note the results. Do not set your environment using the %ENV hash - use oraenv. I cannot stress this enough. I know one of the mantras of Perl is TMTOWTDI, but this does not hold true for the use of oraenv. I have been a DBA for almost 10 years and have been working with Perl since version 4 and this is by far the easiest way to set up your environment and to keep things running. Good luck. rr From: joe bayer [mailto:[EMAIL PROTECTED] Sent: Friday, March 23, 2007 9:13 PM To: Reidy, Ron; RaviChandra Chelikam; dbi-users@perl.org Subject: RE: help with my perl script I I just installed the ORACLE 10.2.0.3 to another home, and re-run the script, this time, even perl itself stopped running. === The script is like this: #!/usr/bin/perl my $ORACLE_HOME = /opt/oracle/product_10g_2; $ENV{ORACLE_HOME}=$ORACLE_HOME; my $ORACLE_SID=test; $ENV{ORACLE_SID}=$ORACLE_SID; my $backup_log = backup_log.log; open RMAN, | /opt/oracle/product_10g_2/bin/rman target=sys/temp or die Can't pipe to $!; print RMAN startup nomount\n; print RMAN exit\n; close RMAN; = [EMAIL PROTECTED] dba]$ ps -eaf|grep pmon ora92 8178 1 0 22:31 ?00:00:00 ora_pmon_test ora9210212 1 0 23:04 ?00:00:00 ora_pmon_test The SID did passed, but somehow this test is different from that test, how can that be possible? Thanks for your help. Reidy, Ron [EMAIL PROTECTED] wrote: Then there is something wrong with your environment. Have you tried using oraenv to set you environment vs. setting the %ENV hash? In cron, it would look like this: (export ORAENV_ASK=NO export ORACLE_SID=test . oraenv /path/to/rman/script) There are other environment variables that are set in oraenv. Another question I have to ask - is the DB running? -- Ron Reidy Lead DBA Array BioPharma, Inc. From: joe bayer [mailto:[EMAIL PROTECTED] Sent: Friday, March 23, 2007 4:25 PM To: Reidy, Ron; RaviChandra Chelikam; dbi-users@perl.org Subject: RE: help with my perl script Thanks for your prompt response. I tried $ENV{ORACLE_SID}=$ORACLE_SID or $ENV{ORACLE_SID}=test It did not work. Reidy, Ron [EMAIL PROTECTED] wrote: See below ... From: joe bayer [mailto:[EMAIL PROTECTED] Sent: Friday, March 23, 2007 3:33 PM To: Reidy, Ron; RaviChandra Chelikam; dbi-users@perl.org Subject: help with my perl script Dear group, I know it is not DBI related problem, but it is hard to find some one who knows perl, shell and Oracle. I am trying to write a RMAN script, == #!/usr/bin/perl my $ORACLE_HOME = /opt/oracle/product_10g/test/10.2; $ENV{ORACLE_HOME}=$ORACLE_HOME; my $ORACLE_SID=test; $ENV{ORACLE_SID}=test; # what is this? Shouldn't this read $ENV{ORACLE_SID}=$ORACLE_SID or $ENV{ORACLE_SID}=test my $backup_log = /backup/backup_log.log; open RMAN, | /opt/oracle/product_10g/eratest/10.2/bin/rman target=sys/temp log=$backup_log or die Can't pipe to $!; print RMAN exit\n; close RMAN; == It works in command line, but when I put it into crontab job, I always get === connected to target database (not started) RMAN === The script does not recognize the sid, what can I do to fix it? Thanks very much for your help. No need to miss a message. Get email on-the-go http://us.rd.yahoo.com/evt=43910/*http:/mobile.yahoo.com/mail%0d%0a with Yahoo! Mail for Mobile. Get started. http://us.rd.yahoo.com/evt=43910/*http:/mobile.yahoo.com/mail%0d%0a size=2 width=100% align=center This electronic message transmission is a PRIVATE communication which contains information which may be confidential or privileged. The information is intended to be for the use of the individual or entity named above. If you are not the intended recipient, please be aware that any disclosure, copying, distribution or use of the contents of this information is prohibited. Please notify the sender of the delivery error by replying to this message, or notify us by telephone (877-633-2436, ext. 0), and then delete it from your
DBD::mysql 4.004 Released!
Dear DBD::mysql users and developers, I'm pleased to announce the release of DBD::mysql 4.004! This release contains various fixes, per Changelog: * Work around a bug in old 3.23 servers by specifying NOT NULL for fields used as a primary key in tests. (Bug #20325, reported by Julian Ladisch) * Add support for mysql_warning_count statement handle attribute. (Bug #25457, patch from Philip Stoev) * Add support for mysql_multi_statements connection option. (RT #12322, based on patch from Doug Morris) * Had to bump to 4.003 do to print statement in mysql.pm that made it into the dist. Even though you can delete a file on CPAN, you cannot re-upload it if it's the same name. Mea Culpa. * UTF8-Flag not set with flag mysql_enable_utf8 and column collation utf8_bin patch, Joost Diepenmaat, (RT #24738) * Fixed do_error definition (Scott Hildreth, Tim Bunce) * Conversion of test suite to Test::More This release was possible due to the efforts of: Jim Winstead Tim Bunce Scott Hildreth Joost Diepenmaat Dave Rolsky Philip Stoev Doug Morris Julian Ladisch And the rest of the community, and anyone else I forgot to mention! Thank you for using DBD::mysql and MySQL! The files: file: $CPAN/authors/id/C/CA/CAPTTOFU/DBD-mysql-4.004.tar.gz size: 122247 bytes md5: ba89b04b003dec320c893f2553a98ede Also: http://search.cpan.org/~capttofu/DBD-mysql-4.004/ Kind regards, Patrick Galbraith -- Patrick Galbraith, Senior Programmer Grazr - Easy feed grazing and sharing http://www.grazr.com Satyam Eva Jayate - Truth Alone Triumphs Mundaka Upanishad