db2 常用命令

摘要:
1.将常用命令设置为别名,以便于存储aliaslistapp='dblistapplications'aliaslistappx='dbListapplications showdetail'aliasisttran='db2listINDUBTTRANSACTION'aliaslisttranx='db2listINDUTTRANSACTION SWITHPROMPTING'别名

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) asstandby"

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

免责声明:文章转载自《db2 常用命令》仅用于学习参考。如对内容有疑问,请及时联系本站处理。

上篇UE4 Subsystemswindows命令行下简单使用javac、java、javap详细演示下篇

宿迁高防,2C2G15M,22元/月;香港BGP,2C5G5M,25元/月 雨云优惠码:MjYwNzM=

相关文章

Jenkins启动、停止脚本

1、jenkins下载地址:http://pan.baidu.com/s/1eSHusCi 2、创建shell脚本,如:jenkins.sh #!/bin/bash pid=`ps -ef | grep jenkins.war | grep -v 'grep'| awk '{print $2}'| wc -l` if [ "$1" = "start" ];...

DB2带UPDATE,INSERT语句的函数

带UPDATE,INSERT 语句的函数返回值应该是一个TABLE如:RETURNS TABLE(COL VARCHAR(36))函数中返回应该:return select NEWID from sysibm.sysdummy1;在调用时例子: select*fromtable(UF_GETID('RE'))ast 创建ID函数: CodeCREAT...

DB2 日期时间函数

db2日期时间函数 (DATE(TRIM(CHAR(DT#11Y))||'-'||TRIM(CHAR(DT#11M))||'-'||TRIM(CHAR(DT#11D))) BETWEEN DATE('" & strDate1 & "') AND DATE('" & strDate2 & "')) (Y > y) OR...

Nginx补充

[root@localhost ~]# yum -y install pcre-devel zlib-devel openssl-devel gcc gcc-c++ make [root@localhost ~]# useradd -M -s /sbin/nologin nginx [root@localhost ~]# tar xf nginx-1...

Linux下杀掉所有得java进程

--转自https://blog.csdn.net/oppo62258801/article/details/81434038 1.Linux查看所有Java进程 ps -ef | grep java | grep -v grep  (是在列出的进程中去除含有关键字"grep"的进程) 2. 使用awk分割结果,获取PID awk '{print $2}'...

grep、egrep命令用法

何谓正则表达式 正则表达式,又称正规表示法、常规表示法(Regular Expression,在代码中常简写为regex、regexp或RE),是一类字符所书写的模式,其中许多字符不表示其字面意义,而是表达控制或通配等功能。正则表达式使用单个字符串来描述、匹配一系列符合某个句法规则的字符串。在很多文本编辑器里,正则表达式通常被用来检索、替换那些符合某个模...