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.