informix常用命令

1. 查看日志信息

# onstat -m

--------------------------------------------------------------
IBM Informix Dynamic Server Version 11.50.FC8     -- On-Line -- Up 9 days 13:30:30 -- 101950928 Kbytes


Message Log File: /informix/online_gsbys.log
14:22:05  Logical Log 1840403 - Backup Completed
14:25:34  Checkpoint Completed:  duration was 0 seconds.
14:25:34  Fri Mar 29 - loguniq 1840404, logpos 0x75f7018, timestamp: 0xbf3c0cc3 Interval: 833386

14:25:34  Maximum server connections 11340 
14:25:34  Checkpoint Statistics - Avg. Txn Block Time 0.005, # Txns blocked 20, Plog used 67770, Llog used 80743

14:27:38  Logical Log 1840404 Complete, timestamp: 0xbf445257.
14:27:38  Logical Log 1840404 - Backup Started
14:27:47  Logical Log 1840404 - Backup Completed
14:30:05  partition 'cashbill:informix.session_status': no more extents
14:32:29  Logical Log 1840405 Complete, timestamp: 0xbf5700aa.
14:32:29  Logical Log 1840405 - Backup Started
14:32:39  Logical Log 1840405 - Backup Completed
14:35:36  Checkpoint Completed:  duration was 0 seconds.
14:35:36  Fri Mar 29 - loguniq 1840406, logpos 0xa13a2e4, timestamp: 0xbf68366a Interval: 833387

14:35:36  Maximum server connections 11340 
14:35:36  Checkpoint Statistics - Avg. Txn Block Time 0.004, # Txns blocked 22, Plog used 80414, Llog used 113602

1.1. 查看所有数据库的连接信息

onstat -g sql

1.2. 查看服务名

dbaccess

1.3. informix 执行数据导出

unload to /opt/informix/abc.csv delimiter "," select * from test;

1.5. 数据库字符集

select * from sysmaster:sysdbslocale;

1.4. 服务名查询

onstat -c | grep DBSERVER

1.6. 导出表结构

dbschema -d cust -t interface_mtrlsrv_log interface.sql

1.7. 外部文件执行

dbaccess cust test.sql

1.8. 批量模式显示语句

dbaccess -e metadb dy_table.sql     > dy_log${DATE}y.txt 2>&1

1.9. 显示所有数据库下所有表

dbschema -d cust  -t all | grep TABLE | awk '{print $3}' | cut -d \. -f 2 > table.txt

1.10. 查询数据库下所有表

select dbsname,tabname from sysmaster:systabnames where dbsname='test';

1.11. 查找主键

select constrname from sysconstraints where constrtype='P' and tabid= ( select tabid from systables where tabname = 'test' );

1. 12检测同步表是否动态

#!/usr/bin/ksh
dbaccess metadb dy_table.sql     > dy_log20190401x.txt 2>&1 
sleep 60
dbaccess metadb dy_table.sql     > dy_log20190401y.txt 2>&1
diff dy_log20190401x.txt dy_log20190401y.txt
  • 0
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值