How to get rid off Password expiry error message when connecting to sql in script?


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting How to get rid off Password expiry error message when connecting to sql in script?
# 1  
Old 11-22-2013
How to get rid off Password expiry error message when connecting to sql in script?

I am connecting to sql databases through shell script. Databases that i am connecting will need password change every 60 days. This is according to our security policy and cannot be changed. But this is creating problem when connecting to Databases through shell script . To connect to oracle DB we use below through shell script

Code:
ERROR: ORA-28002: the password will expire within 13 days

please let me know how i can delete this message in our file.

Code:
sqlplus -s $Username/$Password@BGIW @Job_Failure_check.sql >> Job_Failure_status.txt

# 2  
Old 11-23-2013
I'm not clear if you redirected stderr or not. Start with this:
Code:
sqlplus -s $Username/$Password@BGIW @Job_Failure_check.sql | grep -v 'ORA-28002'>> Job_Failure_status.txt

# 3  
Old 11-25-2013
If you are connecting to the database with a service account that an application will use (i.e. not a personal account) then discuss with the DBA about switching off expiry for that account. You will have to ensure that you keep the credentials secret though.


Robin
Login or Register to Ask a Question

Previous Thread | Next Thread

8 More Discussions You Might Find Interesting

1. Red Hat

Root password expiry script

Hi Guys In red hat linux server is there a way to alert via email when the root password is about to expire ? As per security policy in our environment root password will expire in 90 days. Example : It would be better if we receive a email on 7th november stating that the root password... (1 Reply)
Discussion started by: newtoaixos
1 Replies

2. Shell Programming and Scripting

Script to send an email for password expiry

Newbie in scripting Please assist with a script to send an email to all users seven days before their passwords expires.Aging set for 90 days. # chage -l user1 Last password change : Jul 08, 2015 Password expires :... (4 Replies)
Discussion started by: tshepang
4 Replies

3. Shell Programming and Scripting

Need a script to set non-expiry password

Hi All, I have a gateway server, from where I can connect any server via 'sudo ssh server_name'. Generally, if we need to run a command on any number of servers, we put server names in a file like '/tmp/ser_name' and execute it with for loop from gateway server. Now, I need to set non-expiry... (0 Replies)
Discussion started by: solaris_1977
0 Replies

4. Solaris

SSH Password-less login fails on password expiry.

Hi Gurus I have a few Sol 5.9 servers and i have enabled password less authentication between them for my user ID. Often i have found that when my password has expired,the login fails. Resetting my password reenables the keys. Do i need to do something to avoid this scenario or is this... (2 Replies)
Discussion started by: Renjesh
2 Replies

5. Shell Programming and Scripting

How to get rid of message when script kills process it started?

When I run the following script I get the following error message whcih I would like to suppress when the kill is issued: ./kill.sh: line 13: 31854 Killed nc -l -p 12345 Script: #!/bin/bash echo running nc in the background nc -l -p 12345 & PID=$! echo nc pid: $PID ... (1 Reply)
Discussion started by: cmarkle
1 Replies

6. Shell Programming and Scripting

error connecting sql through a shell script

Hi I am getting this error while connecting to sql through a shell script, whereas i am able to connect to sql directly. It was working properly earlier, no clue why i am getting this. Please find the log below: FTP to <IP> completed Wed Apr 30 11:42:01 BST 2008 Program ended. Wed Apr 30... (1 Reply)
Discussion started by: nehak
1 Replies

7. Shell Programming and Scripting

SQL Error Message

Hi, I have a script that will call a .sql file in unix. My question is, incase the .sql file encountered an error on execution (e.g. 'ORA-00942: table or view does not exist') is it possible to get that error back to the script that call the .sql file? Please give me an example. Thanks. (4 Replies)
Discussion started by: kakashi_jet
4 Replies

8. UNIX for Advanced & Expert Users

Connecting DB in the Shell Script to do SQL Query

Any link or example to write shell script for the Connecting Oracle for Quering through SQL thanks in advance ... Cheers !! Mehul Doshi (3 Replies)
Discussion started by: mehuldoshi
3 Replies
Login or Register to Ask a Question