echo "
select * from dba_profiles
where resource_name in ('PASSWORD_LIFE_TIME','PASSWORD_GRACE_TIME')
order by profile;
" > t2.sql
echo "@t2.sql" | sqlplus -s erwin/nm21784
:My boss told me that the script should DISPLAY ERROR if FAILED_LOGIN_ATTEMPTS is greater than 3... HOW should I do THis?
PLease talk to me like im moron, im just a beginner... or please give a
sample code to do this.. thanx a lot...
ps: this is a follow question: thanv to those who answer,
specially dhruva...
i have tried what you have though i get this error
syntax error The source line is 1.
The error context is
{ if >>> { <<<
awk: The statement cannot be correctly parsed.
The source line is 1.
awk: Quitting
The source line is 1.
IF you have still Suggestions that i should try pls inform me...
make sure that the failed login attempts are in the 4th column otherwise change the value of the $4. if the values for the failed login attempts are located elsewhere change it.
also to make sure that the code is correct you can reverse the condition from $4>3 into $4<3 just to see if there are any values received.
hmmm... i saw a similar post to this. please next time avoid reposting the same question.
do you actually need all the data then segregate the failed login attempts? if you only need the failed login attempts you just change the query.
select * from dba_profiles
where resource_name in ('PASSWORD_LIFE_TIME','PASSWORD_GRACE_TIME')
and RESOURCE_NAME like '%FAILED_LOGIN_ATTEMPTS%'
and LIMIT > 3
order by profile;
otherwise:
export ORACLE_SID=ohkrm92
export ORAENV_ASK=NO
. oraenv
echo "
select * from dba_profiles
where resource_name in ('PASSWORD_LIFE_TIME','PASSWORD_GRACE_TIME')
order by profile;
" > t2.sql
echo "@t2.sql" | sqlplus -s erwin/nm21784 | grep "FAILED_LOGIN_ATTEMPTS" | awk ' { if ($4>3) print $0 }'
i have get some output, but how do i DISPLAY a error Message if
FAILED_LOGIN_ATTEMPTS is greater than 3...... i have also tried
your suggestions,, it works though how can i display an error message...
thanx you...