zoukankan      html  css  js  c++  java
  • db2 常用命令

    1、将常用命令,设置为别名,方便记忆

    alias listapp='db2 list applications'

    alias listappx='db2 list applications show detail'

    alias listtran='db2 list INDOUBT TRANSACTIONS'

    alias listtranx='db2 list INDOUBT TRANSACTIONS WITH PROMPTING'

    alias listtab='db2 list tables for all'

    alias listlockwait='db2 list applications show detail|grep -i lock'

    alias listdb='db2 list database directory'

    alias listnode='db2 list node directory show detail'

    alias listutil='db2 list utilities'

    alias listutilx='db2 list utilities show detail'

    alias listts='db2 list tablespaces'

    alias listtsx='db2 list tablespaces show detail'

    alias listtsc='db2 list tablespace containers for '

    alias db2topx="db2top -d $(db2 list database directory|grep -B 5 'Indirect'|head -n 1) -V $(db2 list database directory|grep -B 5 'Indirect'|head -n 1)"

    alias hadr_cfg="db2 get db cfg for $(db2 list database directory|grep -B 5 'Indirect'|head -n 1) |grep -i hadr "

    alias hadr_primary="db2 start hadr on database $(db2 list database directory|grep -B 5 'Indirect'|head -n 1) as primary "

    alias hadr_standby="db2 start hadr on database $(db2 list database directory|grep -B 5 'Indirect'|head -n 1) as standby "

    alias hadr_status="db2pd -d $(db2 list database directory|grep -B 5 'Indirect'|head -n 1) -hadr"

    alias hadr_stop= "db2 stop hadr on database $(db2 list database directory|grep -B 5 'Indirect'|head -n 1)"

    alias hadr_toprimary="db2 takeover hadr on db $(db2 list database directory|grep -B 5 'Indirect'|head -n 1)"

    alias hadr_toprimary_force="db2 takeover hadr on db $(db2 list database directory|grep -B 5 'Indirect'|head -n 1) by force"

    alias db2version=$(db2level |grep -oE "v[0-9.]+")

    #查看数据库有哪些表

    db2 list tables for all

    db2 list tables for schema xxx

    #强制关闭所有连接

    db2 force application all

    #清楚当前回话的所有后台进程

    db2 terminate

    #kill指定进程

    db2 force application(id)

    #判断是否主从

    db2pd -d $DBNAME -hadr

  • 相关阅读:
    大话位运算
    Docker部署jar包
    linux系统备份mysql数据库
    关于Centos7 firewalld防火墙开放端口后仍不能访问ftp和nginx的问题解决
    MySql查询当天、本周、本月、本季度、本年的数据
    c#模拟线性回归
    监控服务器配置(五)-----Redis_exporter安装配置
    监控服务器配置(二)-----Grafana安装配置
    监控服务器配置(三)-----Node_exporter安装配置
    js网页唤起支付宝进行支付
  • 原文地址:https://www.cnblogs.com/dbcloud/p/6002792.html
Copyright © 2011-2022 走看看