Results 1 to 8 of 8

Thread: Output to file

  1. #1
    Join Date
    Oct 2006
    Posts
    12

    Unanswered: Output to file

    Dears,

    I have embeded this query in the following sql file,

    SELECT tablespace_name, sum ( blocks ) as free_blk , trunc ( sum ( bytes ) / (1024*1024) ) as free_m, max ( bytes ) / (1024) as big_chunk_k, count (*) as sum_chunks FROM dba_free_space GROUP BY tablespace_name


    and I am running it through the following command,

    sqlplus -S myname/mypassword @/home/oracle/check/free.sql

    After the query finish without error it does not generate anyoutput to the screen, also if I add the following

    SPOOL ./tfree
    SET LINESIZE 1000
    SET PAGESIZE 50

    query as above

    SPOOL OFF
    EXIT;

    No file is generated with the ouput, can somebody help on this please.

    Regards,

  2. #2
    Join Date
    Aug 2003
    Location
    Where the Surf Meets the Turf @Del Mar, CA
    Posts
    7,776
    Provided Answers: 1
    >SPOOL ./tfree
    not as above but as below
    SPOOL /tmp/tfree

    Now you know where to look for spool file in /tmp
    You can lead some folks to knowledge, but you can not make them think.
    The average person thinks he's above average!
    For most folks, they don't know, what they don't know.
    Good judgement comes from experience. Experience comes from bad judgement.

  3. #3
    Join Date
    Oct 2006
    Posts
    12

    output to file

    Quote Originally Posted by anacedent View Post
    >SPOOL ./tfree
    not as above but as below
    SPOOL /tmp/tfree

    Now you know where to look for spool file in /tmp
    Hello there,

    I tried it as you mentioned, and I found nothing.

    Regards,

  4. #4
    Join Date
    Jan 2004
    Location
    Croatia, Europe
    Posts
    4,094
    Provided Answers: 4
    Quote Originally Posted by jdaouk
    After the query finish without error it does not generate anyoutput to the screen
    Well, that might be a problem. You can't expect that spooled result will contain better information than a query what returns nothing.

    So, I guess that you should first make sure that query returns "something" (it seems to be OK - there are certain figures there if I run it on my 10g). Are credentials you provided (myname/mypassword) correct? Is "myname" user allowed to view DBA_FREE_SPACE?

  5. #5
    Join Date
    Oct 2006
    Posts
    12

    output to file

    Quote Originally Posted by Littlefoot View Post
    Well, that might be a problem. You can't expect that spooled result will contain better information than a query what returns nothing.

    So, I guess that you should first make sure that query returns "something" (it seems to be OK - there are certain figures there if I run it on my 10g). Are credentials you provided (myname/mypassword) correct? Is "myname" user allowed to view DBA_FREE_SPACE?
    Hello Littlefoot,

    I tried the query from toad with the same user, indeed he is able to read from dba_free_space.

    Regards,

  6. #6
    Join Date
    Jan 2004
    Location
    Croatia, Europe
    Posts
    4,094
    Provided Answers: 4
    Is there any setting (in LOGIN.SQL or GLOGIN.SQL) that would prevent output to be displayed?

  7. #7
    Join Date
    Oct 2006
    Posts
    12

    output to file

    Hello there,

    I searched for the two files, and I could not find them on the database server.

    Regards,

  8. #8
    Join Date
    Jan 2004
    Location
    Croatia, Europe
    Posts
    4,094
    Provided Answers: 4
    (LOGIN.SQL is, if it exists, on your computer, in a directory you were in while executing SQLPLUS command)

    That's strange; you see the output in TOAD, you don't see it in SQL*Plus. No more ideas at the moment, sorry.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •