cancel
Showing results for 
Search instead for 
Did you mean: 

Ownership

SOLVED
Go to solution
Jennifer Chiarelli
Regular Advisor

Ownership

During startup I have a script I created in /sbin/rc3.d that will start a database. The database starts with root as the owner and this is not acceptable. How can I change the ownership during a system startup script?
None of my shell script books talk about this.
It's a binary world!
3 REPLIES
RikTytgat
Honored Contributor
Solution

Re: Ownership

Hi,

Because your startup script run as root, you can use the 'su' command to 'substitute user'.

Your startup script could contain for example following line:

su - oracle -c
See the su manpage for more details.

Hope this helps,
Rik.
Deshpande Prashant
Honored Contributor

Re: Ownership

HI
Add following lines in your start up script.
su - oracle -c 'lsnrctl start'
su - oracle -c 'dbstart'

similar for shutdown

su - oracle -c 'lsnrctl stop'
su - oracle -c 'dbshut'

Cheers.

Prashant
Take it as it comes.
Jim Mulshine
Frequent Advisor

Re: Ownership

I find it useful to also modify the $ORACLE_HOME/bin/dbshut script to perform "shutdown immediate" instead of only "shutdown". Otherwise you may be waiting a long time for all your database users to log out.