Create a DB2 tablespace in windows

Source: Internet
Author: User

The following describes how to create a DB2 tablespace in windows. If you are interested in creating a DB2 tablespace, take a look.

 
 
  1. db2set db2codepage=819 
  2. db2 create database test03   
  3. db2 connect to test03 user db2amdin using 1  
  4. db2 CREATE Bufferpool USER8 SIZE 100000 PAGESIZE 8K   
  5. db2 CREATE Bufferpool USER16 SIZE 1000 PAGESIZE 16 K   
  6. db2 CREATE Bufferpool USER32 SIZE 1000 PAGESIZE 32 K   
  7. db2stop force   
  8. db2start  
  9. db2 connect to test03 user easymis using easymis  
  10. db2 "CREATE REGULAR TABLESPACE TS_USER8 PAGESIZE 8K MANAGED BY SYSTEM USING ('FSMS_8K_1') BUFFERPOOL USER8"  
  11. db2 "CREATE REGULAR TABLESPACE TS_USER16 PAGESIZE 16K MANAGED BY SYSTEM USING ('FSMS_16K_1') BUFFERPOOL USER16"  
  12. db2 "CREATE REGULAR TABLESPACE TS_USER32 PAGESIZE 32K MANAGED BY SYSTEM USING ('FSMS_32K_1') BUFFERPOOL USER32"  
  13. db2 GRANT   DBADM,CREATETAB,BINDADD,CONNECT ON DATABASE   TO USER EASYMIS  
  14. db2 GRANT   DBADM,CREATETAB,BINDADD,CONNECT,LOAD ON DATABASE   TO USER EASYMIS  
  15. db2 connect to test03 user easymis using easymis  
  16. db2 -f dbstruct.sql >kk.log 

Use the configuration assistant to add odbc and cli commands and configure the user password.
Use odbctool to load data to the database at a time.
Configure jdbc connection
You can use jcc directly.

 
 
  1. <property name="dialect">org.hibernate.dialect.DB2Dialect</property> 
  2. <property name="connection.driver_class">com.ibm.db2.jcc.DB2Driver</property> 
  3. <property name="connection.username">easymis</property> 
  4. <property name="connection.password">1</property> 
  5. <property name="connection.url">jdbc:db2://192.168.20.249:50000/test03</property> 

If the app format is used, modify db2java.zip to db2java. jar.

 
 
  1. db2jdbcbind -url jdbc:db2://192.168.20.249:50000/test03 -user easymis -password 1   
  2.      <property name="dialect">net.sf.hibernate.dialect.DB2Dialect</property> 
  3.      <property name="connection.driver_class">COM.ibm.db2.jdbc.app.DB2Driver</property> 
  4.      <property name="connection.username">easymis</property> 
  5.      <property name="connection.password">1</property> 
  6.      <property name="connection.url">jdbc:db2:test03</property> 

The preceding section describes how to create a DB2 tablespace in windows.

DB2 tablespace Classification

Implementation of DB2 string connection

DB2 update statements for records in the same table

How to expand the tablespace and Field Length in db2

DB2 strings in DB2 Databases

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.