Check the number of tables in the specified user table in the SQL statement of Oracle and the number of tables currently logged on to the user table.

Source: Internet
Author: User
1. Check the number of tables in the specified user table in the SQL statement of Oracle (provided by Koko)

Bytes ------------------------------------------------------------------------------------------------------------

Syntax:

Select * From dba_tables t where T. Owner = 'user id ';

Dba_tables: a dba with Permissions

User ID: Oracle user name

Demo:

SQLCode

    1. SelectCount (*)FromDba_tables tWhereT. Owner = 'Scott ';

Select count (*) from dba_tables t where T. Owner = 'Scott ';

Execution result:

Count (*)
----------
42

This 42 refers to the number of tables under the Scott user.

Bytes -------------------------------------------------------------------------------------------------------------------------

2. view the current number of login user tables (provided by butterfly)

Select table_name from user_tables

Execution result:

List table names

10 rows have been selected.

SQL code

    1. SelectCount (table_name)FromUser_tables

Select count (table_name) from user_tables

Execution result

Count (table_name)
-----------------
10

Extension:

Find all views, indexes, and stored procedures...

SQL code

    1. SelectView_nameFromUser_views
    2. SelectIndex_nameFromUser_indexs

Select view_name from user_viewsselect index_name from user_indexs

Some Syntax:

User_tables is used to store the table views assigned by users.
Dba_tables is used to store the table view assigned by the Administrator.
All_tables views of all tables stored in the database

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.