## Simple perl script to connect to Oracle database using DBI::Oracle#
#!/usr/bin/perl -w
# Get the count of the parametersmy $count=@ARGV;
# if paramters are not 3 exitif ($count!=3) {print “Usage: ./dbcon.pl [dbname] [user] [password]\n”;exit ;}
use strict;use DBI;
# Assign the parameter values to variablesmy $db=$ARGV[0];my $usr=$ARGV[1];my $pass=$ARGV[2];
# Connect to databasemy $dbh=DBI->connect(“dbi:Oracle:$db”,$usr,$pass) or die “Connection [...]
Archive for December, 2007
Simple Perl Script
Posted in perl on December 31, 2007 | Leave a Comment »
RMAN Backup Restoration Drill
Posted in RMAN on December 24, 2007 | Leave a Comment »
1. Copy the pfile from prod box to test box and edit it.$ scp init.ora oracle@TestBox:/restore_path
2. Create password file$ orapwd file=orapw password=oracle
3. Create necessary folders in /restore_path$ cd /restore_path$ mkdir adump bdump cdump udump redo data archive
4. Restore the control file$ export ORACLE_SID=$ sqlplus “/ as sysdba”sql> startup nomount pfile=/restore_path/init.orasql> exit$ rman target /rman> run [...]
Perl DBD::Oracle
Posted in perl on December 24, 2007 | Leave a Comment »
Installing Perl DBD::Oracle on linux
1. Download DBD::Oracle from the linkhttp://search.cpan.org/search for DBD-Oracle in modules
2. Uncompress the downloaded file$ gunzip DBD-Oracle-1.19.tat[1].gz
3. Untar the file$ tar -xvf DBD-Oracle-1.19.tat[1]$ cd DBD-Oracle-1.19
4. Login as root$ su – rootpassword: *****
5. Go to DBD-Oracle-1.19 directory$cd DBD-Oracle-1.19
6. Install the module$ export ORACLE_HOME=/opt/oracle/product/10.2.0/db_1$ perl MakeFile.PL$ make$ make test$ make intall$ exit [exit from [...]