Yii Framework Forum: Conectar No Oracle - Yii Framework Forum

Jump to content

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

Conectar No Oracle Rate Topic: -----

#1 User is offline   Breno Mayder 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 85
  • Joined: 15-September 10
  • Location:Belo Horizonte - Brasil

Posted 04 March 2013 - 08:24 AM

Pessoal, estou tentando me conectar no Oracle pelo Yii e não estou conseguindo, o pdo_oci esta habilitado em meu PHP e conectando pelo PL SQL não tenho erro nenhum. Eu não tenho acesso ao servidor que o Oracle esta. Alguém já teve este problema que dá o erro abaixo?



CDbException

Description
CDbConnection falhou ao abrir uma conecção com o banco de dados: SQLSTATE[HY000]: pdo_oci_handle_factory: ORA-12514: TNS:listener não tem conhecimento sobre o serviço solicitado atualmente no descritor de conexão
(ext\pdo_oci\oci_driver.c:579)


Source File
D:\www\yii\framework\gii\generators\model\ModelCode.php(51)

00039: )); 00040: } 00041: 00042: public function requiredTemplates() 00043: { 00044: return array( 00045: 'model.php', 00046: ); 00047: } 00048: 00049: public function init() 00050: { 00051: if(Yii::app()->db===null) 00052: throw new CHttpException(500,'An active "db" connection is required to run this generator.'); 00053: $this->tablePrefix=Yii::app()->db->tablePrefix; 00054: parent::init(); 00055: } 00056: 00057: public function prepare() 00058: { 00059: $this->files=array(); 00060: $templatePath=$this->templatePath; 00061: 00062: if(($pos=strrpos($this->tableName,'.'))!==false) 00063: {
Stack Trace
#0 D:\www\yii\framework\db\CDbConnection.php(242): CDbConnection->open() #1 D:\www\yii\framework\db\CDbConnection.php(221): CDbConnection->setActive(true) #2 D:\www\yii\framework\base\CModule.php(363): CDbConnection->init() #3 D:\www\yii\framework\base\CModule.php(86): CModule->getComponent('db') #4 D:\www\yii\framework\gii\generators\model\ModelCode.php(51): CModule->__get('db') #5 D:\www\yii\framework\web\CFormModel.php(40): ModelCode->init() #6 D:\www\yii\framework\gii\CCodeGenerator.php(149): CFormModel->__construct() #7 D:\www\yii\framework\gii\CCodeGenerator.php(61): CCodeGenerator->prepare() #8 D:\www\yii\framework\web\actions\CInlineAction.php(50): CCodeGenerator->actionIndex() #9 D:\www\yii\framework\web\CController.php(300): CInlineAction->run() #10 D:\www\yii\framework\web\CController.php(278): CController->runAction(Object(CInlineAction)) #11 D:\www\yii\framework\web\CController.php(257): CController->runActionWithFilters(Object(CInlineAction), Array) #12 D:\www\yii\framework\web\CWebApplication.php(324): CController->run('') #13 D:\www\yii\framework\web\CWebApplication.php(121): CWebApplication->runController('gii/model') #14 D:\www\yii\framework\base\CApplication.php(135): CWebApplication->processRequest() #15 D:\www\sisouv\index.php(13): CApplication->run() #16 {main} 2013-03-04 10:15:54 Apache/2.2.21 (Win32) PHP/5.3.8 Yii Framework/1.1.4


Minha conection string esta como abaixo:

'db'=>array(
'class'=>'CDbConnection',
'connectionString'=>'oci:dbname=172.30.11.7:1521/ouvidoria;charset=UTF8',
'emulatePrepare' => true,
'username' => 'xxx',
'password' => 'xxx',

'schemaCachingDuration' => '3600',
'enableParamLogging' => true,

),
Breno Mayder
Posted Image
0

#2 User is offline   ExtremsX 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 4
  • Joined: 05-March 13

Posted 05 March 2013 - 10:23 AM

'ouvidoria' é o nome do TNS ou é o nome do banco de dados?

No exemplo do Yii:
'connectionString' => 'oci:dbname=//localhost:1521/XE',

www.yiiframework.com/wiki/99/using-yii-with-oracle-through-pdo/
0

Share this topic:


Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users