I guess you have connecting to Oracle with a valid user working.


#################################################
# Connect to Oracle as username/oldpassword ##
#################################################
use DBI;
print "connect string: $username/\"$oldpassword\"\@$database \n";
$dbh = DBI->connect("dbi:Oracle:$database","$username",$oldpassword, {PrintError => 1} );
if ($DBI::errstr =~ /ORA-28002/) {
# this is the 'expire in 3 days' message
print "***User/oldpassword/database valid: connection okay ***\n";
} elsif ($DBI::errstr =~ /ORA-/) {
print "***User/oldpassword/database invalid: connecting failed - check authentication and db name (tns) \n $DBI::errstr \n";
exit 1;
} else {
print "*** connecting as user with old password: connection okay ***\n";
$dummy = 1;
}