How to run a spool program in unix environment within a shell script

Hi
I have written a spool program , which i run from SQL * PLUS
using
@'path of the spool file having extension .sql'
Now i want to include this spool program within the shell script , please help me , how to do it.
Thanks in advance ..

user8703472 wrote:
Thank You Sir for the reply .
#!/bin/ksh
ORACLE_SID=<SID>; export ORACLE_SID
ORACLE_HOME=<ORACLE_HOME>; export ORACLE_HOME
$sqlplus / as sysdba <<-EOFSQL1 >> output.log 2>&1
spool /tmp/a.log
select * from v\$instance
spool off;
EOFSQL1
Please explain me this statement $sqlplus / as sysdba
and also what a.log contains .
i have the user id and password for the DB.
should i write something like this
$sqlplus -Uusername -Ppassword -Sservername
i know how to run a procedure from isql(sybase DB)
Ahh.... but oracle is not just sybase under a different name.
It would be a good investment in your career to go to tahiti.oracle.com. Drill down to your product and version. There you will find the complete doc library.
You should spend a few minutes just getting familiar with what kind of documentation is available there by simply browsing the titles under the "Books" tab.
Open the Reference Manual and spend a few minutes looking through the table of contents to get familiar with what kind of information is available there. Learning where to look things up in the documentation is time well spent on your career.
For your immediate task, spend a few minutes looking through the SQLPlus User Guide and Reference.
Then set yourself a plan to dig deeper.
- Read a chapter a day from the Concepts Manual.
- Look in your alert log and find all the non-default initialization parms listed at instance startup. Then read up on each one of them in the Reference Manual. Take a look at your listener.ora, tnsnames.ora, and sqlnet.ora files, then bounce what you see there in the network administrators manual.
Give a man a fish and he eats for a day. Teach a man to fish and he eats for a lifetime.
But this project , i need to run the spool program from with in a shell script .We see what you mean, but the term "spool program" has no meaning in Oracle and only serves to cloud the issue. I know you are used to using this term with other products, but "When in Rome ...."
>
Thank You in advance ..

Similar Messages

  • Running Pro*C program in Unix environment.

    I have a program developed in Pro*C running on AIX version 5.3 and at the moment compiled in a 10g release 2 environment.
    This program find some job to start via a system() call. On previous release of Oracle software I have the possibility to get error detected in these job, but now every job return error code 0!
    I have found out that it easily can be seen, if you start a sqlplus on the unix commandline and start a host command (!) inside this sqlplus, then all command called from this new unix prompt will return error code 0, and no error can be detected! Try run the command diff x y where file x and y does not exist, and see the error code (type echo $?).
    My question is have anyone seen this problem, and have somebody found a solution? My guess is that it is a problem in the AIX port, but I have not the possibility to try on other hardware running Unix.

    unix> uname -a
    AIX david 3 5 00C5E53B4C00
    unix> echo My C-program
    My C-program
    unix> diff x y
    diff: x: A file or directory in the path name does not exist.
    diff: y: A file or directory in the path name does not exist.
    unix> echo $?
    2
    unix> ./bostst1 ksh
    tor 12 okt 09:09:20 2006
    unix> diff x y
    diff: x: A file or directory in the path name does not exist.
    diff: y: A file or directory in the path name does not exist.
    unix> echo $?
    2
    unix>
    unix> echo My Pro*C program:
    My Pro*C program:
    unix> diff x y
    diff: x: A file or directory in the path name does not exist.
    diff: y: A file or directory in the path name does not exist.
    unix> echo $?
    2
    unix> ./bostst ksh
    Dato: 2006.10.12 09:13:15
    unix> diff x y
    diff: x: A file or directory in the path name does not exist.
    diff: y: A file or directory in the path name does not exist.
    unix> echo $?
    0
    unix> sqlplus scott/tiger
    SQL*Plus: Release 10.2.0.1.0 - Production on To Okt 12 09:13:55 2006
    Copyright (c) 1982, 2005, Oracle. All rights reserved.
    Forbindelse er oprettet til :
    Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - 64bit Production
    With the Partitioning, OLAP and Data Mining options
    SQL> !diff x y ; echo $?
    diff: x: A file or directory in the path name does not exist.
    diff: y: A file or directory in the path name does not exist.
    0
    SQL>
    I hope this show the problem !!!
    On what platform are you (Kamal Kishore) running?

  • Java program in UNIX environment

    Hi All,
    Could you please help me with how to configure a java program in UNIX environment..
    that is to schedule it to run every day from cron..
    I need to know what are the basic things we require to achieve the above..
    I guess it is:
    A script
    A config file containing db login details
    oher than this I don?t know what is required plz help

    You can execute any jar or class file with cron. If you are using a jar you might use something like java -jar /usr/bin/myapp.jar .
    I use Linux, this is my area of expertise.
    Here is an online guide "for complete newbies" on how to set up cron.
    http://www.unixgeeks.org/security/newbie/unix/cron-1.html
    Hope it helps.

  • How to run a Concurrent Program from the back end?

    Hi,
    How to run a Concurrent Program from the back end?
    Is it Possible to see that Concuurent Request id which we run from the back end, in the front end?
    If yes, then Please Give reply how to write the code
    Thanks in Advance,
    Bharathi.S

    This is documented in Chapter 20 of the Application Developers Guide http://download.oracle.com/docs/cd/B53825_03/current/acrobat/121devg.pdf. These MOS Docs also have some information available
    221542.1 - Sample Code for FND_SUBMIT and FND_REQUEST API's
    235359.1 - How to Launch Planning Data Pull MSCPDP using FND_REQUEST.SUBMIT_REQUEST
    HTH
    Srini

  • How to submit a cuncurrent program from UNIX?

    How to submit a concurrent program from UNIX.Plz reply immediatly

    Please see;
    Oracle Metalink Document: How to Submit a Concurrent Request Using CONCSUB Syntax: Doc ID: Note:457519.1
    https://metalink.oracle.com/metalink/plsql/f?p=130:14:5250231761732667752::::p14_database_id,p14_docid,p14_show_header,p14_show_help,p14_black_frame,p14_font:NOT,457519.1,1,1,0,helvetica
    Adith

  • How to run a JAR file in Unix system?

    hi there
    ca anyone tell me how to run a JAR file in unix system or X window, thank you

    You want to create an executable JAR file? You do it in the following way.
    Create a manifest file such as manif.txt and the contents should contain
    Main-Class: foo
    assuming foo is the name of your main class. Then create the jar as follows
    jar cvfm foo.jar manif.txt foo.class
    I hope that helps you!
    you can find more info here http://java.sun.com/docs/books/tutorial/jar/

  • How to run automatic payment program business area wise

    dear all
    please let me know how to run automtic payment program business area wise.
    for example business area 2020 we want to make payment business area wise.
    what are the back gorund settings for congigration Tc- fbzp
    wht are the configrations forTC- f110
    regards
    babu

    Hi,
    You can make payments business area wise if you had ticked payment goup business area wise in the payment method in company code screen. However you will have to give company codes in the payment parametets, but payments will be grouped by business area.
    Thanks,
    Ramesh.

  • How to run a ABAP Program in Batch JOB

    How to run a ABAP Program in Batch JOB ?

    Hello Manish,
    Using transaction SM36 you can define the batch job along with the start conditions for that job.
    1. Transaction SM36.
    2. Give the Z name of the job in the 'Job Name' input field.
    3. Click on 'Steps' button from the application toolbar.
    4. On the 'Create Step 1' dialog box, give the name of the ABAP program in the 'ABAP Program' section' along with the variant.
    5. Click on 'Check Input' button from the dialog box.
    6. Click on 'Save' button from the dialog box once the check is successful.
    7. One list will be shown. Click on Back button from the standard toolbar.
    8. Click on 'Start Conditions' button from the application toolbar. Specify the start condition e.g. immediate. Click on save.
    9. The job staus is now scheduled.
    10.Click on Save button from the standard toolbar of SM36. The job status will be released.
    Using SM37 you can monitor the status of the job.
    This will sort out your problem.
    PS If the answer solves your query, plz reward points.
    Regards

  • How to run a java program in another folder

    Hello!
    I want to run for example the java class file in the path ./sourcecode/javafile.class. It works fine if I do the following:
    cd sourcecode
    java javafile
    but it cannot work if I do:
    java sourcecode/java
    The error it outputs is NoClassDefFoundError.
    Can someone tell me how to run a java program in another folder
    thanks a lot.

    You need to specify the classpath using the -cp flag when running. so instead of
    "java sourcecode/javafile"
    Try
    "java -cp sourcecode javafile"

  • How to run the Servlet program?

    hi, all, I am new to servlet, and I want to know how to run the servlet program. I got the TomCat and Java JDK install in my computer, something else I need for create and run the servlet program?

    no that is all u need to run servlets. u can try few of the servlets that come with tomcat

  • How to run the package programs in eclipse ?

    hi all,
    how to run the package programs in eclipse ?
    plz clarify...
    regards
    balakrishna.m

    package source code is
    package package1;
    public class ClassaA
              public void displayA()
                   System.out.println("class A");
         }java source code is import package1.ClassA;
         class Packagetest1
              public static void main(String args[])
                   ClassA objectA = new ClassA();
                   objectA.displayA();
         }if i write the notepad means its executing successfully..
    but in eclips is not working..
    plz help me..

  • How to run windows application programs in mac book pro, how to run windows application programs in mac book pro

    how to run windows application programs in mac book pro, how to run windows application programs in mac book pro

    Install Windows..either by Boot Camp or via virtual machine from VMWare, Parallels or Virtual Box

  • How to run OBIEE Reports in Multi-Org Environment?

    How to run OBIEE Reports in Multi-Org Environment of EBS.

    hi Rainer,
    My Forms and Reports Server is in Same System only. Actually i am giving this path
    http://vagee.ail/reports/rwservlet?
    server=rep_vagee_oracle10g_apps_server&report=D:\FP2
    \dealer_reports\oc_dealer.rep&userid=fp2/fp2erp@info
    &destype=cache&desformat=pdf&ODSNO=OC0809/00110&branch=DLR002
    In My AS System Running Successfully. But Client systems Page cannot be display message is displaying.
    but generally i m able to access the reports server using this path
    http://vagee.ail/reports/rwservlet?
    then Reports server page is displaying but
    when i specify that report server name
    http://vagee.ail/reports/rwservlet?server=rep_vagee_oracle10g_apps_server
    page cannot be displayed.
    what will be the problem. please help me. thank you.
    Regards,
    Kalyan.

  • UNIX path AND  Do shell script path with spaces

    I am trying to building a interface with buttons to execute shell commands when the button is pressed. Below press button execute code.
    I am new to AppleScript and Xcode and Interface builder. I have read different post referencing spaces but I still don't understand.
    THIS COMMAND DOESN'T WORK IT'S SOMETHING TO DO WITH SPACES.
    How would I fix this to work.
    on clicked theObject
    do shell script "rm /Library/Preferences/com.netopia.netOctopus\ Agent.preferences"
    end clicked
    This works (Below) no spaces in the path
    on clicked theObject
    do shell script "open /System/Library/PreferencePanes/SharingPref.prefPane/"
    end clicked
    ALL Mac OS X (10.4.6)
    ALL   Mac OS X (10.4.6)  
    ALL   Mac OS X (10.4.6)  
    ALL   Mac OS X (10.4.6)  
    ALL   Mac OS X (10.4.6)  
    ALL   Mac OS X (10.4.6)  
    ALL   Mac OS X (10.4.6)  
    ALL   Mac OS X (10.4.8)  
    ALL   Mac OS X (10.4.8)  

    Camelot's explanation was good, but you don't seem to get it, so I'll take a crack at explaining as well.
    First off, you need to understand what "do shell script" does and does not do. "do shell script" takes a string from AppleScript and passes it to a shell interpreter. It does not check in advance that this string makes sense. (That is impossible to do, in fact.) It just passes it along. The shell interpreter then converts the string into a command, or series of commands, and attempts to run them.
    In AppleScript, quotation marks around something make that something a string. So, for example:
    "rm "
    is a string containing a letter r, a letter m, and then a space. Some commands can also return a string, which can then be stored in a named variable, as for example:
    set a_variable to (the text returned of display dialog "Hi!" default answer "Some text")
    When you wish to put two strings together in AppleScript, you use the & operator, as in:
    "String 1" & "String 2"
    In this example, there is no space at the end of the first string, and none at the beginning of the second, so the result is:
    "String 1String 2"
    All clear so far?
    When a shell interpreter attempts to convert a string into commands, it has to split the string into pieces. A space signifies a break between pieces. In order to put a space into a single item, you can do a number of things. You can put the whole item in quotation marks (single or double), which is known as "quoting":
    '/A/Path/With/A Space'
    or you can put a backslash before the space, which is known as "escaping":
    /A/Path/With/A\ Space
    You can combine quoting and escaping if you do it right. For example, the backslash also lets you use a quotation mark inside a single item which is quoted:
    "/A/Path/With/A Space/And/A\"Quotation/Mark"
    There are further rules and substitutions that sometimes border on the arcane.
    In order to simplify things, Apple created the command "the quoted form of". This command takes a string and returns a new string which is properly set up so that it will be just one item when split up for the command line. It will add quotation marks, backslashes, or whatever.
    So, to put things together:
    "rm " & the quoted form of thePath
    is a way of saying to AppleScript "take the string in the variable named thePath, and quote it for the command line; then stick it on the end of a string containing an r, an m, and a space."
    When you pass this to "do shell script", it will break things up in such a way that it hands thePath to the rm command, which will attempt to remove whatever is represented by thePath. (Adding the "-r" in there just tells the rm command "if this is a directory, get rid of it and all its contents". Otherwise rm will complain if the item is a directory.)
    I think, however, you may just have the path wrong. In one of the spots where you gave the POSIX path, it had a backslash (\) at the end instead of a forward slash (/). As Camelot says, a forward slash means that the item is a directory and not a plain file. But if you really meant the backslash, it suggests that the item is a plain file, but has a space at the end (or some other character that mystifies the command line). It's an escape.
    Try making a new script in Script Editor which says
    ">" & (the POSIX path of (choose file)) & "<" at the end, that's the culprit.
    (And if it won't let you select the file when you run the script, it means that the item is actually a folder.)

  • How to run a java program in windows 2003 server from unix server.

    Hi ,
    I want to run a java program in windows 2003 server from unix machine ..
    will RMI helps me to obtain this.
    Please tell me the procedure to do this.
    Thanks in advance,

    rmi,web services,corba,web 2.0,xml,xls,dtd,rss,ruby on rails,https,soap,tags,blog,podcast,google

Maybe you are looking for