EOF

YESTERDAY=`cat /database/log/tns_log/yesterday.out` TODAY=`date '+%d-%b-%Y'`

echo $YESTERDAY  $TODAY

echo "HOSTTNS|Date|SID|PROGRAM|HOST|USER|IP|PORT|"  >$PWDPATH/tns_`date +%Y%m%d`.txt

cd $PWDPATH grep -i $YESTERDAY `ls *.log` |grep 'HOST=' |grep -v 'listening on:' |grep -v 'Listening on:' |grep -v 'COMMAND=' |grep -v '192.168.6.33' |grep -v '192.168.4.45' |sed -e 's/\* (CONNECT_DATA=(SID=/|/g' \ -e 's/\* (CONNECT_DATA=(SERVICE_NAME=/|/g' \ -e 's/)(CID=(PROGRAM=/|/g' \ -e 's/)(HOST=/|/g' \ -e 's/))) \* (ADDRESS=(PROTOCOL=tcp//g' \ -e 's/)(USER=/|/g'  \ -e 's/)(PORT=/|/g'   \ -e 's/))(SID=/|/g'   \ -e 's/)) \* (ADDRESS=(PROTOCOL=tcp//g'   \ -e 's/\* (CONNECT_DATA=(CID=(PROGRAM=/|/g' \ -e 's/)(CID=(PROGRAM=/|/g' \ -e 's/))(SERVICE_NAME=/|/g' \ -e 's/)) \* establish \* *.* \* *.*/|/g'   >>$PWDPATH/tns_`date +%Y%m%d`.txt

cat tns_`date +%Y%m%d`.txt |grep -v 192.168.3.91 |grep -v 192.168.3.92 |grep -v 192.168.61.33 |grep -v 192.168.61.35 |grep -v 192.168.61.37 |grep -v 192.168.61.32 |grep -v 192.168.4.60|grep -v 192.168.3.90|grep -v 192.168.4.12 |grep -v 192.168.4.19 |grep -v 192.168.4.20 |grep -v 192.168.1.53|grep -v 192.168.4.21  |grep -v 1 92.168.6.14 |grep -v 192.168.6.70|grep -v 192.168.6.20 |grep -v 192.168.4.31 |grep -v 192.168.6.65 |grep -v 192.168.6.19|grep -v 192.168.200.10 |grep -v 192.168.6 .74 |grep -v 192.168.4.144 |grep -v 192.168.4.10 |grep -v 192.168.108.62|grep -v 192.168.3.8 |grep -v 192.168.24.30|grep -v 192.168.24.43|grep -v 192.168.16.195|g rep -v 192.168.63.160| grep -v 192.168.6.60|grep -v 192.168.6.63 |grep -v 192.168.4.24 |grep -v 192.168.23.15|grep -v 192.168.23.36 |grep -v 192.168.23.16 |grep - v 192.168.23.38 |grep -v 192.168.6.25 |grep -v 192.168.1.51 |grep -v 192.168.23.7 |grep -v 192.168.1.43 |grep -v 192.168.1.47 |grep -v 192.168.24.31|grep -v 192.1 68.24.32|grep -v 192.168.24.85 |grep -v 192,168.1.63|grep -v 192.168.1.64 |grep -v 192.168.3.71|grep -v 192.168.24.8|grep -v 192.168.63.113|grep -v 192.168.16.54| grep -v 192.168.4.82|grep -v 192.168.4.32|grep -v 192.168.2.223|grep -v 192.168.4.81|grep -v 192.168.4.80|grep -v 192.168.4.22|grep -v 10.200.7.101|grep -v 192.16 8.4.18|grep -v 192.168.1.46|grep -v 192.168.6.95|grep -v '192.168.23.8|'|grep -v 172.18.193.12|grep -v -i pacer.exe|grep -v -i yictrpt.exe|grep -v 192.168.3.93|gr ep -v 172.17.7.11|grep -v 172.17.7.12|grep -v 192.168.23.87|grep -v 192.168.4.58|grep -v 192.168.23.41|grep -v 192.168.23.42|grep -v 192.168.24.7|grep -v 192.168. 23.86|grep -v 192.168.23.90|grep -v 192.168.201.122|grep -v 192.168.2.182|grep -v 192.168.3.72|grep -v 192.168.4.36|grep -v 192.168.4.85| grep -v 192.168.23.80|gr ep -v 192.168.6.69|grep -v 192.168.6.27 |grep -v 192.168.6.28|grep -v 192.168.4.45|sed -e 's/.log:/|/g'   >$PWDPATH/tns_dbconnection`date +%Y%m%d`.txt

#sed -e 's/$/ /' $PWDPATH/tns_dbconnection`date +%Y%m%d`.txt >$PWDPATH/1 #(echo "DB doubtable connections at $YESTERDAY: \n\nyou may open it by notepad.exe or wordpad.exe or office excel.\n";/usr/bin/uuencode 1  1) |/bin/mailx -s "DB d oubtable connections at $YESTERDAY:"  a@text.com

(echo "DB doubtable connections on $YESTERDAY: \n\nyou may open it by notepad.exe or wordpad.exe or office excel.\n") |/bin/mailx -s "DB doubtable connections at $YESTERDAY:"  ts-dba@test.com.cn <$PWDPATH/tns_dbconnection`date +%Y%m%d`.txt #(echo "DB doubtable connections on $YESTERDAY: \n\nyou may open it by notepad.exe or wordpad.exe or office excel.\n") |/bin/mailx -s "DB doubtable connections at  $YESTERDAY:"  a@tex.com  <$PWDPATH/tns_dbconnection`date +%Y%m%d`.txt

#(echo "DB doubtable connections at $YESTERDAY: \n\nyou may open it by notepad.exe or wordpad.exe or office excel.\n";/usr/bin/uuencode tns_dbconnection`date +%Y% m%d`.txt  tns_dbconnection`date +%Y%m%d`.txt) |/bin/mailx -s "DB doubtable connections at $YESTERDAY:"  c@test.com.cn

listener.ora的更多相关文章

  1. ORA-12541:TNS:no listener 客户端tnsnames.ora配置,以及服务端listener.ora配置

    需求:客户端(192.168.25.1)需要访问服务端(192.168.7.215)的Oracle库ORCL. 步骤一:配置客户端tnsnames.ora 步骤二:配置服务端listener.ora ...

  2. oracle的sqlnet.ora,tnsnames.ora,listener.ora三个配置文件

    总结: 1 .三个配置文件都是放在$ORACLE_HOME\network\admin目录下. 2 .sqlnet.ora确定解析方式 3 .listener.ora上设SID_NAME,通常用于JD ...

  3. listener.ora/sqlnet.ora/tnsnames.ora配置文件详解

    oracle网络配置 三个配置文件 listener.ora.sqlnet.ora.tnsnames.ora ,都是放在$ORACLE_HOME/network/admin目录下. 英文说明: The ...

  4. listener.ora增加监听端口

    一个简单的listener.ora # listener.ora Network Configuration File: d:\app\zyd\product\11.2.0\dbhome_1\netw ...

  5. oracle的listener.ora sqlnet.ora tnsnames.ora三个文件的关联性

    学习:http://www.cnblogs.com/william-lee/archive/2010/10/20/1856261.html 之前因为安装的是windows server 2008 r2 ...

  6. [oracle] listener.ora 、sqlnet.ora 、tnsnames.ora

    路径 $ORACLE_HOME/network/admin sqlnet.ora(客户及服务器端) 作用类似于linux或者其他unix的nsswitch.conf文件,通过这个文件来决定怎么样找一个 ...

  7. ORACLE RAC 下非缺省端口监听配置(listener.ora tnsnames.ora)

    不论是单实例还是RAC,对于非缺省端口下(1521)的监听器,pmon进程不会将service/instance注册到监听器,即不会实现动态注册.与单实例相同,RAC非缺省端口的监听器也是通过设置参数 ...

  8. 真心崩溃了,oracle安装完成后居然没有tnsnames.ora和listener.ora文件

    problem: oracle  11  r2  64位安装完成后NETWORK/ADMIN目录下居然没有tnsnames.ora和listener.ora文件 solution: 问题是之前安装了另 ...

  9. oracle的sqlnet.ora , tnsnames.ora , Listener.ora 文件的作用(转)

    oracle网络配置三个配置文件 listener.ora.sqlnet.ora.tnsnames.ora ,都是放在$ORACLE_HOME/network/admin目录下.1. sqlnet.o ...

  10. Oracle Net Listener Parameters (listener.ora)(转)

    12/20 7 Oracle Net Listener Parameters (listener.ora) This chapter provides a complete listing of th ...

随机推荐

  1. [妙味JS基础]第三课:自定义属性、索引值

    知识点总结 自定义属性 元素.自定义属性 = 值: 比如: oDiv.abc = 100; =>abc为自定义属性 索引值 index  =>也是自定义属性 oDiv.index = '' ...

  2. C#指定某用户对某文夹件的访问权限

    using System.Security.AccessControl; //设置myFloder文件夹的iis访问权限                string userAccount = @&q ...

  3. bzoj1336: [Balkan2002]Alien最小圆覆盖

    题目链接:http://www.lydsy.com/JudgeOnline/problem.php?id=1336 1336: [Balkan2002]Alien最小圆覆盖 Time Limit: 1 ...

  4. csu oj Infected Computer 1427

    #include <iostream> #include <algorithm> #include <stdio.h> #define max 20005 #def ...

  5. STL学习:STL库vector、string、set、map用法

    本文仅介绍了如何使用它们常用的方法. vector 1.可随机访问,可在尾部插入元素:2.内存自动管理:3.头文件#include <vector> 1.创建vector对象 一维: (1 ...

  6. heap和stack的区别

    参考<程序员面试宝典> 1.栈区(stack) 由编译器自动分配和释放,存放函数的参数值,局部变量值等.其操作方式类似于数据中的栈. 2.堆区(heap) 一般由程序员分配和释放,若程序员 ...

  7. HDU 2209 翻纸牌游戏(DFS)

    题目链接 Problem Description 有一种纸牌游戏,很有意思,给你N张纸牌,一字排开,纸牌有正反两面,开始的纸牌可能是一种乱的状态(有些朝正,有些朝反),现在你需要整理这些纸牌.但是麻烦 ...

  8. C库 - 常用文件IO函数

    #include<stdio.h> 0. 文件打开关闭FILE *fp = fopen("C:\\a.dat","wb+");fclose(fp); ...

  9. [FBA]SharePoint 2013自定义Providers在基于表单的身份验证(Forms-Based-Authentication)中的应用

    //http://tech.ddvip.com/2014-05/1401197453210723.html 由于项目的需要,登录SharePoint Application的用户将从一个统一平台中获取 ...

  10. MTK平台Android项目APK预置方案

    项目开发中,通常需要向系统中预置一些APK,这里简单介绍一下MTK平台预置APK的方法. 需要预置的apk可以放置在目录:vendor/mediate/${Project}/artifacts/out ...