When you create a DB in RDS you give it a name (specifically "DB Identifier"). Is there a way to query in SQL from a given instance and get that DB Identifier?
When you create a DB in RDS you give it a name (specifically "DB Identifier"). Is there a way to query in SQL from a given instance and get that DB Identifier?
Try the SYS_CONTEXT() function -- it can return all sorts of interesting things, including the DB Name:
select sys_context('USERENV', 'DB_NAME') from dual;
See the documentation for all the other values that can be used for the second parameter. This is a funciton that can be called both from a SQL query as above, or from PL/SQL.