I'm trying to execute a script that starts/stops LSNRCTL, but the following error is shown:
LSNRCTL for Linux: Version 184.108.40.206.0 - Production on 27-MAR-2001 13:15:02
(c) Copyright 1998, 1999, Oracle Corporation. All rights reserved.
Message 850 not found; No message file for product=network, facility=NL
Message 866 not found; No message file for product=network, facility=NL
Message 861 not found; No message file for product=network, facility=NL
Variables like $ORACLE_HOME, $ORACLE_SID etc are assigned to 'oracle' user according to /etc/oratab, but the script has to be executed by another user (with the same or even more grants than 'oracle'). What environment variables has to be set to that user so the task can be done?
If I'm going the wrong way, how can I solve that problem?
Inside your script, call oraenv with the correct environment variables set and it will setup your environment automatically. For example:
Or, if you are running the script as root, just su to the oracle user:
su -c oracle /bin/yourscript