Batch table creation using batch files in Oracle

Source: Internet
Author: User
In Oracle, creating tables in batches using batch files is assumed that many tables need to be created. One of the table creation statements is saved in the file create_table1. SQL, the content of which is as follows: droptabletable1; createtabletable1 (NAMEVARCHAR2 (100) NOTNULL, IDNUMBER (6) tablespaceTS_DATA1; then you only need

In Oracle, creating tables in batches using batch files is assumed that many tables need to be created. One of the table creation statements is saved in the file create_table1. SQL, with the following content: drop table table1; create table table1 (NAME VARCHAR2 (100) not null, id number (6) tablespace TS_DATA1; then you only need

Batch table creation using batch files in Oracle

Assume that you need to create many tables. One of the table creation statements is saved in the file "create_table1. SQL". The content is as follows:

Drop table table1;

Create table table1 (

NAME VARCHAR2 (100) not null,

Id number (6)

)

Tablespace TS_DATA1;

Then you only need to create two files: run. SQL and run. bat.

Run. SQL ):

@ Create_table1. SQL

@ Create_table2. SQL;

@ Create_index1. SQL;

............

The content of run. bat is as follows:

Sqlplus username/password @ dbname Sqlplus. log

Note: Change the items in "username/password @ dbname" to the relevant logon information of your database.

Double-click the bat file to execute all the table creation files.

PS: The environment variable % oracle_home %; % oracle_home %/bin should be added in advance.

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.