Sunday, 24 March 2019

How to get all table names in a schema in Oracle database

Metadata of tables are maintained in USER_TABLES table.


We can get all table names in a Oracle DB by :

 SELECT TABLE_NAME FROM USER_TABLES;

To get the number of rows present in a table :

select NUM_ROWS from user_tables WHERE TABLE_NAME='<TABLE_NAME>'

We can get all information related to tables in a schema by

select * from user_tables

To get a table information : 

desc <table_name>

Name        Null?              Type         
-------      --------              -------------
TITLE   NOT NULL VARCHAR2(80) 
VALUE                      VARCHAR2(80) 
PARRENT                 VARCHAR2(80) 
URL                          VARCHAR2(400)
NAME                      VARCHAR2(80) 
ICON                        VARCHAR2(80) 
STATUS                   VARCHAR2(80) 
ID      NOT NULL    NUMBER(38) 

No comments:

Post a Comment

Thank You for your valuable comment

Difference between class level and object locking and static object lock

1) Class level locking will lock entire class, so no other thread can access any of other synchronized blocks. 2) Object locking will lo...