[Shell] Shell 生成 HTML脚本,可显示表格
Shell 生成 HTML脚本生成的格式不好看,以后要多改进.[mon@oracle6 source]$ more gen_html #!/bin/bash datetime=`date +"%Y/%m/%d %H:%M:%S"`DATA=/home/mon/source/config/mon_host_stat.dataMAILLIST=tolilong@163.com,bruce_lilong@163.comCOUNT=4MAILLIST=tolilong@163.comHTMLFILE=/home/mon/d...
[Oracle] Clustering Factor
1.Clustering Factor is a measure of the orderedness of an index in comparison to the table that is based upon It is used as an indicator for computing the estimated cost of the table lookup following an index access.2.The Clustering Factor records the number of data blocks that will be acces...
[Shell] awk sub,gsub
sub 只替换每行的第一个匹配字符gsub会替换当前行的所有匹配字符[/tmp/test]# more tt150 IT China 800 10 ACC...
[Shell] awk FS,OFS,RS,ORS
FS :是列分隔符,默认是空格OFS:是输出列的分隔符RS :是行分隔符,默认是空格ORS:是输出行的分隔符[/]# echo "a b c d" | awk '{print $1}'a[/]# echo "a b c d" | awk '{print $0}' a b c d[/]# echo "a:b:c:d" | awk '{print $1}'a:b:c:d[/]# echo "a:b:c:d" | awk 'BEGIN{FS=":"}{print $1}'a[/]# echo...
[Shell] 统计字符串出现的次数和排序(cut,sort,uniq)
对tt3文本中出现的url进行统计并排序[/tmp/test]# cat tt3http://www.baidu.com/index.htmlhttp://www.google.com/index.htmlhttp://www.baidu.com/index.htmlhttp://www.google.com/index.htmlhttp://www.163.com/index.htmlhttp://www.baidu.com/index.htmlhttp://www.sina.com/index.html[/tmp/test]# cat tt3...
[Shell] Sort排序的例子
source data[/tmp/test]# more tt150 IT China 800 10 ACCOUNTING ...
[Shell] Shell 生成 HTML脚本
Shell 生成 HTML脚本生成的格式不好看,以后要多改进.[mon@oracle6 source]$ more gen_html #!/bin/bash datetime=`date +"%Y/%m/%d %H:%M:%S"`DATA=/home/mon/source/config/mon_host_stat.dataMAILLIST=tolilong@163.com,bruce_lilong@163.comCOUNT=4MAILLIST=tolilong@163.comHTMLFILE=/home/mon/da...
[Shell] Sort 和 对齐
[/tmp/test]# more test59.69.61.0 59.69.63.255 American59.70.12.0 59.70.15.255 Unit State59.70.208.0 59.70.223.255 Unit State59.71.48.0...
[Shell] Ping host status
1.Shell脚本[mon@oracle6 source]$ more mon_host_stat #!/bin/bashdatetime=`date +"%Y/%m/%d %H:%M:%S"`DATA=/home/mon/source/config/mon_host_stat.dataCOUNT=4LOG=/home/mon/data/mon_host_stat.logecho -n "" > $LOGcat $DATA | while read LINEdo IP=`echo $LINE | awk '{print $1}'`&n...
[Linux] mutt+msmtp发送mail时出现了如下错误(msmtp: cannot locate host)
mutt+msmtp发送mail时出现了如下错误(msmtp: cannot locate host )msmtp: cannot locate host smtp.xxxxx.com: Name or service not knownmsmtp: could not send mail (account default from /opt/msmtp/etc/msmtprc)Error sending message, child exited 68 (Host unknown.).在/etc/hosts中添加IP,HOSTNAME信息,42...
[Shell] Input null到文件中的两个方法
Input null到文件中的两个方法[mon@oracle6 data]$ echo > mon_host_stat.log [mon@oracle6 data]$ ll-rw-rw-r--. 1 mon mon 1 Mar 2 23:22 mon_host_stat.log直接echo >到文件的时候,文件大小为1,文件中的内容部位null如果需要将文件清空为null 可以使用如下两种方法1.cat /dev/null ...
6.Monitor Linux OS process and DB session
1.create tableSQL> create table mon_process 2 (ip_address varchar2(30), 3 hostname varchar2(20), 4 datetime varchar2(20), 5 all_process int, 6 running_process int, 7 sleeping_process int, 8 stopped_proc...
[Shell] Linux monitor OS process and DB session
1.create tableSQL> create table mon_process 2 (ip_address varchar2(30), 3 hostname varchar2(20), 4 datetime varchar2(20), 5 all_process int, 6 running_process int, 7 sleeping_process int, 8 stopped_proc...
[Oracle] ORA-02020 过多的数据库链接在使用中
oracle6中已经使用了4个db link使用到第五个的时候就报了ORA-02020 过多的数据库连接在使用中查看系统参数SQL> show parameter open_linkNAME TYPE VALUE-----------...
[Linux] Linux启动文件grub.conf
BIOS->Bootloader-->Kernel-->init-->service-->login-->bash1.Bootloader启动kernel通过/boot/grub/grub.conf root(hd0,0) kernel /vmlinuz-2.6.32-358.el6.x86_64 ro root=/dev/sda1 initrd /initramfs-2.6.32-358.el6.x86_64...
[Oracle] Shrink space & Table move比较
本实验是对两个一样的table,测试shrink space 和 table move释放了多少空间,以及对index status的影响.1.新建了两个一样的table tt5,tt7SQL> select (select count(*) from tt5) tt5_count,(select count(*) from tt7) tt7_count from dual; TT5_COUNT TT7_COUNT---------- ---------- &nb...
[Oracle] v$sql_bind_capture & dba_hist_sqlbind
v$sql_bind_capture view包含了SQL绑定变量的信息1.此view中只保存最后一次捕获SQL的变量信息2.两次捕获之间的间隔为900s,受隐藏参数控制SQL> @?/yccsEnter value for value: captureold 4: AND ksppinm like '%&value%'new 4: AND ksppinm like '%capture%'KSPPINM &...
[shell] execute remote Script自动生成oracle awr report并mail出来
shell执行远端Script自动生成awr report并mail出来1.remote machine shell script[mon@topaz source]$ more gen_oracle_awr #!/bin/bashexport ORACLE_BASE=/u01/oracleexport ORACLE_HOME=$ORACLE_BASE/product/11.2.0/dbhome_1export ORACLE_SID=wlcspAWRHOME=/home/mon/awr#interval=8#echo $ORACLE_SID...
[Excel] 设置excel连接oracle db,可刷新数据
设置excel连接oracle db,可以自动刷新数据的excel 20101.菜单栏-->数据-->自其它来源-->来自数据连接向导2.选择"microsoft data access-ole db provide for oracle" 输入tnsnames.ora中的字符串,username,password3.选择表(需要查询的表,可以随便选一个的)-->完成4.弹出"导入数据" ,点确定。=============...
[Shell] 自动生成oracle awr report并mail出来
Shell script如下:[mon@oracle6 source]$ more gen_oracle_awr #!/bin/bashexport ORACLE_BASE=/u01/oracleexport ORACLE_HOME=$ORACLE_BASE/product/11.2.0/dbhome_1export ORACLE_SID=xxxxxxxAWRHOME=/home/mon/awr#interval=8maxmin=`$ORACLE_HOME/bin/sqlplus -s /nolog << EOF # >> /home/mon/log/gen...