How to view the table structure in Oracle

Source: Internet
Author: User

1. DESCRIBE command

The usage is as follows:

SQL> describe nchar_tst (nchar_tst indicates the table name)

The result is as follows:

Is the name empty? Type
-----------------------------------------------------------------------------
Name nchar (6)
ADDR NVARCHAR2 (16)
Sal number (9, 2)
2. DBMS_METADATA.GET_DDL package

The usage is as follows:

SQL> SELECT DBMS_METADATA.GET_DDL ('table', 'nchar _ tst') FROM DUAL;

If the displayed results are incomplete, as shown below:

Create table "SCOTT". "NCHAR_TST"
("NAME" NCHAR (6 ),
"ADDR" NVARCHAR2 (16

The modification is as follows:

SQL> SET LONG 9999

SQL> SELECT DBMS_METADATA.GET_DDL ('table', 'nchar _ tst') FROM DUAL;

The following result is displayed:

DBMS_METADATA.GET_DDL ('table', 'nchar _ tst ')
------------------------------------------------------------------------------

Create table "SCOTT". "NCHAR_TST"
("NAME" NCHAR (6 ),
"ADDR" NVARCHAR2 (16 ),
"SAL" NUMBER (9, 2)
) PCTFREE 10 PCTUSED 40 INITRANS 1 MAXTRANS 255 LOGGING
STORAGE (INITIAL 12288 NEXT 12288 MINEXTENTS 1 MAXEXTENTS 249 PCTINCREASE 50
FREELISTS 1 freelist groups 1 BUFFER_POOL DEFAULT) TABLESPACE "SYSTEM"

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.