Originally Posted by rohit724
I am new Linux .. Please someone help me. I need to provide sudo access to Oracle User, run only this particular "SRVCTL" command.
Do I need to edit "sudoers" file .if so where do I need to add these two lines in sudoers file.
Sorry if I am confusing, someone please help me
Well, if you want to modify how SUDO behaves, you obviously have to modify the sudoer's file.
First, you need to be root to run "visudo". Do NOT just edit the sudoers file manually...while you CAN do it, the permissions and other things you have to set on the file afterwards can be tricky, and render sudo unusable if you get it wrong. Visudo is much easier.
Add a line similar to this:
oracle ALL= /apps/opt/grid/bin/srvctl, /apps/opt/oracle/product/11.2.0/db_1/bin/srvctl
So those commands are the ONLY thing the oracle user can run as root. They would run it with "sudo /apps/opt/grid/bin/srvctl". There are many man pages and examples you can find on Google.