hi!

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...


HERE's THE SCRIPT:

export ORACLE_SID=ohkrm92
export ORAENV_ASK=NO
. oraenv

echo "
select * from dba_profiles
where resource_name in ('FAILED_LOGIN_ATTEMPTS ')
order by profile;
" > t2.sql

echo "@t2.sql" | sqlplus -s username/password

HERE'S THE OUTPUT:


PROFILE -------- RESOURCE_NAME -------- RESOURCE
DEFAULT -------- FAILED_LOGIN_ATTEMPTS -------- PASSWORD
3


HOW SHOULD I MAKE A SCRIPT THAT WOULD DISPLAY AN ERROR MESSAGE IF FAILED_LOGIN_ATTEMPTS is GREATER THAN 3...

PLEASE help...

thank you....

Recommended Answers

All 2 Replies

This is actually an Oracle question:
dba_profiles sets the rules for the system, not how many login failures there are for a given user.

Offhand I do not know what SYS table Oracle currently uses to store this information. Plus, this approach is an idea that is doomed to failure unless the dba does a

GRANT SELECT ON <whatever the underlying table is>  to PUBLIC;

which could very well be against most security policies.
Most tables relating to security are carefully protected.

echo "
set head off
select profile,limit from dba_profiles
   where resource_name = 'FAILED_LOGIN_ATTEMPTS';
" |sqlplus -S username/password |
while read profile limit ; do
    if [[ $limit = UNLIMITED ]] || [[ $limit -gt 3 ]] ; then
        echo "ERROR: $profile can attempt to login $limit times"
    fi
done
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.