Home  >  Article  >  Database  >  如何查看oracle数据库中的所有表

如何查看oracle数据库中的所有表

WBOY
WBOYOriginal
2016-06-07 15:19:462061browse

觉得你应该先弄清楚oracle的常规数据字典的结构,像9i里的常规数据字典中对象名称就有以USER,ALL,DBA为前缀的对象。 以USER为例,我们查该对象下有些什么表,就应该执行下列的语句: SQLselect table_name from user_tables; 类的,你可以进行替换。:) 如果

觉得你应该先弄清楚oracle的常规数据字典的结构,像9i里的常规数据字典中对象名称就有以USER,ALL,DBA为前缀的对象。
以USER为例,我们查该对象下有些什么表,就应该执行下列的语句:
SQL>select table_name from user_tables;
类似的,你可以进行替换。:)

 

如果你想查数据库中所有的表的话,可以查询
SELECT * FROM dba_tables

如果你想查询数据库中某个用户下的表的话,也可以登录这个用户,再查询:
SELECT * FROM USER_TABLES

 

要想导入外部sql语句可以用命令

sql >@e:\文件名.sql

 

如你想保存 select * from tablename;语句的结果,可以在sql*plus 里面这样:

SPOOL c:\test.sql             //这是保存文件的位置
select * from tablename;
SPOOL OFF

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn