NYCPHP Meetup

NYPHP.org

[nycphp-talk] PHP Question -- SID in Oracle

Julia Sheehy jusheehy at vassar.edu
Tue Dec 4 09:56:05 EST 2007


*Gary Mort* bz-gmort at beezifies.com 
<mailto:talk%40lists.nyphp.org?Subject=%5Bnyphp-talk%5D%20PHP%20Question%20--%20SID%20in%20Oracle&In-Reply-To=475553B7.70303%40vassar.edu>

Dear Gary,

Yes.  I can  set the database name while making the connection. I use an 
include file for the connection and make a small change just  to the 
name of the SID when I want to point the whole shebang to the production 
data.

My problem is that the SID name I return in using getenv is wrong.

But you gave me a really good idea.  Instead of using the standard oci 
connection

$Ora_conn = OCILogon(DB_USER,DB_PASS,DB_NAME) or die ("Couldn't Connect 
to Oracle");


which uses the define that follows:


define('DB_NAME' , '(DESCRIPTION =

                    (ADDRESS = (PROTOCOL = TCP)(HOST = 
somemachinehere.vassar.edu)(PORT = XXXX))

                    (CONNECT_DATA = (SID = testserverX)))');

define('DB_USER','myadminuserid');

define('DB_PASS','myadminuserpassword');



I could instead use: $conn = OCILogon($dbuser, $dbpass, $dbtns);

$dbuser = 'myadminuserid';
$dbpass = 'myadminpassword';
$dbtns = 'testerverX';

and $dbtns  is a variable I can recall accurately.  This is fine as long 
as the web app can resolve the TNS on it's own (in the config)

I am playing with this and am hopeful that it will work


-------------- next part --------------
A non-text attachment was scrubbed...
Name: jusheehy.vcf
Type: text/x-vcard
Size: 474 bytes
Desc: not available
URL: <http://lists.nyphp.org/pipermail/talk/attachments/20071204/b98421ba/attachment.vcf>


More information about the talk mailing list