<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Script to kill session in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/script-to-kill-session/m-p/5119889#M687150</link>
    <description>&lt;!--!*#--&gt;&amp;gt;if column 6 and 7 are 6 and 6 using awk to get value in column 1 and 2 and then insert it into sql statement "alter session....."&lt;BR /&gt;&amp;gt;Do you know away to insert 2 results back to this sql statement&lt;BR /&gt;&lt;BR /&gt;Try this:&lt;BR /&gt;awk '&lt;BR /&gt;($6==6 &amp;amp;&amp;amp; $7==6) {&lt;BR /&gt;   printf "ALTER SYSTEM KILL SESSION '%s,%s' ;\n", $1, $2&lt;BR /&gt;}' /home/oracle/ORACLE/CHK/wlm.log &amp;gt; sql.cmd&lt;BR /&gt;&lt;BR /&gt;if [ ! -s sql.cmd ]; then&lt;BR /&gt;   exit&lt;BR /&gt;fi&lt;BR /&gt;&lt;BR /&gt;/u10/app/oracle/product/db10g/bin/sqlplus / as sysdba &amp;lt; sql.cmd&lt;BR /&gt;&lt;BR /&gt;I'm not sure of the exact format in SQL.  Did you want a "&amp;amp;" before the numbers?</description>
    <pubDate>Thu, 17 Jul 2008 04:58:24 GMT</pubDate>
    <dc:creator>Dennis Handly</dc:creator>
    <dc:date>2008-07-17T04:58:24Z</dc:date>
    <item>
      <title>Script to kill session</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/script-to-kill-session/m-p/5119888#M687148</link>
      <description>dear all,&lt;BR /&gt;Please help me with this script.&lt;BR /&gt;&lt;BR /&gt;i am trying to write a script to terminate locking sessions and it run from cron every 5 mins. &lt;BR /&gt;if column 6 and 7 are 6 and 6 using AWK to get value in column 1 and 2 and then insert it into  sql statement "alter session....."&lt;BR /&gt;if no line is returned then exist.&lt;BR /&gt;&lt;BR /&gt;#!/usr/bin/sh&lt;BR /&gt;&lt;BR /&gt;export  NLS_LANG=AMERICAN_AMERICA.UTF8&lt;BR /&gt;/u10/app/oracle/product/db10g/bin/sqlplus / as sysdba &amp;lt;&lt;EOF&gt;&lt;/EOF&gt;@/home/oracle/ORACLE/CHK/locktest.sql&lt;BR /&gt;EOF&lt;BR /&gt;grep 6  /home/oracle/ORACLE/CHK/wlm.log|awk '{if ($6==6 &amp;amp;&amp;amp; $7==6) print}'&lt;BR /&gt;if no line return exist (Please help on this syntax)&lt;BR /&gt;##if column 6 and 7 of file wlm.log are 6 and 6 then &lt;BR /&gt;else &lt;BR /&gt; awk '{print $1 " " $2}'&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;250    13233&lt;BR /&gt;251    13233&lt;BR /&gt;&lt;BR /&gt;--Do you know away to insert 2 results back to this sql statement&lt;BR /&gt;&lt;BR /&gt;/u10/app/oracle/product/db10g/bin/sqlplus / as sysdba &amp;lt;&lt;EOF&gt;&lt;/EOF&gt;ALTER SYSTEM  KILL SESSION '&amp;amp;sid,&amp;amp;serial' ;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;/home/oracle/ORACLE/CHK/locktest.sql&lt;BR /&gt;this is the result of locktest.sql&lt;BR /&gt;&lt;BR /&gt;wlm.log&lt;BR /&gt;  SID  SERIAL# TY     ID1     ID2  LMODE  REQ&lt;BR /&gt;----- ---------- -- --------- --------- ------ &lt;BR /&gt;  764        1 TS       3         1    3    0&lt;BR /&gt;  250    13233 TM   79026         0    3    0&lt;BR /&gt;  250    13233 TX  196627   3532464    6    0&lt;BR /&gt;  250    13233 TX  196627   3532464    6    6&lt;BR /&gt;  251    13233 TX  196627   353246     6    6&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Thanks in advance,&lt;BR /&gt;Tom</description>
      <pubDate>Thu, 17 Jul 2008 03:21:41 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/script-to-kill-session/m-p/5119888#M687148</guid>
      <dc:creator>tom quach_1</dc:creator>
      <dc:date>2008-07-17T03:21:41Z</dc:date>
    </item>
    <item>
      <title>Re: Script to kill session</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/script-to-kill-session/m-p/5119889#M687150</link>
      <description>&lt;!--!*#--&gt;&amp;gt;if column 6 and 7 are 6 and 6 using awk to get value in column 1 and 2 and then insert it into sql statement "alter session....."&lt;BR /&gt;&amp;gt;Do you know away to insert 2 results back to this sql statement&lt;BR /&gt;&lt;BR /&gt;Try this:&lt;BR /&gt;awk '&lt;BR /&gt;($6==6 &amp;amp;&amp;amp; $7==6) {&lt;BR /&gt;   printf "ALTER SYSTEM KILL SESSION '%s,%s' ;\n", $1, $2&lt;BR /&gt;}' /home/oracle/ORACLE/CHK/wlm.log &amp;gt; sql.cmd&lt;BR /&gt;&lt;BR /&gt;if [ ! -s sql.cmd ]; then&lt;BR /&gt;   exit&lt;BR /&gt;fi&lt;BR /&gt;&lt;BR /&gt;/u10/app/oracle/product/db10g/bin/sqlplus / as sysdba &amp;lt; sql.cmd&lt;BR /&gt;&lt;BR /&gt;I'm not sure of the exact format in SQL.  Did you want a "&amp;amp;" before the numbers?</description>
      <pubDate>Thu, 17 Jul 2008 04:58:24 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/script-to-kill-session/m-p/5119889#M687150</guid>
      <dc:creator>Dennis Handly</dc:creator>
      <dc:date>2008-07-17T04:58:24Z</dc:date>
    </item>
    <item>
      <title>Re: Script to kill session</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/script-to-kill-session/m-p/5119890#M687152</link>
      <description>&lt;BR /&gt;Thanks Dennis,&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Try this:&lt;BR /&gt;awk '&lt;BR /&gt;($6==6 &amp;amp;&amp;amp; $7==6) {&lt;BR /&gt;   printf "ALTER SYSTEM KILL SESSION '%s,%s' ;\n", $1, $2&lt;BR /&gt;}' /home/oracle/ORACLE/CHK/wlm.log &amp;gt; sql.sql&lt;BR /&gt;&lt;BR /&gt;if [ ! -s sql.sql ]; then&lt;BR /&gt;   exit&lt;BR /&gt;fi&lt;BR /&gt;&lt;BR /&gt;/u10/app/oracle/product/db10g/bin/sqlplus / as sysdba &amp;lt;</description>
      <pubDate>Thu, 17 Jul 2008 05:26:59 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/script-to-kill-session/m-p/5119890#M687152</guid>
      <dc:creator>tom quach_1</dc:creator>
      <dc:date>2008-07-17T05:26:59Z</dc:date>
    </item>
    <item>
      <title>Re: Script to kill session</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/script-to-kill-session/m-p/5119891#M687153</link>
      <description>&amp;gt;[ ! -s sql.sql ] is this line to check if the file id empty??&lt;BR /&gt;&lt;BR /&gt;Yes.  It says NOT (!), size &amp;gt; 0 (-s) for that file.</description>
      <pubDate>Thu, 17 Jul 2008 05:39:48 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/script-to-kill-session/m-p/5119891#M687153</guid>
      <dc:creator>Dennis Handly</dc:creator>
      <dc:date>2008-07-17T05:39:48Z</dc:date>
    </item>
    <item>
      <title>Re: Script to kill session</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/script-to-kill-session/m-p/5119892#M687155</link>
      <description>Thanks Dennis,&lt;BR /&gt;&lt;BR /&gt;I test the whole script and it works well.&lt;BR /&gt;&lt;BR /&gt;Thank you very much,&lt;BR /&gt;Tom</description>
      <pubDate>Thu, 17 Jul 2008 06:12:10 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/script-to-kill-session/m-p/5119892#M687155</guid>
      <dc:creator>tom quach_1</dc:creator>
      <dc:date>2008-07-17T06:12:10Z</dc:date>
    </item>
    <item>
      <title>Re: Script to kill session</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/script-to-kill-session/m-p/5119893#M687157</link>
      <description>Thank you</description>
      <pubDate>Mon, 21 Jul 2008 14:52:09 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/script-to-kill-session/m-p/5119893#M687157</guid>
      <dc:creator>tom quach_1</dc:creator>
      <dc:date>2008-07-21T14:52:09Z</dc:date>
    </item>
  </channel>
</rss>

