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