Select Database details and table names in iSQL plus

。_饼干妹妹 提交于 2019-12-13 00:44:00

问题


I used the answer of the question found here to get the database name using this command select ora_database_name from dual;. and below is a screen shot of the result. But how to get the details of this database found in the screenshot and its list of tables?


回答1:


You can find most details of the database and the client using the queries against metadata tables or USERENV variables.

For example:

select * from global_name; -- will give you the name

select * from v$version; -- will give you the oracle version and other details. 

Oracle Database 11g Enterprise Edition Release 11.2.0.2.0 - 64bit Production
PL/SQL Release 11.2.0.2.0 - Production
"CORE   11.2.0.2.0  Production"
TNS for Linux: Version 11.2.0.2.0 - Production
NLSRTL Version 11.2.0.2.0 - Production

For details about the objects, you can query oracle's data dictionary tables. If you need list of tables, you could use user_tables (tables owned by current user), all_tables (tables that are accessible to the current user) or dba_tables (all tables in the database).

select * from dba_tables where owner = 'SYS';

SYS TMP_F_FREQ_BKP  SYSTEM
SYS OLAP_CUBE_BUILD_PROCESSES$  SYSTEM
SYS TRUSTED_LIST$   SYSTEM
SYS WRH$_PERSISTENT_QMN_CACHE   SYSAUX
.....

http://docs.oracle.com/cd/B28359_01/server.111/b28310/tables014.htm#ADMIN01508



来源:https://stackoverflow.com/questions/27627742/select-database-details-and-table-names-in-isql-plus

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!