
shell
shell
数据库人生
专注于数据库
PostgreSQL;Oracle 11G OCA、OCP;OceanBase V2 OBCA、OBCP
展开
-
shell脚本输出带颜色字体
【代码】shell脚本输出带颜色字体。转载 2023-09-07 14:33:04 · 513 阅读 · 0 评论 -
shell 脚本 aws cli 获取数据库信息
shell 脚本 aws cli 获取数据库信息原创 2022-11-22 23:58:53 · 133 阅读 · 0 评论 -
shell 脚本并行连接 postgresql 数据库执行脚本
shell 脚本连接 postgresql 数据库原创 2022-11-22 23:53:26 · 382 阅读 · 0 评论 -
sqlplus 使用之六 模拟多进程压测
os: centos 7.4db: oracle 11.2.0.4create tableSQL> create table tmp_t0(c0 varchar2(100),c1 varchar2(100),c2 varchar2(100),c3 date );shell 并发启动 100个进程$ vi insert_date.sh #!/bin/bashfor((i=1...原创 2020-02-06 09:18:21 · 378 阅读 · 0 评论 -
sqlplus 使用之三 shell 执行
单实例自动启动#start oraclesu - oracle -c "/data/u01/oracle/app/oracle/product/12.1.0/dbhome_1/bin/lsnrctl start"su - oracle -c "/data/u01/oracle/app/oracle/product/12.1.0/dbhome_1/bin/sqlplus -S / as sy...原创 2019-07-17 16:57:11 · 1272 阅读 · 0 评论 -
psql 的一个shell 压测脚本
#!/bin/bashfor((i=1;i<=$1;i++));do(/bin/psql <<EOF begin; DO \$\$ DECLARE lv_var varchar; lv_rec record; BEGIN for lv_rec in ( select trunc(random()*1000000::int4):原创 2021-03-10 11:05:41 · 507 阅读 · 0 评论 -
vi、vim 复制粘贴导致多行出现#号解决办法
vi、vim 复制粘贴导致多行出现#号解决办法 :set paste原创 2020-05-18 19:38:11 · 940 阅读 · 0 评论 -
shell 脚本批量删掉会话
有时候需要批量杀会话ps -ef|grep -i “postgres”|grep -i “idle”|awk ‘{print $2}’|xargs kill -9原创 2017-12-29 10:19:01 · 665 阅读 · 0 评论 -
linux 查看 mongodb 连接数
netstat -antp|grep -i 27017 | awk '{print $5}'| cut -d: -f1 | sort | uniq -c | sort -n适当修改就可以查看其他信息原创 2018-01-09 16:41:18 · 5121 阅读 · 0 评论 -
shell 脚本里启动多进程执行
下面是shell脚本的部分代码,改代码段是并发 gpg 加密echo “gpg start…date ” #并发加密文件,缩短执行时间 for FILE in ls -1 /backup/base*.tgz do ( gpg -er zlfund -o ${FILE}.gpg ${FILE} )& done wait echo “gpg end…date “原创 2017-12-04 18:51:58 · 4741 阅读 · 0 评论