ZF-5893: Can not connect to Oracle Database with SERVICE_NAME and can't use tnsnames.ora as well
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.