<?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: EOF in Operating System - Linux</title>
    <link>https://community.hpe.com/t5/operating-system-linux/eof/m-p/3584252#M103716</link>
    <description>&lt;BR /&gt;You can pipe directly into sqlplus.  And I think you can also use "sqlplus &amp;lt;&amp;lt;" too, but I prefer the syntax below:&lt;BR /&gt;&lt;BR /&gt;Here is what I have in our Oracle startup scripts.&lt;BR /&gt;&lt;BR /&gt;Example 1: runs as root when the system boots:&lt;BR /&gt;&lt;BR /&gt;($SU and $USER1 would be assigned according to your system; $SU is your path to su or sudo, $USER1 is the dba account)&lt;BR /&gt;&lt;BR /&gt;cat &amp;lt;&amp;lt; _EOF_ | ($SU - $USER1 -c "sqlplus /nolog")&lt;BR /&gt;connect oradb/oradb as sysdba;&lt;BR /&gt;startup;&lt;BR /&gt;exit;&lt;BR /&gt;_EOF_&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Example 2: runs directly as the dba user:&lt;BR /&gt;&lt;BR /&gt;cat &amp;lt;&amp;lt; _EOF_ | sqlplus /nolog&lt;BR /&gt;connect oradb/oradb as sysdba;&lt;BR /&gt;startup;&lt;BR /&gt;exit;&lt;BR /&gt;_EOF_&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;If you really want to be fancy, you can put tabs in the code and then use &amp;lt;&amp;lt;- (note the addition of the dash (-).  This little trick works for sh (posix), ksh and bash:&lt;BR /&gt;&lt;BR /&gt;cat &amp;lt;&amp;lt;- EOF | sqlplus /nolog&lt;BR /&gt;[tab] connect oradb/oradb as sysdba;&lt;BR /&gt;[tab] startup;&lt;BR /&gt;[tab] exit;&lt;BR /&gt;[tab] EOF&lt;BR /&gt;&lt;BR /&gt;(I spelled out [tab] here because the forum does not handle tabs in postings very well).&lt;BR /&gt;&lt;BR /&gt;-- Tom&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;</description>
    <pubDate>Tue, 19 Jul 2005 15:25:54 GMT</pubDate>
    <dc:creator>Tom Schroll</dc:creator>
    <dc:date>2005-07-19T15:25:54Z</dc:date>
    <item>
      <title>EOF</title>
      <link>https://community.hpe.com/t5/operating-system-linux/eof/m-p/3584247#M103711</link>
      <description>Hi All,&lt;BR /&gt;&lt;BR /&gt;export ORACLE_HOME=/opt/oracle/product/9.2&lt;BR /&gt;export ORACLE_SID=idmp005&lt;BR /&gt;export PATH=$PATH:/opt/oracle/product/9.2/bin:.&lt;BR /&gt;lsnrctl stop&lt;BR /&gt;/bin/cat &amp;lt;&lt;EOF&gt;&lt;/EOF&gt;@/home/oracle/bin/stop.sql&lt;BR /&gt;exit&lt;BR /&gt;EOF&lt;BR /&gt;&lt;BR /&gt;As you can see from the script above this will stop the listener and the oracle database.&lt;BR /&gt;&lt;BR /&gt;Can anyone explain to me how "EOF" and "@" work in this script, also where can I put the "lsnrctl start" command if I want this script to start the listener and database.&lt;BR /&gt;&lt;BR /&gt;Thanks,&lt;BR /&gt;Paul&lt;BR /&gt;</description>
      <pubDate>Mon, 18 Jul 2005 00:00:47 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/eof/m-p/3584247#M103711</guid>
      <dc:creator>Paul_481</dc:creator>
      <dc:date>2005-07-18T00:00:47Z</dc:date>
    </item>
    <item>
      <title>Re: EOF</title>
      <link>https://community.hpe.com/t5/operating-system-linux/eof/m-p/3584248#M103712</link>
      <description>Hi&lt;BR /&gt;&lt;BR /&gt;The EOF is the end of the sqlplus commands&lt;BR /&gt;and, @ is a part of the oracle connect string. Starting listener and database works exact as starting.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Hi&lt;BR /&gt;export ORACLE_HOME=/opt/oracle/product/9.2&lt;BR /&gt;export ORACLE_SID=idmp005&lt;BR /&gt;export PATH=$PATH:/opt/oracle/product/9.2/bin:.&lt;BR /&gt;lsnrctl stop&lt;BR /&gt;/bin/cat &amp;lt;&lt;EOF&gt;&lt;/EOF&gt;@/home/oracle/bin/stop.sql&lt;BR /&gt;exit&lt;BR /&gt;EOF&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;lsnrctl start&lt;BR /&gt;/bin/cat &amp;lt;&lt;EOF&gt;&lt;/EOF&gt;@/home/oracle/bin/start.sql&lt;BR /&gt;exit&lt;BR /&gt;EOF&lt;BR /&gt;</description>
      <pubDate>Mon, 18 Jul 2005 00:21:07 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/eof/m-p/3584248#M103712</guid>
      <dc:creator>Leif Halvarsson_2</dc:creator>
      <dc:date>2005-07-18T00:21:07Z</dc:date>
    </item>
    <item>
      <title>Re: EOF</title>
      <link>https://community.hpe.com/t5/operating-system-linux/eof/m-p/3584249#M103713</link>
      <description>Here the line /bin/cat &amp;lt;&lt;EOF&gt;&lt;/EOF&gt;&lt;BR /&gt;U can try it in a command line itself. Try '/bin/cat &amp;lt;&lt;EOF&gt;' prompt to enter ur commands which will be redirected to the sql prompt , here enter some sql queries like 'select' etc. , now type exit which will exit from the sql prompt ( this will not be visible for u that u exited from the sql prompt ) , now type EOF , which will complete the command block of cat . Now u will get the out put of ur select commands.&lt;BR /&gt;&lt;BR /&gt;U can use a script like below to startup ur database.&lt;BR /&gt;&lt;BR /&gt;export ORACLE_HOME=/opt/oracle/product/9.2&lt;BR /&gt;export ORACLE_SID=idmp005&lt;BR /&gt;export PATH=$PATH:/opt/oracle/product/9.2/bin:.&lt;BR /&gt;/bin/cat &amp;lt;&lt;EOF&gt;&lt;/EOF&gt;startup&lt;BR /&gt;exit&lt;BR /&gt;EOF&lt;BR /&gt;lsnrctl start&lt;/EOF&gt;</description>
      <pubDate>Mon, 18 Jul 2005 00:38:56 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/eof/m-p/3584249#M103713</guid>
      <dc:creator>Bejoy C Alias</dc:creator>
      <dc:date>2005-07-18T00:38:56Z</dc:date>
    </item>
    <item>
      <title>Re: EOF</title>
      <link>https://community.hpe.com/t5/operating-system-linux/eof/m-p/3584250#M103714</link>
      <description>EOF is used in conventional way. You can use any pattern here. shell executes all the commands till it reads the same characters.&lt;BR /&gt;&lt;BR /&gt;for example,&lt;BR /&gt;&lt;BR /&gt;/bin/cat &amp;lt;&lt;SQLFROMSHELL&gt;&lt;/SQLFROMSHELL&gt;@/home/oracle/bin/stop.sql&lt;BR /&gt;exit&lt;BR /&gt;SQLFROMSHELL</description>
      <pubDate>Tue, 19 Jul 2005 02:14:54 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/eof/m-p/3584250#M103714</guid>
      <dc:creator>vasundhara</dc:creator>
      <dc:date>2005-07-19T02:14:54Z</dc:date>
    </item>
    <item>
      <title>Re: EOF</title>
      <link>https://community.hpe.com/t5/operating-system-linux/eof/m-p/3584251#M103715</link>
      <description>Well the others have said how it works, but just a few more details.&lt;BR /&gt;&lt;BR /&gt;The 'EOF' thing is called a "here document".&lt;BR /&gt;&lt;BR /&gt;Most modern shells have the ability to use them to encompass multiple lines of 'text', and can be used for pretty much any purpose.  Combined with a pipe, they are useful tools.&lt;BR /&gt;&lt;BR /&gt;Even Perl can use here documents (see man perlop, search for '&amp;lt;&lt;EOF&gt;&lt;/EOF&gt;&lt;BR /&gt;The thing to note is that the end-token is case specific (has to be identical to the opening-token), and can have no leading spaces or other characters.&lt;BR /&gt;&lt;BR /&gt;Basically, the here document extends the STDIN for the command it is &amp;lt;&amp;lt;'d (input-redirected) into.  So in reality, you could probably just &amp;lt;&lt;EOF it="" straight="" into="" the=""&gt;&lt;/EOF&gt;</description>
      <pubDate>Tue, 19 Jul 2005 07:22:23 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/eof/m-p/3584251#M103715</guid>
      <dc:creator>Stuart Browne</dc:creator>
      <dc:date>2005-07-19T07:22:23Z</dc:date>
    </item>
    <item>
      <title>Re: EOF</title>
      <link>https://community.hpe.com/t5/operating-system-linux/eof/m-p/3584252#M103716</link>
      <description>&lt;BR /&gt;You can pipe directly into sqlplus.  And I think you can also use "sqlplus &amp;lt;&amp;lt;" too, but I prefer the syntax below:&lt;BR /&gt;&lt;BR /&gt;Here is what I have in our Oracle startup scripts.&lt;BR /&gt;&lt;BR /&gt;Example 1: runs as root when the system boots:&lt;BR /&gt;&lt;BR /&gt;($SU and $USER1 would be assigned according to your system; $SU is your path to su or sudo, $USER1 is the dba account)&lt;BR /&gt;&lt;BR /&gt;cat &amp;lt;&amp;lt; _EOF_ | ($SU - $USER1 -c "sqlplus /nolog")&lt;BR /&gt;connect oradb/oradb as sysdba;&lt;BR /&gt;startup;&lt;BR /&gt;exit;&lt;BR /&gt;_EOF_&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Example 2: runs directly as the dba user:&lt;BR /&gt;&lt;BR /&gt;cat &amp;lt;&amp;lt; _EOF_ | sqlplus /nolog&lt;BR /&gt;connect oradb/oradb as sysdba;&lt;BR /&gt;startup;&lt;BR /&gt;exit;&lt;BR /&gt;_EOF_&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;If you really want to be fancy, you can put tabs in the code and then use &amp;lt;&amp;lt;- (note the addition of the dash (-).  This little trick works for sh (posix), ksh and bash:&lt;BR /&gt;&lt;BR /&gt;cat &amp;lt;&amp;lt;- EOF | sqlplus /nolog&lt;BR /&gt;[tab] connect oradb/oradb as sysdba;&lt;BR /&gt;[tab] startup;&lt;BR /&gt;[tab] exit;&lt;BR /&gt;[tab] EOF&lt;BR /&gt;&lt;BR /&gt;(I spelled out [tab] here because the forum does not handle tabs in postings very well).&lt;BR /&gt;&lt;BR /&gt;-- Tom&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Tue, 19 Jul 2005 15:25:54 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/eof/m-p/3584252#M103716</guid>
      <dc:creator>Tom Schroll</dc:creator>
      <dc:date>2005-07-19T15:25:54Z</dc:date>
    </item>
  </channel>
</rss>

