【Mycat1.6之操作db2案例】

阅读更多

一、环境准备,配置网络,启动DB2数据库

【Mycat1.6之操作db2案例】_第1张图片
 


【Mycat1.6之操作db2案例】_第2张图片
 
【Mycat1.6之操作db2案例】_第3张图片
 

二、配置Schema文件,引入DB2的JDBC链接jar

 

 
【Mycat1.6之操作db2案例】_第4张图片
 

三、实验结果验证

【Mycat1.6之操作db2案例】_第5张图片
 

附件:schema.xml内容





	
		
select 1 from sysibm.sysdummy1 select 1 from sysibm.sysdummy1 select 1 from sysibm.sysdummy1 数据库操作参数: Last login: Fri May 5 21:42:37 2017 [root@localhost ~]# su - db2linst1 su: 用户 db2linst1 不存在 [root@localhost ~]# su - db2inst1 [db2inst1@localhost ~]$ db2level DB21085I Instance "db2inst1" uses "64" bits and DB2 code release "SQL09070" with level identifier "08010107". Informational tokens are "DB2 v9.7.0.0", "s090521", "LINUXAMD6497", and Fix Pack "0". Product is installed at "/opt/ibm/db2/V9.7_01". [db2inst1@localhost ~]$ db2 list db directory System Database Directory Number of entries in the directory = 3 Database 1 entry: Database alias = TOOLSDB Database name = TOOLSDB Local database directory = /home/db2inst1 Database release level = d.00 Comment = Directory entry type = Indirect Catalog database partition number = 0 Alternate server hostname = Alternate server port number = Database 2 entry: Database alias = XXX Database name = XXX Local database directory = /home/db2inst1 Database release level = d.00 Comment = Directory entry type = Indirect Catalog database partition number = 0 Alternate server hostname = Alternate server port number = Database 3 entry: Database alias = TEST001 Database name = TEST001 Local database directory = /home/db2inst1 Database release level = d.00 Comment = Directory entry type = Indirect Catalog database partition number = 0 Alternate server hostname = Alternate server port number = [db2inst1@localhost ~]$ db2 connect to TEST001 SQL1032N No start database manager command was issued. SQLSTATE=57019 [db2inst1@localhost ~]$ db2start 05/05/2017 21:48:12 0 0 SQL1063N DB2START processing was successful. SQL1063N DB2START processing was successful. [db2inst1@localhost ~]$ db2 connect to TEST001 Database Connection Information Database server = DB2/LINUXX8664 9.7.0 SQL authorization ID = DB2INST1 Local database alias = TEST001 [db2inst1@localhost ~]$ DB2 LIST TABLES FOR USER -bash: DB2: command not found [db2inst1@localhost ~]$ db2 LIST TABLES FOR USER Table/View Schema Type Creation time ------------------------------- --------------- ----- -------------------------- USER DB2INST1 T 2012-08-02-05.57.32.932312 USER1 DB2INST1 T 2012-08-02-06.47.42.505658 2 record(s) selected. [db2inst1@localhost ~]$ [db2inst1@localhost ~]$
  • 【Mycat1.6之操作db2案例】_第6张图片
  • 大小: 124.4 KB
  • 【Mycat1.6之操作db2案例】_第7张图片
  • 大小: 53.9 KB
  • 【Mycat1.6之操作db2案例】_第8张图片
  • 大小: 58.4 KB
  • 【Mycat1.6之操作db2案例】_第9张图片
  • 大小: 62.5 KB
  • 【Mycat1.6之操作db2案例】_第10张图片
  • 大小: 84.6 KB
  • 查看图片附件

你可能感兴趣的:(【Mycat1.6之操作db2案例】)