LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 08-16-2008, 08:56 PM   #1
StupidNewbie
Member
 
Registered: Dec 2007
Posts: 71

Rep: Reputation: 16
Oracle SQLPlus Help


Hi all,

I've written a little app to change the passwords for my multiple Oracle databases (SIDs) using SQL Plus. It works great right now but there is no validation. I would like to do some error checking/trapping/validation so I can roll it out to the rest of the users here who have a similar need.

Here is the script:


Code:
ACCEPT username char prompt 'Enter your username: '
ACCEPT currpw char prompt 'Enter current password: '
ACCEPT newpw char prompt 'Enter desired password: '
PROMPT 'Connecting to SID';
CONNECT &username/&currpw@SID;
PROMPT 'Changing password...';
ALTER user &username identified by &newpw;
Here is the error checking I would like to do:

1. Make sure the connection to the database is established before continuing with the script.

2. Make sure the user doesn't enter any special characters OR NULL for their current password, new password or username.

3. Make sure the script continues with the rest of the SIDs (there are about 25) if one fails, and displays a message that the change for that SID was unsuccessful.

Also, is there a way to reference the SID as a variable?

Any help is greatly appreciated...thanks!

Chris
 
Old 08-17-2008, 09:43 AM   #2
StupidNewbie
Member
 
Registered: Dec 2007
Posts: 71

Original Poster
Rep: Reputation: 16
...anyone?? I can't find ANYTHING on Google!
 
Old 08-18-2008, 02:48 PM   #3
StupidNewbie
Member
 
Registered: Dec 2007
Posts: 71

Original Poster
Rep: Reputation: 16
One more try...anyone out there who can help with this???
 
  


Reply



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 Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
execute oracle procedure from linux script and sqlplus Stilltray Linux - Newbie 3 11-14-2008 10:35 AM
remote sqlplus connection to an oracle server saavik Linux - Networking 0 01-20-2006 03:16 AM
Running SQLPLUS after installing Oracle 8i linux_pioneer Solaris / OpenSolaris 4 08-14-2004 11:59 PM
Need to connect to db with SQLplus...or ANY oracle client.... vous Linux - Software 2 08-06-2003 04:54 AM
Sqlplus mikeshn Programming 1 07-16-2002 10:13 PM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 04:41 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration