Shell Script to validate the access for Servers

Hi Experts,

Please advise to Write a Shell script,

  1. To check , whether the user has access to UNIX PRODUCTION server or not?
  2. If no, then need to provide the access to UNIX PRODUCTION server and then need to provide access to print only few FILES.
  3. After connecting to ther server, again need to check wheter the user is having access to Oracle PRODUCTION Database or not?
  4. If no then need to provide the access/grants to Oracle PRODUCTION Database and provide the grants to SQL Loader and specific PROCEDURES/FUNCTIONS.
  5. Need to create a LOG for this entire process
    Eg:
    [list=1]
  6. Whom we are giving access
  7. Database Name :
  8. Unix Server Name :
  9. Date :
  10. User Login Time :
  11. User Logoff time :
    etc ::
    [/list]

Thanks,
Vasu

Hello vasuvv,

I have a few to questions pose in response first:-

  • What have you tried so far?
  • What output/errors do you get?
  • What OS and version are you using?
  • What are your preferred tools? (C, shell, perl, awk, etc.)
  • What logical process have you considered? (to help steer us to follow what you are trying to achieve)

Most importantly, What have you tried so far?

There are probably many ways to achieve most tasks, so giving us an idea of your style and thoughts will help us guide you to an answer most suitable to you so you can adjust it to suit your needs in future.

We're all here to learn and getting the relevant information will help us all.

Kind regards,
Robin

Robin,

After reviewing many threads Here I have written the script to connect to database. With this I can see am able to connect to Datase by giving my credentilas.

#!/bin/ksh
sqlplus -s userID/password@DB_INSTANCE @Test.sql & 
sqlplus -s  userID/password@DB_INSTANCE << EOF
exit
EOF

But not sure whether that specific user has access for the expected servers. So suggestions from you..

Experts,

It would be great if someone can advise..

Thanks,
Vas

If you are unable to answer the questions that Robin asked in post #2 in this thread, there is little chance that you will get much help. We depend on the information you provide to get the information we need to be able to help you.

Don,

Please find below for Robin's queries

What have you tried so far?
--Have posted the code which will to connect to Database or not.
What output/errors do you get?
-- Was not able to write any other scripts apart from the posted one.

What OS and version are you using?

--Am using UNIX OS

What are your preferred tools? (C, shell, perl, awk, etc.)

-- SHELL

Thanks
Vasu