DB2的CATALOG相關操作命令示例

2021-05-21 14:23:30 字數 460 閱讀 4609

我們知道,在oracle資料庫中,如果需要從客戶端連線到本機或者遠端的oracle資料庫,只需要在tnsnames.ora中配置連線。在db2資料庫,我們需要使用catalog命令來完成這個操作。

--新增本機(node)節點

db2 catalog  local node bsm1

--新增遠端(node)節點

db2 catalog  tcpip node node_ntbgm0 remote 10.25.11.11 server 50001

--為(node)節點新增資料庫

db2 catalog database ntbgm0 as db_ntbgm0 at node node_ntbgm0

--刪除節點上的資料庫

db2 uncatalog db_ntbgm0

--刪除(node)節點

db2 uncatalog node node_ntbgm0

db2相關操作

建立索引 create unique index gwdev.gg fy dsxfyjlb pk on gwdev.gg fy dsxfyjlb daishengxfyxh asc pctfree 10 allow reverse scans grant control on index gwdev...

DB2資料庫相關操作

自增字段的建立 start with 1 increment by 1 cache 20 no cycle no order 設定自增序列從20001開始 alter sequence linkage seq restart with 20001 使用自增字段 插入一條資料insert into l...

db2 基礎操作

清空cls 檢視資料版本 select from sysibm.sysversions 重啟資料 restart db twcs177 啟用資料庫 activate db twcs177 停止資料庫 deactivate db twcs177 資料庫鏈結名 db2 catalog tcpip mod...