Join the OracleApps88 Telegram group @OracleApps88to get more information on Oracle EBS R12/Oracle Fusion applications.

If you are facing any issues while copying the Code/Script or any issues with Posts, Please send a mail to OracleApp88@Yahoo.com or message me at @apps88 or +91 905 957 4321 in telegram.

Thursday, September 29, 2011

It will create/update the file tnsnames.ora and it will create a test page that will try to connect the Oracle DB

This script will take in input the function names associated to each form personalization, will download the *.ldt files and will create the installation script to be executed on the server where the personalization should be installed.
The parameters that the script requires in input are:
- RFC NUMBER: is the Request For Change ID to be written in the installation script (can be blank)
- RFC TITLE: is the Request For Change Title to be written in the installation script (can be blank)
- RFC DEVELOPER: is the person in charge of the form personalization (can be blank)
- FILE VERSION: is the version of the installation script (can be blank)
- APPS PASSWORD: is required to download the for personalization
- FUNCTION NAMES: are required to identify the form personalization to be downloaded

# It will create/update the file tnsnames.ora and it will create a test page that will try to connect the Oracle DB.

# 1. You need to be logged as root

mkdir -p /opt/oracle/tns
cd /opt/oracle/tns

echo "This script will configure tnsnames.ora"
echo "Please write the following information.";
echo -n "ORACLE SID (SIDDB): "
read sid
echo -n "ORACLE SERVER IP ADDRESS (10.9.1.1): "
read server
echo -n "ORACLE SERVER PORT (1521): "
read port
echo -n "ORACLE DB USERNAME (ex. RAC_ACCNT): "
read oracle_user
echo -n "ORACLE DB PASSWORD: "
read oracle_password

echo "";
echo "This information will be now written on the file /opt/oracle/tnsnames.ora"
echo "If the information you typed are wrong the connection to Oracle wont work"
echo -n "Do you want to save the information you typed? (y/n): "

read confirm
case $confirm in yes|Yes|YES|y|Y)
echo "$sid =" >> tnsnames.ora
echo " (DESCRIPTION =" >> tnsnames.ora
echo " (ADDRESS_LIST =" >> tnsnames.ora
echo " (ADDRESS = (PROTOCOL = TCP)(HOST = $server)(PORT = $port))" >> tnsnames.ora
echo " )" >> tnsnames.ora
echo " (CONNECT_DATA =" >> tnsnames.ora
echo " (SID = $sid)" >> tnsnames.ora
echo " )" >> tnsnames.ora
echo " )" >> tnsnames.ora
echo "" >> tnsnames.ora

cd /var/www
rm -f test.php

echo "> test.php
echo "\$odbc = ocilogon($oracle_user, $oracle_password, $sid) or die( 'Could not connect the Oracle database!');" >> test.php
echo "if (\$odbc == false)" >> test.php
echo "{\$msg = OCIError(\$odbc);}" >> test.php
echo "else" >> test.php
echo "{echo 'Your Oracle Connection is working properly!';}" >> test.php
echo "?>" >> test.php

/etc/init.d/apache2 restart

echo ""
echo "You can now try to connect the page http://your_ip_address/test.php"
echo "If everything went fine you would be able to connect the Oracle DB you defined"
echo "If something went wrong you can delete maually the connections from the file /opt/oracle/tns/tnsnames.ora"
;;
esac

No comments:

Post a Comment

If you are facing any issues while copying the Code/Script or any issues with Posts, Please send a mail to OracleApp88@Yahoo.com or message me at @apps88 or +91 905 957 4321 in telegram.
Best Blogger TipsGet Flower Effect