Jira issue originally created by user firstname.lastname@example.org:
The method getDatabase in both the PDOOracle & OCI8 drivers return the "user" param not the "dbname" as expected and defined in DBAL/Driver interface. Compare their implementation with that of the MySql driver for a proper implementation. This must have been an oversight.
Comment created by @beberlei:
But the user parameter is the "database" in oracle, the dbname is the name of the service instance.
Comment created by email@example.com:
Well to be precise, the user is the name of the schema that contains all the objects created by that user.
So you connect to a SID (dbname) as a User and anything you create resides in a schema named after your user name. You could also be granted access to another schema. I'm not sure how you intended this function to be used, but I needed to get from a Connection the SID it connected to and I assumed that getDatabse would yield that since there are already getUser, getPassword, getHost and getPort functions. Maybe this function doesn't really apply in the context of Oracle and the current implementation is better.
As to why I needed the SID:
I've been using the DBAL Migrations project and wanted to use the the postUp() function to import some database dumps I've taken with Oracle EXP and for that I need to create a connection descriptor, since this is a process that I want to automate and replicate I thought I could get the info through the connection. Maybe I'll just refactor and use the DBAL configuration values instead of asking the connection.
I say this is an oversight of us, we are not really Oracle experts and this matched our expectations compared to other vendors much better.
You can use $connection->getParams() to get to the database name.
Issue was closed with resolution "Can't Fix"