In my Symfony2 project at work, I would like to configure my connection in the config.yml / parameters.yml files to point to the Oracle data guard database they will install later on. Thing is, they told us: this is the connector :
jdbc:oracle:thin@(DESCRIPTION=
(ADDRESS_LIST=
(ADDRESS=(PROTOCOL=TCP)(HOST=some.primary.host)(PORT=1521))
(ADDRESS=(PROTOCOL=TCP)(HOST=some.secondary.host)(PORT=1521))
(LOAD_BALANCE=off)
(FAILOVER=on)
)
(CONNECT_DATA=
(SERVER=DEDICATED)
(SERVICE_NAME=SOMESERVICENAME))
(FAILOVER_MODE = (TYPE = SELECT)(METHOD = BASIC)(RETRIES = 120)(DELAY = 5))
)
and I can't find a way to work with this because of the 2 addresses. Our stations are on Windows 7, locally I have an Apache2.4 and PHP 5.4 with an Oracle instant client for 12c. For now, we're connecting to the current base with the usual configuraito nof Symfony2, wit hall the host: user: variables etc... in the .yml files. Our test / preprod / prod envs are all linux.
I've tried to read a lot of stuff to understand how this is working, so I went on the doctrine doc, and I also followed the link to the Oracle naming methods on it. I also read the Symfony2 doctrine config page. I can't yet post more than 2 links, sorry.
Then I found some people talking about the classes in doctrine like this one https://github.com/symfony/symfony/issues/5106 and this one http://blog.ineat-conseil.fr/2014/07/configurer-doctrine-dbal-avec-oracle/
So, what I got from all this is :
Now, I have thought about 2 things :
I've tried to give the "dbname" attribute in the .yml file the value of a service name in a tsnames.ora that I've created in a specific location, and by putting the TNS_ADMIN env variable to this location, but it didn't work (I've put it in the system vars, not the user vars).
So,maybe it's something trivial, but I'm kinda lost.
Any help would be greatly appreciated.
Cheers :)
Well, as it turns out, the solution was to put the connection string into the dbname directly :
database_host: false
and the host parameter to false :
database_name: '(DESCRIPTION=…'