1 2 Previous Next 18 Replies Latest reply: Jan 30, 2013 11:55 AM by jgarry RSS

    spool

    11g.DBA
      Hi all,

      I want to create the output.txt file ,of spool command , on my network rather than the server itself.Is there any way to do that.

      Thanx
        • 1. Re: spool
          sb92075
          11g.DBA wrote:
          Hi all,

          I want to create the output.txt file ,of spool command , on my network rather than the server itself.Is there any way to do that.
          to where exactly does "on my network" actually mean?
          Thanx
          SQL> SPOOL OUTPUT.TXT

          the file will reside on the same directory from which you started sqlplus.
          If you want OUTPUT.TXT to be in some other directory, then change directory to where you desire it to go
          • 2. Re: spool
            Chanchal Wankhade
            Hi,

            You need to generate spool file on network correct if yes then provide the path of the folder on the network like below
            spool \\IP_ADDRESS\FOLDER_FOR_SPOOL_OUTPUT\chanchal\ttt.txt
            SELECT * FROM TEST;
            SPOOL OFF;
            You will get file on above specified location.
            • 3. Re: spool
              11g.DBA
              1) to where exactly does "on my network" actually mean?

              on my network actually means my server is located at some different place and I want to generate the output file on some other machine that is connected to the network of the server.



              @chanchal

              I tried this.

              Sorry i dint mention that server is on linux (As per i think it shouldnt matter though).

              The output of spool \\IP_ADDRESS\FOLDER_FOR_SPOOL_OUTPUT\chanchal\ttt.txt

              was a file created with name IP_ADDRESSFOLDER_FOR_SPOOL_OUTPUTchanchalttt.txt and on the server itself not on the network
              • 4. Re: spool
                sb92075
                11g.DBA wrote:
                1) to where exactly does "on my network" actually mean?

                on my network actually means my server is located at some different place and I want to generate the output file on some other machine that is connected to the network of the server.
                sqlplus username/password@linux_db_server
                the SPOOL file is created on same system from where sqlplus was started
                • 5. Re: spool
                  11g.DBA
                  So there is no way we can generate output on a remote machine??
                  • 6. Re: spool
                    baskar.l
                    Hi,
                    I want to create the output.txt file ,of spool command , on my network rather than the server itself.Is there any way to do that.
                    You can connect to the database from a different server where you need the spool file and can do

                    CONNECT username/password@SERVER
                    SPOOL C:\emp2C.txt

                    so the spool file will be generated not in the host server.

                    thank you,
                    baskar.l
                    • 7. Re: spool
                      11g.DBA
                      I dont have oracle client installed on remote machines,I am accessing oracle database directly on server.
                      • 8. Re: spool
                        sb92075
                        11g.DBA wrote:
                        So there is no way we can generate output on a remote machine??
                        who is "we"?
                        "remote" is relative to what?

                        exactly where do you desire the SPOOL file to be produce & specify in absolute & unambiguous terms.
                        • 9. Re: spool
                          633234
                          if you are using windows system, then you need to map drive and then you can create spool file over there like

                          SQL> spool X:\spool_output.txt
                          .
                          .
                          .
                          SQL> spool off

                          where X:\ is network drive and you should have write permission on it.
                          • 10. Re: spool
                            11g.DBA
                            Can you please stop responding to my threads.You are just replying to each and everyone's thread and not even a single reply of users is useful to anybody.Please do not reply to my questions as i dont need your "VALUABLE" advice.

                            Please stop replying to everyone(just to increase your number of posts) till you dont have a solution.

                            Thanx :)
                            • 11. Re: spool
                              Chanchal Wankhade
                              Hi,

                              What i mean was i use windows server.

                              Lets take a example

                              M database is cituated on 100.100.1.0 ip address.
                              I Am firing query from 100.10.1.10 which is in my domain.

                              Your question --> i need output on network
                              What is network. Netword is the location correct. so specify Ip_address first and the location followed.
                              like if my folder is on network and i want to write spool file there then i can use
                              spool \\100.10.1.1\spool_test\test.txt;
                              your query
                              spool off;

                              It will generate spool file on the specified location on windows.
                              • 12. Re: spool
                                11g.DBA
                                Thanx Chanchal,

                                Let me show the complete scenerio:

                                Oracle Server(Linux): 10.10.1.30
                                Windows system(where i want the output to be generated): 10.10.1.20

                                I am using putty to connect to the oracle server.
                                Firing query from oracle server as

                                spool \\10.10.1.20\d\output.txt
                                select * from tab;
                                spool off

                                10.10.1.20dOutput.txt is generated in /root on 10.10.1.30 i.e. on Oracle server itself.

                                I want it to be generated on 10.10.1.20 instead
                                • 13. Re: spool
                                  Chanchal Wankhade
                                  Hi,

                                  Correct but first of all you need to check that whether you are able to get net bios of the said location.
                                  Just do one thing copy past the below command in your run dialog box and hit enter.
                                  It must be shared location on windows so the users who have privileges to access this location can able to access.

                                  \\10.10.1.20\d\output.txt


                                  In you case your D drive on 10.10.1.20 server must be shared drive.
                                  if you are not able to access or any error occured then you will need to contact to your Network team for netbios.

                                  Edited by: Chanchal Wankhade on Jan 29, 2013 10:47 PM
                                  • 14. Re: spool
                                    11g.DBA
                                    yes \\10.10.1.20\d is shared with "Full Control" permission enabled for "everyone".
                                    1 2 Previous Next