The UNIX and Linux Forums  


Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting
.
google unix.com



Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
ksh scripting help praveenbvarrier Shell Programming and Scripting 1 04-15-2008 11:19 AM
sql scripting help sam786 Shell Programming and Scripting 3 12-10-2007 12:31 PM
difference between AIX shell scripting and Unix shell scripting. haroonec Shell Programming and Scripting 2 04-12-2006 09:12 AM
scripting guru's pls help me with scripting on AIX thatiprashant Shell Programming and Scripting 1 01-20-2006 07:58 PM
Scripting? woofie What's on Your Mind? 1 03-09-2005 07:03 AM

Closed Thread
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Bulgarian Greek Powered by Powered by Google
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
  #1 (permalink)  
Old 09-14-2006
liezer liezer is offline
Registered User
  
 

Join Date: Sep 2006
Posts: 5
Scripting Help!

THIS MY SCRIPT:

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


HERE IS THE OUTPUT:

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


: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...
  #2 (permalink)  
Old 09-15-2006
inquirer's Avatar
inquirer inquirer is offline
Registered User
  
 

Join Date: Aug 2001
Posts: 79
Lightbulb

i no longer have an oracle box to test this with but you can try:

check which column is the "DEFAULT FAILED_LOGIN_ATTEMPTS PASSWORD"
example that column is 4th column hence....


Code:
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 | awk ' { if ($4>3) print $0 }'  

add the awk command to your existing script
thanks
  #3 (permalink)  
Old 09-15-2006
liezer liezer is offline
Registered User
  
 

Join Date: Sep 2006
Posts: 5
thnx inquirer

thnx inquirer...


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

thanks a lot....
  #4 (permalink)  
Old 09-15-2006
inquirer's Avatar
inquirer inquirer is offline
Registered User
  
 

Join Date: Aug 2001
Posts: 79
please note that the curly bracket {} is different with parenthesis ()

thanks
  #5 (permalink)  
Old 09-15-2006
liezer liezer is offline
Registered User
  
 

Join Date: Sep 2006
Posts: 5
hi'

inquirer thnx for the help..

i have checked that, though this time
the script has no error, it also has no
output.. Their is no output on the screen...

What does this mean?
Is there any thing i can do?

thnx for the help, i really appreciate it...
  #6 (permalink)  
Old 09-15-2006
inquirer's Avatar
inquirer inquirer is offline
Registered User
  
 

Join Date: Aug 2001
Posts: 79
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.
Closed Thread

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT -4. The time now is 07:59 PM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language Translations Powered by .
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2009. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0