The following bash script creates the two files with the private ip that you pass as argument and starts the listener. The old files are renamed in the same folder (just in case you want to recover them).
Check that the LISTENER_DIR variable is correct in your system.
#!/bin/bash
EXPECTED_ARGS=1
LISTENER_DIR=/u01/app/oracle/product/11.2.0/db_1/network/admin
if [ $# -ne $EXPECTED_ARGS ]
then
echo "Usage: `basename $0` {private_ip}"
exit 0
fi
cp ${LISTENER_DIR}/listener.ora ${LISTENER_DIR}/listener.ora.old
echo "LISTENER =" > ${LISTENER_DIR}/listener.ora
echo " (DESCRIPTION_LIST =" >> ${LISTENER_DIR}/listener.ora
echo " (DESCRIPTION =" >> ${LISTENER_DIR}/listener.ora
echo " (ADDRESS = (PROTOCOL = TCP)(HOST = "${1}")(PORT = 1521))" >> ${LISTENER_DIR}/listener.ora
echo " )" >> ${LISTENER_DIR}/listener.ora
echo " )" >> ${LISTENER_DIR}/listener.ora
lsnrctl start
cp ${LISTENER_DIR}/tnsnames.ora ${LISTENER_DIR}/tnsnames.ora.old
echo "ORCL =" > ${LISTENER_DIR}/tnsnames.ora
echo " (DESCRIPTION =" >> ${LISTENER_DIR}/tnsnames.ora
echo " (ADDRESS = (PROTOCOL = TCP)(HOST = "${1}")(PORT = 1521))" >> ${LISTENER_DIR}/tnsnames.ora
echo " (CONNECT_DATA =" >> ${LISTENER_DIR}/tnsnames.ora
echo " (SERVER = DEDICATED)" >> ${LISTENER_DIR}/tnsnames.ora
echo " (SERVICE_NAME = orcl)" >> ${LISTENER_DIR}/tnsnames.ora
echo " )" >> ${LISTENER_DIR}/tnsnames.ora
echo " )" >> ${LISTENER_DIR}/tnsnames.ora
Great content material and great layout. Your website deserves all of the positive feedback it’s been getting.
ReplyDeletesee this
This comment has been removed by the author.
ReplyDelete
ReplyDeleteERPTREE Offering Oracle fusion HCM online training, Oracle Fusion SCM Online Training, Oracle fusion financials online
training, Oracle fusion hcm training, Oracle fusion scm training, Oracle fusion financials training,
Oracle fusion dba online training in Hyderabad, Bangalore,Gurgon, Noida, India, Dubai, UAE, USA, Kuwait, UK, Singapore, Saudi Arabia, Canada,
Delhi, Chennai, Kolkata, Pune, Mumbai, Ahmedabad.
Oracle fusion HCM Online Training
Oracle Fusion HCM Training
This helps the readers a lot AWS Online course Hyderabad
ReplyDeleteIt was really a nice article and i was really impressed by reading this AWS Online Training
ReplyDeleteThanks for sharing great article, Hope you will post many more articles like this.
ReplyDeleteOracle Fusion Financials Online Training
Hey Really Thanks for sharing the best information regarding oracle,hope you will write more great blogs.
ReplyDeleteoracle fusion financials online training
oracle fusion financials training in hyderabad