- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Re: starting listener running on remote server us...
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
Forums
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
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
тАО06-25-2004 02:41 AM
тАО06-25-2004 02:41 AM
remsh ${PRODUCTION_NODE} -n "su - oracle -c 'lsnrctl start'" >>${LOGFILE} 2>& 1
Now however it just hangs and we have to kill off the remsh to continue the script.According to Oracle this should never have worked but it did !!
Anyone had similar problems and have cured them or does anyone have any other ways of starting a listener on a remote server from within a script
We are running Oracle 8.1.7
Any help appreciated
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО06-25-2004 02:57 AM
тАО06-25-2004 02:57 AM
Re: starting listener running on remote server using script
A beeter solution is to use remsh to invoke a script on the remote host which sets and exports all the needed environment variables and then executes lsnrctl.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО06-25-2004 03:27 AM
тАО06-25-2004 03:27 AM
Re: starting listener running on remote server using script
Do you happen to know what variables are needed in order to start the listener.
I know I need PATH to the bin dir but what others do I need to putin the script
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО06-25-2004 03:38 AM
тАО06-25-2004 03:38 AM
Re: starting listener running on remote server using script
Oracle upgrade? you need to check with the dba's and find out what changed...
Try it manually.
remsh PROD
su - oracle
Does that work?
what about 'lsnrctl start'?
Ask them the correct command to start the listener...
Rgds...Geoff
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО06-25-2004 03:45 AM - last edited on тАО09-16-2024 02:26 AM by support_s
тАО06-25-2004 03:45 AM - last edited on тАО09-16-2024 02:26 AM by support_s
Re: starting listener running on remote server using script
- Tags:
- Port
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО06-25-2004 04:02 AM
тАО06-25-2004 04:02 AM
Re: starting listener running on remote server using script
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО06-25-2004 04:55 AM
тАО06-25-2004 04:55 AM
Re: starting listener running on remote server using script
ORACLE_BASE=/u01/app/oracle
ORACLE_HOME=${ORACLE_BASE}/product/8.1.7
TNS_ADMIN=${ORACLE_HOME}/network/admin
export ORACLE_BASE ORACLE_HOME TNS_ADMIN
You may need to export others such as ORACLE_SID or TWO_TASK
I tend to put these commands in a script such as /usr/local/bin/oraenv.sh but make sure that this script contains no exit or return statements
Then both oracle's .profile AND any other batch scripts souce this file using the shell's "." dot operator so that the file is sourced.
e.g.
. /usr/local/bin/oraenv.sh
Now oracle's .profile and everything else "zig" together and any changes can be made in one file.
Plan B.
Surround all interactive commands in oracle's .profile with
if [ -t 0 ]
then
stty ...
tset ...
tabs
fi
so that they are only executed if stdin (-t 0) is a tty device.
I find the common sourced file to be a more elegant approach.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО06-25-2004 04:57 AM
тАО06-25-2004 04:57 AM
Re: starting listener running on remote server using script
remsh ${PRODUCTION_NODE} -n "su - oracle -c 'lsnrctl start &'" >>${LOGFILE} 2>& 1
Do all remsh's hang?
remsh ${PRODUCTION_NODE} date
Rgds...Geoff
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО06-25-2004 05:36 AM
тАО06-25-2004 05:36 AM
Re: starting listener running on remote server using script
1. Why not write a script to do this, and call it directly with a su oracle "script" rather than trying to run the lsnrctl directly?
2. Why not just write a monitoring script to run on the system under the oracle cron that would check and see if the listener is available, and starting it as needed?
Thanks,
Brian
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО06-27-2004 08:48 PM
тАО06-27-2004 08:48 PM
Re: starting listener running on remote server using script
the starting of the listener is part of a script that is runing a database refresh using BCVs
so basic order of events are :
bcv establish
shut prod database and listener
bcv split
restart prod database and listener
import bcv
mount filesystems
the script runs on the DR server and does remsh to prod server to do database shutdown and restart.
The only remsh that hangs is the one that restarts the listener so script does not continue to import bcvs,etc to the DR server. Once we kill the listener remsh it will continue and complete ok.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО06-28-2004 12:58 AM
тАО06-28-2004 12:58 AM
Re: starting listener running on remote server using script
We do something similiar for our backups. bcv splitting and mounting on backup server.
Rgds...Geoff
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО06-28-2004 01:04 AM
тАО06-28-2004 01:04 AM
Re: starting listener running on remote server using script
as per suggestions I have created a script on the prod server that the DR server invokes
To test it I used lsnrctl status - this worked using both
su - oracle -c "lsnrctl status"
and adding oracle variables to begining of script and running su oracle -c "lsnrctl status"
So the feeling here is that it is an issue with running lsnrctl start - got a run of the script coming up this weekend and have gone for the adding variables to script and running su oracle -c lsnrctl start
Will let you know if this makes a difference
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО06-28-2004 04:44 AM
тАО06-28-2004 04:44 AM
Re: starting listener running on remote server using script
"remsh or rexec may appear hung when you execute certain remote commands, because it waits for the remote command to finish before exiting. This behavior can be changed by adding the -m option to the remsh and rexec lines in /etc/inetd.conf."
You could try to add -m option to remsh line in inetd.conf, restart inetd and try an unmodified version of your script.
Hope this helps,
Fred
"Reality is just a point of view." (P. K. D.)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО06-28-2004 09:37 AM
тАО06-28-2004 09:37 AM
Re: starting listener running on remote server using script
Thanks,
Brian
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО07-04-2004 09:30 PM
тАО07-04-2004 09:30 PM
Re: starting listener running on remote server using script
I attach a copy of the script we are using the
first part runs on DR server and invokes second part on Prod server,we will try the -m option on rexec/rlogin this coming weekend but in case there is something that we have missed in the scripts would appreciate any ideas/help
Thanks
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО07-05-2004 12:37 AM
тАО07-05-2004 12:37 AM
Re: starting listener running on remote server using script
Sorry i am from the beginning,
Did a normal remsh work properly
Did the lsnrctl start work from the local server.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО07-05-2004 12:42 AM
тАО07-05-2004 12:42 AM
Solutionremsh ${PRODUCTION_NODE} -n "/bin/su - oracle -c 'lsnrctl start listenerPROD'" | tee ${LOGFILE} >/dev/null 2>&1
Better yet, why not like this:
remsh ${PRODUCTION_NODE} -l oracle -n "lsnrctl start listenerPROD" | tee ${LOGFILE} >/dev/null 2>&1
Rgds...Geoff
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО07-05-2004 01:09 AM
тАО07-05-2004 01:09 AM
Re: starting listener running on remote server using script
The listener starts ok on the prod server it just does not return to the script on the DR server so the DR server script just hangs until we kill the remsh process that is starting the listener up.
Once that is done the script continues on the DR server completing ok
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО07-05-2004 07:06 AM
тАО07-05-2004 07:06 AM
Re: starting listener running on remote server using script
so then do not care about the listener. It has absolutly nothing to do with the datafiles, so to get a consistent copy, it is not needed to stop the listener.
Just shut down the database, do the split and let the listener up and running.
Beside this, to do the login as oracle user as Geoff suggested would be best.
Keep in mind, that you do not need to use any shell at all to re-cycle the listener, since the listener can be controlled remotely (if it is up and runnning) without any shell access .
"lsnrctl" and a proper listener.ora is all you need on a client which should control the target listener [This is why you should configure a password for the listener(!)].
So the last way out would be to do the copy via remsh and re-cycle the listener via network without the shell in case you just want to bounce the listener for whatever reason.
Hope this helps
Volker