[Developer] Grouping sets
grouping setsgroup by grouping sets(a,b,c) = group by a union all group by b union all group by cSQL> list 1 &nb...
[Shell] awk学习(3)-regular expression 正则表达式
A regular expression is used as a pattern by enclosed it in slashes.^ :this matches the begining of a string (awk '/^J/' ff2 :以J开头) $ :this matches only at the end of the string (awk '/7$/' ff2:以7结尾). &nb...
[Developer] Cube
cube(a,b) 统计列包含:(a,b)、(a)、(b)、()cube(a,b,c) 统计列包含:(a,b,c)、(a,b)、(a,c)、(b,c)、(a)、(b)、(c)、()……以此类推ing……cube分组级别更多,结果更精细 SQL> editWrote file afiedt.buf 1 select b.dname,a.job,sum(sal) 2 from emp a,d...
[Shell] awk学习(2)-pattern{action}
其中如果pattern为true,则执行action其中关系运算符包括>,<,==,!=,~,!~ #~表示match,!~表示不match例子:[/tmp/test]# more tt11A125 Jenny 100 210A341 Dan 110 215P158 Max 130 209P148 John 125 220A123 Li...
[HP-UX] vxfs mount:xxxx is corrupted.needs checking
HP-UX 小机重启后,mount lvm的时候出现了如下错误[root@xxxxx002:/]# mount /dev/vgXXXX/lvol1 /oradata/XXXX/data4vxfs mount: /dev/vgXXXX/lvol1 is corrupted. needs checking执行fsck命令进行检查[root@xxxxx002:/]# fsck -F vxfs /dev/vgXXXX/lvol1log replay in progressreplay complete - marking super-bl...
[Shell] awk学习(1)-pattern{action}
awk pattern{action}其中如果pattern为true,则执行action样例data file[/tmp/test]# cat ff1aardvark 555-5553 1200/300 Balpo-net 555-3412 2400/1200/300 Abarfly 555-7685 1200/300 Abites 555-1675 2400/1200/300 Acamelot 555-0542 300 Ccore 555-2912 1200/300 Cfooey 555-1234 2400/1200/300 Bfoot 555-...
[Developer] Procedure发送html形式表格的mail
如下procedure先生成html格式的样式,然后利用sendmail procedure 发送邮件出来。create or replace procedure mon_filesystem_proasv_body long;v_subject varchar2(1000) :='Filesystem Warning';msg varchar2(1000);cursor c1 is SELECT hostname,filesystem,allbytes,usebytes,freebytes,usepct,mou...
[HP-UX] ORA-01081: cannot start already-running ORACLE - shut it down first
Oracle启动的时候报了这个错误:ORA-01081: cannot start already-running ORACLE - shut it down firstipcs查看shared memory后,发现有oracle的shared memory[root@xxxxx002:/]# ipcs -mIPC status from /dev/kmem as of Tue Apr 5 22:58:59 2016T ID KEY &...
[HP-UX] ERROR: Function activate_volume_group
小机重启后,执行cmrunpkg -v -n XXXXX002 pkg_X3PROD的时候log中会出现如下错误:########### Node "XXXXX002": Package start failed at Mon Apr 4 22:28:39 EAT 2016 ###########/etc/cmcluster/pkg_X3PROD/pkg_X3PROD.cntl: OMMENT: not found.########### Node "XXXXX002": Starting package at Mon Apr...
[HP-UX] cmviewcl运行时提示cmviewcl : Cannot talk to all the nodes.
机器重启后,运行cmviewcl后出现了如下错误:[root@xxxxx016:/]# cmviewclcmviewcl : Cannot talk to all the nodes.Cluster does not appear to be upCLUSTER STATUS cluster3 unknown NODE ...
[Developer] Oracle send mail procedure(2)
CREATE OR REPLACE PACKAGE demo_base64 IS FUNCTION encode(r IN RAW) RETURN VARCHAR2; end; CREATE OR REPLACE PACKAGE BODY demo_base64 IS TYPE vc2_table IS TABLE OF VARCHAR2(1) INDEX BY BINARY_INTEGER; map vc2_table; PROCEDURE ...
8.Monitor oracle alert.log file and sendmail
自己写的每隔一分钟检测alert.log文件是否有错误,如果有错误,则mail出来。第一次写,有很多地方没有考虑到。以后多加改善[mon@oracle6 source]$ more mon_alert_log #!/bin/bashalertlog=/u01/oracle/diag/rdbms/xxxxxdb/xxxxxdb/trace/alert_xxxxxdb.log #alert file locationda...
[Shell] monitor oracle alert.log file and sendmail
自己写的每隔一分钟检测alert.log文件是否有错误,如果有错误,则mail出来。第一次写,有很多地方没有考虑到。以后多加改善[mon@oracle6 source]$ more mon_alert_log #!/bin/bashalertlog=/u01/oracle/diag/rdbms/xxxxxdb/xxxxxdb/trace/alert_xxxxxdb.log #alert file locationda...
[Shell] awk 判断列的大小例子
这个是chinaunix论坛上看到的问题,也测试一下.有原始文件[/tmp/test]# cat tt10N1 5 6 8 4 1 2 1 &...
[Shell] awk NR,FNR,NF
NR: 已经读出的记录数FNR:当前文件的记录数NF:当前记录中的字段(列,域)个数[/tmp/test]# cat tt150 IT China 800 ...
[Developer] Oracle sendmail procedure(1)(转载)
CREATE OR REPLACE PROCEDURE send_mail( p_recipient VARCHAR2, -- 邮件接收人 p_subject VARCHAR2, -- 邮件标题 p_message VARCHAR2 -- 邮件正文 ) IS ...
[Oracle] ORA-24247: network access denied by access control list(ACL)
利用utl_smtp发送邮件的时候,会出现如下错误,具体方法如下:ORA-20001: The send mail was error ORA-24247: network access denied by access control list(ACL)BEGIN DBMS_NETWORK_ACL_ADMIN.CREATE_ACL ( acl => 'email_server_permissions.xml', descript...
[Shell] shell中的内部变量
1.BASH二进制执行文件的位置,版本[root@oracle6 /]# echo $BASH/bin/bash[root@oracle6 /]# echo $BASH_VERSION4.1.2(1)-release2.home目录[root@oracle6 /]# echo $HOME/root3.$? : shell command的返回值[root@oracle6 /]# ping 172.16.20.31 这个ip能ping通--- 17...
7.monitor oracle database listener & instance status
monitor oracle database listener & instance status[mon@oracle source]$ crontab -l* * * * * /home/mon/source/mon_db >> /home/mon/log/mon_db.log[mon@oracle source]$ more mon_db #!/bin/bashexport ORACLE_BASE=/u01/oracleexport ORACLE_HOME=$ORACLE_BASE/product/11.2.0.4/dbhome_1export ORAC...
[Shell] monitor oracle database listener & instance status
monitor oracle database listener & instance status[mon@oracle source]$ crontab -l* * * * * /home/mon/source/mon_db >> /home/mon/log/mon_db.log[mon@oracle source]$ more mon_db #!/bin/bashexport ORACLE_BASE=/u01/oracleexport ORACLE_HOME=$ORACLE_BASE/product/11.2.0.4/dbhome_1export ORAC...