Details
-
Type:
Bug
-
Status:
Open
-
Priority:
N/A
-
Resolution: Unresolved
-
Affects Version/s: None
-
Fix Version/s: None
-
Component/s: Zend_Db_Adapter_Oracle
-
Labels:None
-
Tags:
Description
I am using zend core version 2.5.2 and attempting to connect to Oracle 10g database. I used following code to set up the details
$config = new Zend_Config(
array(
'database' => array(
'adapter' => 'pdo_oci',
'params' => array('host'=> 'host1, 'port'=>'1521','dbname'=> 'DEV','username' => 'dev','password' => 'pwd')
)
)
);
$db = Zend_Db::factory($config->database);
Zend_Db_Table::setDefaultAdapter($db);
I keep getting ORA-12505: TNS:listener does not currently know of SID given in connect descriptor (ext\pdo_oci\oci_driver.c:581)' for this.
The database is expecting SERVICE_NAME instead of SID. And for this reason I can't seem to connect to the database.
I tried putting TNS_ADMIN in environment variable and assign tnsnames.ora entry to dbname. Then I get illegal address parameter error. I could connect to the databases which can accept SID parameter. But since this is clustered database, it expects service_name.
Any help is appreciated. I am running out of ideas.
I changed:
../library/Zend/Db/Adapter/Pdo/Oci.php
line 89: replaced SID with SERVICE_NAME
It is working fine now.