in reply to Re^2: [OT] Get the database name in Oracle
in thread [OT] Get the database name in Oracle

Well, in this context dbname isn't the name of your database, but a tnsname (which may be in a local tnsnames.ora file, your Oracle Names server or on an LDAP server). In other words the tnsname is a shorthand descriptor for the connection parameters to your database (including protocol, host or ip address, etc) It *may* (and usually does) have tha same name as your database, but this isn't required

If all you want to do is get your connect name, it should be in $dbh->{Name} (I don't have ready access to Oracle at the moment, but I tested that it works for MySQL). Otherwise, get your DBA to give you access to v$database, and you can query the real db name from there.

  • Comment on Re^3: [OT] Get the database name in Oracle