- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- start listener automatically
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Discussions
Discussions
Discussions
Forums
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО05-16-2002 11:08 PM
тАО05-16-2002 11:08 PM
i want to start listener automatically when the server startup.
my dbora file is;
#!/bin/sh
# Set ORA_HOME to be equivalent to the ORACLE_HOME
# from which you wish to execute dbstart and
# dbshut
# set ORA_OWNER to the user id of the owner of the
# Oracle database in ORA_HOME
ORA_HOME=/home/oracle/r11i/proddb/8.1.6
ORA_OWNER=oracle
if [ ! -f $ORA_HOME/bin/dbstart ]
then
echo "Oracle startup: cannot start"
exit
fi
case "$1" in
'start')
# Start the Oracle databases:
# The following command assumes that the oracle login will not prompt the
# user for any values
/usr/bin/su - $ORA_OWNER -c "$ORA_HOME/bin/dbstart"
/usr/bin/su - $ORA_OWNER -c "$ORA_HOME/bin/lsnrctl start" &
;;
'stop')
# Stop the Oracle databases:
# The following command assumes that the oracle login will not prompt the
# user for any values
/usr/bin/su - $ORA_OWNER -c "$ORA_HOME/bin/lsnrctl stop" &
/usr/bin/su - $ORA_OWNER -c "$ORA_HOME/bin/dbshut"
;;
esac
db could start but not listener. i have no error messages when the server startup. in my rc.log, i get a message like this;
stty: : Not a typewriter
i have no ideas why the listner couldn't start.
please give me some advice.
my system is
HP_UX Release: B.11.00
oracle ver. 8.1.6
thank you
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО05-16-2002 11:25 PM
тАО05-16-2002 11:25 PM
Re: start listener automatically
By default when you log in as say oracle it runs the .profile in the oracle home directory. This .profile has lots of terminal commands in - stty, etc. When you su - oracle as part of the system startup or a cron job you do NOT want these terminal commands in your .profile to be run as they will screw it up. So, we copy ~oracle/.profile to ~oracle/.profile.cron and edit the .profile.cron to remove all stty commands etc. It should only contain variable declarations. Then when you need to su to oracle as part of the system startup or cron you do;
su oracle -c ". ~oracle/.profile.cron;startup.sh"
(in the example above the startup.sh script would try to start the databases and listener).
This works fine for us.
If you did su - oracle .... then it would run ~oracle/.profile which is not what you want.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО05-16-2002 11:28 PM
тАО05-16-2002 11:28 PM
Re: start listener automatically
I have a similar script to start server and listener automatically, and when it start I have the same message
stty: not a typewriter, but it start.
The two only differences are,
Oracle version: 8.1.7.x
and I don't have an & at the end of the line.
Hope this help
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО05-16-2002 11:56 PM
тАО05-16-2002 11:56 PM
Re: start listener automatically
Ruediger
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО05-17-2002 01:06 AM
тАО05-17-2002 01:06 AM
SolutionORA_HOME = $ORACLE_HOME; export ORA_HOME
than to set them both the whatever since the one could change and you would still assume that they are the same. Check that they are the same. You also haven't exported ORA_HOME.
Secondly to debug the script, execute each line manually from the command prompt and see where it goes wrong, then dig there.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО05-17-2002 03:45 AM
тАО05-17-2002 03:45 AM
Re: start listener automatically
The stty error occurs because you're using "su - oracle". This runs the .profile for oracle, which looks for stty settings. You're not running the command from a terminal, but from a script, so there's no terminal type involved and the stty message appears. It's not a problem, but if you want it to go away you could use "su oracle" instead of "su - oracle" and set up the environment variables in the script - which seems like a lot of effort for little return.
You refer to "databases". Do you have multiple listeners? e.g.
if [ ${ORACLE_START} -eq 1 ]
then
echo "Starting Oracle"
su - oracle -c dbstart
su - oracle -c "lsnrctl start listener_AAAA"
su - oracle -c "lsnrctl start listener_BBBB"
su - oracle -c "lsnrctl start listener_CCCC"
su - oracle -c "lsnrctl start listener_DDDD"
su - oracle -c "lsnrctl start listener_EEEE"
su - oracle -c "lsnrctl start listener_FFFF"
su - oracle -c "lsnrctl start listener_GGGG"
su - oracle -c "lsnrctl dbsnmp_start"
set_return
else
rval=2
fi
What's in your listener.ora?
Jon
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО05-18-2002 08:13 AM
тАО05-18-2002 08:13 AM
Re: start listener automatically
To solve this problem on our systems, we add a "wrapper" in the .profile around the stty commands to check for a terminal.
For example:
#If interactive, then run all the sttys
if [ -t 0 ]
then
stty erase "^H" kill "^U" intr "^C" eof "^D"
stty hupcl ixon ixoff
tabs
fi
cheers,
John
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО05-20-2002 07:25 AM
тАО05-20-2002 07:25 AM
Re: start listener automatically
/sbin/init.d/listener startup scripts. they are linked to run in runstate 3.
Remember that you need a
file named /etc/rc.config.d/oracle that cantains the following line.
"ORACLE_START=1"
To manually stop oracle.
/sbin/init.d/oracle stop
/sbin/init.d/listener start
To manually start oracle
/sbin/init.d/listener start
/sbin/init.d/oracle start.
As you can tell these are the standard start\stop scripts used during system reboot.
If you don't want to issue the four lines to bounce oracle. write a script to execute the four commands.
Ror
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО05-20-2002 07:49 AM
тАО05-20-2002 07:49 AM
Re: start listener automatically
We are starting the listener only and not starting the oracle database. But if you want you can add the oracle startup to this file. Attached is the oracle/listener startup file from /sbin/init.d. also the config file /etc/rc.config.d/oracle is typed below,
ORACLE_START=1
export ORACLE_START
The /sbin/init.d/oracle file is linked to /sbin/rc2.d/S990oracle and /sbin/rc1.d/K010oracle
cd /sbin/rc2.d
ln -s /sbin/init.d/oracle S990oracle
cd /sbin/rc1.d
ln -s /sbin/init.d/oracle K010oracle
Hope this helps.
Regds
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО05-20-2002 11:39 PM
тАО05-20-2002 11:39 PM
Re: start listener automatically
ORA-12505:TNS:listener could not resolve SID given in correct descriptor
i used 'lsnrctl start SID' always when startup lisnter manually so i tried modify dbora script in the same way.
however i'm not sure if it's the right way. here is an attachment of my dbora script. if someone knows better way, tell me.