<?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: sql command batch file in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/sql-command-batch-file/m-p/5205808#M651669</link>
    <description>Hi&lt;BR /&gt;&lt;BR /&gt;either this is a permission problem (check the permissions associated with the owner of the sqlplus process) or the file system is full.&lt;BR /&gt;&lt;BR /&gt;Regards&lt;BR /&gt;Jean-Luc</description>
    <pubDate>Mon, 02 Nov 2009 16:29:14 GMT</pubDate>
    <dc:creator>Jean-Luc Oudart</dc:creator>
    <dc:date>2009-11-02T16:29:14Z</dc:date>
    <item>
      <title>sql command batch file</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/sql-command-batch-file/m-p/5205797#M651658</link>
      <description>hi all&lt;BR /&gt;i have hp-ux 11i v1 with oracle 10g r2 installed i want to create batch file to run sql command monthly i have write this line first in the batch&lt;BR /&gt;su - oracle -c sqlplus&lt;BR /&gt;the sqlplus is run when i run this batch but its tell me to enter user name and password for sql user what i need is to put this user and password in this batch to run the sql &lt;BR /&gt;but i dont know how.&lt;BR /&gt;any help please.&lt;BR /&gt;regards</description>
      <pubDate>Sat, 24 Oct 2009 05:26:09 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/sql-command-batch-file/m-p/5205797#M651658</guid>
      <dc:creator>tareq_2</dc:creator>
      <dc:date>2009-10-24T05:26:09Z</dc:date>
    </item>
    <item>
      <title>Re: sql command batch file</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/sql-command-batch-file/m-p/5205798#M651659</link>
      <description>&lt;BR /&gt;Hi,&lt;BR /&gt;&lt;BR /&gt;You can invoke sql commands(or using cron) from shell script similar to this.&lt;BR /&gt;&lt;BR /&gt;# su - oracle -c "sqlplus ane/ane123 @/tmp/ss.sql&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Aneesh</description>
      <pubDate>Sat, 24 Oct 2009 09:19:39 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/sql-command-batch-file/m-p/5205798#M651659</guid>
      <dc:creator>Aneesh Mohan</dc:creator>
      <dc:date>2009-10-24T09:19:39Z</dc:date>
    </item>
    <item>
      <title>Re: sql command batch file</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/sql-command-batch-file/m-p/5205799#M651660</link>
      <description>Do you 'normally' not have to specify a user/pass?&lt;BR /&gt;&lt;BR /&gt;Please define 'normal'&lt;BR /&gt;- user&lt;BR /&gt;- su ?&lt;BR /&gt;- SQlplus command.&lt;BR /&gt;&lt;BR /&gt;One way NOT to have to specify a password is when the user is created "IDENTIFIED EXTERNALLY".&lt;BR /&gt;Check the Oracle Doc, or help, or:&lt;BR /&gt;&lt;A href="http://www.orafaq.com/wiki/Oracle_database_Security_FAQ" target="_blank"&gt;http://www.orafaq.com/wiki/Oracle_database_Security_FAQ&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;Is that the method you use to get in 'normally'?&lt;BR /&gt;&lt;BR /&gt;There is really no (good!) reason to switch to the Oracle account to run an oracle task. It's more clear, clean, accountable, to use a proper user or role name.&lt;BR /&gt;&lt;BR /&gt;I suspect the in the case of the batch job the ORA* environment variables were not set up, or set up differently. &lt;BR /&gt;Fix that, and perhaps the PATH and be happy?!&lt;BR /&gt;&lt;BR /&gt;hth,&lt;BR /&gt;Hein.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Sat, 24 Oct 2009 14:54:45 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/sql-command-batch-file/m-p/5205799#M651660</guid>
      <dc:creator>Hein van den Heuvel</dc:creator>
      <dc:date>2009-10-24T14:54:45Z</dc:date>
    </item>
    <item>
      <title>Re: sql command batch file</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/sql-command-batch-file/m-p/5205800#M651661</link>
      <description>hi &lt;BR /&gt;thanks for help what i need now is to make the .sql file to run my sql command but how i can make this file could you send me example file to see how .&lt;BR /&gt;&lt;BR /&gt;su - oracle -c "sqlplus ane/ane123 @/tmp/ss.sql&lt;BR /&gt;i have write this command but the user name feild is appear to put the user name and password for the sql &lt;BR /&gt;&lt;BR /&gt;"Hein"  i cant understand what you want to tell me exactly  .&lt;BR /&gt;thanks for help</description>
      <pubDate>Sun, 25 Oct 2009 05:44:07 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/sql-command-batch-file/m-p/5205800#M651661</guid>
      <dc:creator>tareq_2</dc:creator>
      <dc:date>2009-10-25T05:44:07Z</dc:date>
    </item>
    <item>
      <title>Re: sql command batch file</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/sql-command-batch-file/m-p/5205801#M651662</link>
      <description>&amp;gt;&amp;gt;what i need now is to make the .sql file to run my sql command &lt;BR /&gt;&lt;BR /&gt;Create a file with your sql statements.&lt;BR /&gt;&lt;BR /&gt;# cat /tmp/ss.sql&lt;BR /&gt;select * from tab;&lt;BR /&gt;exit&lt;BR /&gt;#&lt;BR /&gt;&lt;BR /&gt;Create a file with your sql statements.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;As Hein stated above , its is better to use external authentication to accomplish this task.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;External Authentication ( Using OS ) for a sql user "ops"&lt;BR /&gt;-----------------------------------------------&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;1) SQL&amp;gt; show parameter os_authent_prefix&lt;BR /&gt;&lt;BR /&gt;NAME                                 TYPE        VALUE&lt;BR /&gt;------------------------------------ ----------- ------------------------------&lt;BR /&gt;os_authent_prefix                    string      ops$&lt;BR /&gt;&lt;BR /&gt;2) SQL&amp;gt; alter system set os_authent_prefix='' scope=spfile;&lt;BR /&gt;&lt;BR /&gt;3) create user ops identified externally;&lt;BR /&gt;&lt;BR /&gt;4) grant connect,resource to ops; &lt;BR /&gt;&lt;BR /&gt;5) shutdown and startup the database.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;On Unix&lt;BR /&gt;-----------&lt;BR /&gt;&lt;BR /&gt;6) useradd -g 106 -d /home/ops -m -k /etc/skel -s /usr/bin/sh ops.&lt;BR /&gt;&lt;BR /&gt;(use dba gid instead of 106 in your case)&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;7) passwd ops &lt;BR /&gt;&lt;BR /&gt;8) set ORACLE_SID ,PATH,ORACLE_HOME to appropriate values in the ops user .profile.&lt;BR /&gt;&lt;BR /&gt;9)login as ops (unix)&lt;BR /&gt;&lt;BR /&gt;10) schedule sql scripts without giving the oracle username/password.&lt;BR /&gt;&lt;BR /&gt;example :- sqlplus / @myscript.sql  ( login as ops (os user)&lt;BR /&gt;&lt;BR /&gt;If you want to execute it from root ,then&lt;BR /&gt;&lt;BR /&gt;su - ops -c "sqlplus / @myscript.sql"&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Regards,&lt;BR /&gt;Aneesh</description>
      <pubDate>Sun, 25 Oct 2009 07:42:31 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/sql-command-batch-file/m-p/5205801#M651662</guid>
      <dc:creator>Aneesh Mohan</dc:creator>
      <dc:date>2009-10-25T07:42:31Z</dc:date>
    </item>
    <item>
      <title>Re: sql command batch file</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/sql-command-batch-file/m-p/5205802#M651663</link>
      <description>Tareq,&lt;BR /&gt;&lt;BR /&gt;What I tried to ask is whether this ever works for you. &lt;BR /&gt;When you use is interactively ( normal  ), does this command work?&lt;BR /&gt;   - sqlplus ane/ane123 @/tmp/ss.sql&lt;BR /&gt;&lt;BR /&gt;This relies on ORA_SID to point to the right database.&lt;BR /&gt;Maybe that when run as batcg job, or after the "su -" that ORA_SID is a different DB, or not defined at all??&lt;BR /&gt;&lt;BR /&gt;Things to try:&lt;BR /&gt;&lt;BR /&gt; - sqlplus ane/ane123@&lt;SID&gt; @/tmp/ss.sql&lt;BR /&gt;&lt;BR /&gt;&lt;SID&gt; is the desired entry in TNSNAMES.ORA&lt;BR /&gt;&lt;BR /&gt;and &lt;BR /&gt;&lt;BR /&gt;   su - oracle -c "env | grep -i ora"&lt;BR /&gt;&lt;BR /&gt;The other thing I tried to ask was to get you to think about how you normally log in? &lt;BR /&gt;Do you normally pass a username and password or not?&lt;BR /&gt;And why not run the oracle job under your own account? Why switch user to oracle?&lt;BR /&gt;&lt;BR /&gt;Hein.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/SID&gt;&lt;/SID&gt;</description>
      <pubDate>Sun, 25 Oct 2009 12:35:24 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/sql-command-batch-file/m-p/5205802#M651663</guid>
      <dc:creator>Hein van den Heuvel</dc:creator>
      <dc:date>2009-10-25T12:35:24Z</dc:date>
    </item>
    <item>
      <title>Re: sql command batch file</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/sql-command-batch-file/m-p/5205803#M651664</link>
      <description>&lt;BR /&gt;&lt;BR /&gt;sqlplus ane/ane123 @/tmp/ss.sql&lt;BR /&gt;this command is working normal without the sid coz i have one sid and its the default sid for one database is not Necessary to provide the sid if you have one database as default. but my main issue is not this section (sqlplus ane/ane123) my issue is the second section (@/tmp/ss.sql) this section is not work.&lt;BR /&gt; when i write the complete command like this &lt;BR /&gt;su - oracle -c sqlplus ane/ane123 @/tmp/ss.sql the result is he login to the oracle user just that he didnt run the complete command and go to the sql.&lt;BR /&gt;i have made new batch this batch contain :&lt;BR /&gt;sqlplus ane/ane123 &lt;BR /&gt;&lt;BR /&gt;the main batch contain like this:&lt;BR /&gt;&lt;BR /&gt;su - oracle -c ./sqlbatch.sh&lt;BR /&gt;&lt;BR /&gt;this working good and take me to sqlplus command line but he didnt this section:&lt;BR /&gt;@/tmp/ss.sql&lt;BR /&gt;&lt;BR /&gt;what i can do for that &lt;BR /&gt;any help please&lt;BR /&gt;thnks</description>
      <pubDate>Mon, 26 Oct 2009 07:49:15 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/sql-command-batch-file/m-p/5205803#M651664</guid>
      <dc:creator>tareq_2</dc:creator>
      <dc:date>2009-10-26T07:49:15Z</dc:date>
    </item>
    <item>
      <title>Re: sql command batch file</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/sql-command-batch-file/m-p/5205804#M651665</link>
      <description>Hello,&lt;BR /&gt;don't use sqlplus ane/ane123 but:&lt;BR /&gt;sqlplus&lt;BR /&gt;conn ane/ane123&lt;BR /&gt;....&lt;BR /&gt;exit&lt;BR /&gt;&lt;BR /&gt;reason why is that by 'ps -ef|grep [s]qlplus' in teh first way is it possible to cach database password!!&lt;BR /&gt;&lt;BR /&gt;HTH,&lt;BR /&gt;Art&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Mon, 26 Oct 2009 07:51:52 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/sql-command-batch-file/m-p/5205804#M651665</guid>
      <dc:creator>Arturo Galbiati</dc:creator>
      <dc:date>2009-10-26T07:51:52Z</dc:date>
    </item>
    <item>
      <title>Re: sql command batch file</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/sql-command-batch-file/m-p/5205805#M651666</link>
      <description>Please keep in mind, if you use the command sqlplus ane/ane123 @/tmp/ss.sql and another user does a ps -ef, your Oracle user and password will be displayed.  If you are concerned with security, you may want to look at OS anthentication.  Create an Oracle user with the OPS$ prefix e.i. ops$ane and create a UNIX user as ane.  The command will be sqlplus @/tmp/ss.sql and logged into the ane UNIX account. &lt;BR /&gt;&lt;BR /&gt;To be very secure, you can also change the prefix.  Just set a new value for the os_authent_prefix parameter.</description>
      <pubDate>Mon, 26 Oct 2009 13:47:15 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/sql-command-batch-file/m-p/5205805#M651666</guid>
      <dc:creator>John Brooks_1</dc:creator>
      <dc:date>2009-10-26T13:47:15Z</dc:date>
    </item>
    <item>
      <title>Re: sql command batch file</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/sql-command-batch-file/m-p/5205806#M651667</link>
      <description>thanks for all&lt;BR /&gt;your help was usefull but still i have one thing, in my batch file i have this line &lt;BR /&gt;&lt;BR /&gt;spool /u02/dw.sql&lt;BR /&gt;&lt;BR /&gt;but i face this error&lt;BR /&gt;"cannot create spool file"&lt;BR /&gt;what i can do to resolve this error&lt;BR /&gt;thank for help again&lt;BR /&gt;best regards</description>
      <pubDate>Sun, 01 Nov 2009 08:07:50 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/sql-command-batch-file/m-p/5205806#M651667</guid>
      <dc:creator>tareq_2</dc:creator>
      <dc:date>2009-11-01T08:07:50Z</dc:date>
    </item>
    <item>
      <title>Re: sql command batch file</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/sql-command-batch-file/m-p/5205807#M651668</link>
      <description>Check whether you have proper permission on /u02...&lt;BR /&gt;&lt;BR /&gt;Regards,&lt;BR /&gt;Aneesh</description>
      <pubDate>Mon, 02 Nov 2009 05:24:48 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/sql-command-batch-file/m-p/5205807#M651668</guid>
      <dc:creator>Aneesh Mohan</dc:creator>
      <dc:date>2009-11-02T05:24:48Z</dc:date>
    </item>
    <item>
      <title>Re: sql command batch file</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/sql-command-batch-file/m-p/5205808#M651669</link>
      <description>Hi&lt;BR /&gt;&lt;BR /&gt;either this is a permission problem (check the permissions associated with the owner of the sqlplus process) or the file system is full.&lt;BR /&gt;&lt;BR /&gt;Regards&lt;BR /&gt;Jean-Luc</description>
      <pubDate>Mon, 02 Nov 2009 16:29:14 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/sql-command-batch-file/m-p/5205808#M651669</guid>
      <dc:creator>Jean-Luc Oudart</dc:creator>
      <dc:date>2009-11-02T16:29:14Z</dc:date>
    </item>
    <item>
      <title>Re: sql command batch file</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/sql-command-batch-file/m-p/5205809#M651670</link>
      <description>thanks for all&lt;BR /&gt;your help was very usefull thanks again&lt;BR /&gt;best regards for you</description>
      <pubDate>Tue, 03 Nov 2009 14:21:27 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/sql-command-batch-file/m-p/5205809#M651670</guid>
      <dc:creator>tareq_2</dc:creator>
      <dc:date>2009-11-03T14:21:27Z</dc:date>
    </item>
  </channel>
</rss>

