Oracle: How to Create a table with tens of thousands of data through a system table

Source: Internet
Author: User

It has never been known that whether it is Oracle's default database orcl or a self-created database, there will be a system table, there will be data in the system table, and some data Reaches thousands of rows, tens of thousands of rows. If you can use the data, you can create tables for test data and the data volume is large. Thank you for guiding me today. Hey

The specific operations are as follows:

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

The original create table a as select * from B; can create a table that is the same as B, but the created table a has only the structure of the table, but does not have the default value of table B, so in reality it seems so bad.

Step 1

First, create an empty table with only the table structure but no data loaded.

Create table big_table as selecet * from dba_objects where 1 = 2;

Step 2

Execute a pl/SQL statement and add the data in a loop for 10 times. The data in big_table is tens of thousands... Hey

Begin

For I in 1 .. 10

Loop

Insert into big_table select * from dba_objects;

End loop;

End;

In this way, we can get a table with a very large data volume. However, all the loaded data is repetitive. If this is the case, create table big_table as select... the tables created in this way do not have any primary keys and are not restricted. Even if the original table exists, duplicate data can be loaded, which is rarely used in practice.

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.