Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to use PLSQL to export database storage table structure information

2025-02-24 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >

Share

Shulou(Shulou.com)06/01 Report--

Introduction to how to use PLSQL to export the table structure, do not log in to the data inventory, directly use the plsql tool to export the table structure of the specified table? Now I will introduce how to export. 1: how to Tools after plsql

-- > Exports User Ojbects

-- > > Select the table,squence,view,type,function,procedure,trigger to be exported.

-- > > Select User

-- > > check Include storege or uncheck (include storege means tablespace)

-- > > Select the directory where the exported files are stored

-- > > Export button export

2: let's explain the difference between Include Storage check and uncheck.

1) uncheck the exported sql as follows:

Create table TRAVELSKY_XREZAGENT.AUDIT_TRAIL (product VARCHAR2 (32 CHAR) not null, environment VARCHAR2 (32 CHAR) not null, server VARCHAR2 (32 CHAR) not null, resource_path VARCHAR2 (256 CHAR) not null, action VARCHAR2 (4 CHAR) not null, username VARCHAR2 (32 CHAR) not null, usergroup VARCHAR2 (32 CHAR) not null, address VARCHAR2 (32 CHAR) not null, timestamp DATE default TO_DATE 'YY-MM-DD HH24:MI:SS') not null, status VARCHAR2 (16 CHAR), data NCLOB)

2) after checking, the exported sql is as follows, plus the tablespace to which table belongs and the available tablespace restrictions

Create table TRAVELSKY_XREZAGENT.AUDIT_TRAIL (product VARCHAR2 (32 CHAR) not null, environment VARCHAR2 (32 CHAR) not null, server VARCHAR2 (32 CHAR) not null, resource_path VARCHAR2 (256 CHAR) not null, action VARCHAR2 (4 CHAR) not null, username VARCHAR2 (32 CHAR) not null, usergroup VARCHAR2 (32 CHAR) not null, address VARCHAR2 (32 CHAR) not null, timestamp DATE default TO_DATE 'YY-MM-DD HH24:MI:SS') not null, status VARCHAR2 (16 CHAR), data NCLOB) tablespace OPENJAW_DATA pctfree 10 initrans 1 maxtrans 255 3: let's explain the difference between Include User check and uncheck.

1) uncheck Include User

Create table AUDIT_TRAIL (product VARCHAR2 (32 CHAR) not null, environment VARCHAR2 (32 CHAR) not null, server VARCHAR2 (32 CHAR) not null, resource_path VARCHAR2 (256 CHAR) not null, action VARCHAR2 (4 CHAR) not null, username VARCHAR2 (32 CHAR) not null, usergroup VARCHAR2 (32 CHAR) not null, address VARCHAR2 (32 CHAR) not null, timestamp DATE default TO_DATE 'YY-MM-DD HH24:MI:SS') not null, status VARCHAR2 (16 CHAR), data NCLOB)

2) if Include User is selected, the name of User will be added before the tablename of create table tablename, and a TRAVELSKY_XREZAGENT will be added as follows

Create table TRAVELSKY_XREZAGENT.AUDIT_TRAIL (product VARCHAR2 (32 CHAR) not null, environment VARCHAR2 (32 CHAR) not null, server VARCHAR2 (32 CHAR) not null, resource_path VARCHAR2 (256 CHAR) not null, action VARCHAR2 (4 CHAR) not null, username VARCHAR2 (32 CHAR) not null, usergroup VARCHAR2 (32 CHAR) not null, address VARCHAR2 (32 CHAR) not null, timestamp DATE default TO_DATE 'YY-MM-DD HH24:MI:SS') not null, status VARCHAR2 (16 CHAR), data NCLOB)

The original text is from: https://www.linuxprobe.com/plsql-dc-bijg.html

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Database

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report