T
TP
I'm trying to write a program to change oracle db user password in
multiple databases.
I've created following html file to except login id and new password
and pass these parameters to test.pl script.
test.pl script should call tom_reset ksh script that will reset the
password. I tested tom_reset script and it works. My problem is how
can I make check to see if tom_reset script actually ran successfully.
Tom....
<---------------Below is my test.pl script:---------------------->
#!/usr/bin/perl -w
use strict;
use CGI qw(param); # Common Gateway Interface
Module
use vars qw($checkuser $pwd $pwd2);
print "Content-Type: text/html\n\n";
#Passed Variables
(defined param("checkuser")) ? ($checkuser = param("checkuser")) :
($checkuser = "");
(defined param("pwd")) ? ($pwd = param("pwd")) : ($pwd = "");
(defined param("pwd2")) ? ($pwd2 = param("pwd2")) : ($pwd2 = "");
if ($pwd eq $pwd2) {
print "The password for Oracle account $checkuser has been
changed to: $pwd<BR>";
#system("tom_reset($checkuser,$pwd,$pwd2)");
} else {
alert_pwd_notmatching();
}
sub alert_pwd_notmatching {
print <<HTML;
<SCRIPT LANGUAGE="JavaScript">
<!-- hide script from old browsers
alert("The passwords you have submitted do not match.
Please try again.");
history.go(-1);
//-->
</SCRIPT>
HTML
}
<------------------------- end of test.pl
------------------------------>
<---------------------------Below is my tom_reset
script----------------->
#!/bin/ksh
.. /opt/bin/Gsu
USRID=check_usr
.. /opt/bin/.setps_apps
clear
DASH="--------------------------------------------------"
echo ""
echo $DASH
echo This program will reset user password in all the databases...
echo $DASH
echo ""
CHECK_USER=$1
PWD=$2
PWD2=$3
echo ""
if [ "$PWD" != $PWD2 ]
then
clear
echo "Passwords do no match...good-bye!"
echo ""
exit
fi
echo ""
echo The program is resetting.....
echo ""
for db in `/bin/cat file`; do
echo ""
echo resttting password in +++ $db +++ for user account $CHECK_USER
echo ""
{ echo $USRID/$PASWD@$db; echo "define username=$CHECK_USER"; echo
"define password=$PWD"; cat reset.sql; } | $ORACLE_HOME/bin/sqlplus -S
done
exit 0
<-------------------------end of tom_reset
--------------------------------->
multiple databases.
I've created following html file to except login id and new password
and pass these parameters to test.pl script.
test.pl script should call tom_reset ksh script that will reset the
password. I tested tom_reset script and it works. My problem is how
can I make check to see if tom_reset script actually ran successfully.
Tom....
<---------------Below is my test.pl script:---------------------->
#!/usr/bin/perl -w
use strict;
use CGI qw(param); # Common Gateway Interface
Module
use vars qw($checkuser $pwd $pwd2);
print "Content-Type: text/html\n\n";
#Passed Variables
(defined param("checkuser")) ? ($checkuser = param("checkuser")) :
($checkuser = "");
(defined param("pwd")) ? ($pwd = param("pwd")) : ($pwd = "");
(defined param("pwd2")) ? ($pwd2 = param("pwd2")) : ($pwd2 = "");
if ($pwd eq $pwd2) {
print "The password for Oracle account $checkuser has been
changed to: $pwd<BR>";
#system("tom_reset($checkuser,$pwd,$pwd2)");
} else {
alert_pwd_notmatching();
}
sub alert_pwd_notmatching {
print <<HTML;
<SCRIPT LANGUAGE="JavaScript">
<!-- hide script from old browsers
alert("The passwords you have submitted do not match.
Please try again.");
history.go(-1);
//-->
</SCRIPT>
HTML
}
<------------------------- end of test.pl
------------------------------>
<---------------------------Below is my tom_reset
script----------------->
#!/bin/ksh
.. /opt/bin/Gsu
USRID=check_usr
.. /opt/bin/.setps_apps
clear
DASH="--------------------------------------------------"
echo ""
echo $DASH
echo This program will reset user password in all the databases...
echo $DASH
echo ""
CHECK_USER=$1
PWD=$2
PWD2=$3
echo ""
if [ "$PWD" != $PWD2 ]
then
clear
echo "Passwords do no match...good-bye!"
echo ""
exit
fi
echo ""
echo The program is resetting.....
echo ""
for db in `/bin/cat file`; do
echo ""
echo resttting password in +++ $db +++ for user account $CHECK_USER
echo ""
{ echo $USRID/$PASWD@$db; echo "define username=$CHECK_USER"; echo
"define password=$PWD"; cat reset.sql; } | $ORACLE_HOME/bin/sqlplus -S
done
exit 0
<-------------------------end of tom_reset
--------------------------------->