How to query the following tables of Oracle users: 1. Use the "select * from all_tab_comments" statement to query the tables of all users; 2. Use the "select * from user_tab_comments" statement to query the tables of this user.
The operating environment of this tutorial: Windows 10 system, Oracle 11g version, Dell G3 computer.
How to query the tables under the oracle user
There are three views under ORACLE
select table_name from user_tables; //当前用户拥有的表 select table_name from all_tables; //所有用户的表 select table_name from dba_tables; //包括系统表 select table_name from dba_tables where owner='用户名'
Similarly, in addition to tables, there are There are views, stored procedures, synonyms and other objects. Use [DBA|USER|ALL]_TABLES to view the objects you want
Extended information:
When the view is created, ORACLE will verify the validity of the view. If the basic table is modified, it will cause the view to be in an invalid state. You can query the status of user_objects in the data dictionary.
1. Create table T, Contains two columns, ID and NAME;
2. Use the table to create a view t_view to view all the information of the table;
3. Use the table to create a view t_view2 to view the ID of the table and NAME column
4. Check the status of the view;
5. Add a gender column to table T and recheck the status of the view t_view.
6 , Delete column NAME on table T, and recheck the status of view t_view2.
Note: VALID indicates normal status, invalid indicates abnormal status
Recommended tutorial: "Oracle Tutorial》
The above is the detailed content of How to query tables under oracle user. For more information, please follow other related articles on the PHP Chinese website!