<?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: sqlplus: I want to avoid the 'Connected.' string in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/sqlplus-i-want-to-avoid-the-connected-string/m-p/4854226#M867136</link>
    <description>Really COOL! thanks Duncan!&lt;BR /&gt;&lt;BR /&gt;Ciao&lt;BR /&gt;Claudio</description>
    <pubDate>Wed, 05 May 2004 08:26:30 GMT</pubDate>
    <dc:creator>Claudio Cilloni</dc:creator>
    <dc:date>2004-05-05T08:26:30Z</dc:date>
    <item>
      <title>sqlplus: I want to avoid the 'Connected.' string</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/sqlplus-i-want-to-avoid-the-connected-string/m-p/4854223#M867133</link>
      <description>hi all. second question for today.&lt;BR /&gt;&lt;BR /&gt;I need do to some queries inside a shell script.&lt;BR /&gt;I'm doing so:&lt;BR /&gt;&lt;BR /&gt;RESULT=$(sqlplus -silent /nolog &amp;lt;&lt;EOF&gt;&lt;/EOF&gt;SET HEADING OFF&lt;BR /&gt;SET NEWPAGE NONE&lt;BR /&gt;SET FEEDBACK OFF&lt;BR /&gt;CONN / AS SYSDBA&lt;BR /&gt;SELECT ---- something ----;&lt;BR /&gt;EOF)&lt;BR /&gt;&lt;BR /&gt;I was able to hide any output other than the query result (SET HEADING OFF, SET NEWPAGE NONE, SET FEEDBACK OFF). Now... the 'CONN / AS SYSDBA' command still prints 'Connected.'. This  is really annoying. &lt;BR /&gt;How can I remove it using sqlplus commands or options? Or... could you suggest an easy and safe way to remove that line inside my script after the sqlplus command?&lt;BR /&gt;&lt;BR /&gt;thanks.&lt;BR /&gt;&lt;BR /&gt;Claudio</description>
      <pubDate>Wed, 05 May 2004 07:41:04 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/sqlplus-i-want-to-avoid-the-connected-string/m-p/4854223#M867133</guid>
      <dc:creator>Claudio Cilloni</dc:creator>
      <dc:date>2004-05-05T07:41:04Z</dc:date>
    </item>
    <item>
      <title>Re: sqlplus: I want to avoid the 'Connected.' string</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/sqlplus-i-want-to-avoid-the-connected-string/m-p/4854224#M867134</link>
      <description>if you can change the connection with :&lt;BR /&gt;$(sqlplus -silent user/pass &amp;lt;&lt;EOF&gt;&lt;/EOF&gt;SET HEADING OFF&lt;BR /&gt;SET NEWPAGE NONE&lt;BR /&gt;SET FEEDBACK OFF&lt;BR /&gt;SELECT ---- something ----;&lt;BR /&gt;EOF)&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;You won't have the connected message anymore.&lt;BR /&gt;Regards,&lt;BR /&gt;Jean-Luc&lt;BR /&gt;</description>
      <pubDate>Wed, 05 May 2004 08:06:01 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/sqlplus-i-want-to-avoid-the-connected-string/m-p/4854224#M867134</guid>
      <dc:creator>Jean-Luc Oudart</dc:creator>
      <dc:date>2004-05-05T08:06:01Z</dc:date>
    </item>
    <item>
      <title>Re: sqlplus: I want to avoid the 'Connected.' string</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/sqlplus-i-want-to-avoid-the-connected-string/m-p/4854225#M867135</link>
      <description>Here's a code snippet I use in my sql based shell scripts:&lt;BR /&gt;&lt;BR /&gt;RunSQL ()&lt;BR /&gt;{&lt;BR /&gt;&lt;BR /&gt;{&lt;BR /&gt;sqlplus -s /nolog &amp;lt;&amp;lt; EOJ&lt;BR /&gt;connect / as sysdba ;&lt;BR /&gt;set echo off ;&lt;BR /&gt;set heading off ;&lt;BR /&gt;${1}&lt;BR /&gt;exit ;&lt;BR /&gt;EOJ&lt;BR /&gt;} | sed -e '/^Connected/d' -e '/^$/d'&lt;BR /&gt;&lt;BR /&gt;}&lt;BR /&gt;&lt;BR /&gt;Then you can use the function as in:&lt;BR /&gt;&lt;BR /&gt;RunSQL 'select * from v$session'&lt;BR /&gt;&lt;BR /&gt;or whatever&lt;BR /&gt;&lt;BR /&gt;HTH&lt;BR /&gt;&lt;BR /&gt;Duncan</description>
      <pubDate>Wed, 05 May 2004 08:20:19 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/sqlplus-i-want-to-avoid-the-connected-string/m-p/4854225#M867135</guid>
      <dc:creator>Duncan Edmonstone</dc:creator>
      <dc:date>2004-05-05T08:20:19Z</dc:date>
    </item>
    <item>
      <title>Re: sqlplus: I want to avoid the 'Connected.' string</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/sqlplus-i-want-to-avoid-the-connected-string/m-p/4854226#M867136</link>
      <description>Really COOL! thanks Duncan!&lt;BR /&gt;&lt;BR /&gt;Ciao&lt;BR /&gt;Claudio</description>
      <pubDate>Wed, 05 May 2004 08:26:30 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/sqlplus-i-want-to-avoid-the-connected-string/m-p/4854226#M867136</guid>
      <dc:creator>Claudio Cilloni</dc:creator>
      <dc:date>2004-05-05T08:26:30Z</dc:date>
    </item>
    <item>
      <title>Re: sqlplus: I want to avoid the 'Connected.' string</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/sqlplus-i-want-to-avoid-the-connected-string/m-p/4854227#M867137</link>
      <description>&lt;BR /&gt;Claudio, Whenever I need to do something along the lines you describe I find is more productive to just look for the stuff that I want to latch onto and process it right there, typically in perl. Something along the lines of:&lt;BR /&gt;&lt;BR /&gt;foreach $_ (`sqlplus user/pass &amp;lt; script.sql`) {&lt;BR /&gt;    if (/^\s+(\d+)\s+(\d+)/) { ...&lt;BR /&gt;    }&lt;BR /&gt;&lt;BR /&gt;Hope this helps, full example below.&lt;BR /&gt;&lt;BR /&gt;Hein.&lt;BR /&gt; &lt;BR /&gt;On a Tru64 box I wanted to report the Oracle client and slave processes with the actual processor they each run on in NUMA context [4 cpus per RAD's (=cell)] grouped by client node/system.&lt;BR /&gt;So Oracle knows the client-slave connection,&lt;BR /&gt;but Unix knows the processor assignments and I need to join that data, but only for oracle tasks. Perl solution:&lt;BR /&gt;&lt;BR /&gt;# special sort we like to use&lt;BR /&gt;sub by_rad_node_pid {&lt;BR /&gt;int($psr{$a}/4) . $node{$a} . $a &lt;BR /&gt;cmp&lt;BR /&gt;int($psr{$b}/4) . $node{$b} . $b; }&lt;BR /&gt;&lt;BR /&gt;# collect arrays of Oracle info&lt;BR /&gt;&lt;BR /&gt;foreach $_ (`sqlplus system/manager &amp;lt; process.sql`) {&lt;BR /&gt;    if (/^\s+(\d+)\s+(\d+)\s+(\d+)\s+(\w+)/) {&lt;BR /&gt;        $pid=$2;&lt;BR /&gt;        $node{$pid}=$4;&lt;BR /&gt;        $remote{$pid}=$3;&lt;BR /&gt;        $oracle{$pid}=$1;&lt;BR /&gt;        }&lt;BR /&gt;    }&lt;BR /&gt;&lt;BR /&gt;#collect arrays of Tru64 info &lt;BR /&gt;&lt;BR /&gt;foreach $_ (`ps -AOpsr`) {&lt;BR /&gt;    $psr{$1}=$2 if (/^\s+(\d+)\s+(\d+)/ &amp;amp;&amp;amp; $oracle{$1} ) &lt;BR /&gt;    }&lt;BR /&gt;&lt;BR /&gt;# report groups&lt;BR /&gt;&lt;BR /&gt;foreach $pid (sort by_rad_node_pid keys %psr) {&lt;BR /&gt;    if ($node{$pid} eq $old_node) {&lt;BR /&gt;        print "\t$pid";&lt;BR /&gt;        } else {&lt;BR /&gt;        $old_node = $node{$pid};&lt;BR /&gt;        printf "\n%2d %8s %d", $psr{$pid}/4, $old_node, $pid;&lt;BR /&gt;        }&lt;BR /&gt;    }&lt;BR /&gt;&lt;BR /&gt;----- process.sql -------&lt;BR /&gt;column id format 999;&lt;BR /&gt;column Local format 99999999;&lt;BR /&gt;column Remote format 99999999;&lt;BR /&gt;column Node format a9;&lt;BR /&gt;column Local_Program format a20;&lt;BR /&gt;column Remote_Program format a24;&lt;BR /&gt;set pages 9999;&lt;BR /&gt;set lines 132;&lt;BR /&gt;&lt;BR /&gt;select pid "Id", spid "Local", process "Remote",&lt;BR /&gt;        s.machine "Node", SUBSTR(p.program,1,20) "Local Program",&lt;BR /&gt;                          SUBSTR(s.program,1,24) "Remote Program"&lt;BR /&gt;from v$process p, v$session s&lt;BR /&gt;where addr = paddr&lt;BR /&gt;order by machine, spid&lt;BR /&gt;/&lt;BR /&gt;</description>
      <pubDate>Wed, 05 May 2004 09:57:05 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/sqlplus-i-want-to-avoid-the-connected-string/m-p/4854227#M867137</guid>
      <dc:creator>Hein van den Heuvel</dc:creator>
      <dc:date>2004-05-05T09:57:05Z</dc:date>
    </item>
    <item>
      <title>Re: sqlplus: I want to avoid the 'Connected.' string</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/sqlplus-i-want-to-avoid-the-connected-string/m-p/4854228#M867138</link>
      <description>When you go Oracle 9.2 you may need a slightly different sysdba login&lt;BR /&gt;&lt;BR /&gt;sqlplus '/ as sysdba'&lt;BR /&gt;&lt;BR /&gt;This replaces connect internal which was deprecated with 9.2.&lt;BR /&gt;&lt;BR /&gt;I don't know how to integrate it with the excellent scripting above, I just know i had to do it in all my scripts.&lt;BR /&gt;&lt;BR /&gt;SEP</description>
      <pubDate>Wed, 05 May 2004 10:00:07 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/sqlplus-i-want-to-avoid-the-connected-string/m-p/4854228#M867138</guid>
      <dc:creator>Steven E. Protter</dc:creator>
      <dc:date>2004-05-05T10:00:07Z</dc:date>
    </item>
    <item>
      <title>Re: sqlplus: I want to avoid the 'Connected.' string</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/sqlplus-i-want-to-avoid-the-connected-string/m-p/4854229#M867139</link>
      <description>Hi Claudio,&lt;BR /&gt;passing the logon in the same command line of sqlplus is not a good pratice, because another user can catch it using ps -ef|grep sqlplus.&lt;BR /&gt;The better way to avoid your problem is:&lt;BR /&gt;RESULT=$(sqlplus -silent&amp;lt;&lt;EOF&gt;&lt;/EOF&gt;/ AS SYSDBA&lt;BR /&gt;SET HEADING OFF&lt;BR /&gt;SET NEWPAGE NONE&lt;BR /&gt;SET FEEDBACK OFF&lt;BR /&gt;SELECT ---- something ----;&lt;BR /&gt;EOF)&lt;BR /&gt;&lt;BR /&gt;Art</description>
      <pubDate>Thu, 06 May 2004 02:46:34 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/sqlplus-i-want-to-avoid-the-connected-string/m-p/4854229#M867139</guid>
      <dc:creator>Arturo Galbiati</dc:creator>
      <dc:date>2004-05-06T02:46:34Z</dc:date>
    </item>
    <item>
      <title>Re: sqlplus: I want to avoid the 'Connected.' string</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/sqlplus-i-want-to-avoid-the-connected-string/m-p/4854230#M867140</link>
      <description>thread closed. thanks to all.</description>
      <pubDate>Thu, 26 Aug 2004 07:36:18 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/sqlplus-i-want-to-avoid-the-connected-string/m-p/4854230#M867140</guid>
      <dc:creator>Claudio Cilloni</dc:creator>
      <dc:date>2004-08-26T07:36:18Z</dc:date>
    </item>
  </channel>
</rss>

