To create a database using batch processing in DB2

Source: Internet
Author: User
Tags command line db2 db2 connect db2 connect to connect create database linux

On Linux operating systems, each instance must correspond to a Linux user, so the conversion of 2 instances can be simple by converting the user

Implementation, using the SU command.

Scripting: Create_table.bat

DB2 Drop DB Express2

Set Dbpath=c:
SET Dbname=express2

SET memory=20

DB2 CREATE DATABASE%dbname% on%dbpath% autoconfigure USING mem_percent APPLY DB

and DBM

DB2 CONNECT to% dbname% USER%1 USING%2

Del Schema.log Triggers.log App_objeects.log

DB2 Set Schema Express
Db2-t-v-f schema.ddl-z Schema.log
db2-td@-v-f triggers.ddl-z Triggers.log
db2-td@-v-f app_objects.ddl-z App_objects.log

---------------------------------- ---------------------------------

C:/express>create_database.bat XUJM JAMINWM

C:/EXPRESS>DB2 Drop DB Express2
SQL1013N could not find the database alias or database name "EXPRESS2". sqlstate=42705

C:/express>set Dbpath=c:

C:/express>set Dbname=express2

C:/express>set memory=20

C:/EXPRESS>DB2 CREATE DATABASE express2 on c:autoconfigure USING mem_percent 2
APPLY DB and DBM
The sql1047n application is already connected to another database.

C:/EXPRESS>DB2 CONNECT to Express2 USER xujm USING JAMINWM
SQL1013N could not find the database alias or database name "EXPRESS2". sqlstate=42705

C:/express>del Schema.log Triggers.log App_objeects.log
I can't find C:/express/schema.log.

C:/EXPRESS>DB2 Set Schema Express
db21034e This command is treated as an SQL statement because it is an invalid command line processor command. In
During SQL processing, it returns:
SQL1024N No database connection exists. sqlstate=08003

C:/express>db2-t-v-f schema.ddl-z Schema.log
An error occurred while db21005e was accessing the "Schema.ddl" file.


c:/express>db2-td@-v-f triggers.ddl-z Triggers.log
An error occurred while db21005e was accessing the "Triggers.ddl" file.


c:/express>db2-td@-v-f app_objects.ddl-z App_objects.log
An error occurred while db21005e was accessing the "App_objects.ddl" file.


C:/express>create_database.bat XUJM JAMINWM

C:/EXPRESS>DB2 Drop DB Express2
SQL1013N could not find the database alias or database name "EXPRESS2". sqlstate=42705

C:/express>set Dbpath=c:

C:/express>set Dbname=express2

C:/express>set memory=20

C:/EXPRESS>DB2 CREATE DATABASE express2 on c:autoconfigure USING mem_percent 2
APPLY DB and DBM

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.