Spool file problem,Can't see the query in output file.

Hello ,
I am facing a very old school kind of problem .....about spool file ....
The scenario -
I have made a script by name DB_Status_checkup.sql which i want to fire on the database to check the database status. In this script their are many queries regarding the data dictionary views to know about the database. It consist of nearly 25-30 different select queries..
The problem is i want to make a spool file of the output of that query....i want to see the SQL query & the output below in the spool file, so it will be easy for me to judge the result. But i can't see the SQL query , i can only see the output , & in so many queries it all gets jumbled up....even i can't understand where the next output starts ...
Sample of my SQL Script ....
clear buffer
spool D:\DB_status.txt
/*To check the database startup time*/
Select to_char(startup_time, 'HH24:MI DD-MON-YY') "Startup time"
from v$instance
.........next query n so on....
spool off;
In the output pf the spool file at D:\db_status.txt..
Startup time
08:25 16-JUL-10It shows only the output of the query in the spool file not the query,
What should i do to get the SQL query as well as the output of that query just below it in the spool file ???
Please suggest if you have anymore ideas , regarding this .....
ORACLE 10g R2
Windows Server 2008
Thanks in advance ...

Why don't you just use database control, instead of re-inventing the wheel?
Apart from that, SQL*Plus has it's own reference manual, which you apparently refuse to read.
The answer to your quiz/doc question is
set echo on
Sybrand Bakker
Senior Oracle DBA

Similar Messages

  • Can users see the query plan of a SQL query in Oracle?

    Hi,
    I wonder for a given sql query, after the system optimization, can I see the query plan in oracle? If yes, how to do that? thank you.
    Xing

    You can use explain plan in SQLPlus
    SQL>  explain plan for select * from user_tables;
    Explained.
    Elapsed: 00:00:01.63
    SQL> select * from table(dbms_xplan.display());
    PLAN_TABLE_OUTPUT
    Plan hash value: 806004009
    | Id  | Operation                       | Name     | Rows  | Bytes | Cost (%CPU)| Time     |
    |   0 | SELECT STATEMENT                |          |  2014 |  1123K|   507   (6)| 00:00:07 |
    |*  1 |  HASH JOIN RIGHT OUTER          |          |  2014 |  1123K|   507   (6)| 00:00:07 |
    |   2 |   TABLE ACCESS FULL             | SEG$     |  4809 |   206K|    34   (3)| 00:00:01 |
    |*  3 |   HASH JOIN RIGHT OUTER         |          |  1697 |   873K|   472   (6)| 00:00:06 |
    |   4 |    TABLE ACCESS FULL            | USER$    |    74 |  1036 |     3   (0)| 00:00:01 |
    |*  5 |    HASH JOIN OUTER              |          |  1697 |   850K|   468   (6)| 00:00:06 |
    |   6 |     NESTED LOOPS OUTER          |          |  1697 |   836K|   315   (6)| 00:00:04 |
    |*  7 |      HASH JOIN                  |          |  1697 |   787K|   226   (8)| 00:00:03 |
    |   8 |       TABLE ACCESS FULL         | TS$      |    13 |   221 |     5   (0)| 00:00:01 |
    |   9 |       NESTED LOOPS              |          |  1697 |   759K|   221   (8)| 00:00:03 |
    |  10 |        MERGE JOIN CARTESIAN     |          |  1697 |   599K|   162  (10)| 00:00:02 |
    |* 11 |         HASH JOIN               |          |     1 |   326 |     1 (100)| 00:00:01 |
    |* 12 |          FIXED TABLE FULL       | X$KSPPI  |     1 |    55 |     0   (0)| 00:00:01 |
    |  13 |          FIXED TABLE FULL       | X$KSPPCV |   100 | 27100 |     0   (0)| 00:00:01 |
    |  14 |         BUFFER SORT             |          |  1697 | 61092 |   162  (10)| 00:00:02 |
    |* 15 |          TABLE ACCESS FULL      | OBJ$     |  1697 | 61092 |   161  (10)| 00:00:02 |
    |* 16 |        TABLE ACCESS CLUSTER     | TAB$     |     1 |    96 |     1   (0)| 00:00:01 |
    |* 17 |         INDEX UNIQUE SCAN       | I_OBJ#   |     1 |       |     0   (0)| 00:00:01 |
    |  18 |      TABLE ACCESS BY INDEX ROWID| OBJ$     |     1 |    30 |     1   (0)| 00:00:01 |
    |* 19 |       INDEX UNIQUE SCAN         | I_OBJ1   |     1 |       |     0   (0)| 00:00:01 |
    |  20 |     TABLE ACCESS FULL           | OBJ$     | 52728 |   411K|   151   (4)| 00:00:02 |
    Predicate Information (identified by operation id):
       1 - access("T"."FILE#"="S"."FILE#"(+) AND "T"."BLOCK#"="S"."BLOCK#"(+) AND
                  "T"."TS#"="S"."TS#"(+))
       3 - access("CX"."OWNER#"="CU"."USER#"(+))
       5 - access("T"."DATAOBJ#"="CX"."OBJ#"(+))
       7 - access("T"."TS#"="TS"."TS#")
      11 - access("KSPPI"."INDX"="KSPPCV"."INDX")
      12 - filter("KSPPI"."KSPPINM"='_dml_monitoring_enabled')
      15 - filter("O"."OWNER#"=USERENV('SCHEMAID') AND BITAND("O"."FLAGS",128)=0)
      16 - filter(BITAND("T"."PROPERTY",1)=0)
      17 - access("O"."OBJ#"="T"."OBJ#")
      19 - access("T"."BOBJ#"="CO"."OBJ#"(+))
    42 rows selected.
    Elapsed: 00:00:03.61
    SQL> If your plan table does not exist, execute the script $ORACLE_HOME/RDBMS/ADMIN/utlxplan.sql to create the table.

  • How can I see the information about a file used in a sequence?

    How can I see the information about a file used in a sequence?

    You can use pretty much any two or multiple button mouse on a Mac, right out of the box.
    I use this one: http://www.apple.com/mightymouse/

  • In ST03 , how can i see the Query name, user id,how many times executed the

    HI Experts,
    In ST03 , how can i see the Query name, user id,how many times executed the query.
    these details how do i get from the above transaction.
    EX:-if there is one report name X,I want to know how many users had executed X report today,weekly,monthly.
    ex:-query userid total number of execution
    sales order 0000555 5 times
    custmer 05855 2 times
    fast reply will be appreciated,

    Hi,
    Look here:
    http://help.sap.com/saphelp_nw04/helpdata/en/3b/54df4204892a78e10000000a155106/frameset.htm
    Also check these:
    http://help.sap.com/saphelp_nw2004s/helpdata/en/2d/b8be3befaefc75e10000000a114084/content.htm
    http://help.sap.com/saphelp_nw2004s/helpdata/en/25/ece73a39e74d27e10000000a114084/frameset.htm
    Hope this helps..
    Bye
    Dinesh

  • In ST03 , how can i see the Query name, user id,how many times .

    HI Experts,
    In ST03 , how can i see the Query name, user id,how many times executed the query.
    these details how do i get from the above transaction.
    Points will be awarded.
    BR
    sivs

    Hi Siva,
    Reporting statistics data is only written to the database table if BW statistics have been manually activated for the corresponding InfoProvider first. If this has not been done, it is therefore not possible to display any reporting statistics in transaction ST03.
    Therefore activate the reporting statistics for all relevant InfoProviders. To do this, set the OLAP flag in the BW Administrator Workbench (transaction RSA1) in the area Tools ® BW Statistics for InfoProvider.
                    Check here...........
    http://help.sap.com/saphelp_nw04/helpdata/en/ca/86df4254d81e1fe10000000a155106/content.htm
    https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/c8c4d794-0501-0010-a693-918a17e663cc
    Hope this will help you shiva.........
    Regrads,
    Vijay

  • When downloading a file, how can I see the download speed ?

    When downloading a file, how can I see at what speed it is downloading a file ?

    Go to the
    '''''[https://addons.mozilla.org/en-US/firefox/ Mozilla Add-ons Web Page]'''''
    (There’s a lot of good stuff here).<BR>
    What you want is a program to show you what you want to see.
    I myself use
    '''''[https://addons.mozilla.org/en-US/firefox/addon/download-status-bar/?src=collection&collection_id=33bf10fa-666d-45a2-9bc9-491ce21671c6 Download Status Bar]'''''.

  • ExchangeService.TraceEnabled = true , but can't see the traces in output window

    Hello,
    I am building an Visual Studio 2013 asp.net application that uses EWS. I have enabled tracing:
                service.TraceEnabled = true;
                service.TraceFlags = TraceFlags.All;
    I expect so see the EWS trace output in the Output window; however, nothing related to EWS shows in Output window.
    I wonder what am I missing?
    Thank you,

    Hi,
    you need to implement the interface Microsoft.Exchange.WebServices.Data.ITraceListener.
    And then set :
    service.TraceListener = new MyTraceListenerImplementation();
    Regards,
    Désiré GOVIN Refresh IT Solutions

  • How can I see the Query view created for a different user

    Hi All,
    How can a user see the View of a query created for a different user??
    I would like some info about how to give access ( if it is a access problem) or tell me the steps to do that.
    Regards, Federico

    Hi all,
    Maybe I didn't explain me as i should or maybe you dont know what is a Query View. Lets try again, showing you the steps to open a "Query view".
    This way is from Bex Analyzer (Excel)
    I open the Bex Analyzer and connect to the system -> Open query -> Under "Type" choose "Query View"...this is just a different view of the original query (more or least columns/rows).
    This way is from Bex Web:
    Once you open/execute the query, you have a ComboBox to choose the view (previously saved)
    The problem that we have is that the views created for a user, can NOT be found by other user. The only user who can is the owner.
    Could it be an authorization problem? or is ther any configuration possible to see it?
    Thanks in advance, Federico

  • Universe Designer vs BEx query - Can't see the query in the OLAP Cubes list

    Hello Experts,
    We are facing a rather strange issue:
    While creating a connection to an existing BEx query - which wasn't being used by BO before - we aren't able to see that one query in a long list of available multiproviders/queries on the universe side.
    We already checked the option on BEx analyser to authorize external access to the query, with ODBO.
    The connection type we're using is the same for all the other universes built on top of BEx queries: SAP BW Client. Again, we already have a bunch of universes built using this method, but we can't seem to find the BEx query in the OLAP Cubes list.
    Does anyone have a lead on what may be causing this issue?
    Our environment is:
    - SAP BOE XI R3.1 SP2
    - SAP BW 3.5
    - BEx Analyser
    - Integration Kit
    Best Regards,
    Francisco

    Hi,
    i don't know, you'd have to search the BW-BEX component for notes.
    I noticed it with a revision of SAP GUI Front End tools 720 SP7 i think
    I applied the latest corrections (SP08 or 09) and that tickbox worked ok again.
    You might notice - as i did - that when you go back to check the bex query - that property becomes 'magically' unselected/
    Regards.
    H

  • Can I "see" the query string built by PreparedStatement?

    Hi all.
    When using a PreparedStatement, is there a way to see the SQL String built by the class, that is the query that's going to be executed by the "executeQuery()"?
    I'd need it for debugging reasons...
    Any help will be very appreciated!!

    http://www.javaworld.com/javaworld/jw-01-2002/jw-0125-
    overpower.htmlThis works great , that's was I was looking for.
    Thanks hermione!!
    I can't but recommend it to everyone that want to accomplish the same.

  • Where can i see the .mdf or .ldf files for mysql database?

    Hi i have created a database in mysql workbench. Now i want the .mdf  or .ldf files for my project deployment.  where can i see this files in my folders. I have searched in this folders.
    C:\Program Files\MySQL\MySQL Server 5.6\data.
    Couldn't find the data's here. Please Help. Actually i don't know i am on the right path. Or please tell me how can i create it?

    I think mysql has a different file structures than MS SQL. May be this link will help you
    http://www.mkyong.com/mysql/where-does-mysql-stored-the-data-in-my-harddisk/
    Satheesh
    My Blog | How to ask questions in technical forum

  • Cant see the value in output file

    hello,
    iam not getting onevalue in output file when it is directly assigned
    for eg: gs_zcrmtab_scheme-quantity = '1' .
    plz help me
    regards,

    See the below code :
    select mastmatnr maralabor into table lt_mara from mast innerjoin mara on mara matnr = mastmatnr where mastwerks = 'JER' and maststlan = '5'.
    loop at lt_mara.
    if lt_mara-labor is initial.
    write:/ ' nothing'.
    <b>clear : ls_zcrmtab_scheme,
              lt_mara.</b>
    continue.
    endif.
    ls_zcrmtab_scheme-schemecode = lt_matnr.
    case lt_mara-labor.
    when 'D&A'.
    ls_zcrmtab_scheme-clientnumber = '000400001'.
    same when stmts -
    when others.
    <b>clear : ls_zcrmtab_scheme,
              lt_mara.</b>
    continue.
    endcase.
    ls_zcrmtab_scheme-quantity = '1'. <b>-> what is data type of quantity field</b>
    look at debug mode now
    select single stzuztext into lv_ztext from stzu inner join mast on maststlnr = stzu~stlnr
    where matnr = ls_zcrmtab_scheme-schemecode.
    case lv_ztext.
    when 'zwk2'.
    ls_zcrmtab_scheme-modality = '1m'
    when 'zwk4'.
    ls_zcrmtab_scheme-modality = '1m'
    when 'zwk6'.
    ls_zcrmtab_scheme-modality = '1m'
    when 'zwk8'.
    ls_zcrmtab_scheme-modality = '1m'
    endcase.
    ranges :r_scheme for ls_zcrmtab_scheme-schemecode.
    r_scheme-low = 'a3'.
    r_scheme-option = 'EQ'.
    r_scheme-sign = 'I'.
    append r_scheme.
    r_scheme-low = 'AY'
    append r_scheme.
    r_scheme-low = 'c3'
    append r_scheme.
    r_scheme-low = 'QX'
    append r_scheme.
    case ls_zcrmtab_scheme-clientnumber.
    when '00040000073' or '0004000240'.
    ls_zcrmtab_scheme-zor_split = space.
    when others.
    if ls_zcrmtab_scheme-schemecode in r_scheme.
    ls_zcrmtab_scheme-zor_split = space.
    else.
    case ls_zcrmtab_scheme-modality
    when '1M'
    ls_zcrmtab_scheme-zor-split = 'X'
    ls_zcrmtab_scheme-zfc-split = 'X'
    when others.
    ls_zcrmtab_scheme-zor-split = 'a'
    ls_zcrmtab_scheme-zfc-split = 'a'
    endcase.
    endif.
    endcase.
    append ls_zcrmtab_scheme to lt_zcrmtab_scheme.
    <b>clear : ls_zcrmtab_scheme</b>,
                  lt_mara.
    endloop.
    if you get issue again then send me structure of lt_zcrmtab_scheme.
    Thanks
    Seshu

  • Can i see the console.log output in DW?

    hey all!
    this seems like such a simple question, yet i can't find an answer anywhere.  everyone assumes it will be viewed in Firebug or what have you.
    i'd like to be able to see the output of console.log in DW, but don't know if that's even possible, let alone which window to open to see it.  i've tried them all and no such luck.
    i'm running DW cs5.5, btw.  and TIA.
    WR!

    AFAIK, there's no equivalent feature in Dreamweaver. For example, you wouldn't be able to monitor AJAX requests; you'd only be able to see the effects of them.
    There might be an extension out there that does this, but I haven't seen one.
    You could use Firebug Lite in the Dreamweaver Live View, though: http://getfirebug.com/firebuglite
    Probably the best way to do so would be to add the JavaScript into your page (look for "Stable local link" or "Stable live link" on the above page), and then set the debug="true" attribute in your <html> tag (this part is explained on the above page). When you switch to Live View in Dreamweaver after doing so, you should see the familiar Firebug UI appear, including its console.
    Since it sounds like you'd like this to be natively supported by Dreamweaver, be sure to ask our development team to add it: http://adobe.ly/DWwish

  • 5230 can not see the directly copied MP files

    I have a strange experience with my 5230. When I use the Nokia Phone Browser function from the PC Suite via USB and I copy MP3 music files directly into the phone memory card into the Music folder from my PC, then the phone does not display the added MP3 files list! But those can be played from the phone via USB connection with OVI Player and the files can be seen and modified with the Nokia Phone Browser. The files can be seen on the phone only then if I copy those there via the OVI Player transfer function.
    Is there any solution for this problem?
    BR

    Exactly the same problem here for my daughter's 5230.
    Transferred some MP3's via bluetooth. Open nice, play in music player. When selecting save, I get general system exception.
    Phone has several MP3 that are in the library and play nice. These once can be transferred to phone MemoryCard\Music..but player won't even find those.
    Amazing, its 2010 and we've gone back to middle ages :-) Comes with music phone..my a*
    I'll post update if I figure out what's different now compared to last time the **bleep** mp3's did transfer okay (and worked).
    P.S. *Sigh in disbelief*, same happens to AAC files. Maybe its got something to do with installed Nokia Music Player. Unbelievable... Sent over BT, reside in inbox. Play nice, save -> general system fault (Yleinen järjestelmävirhe in finnish). Transferred those via Ovi Player on PC (both MP3 / AAC format). In MP3 format they show in list (for instance 29 songs Unknown Artist), but opening that directory shows no songs at all! No firmware updates available either (phone has latest).

  • How can i see the total size of files which i have been selected?

    I want move my files including movies and photo to the tumpdrive.
    But, my tumpdrive told me which was only 500MB space.
    Therefore, i decided that choose some movies and photo to there.
    When i chose the files i don't know how much of the total size which i've been selected.
    if above 500MB, i could move.

    With them selected, press the Option, Command, and I keys.
    (75125)

Maybe you are looking for