Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

php and oracle: TNS:protocol adapter error

Status
Not open for further replies.

jemminger

Programmer
Jun 25, 2001
3,453
US
hi all,

i have a TNS_NAME for an oracle database like so:

$DB = <<<END
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST = 10.0.0.5)(PORT = 1521))
)
(CONNECT_DATA =
(SID = ORADEV)
(SERVER = DEDICATED)
)
)
END;

two different schemas associated with two different users:
$USER1 = "USER1";
$PASS1 = "PASS1";

$USER2 = "USER2";
$PASS2 = "PASS2";

connecting to the first schema works fine:
$conn = ociplogon($USER1, $PASS1, $DB);

however connecting to the second schema fails:
$conn = ociplogon($USER2, $PASS2, $DB);

i get the error "ORA-12560: TNS:protocol adapter error"

this is stumping me, as both schemas reside on the SAME server, using the SAME tns name!

any ideas?

-jeff
lost: one sig, last seen here.
 
What happends if you put the tns stuff into tnsnames.ora rather than localy ?
 
i'm not sure... this is my first time using oracle with php, and i didn't find any info on how to point it at my tnsnames.ora. all the examples used the method above.

i'm open to suggestions... i'm developing on WinXP + Apache, but will deploy on linux + apache.


-jeff
lost: one sig, last seen here.
 
solved: stupid human error. i was using a function to retrieve the second connection handle and forgot that the $user and $pass vars were global, and did not import from globals in the function.

-jeff
lost: one sig, last seen here.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top