Output of sqlplus formatting

Oracle 11.1.0.7:

I followed SQL. But when I run it it gives me all the SQL statements and other things. How can I get just the result of select?
sqlplus stream_mon/stream_mon << EOF!
 set head off
 set pagesize 0
 set feed off
 set echo off
 spool ${MON_FILE} append

 SELECT APPLY_NAME || '|NoOfErrors=' || COUNT(*) FROM DBA_APPLY_ERROR group by APPLY_NAME;

 select APPLY_NAME || '|Latency=' ||
     (apply_time-applied_message_create_time)*86400
  from dba_apply_progress;

 select QUEUE_NAME || '|SrcSpillMsgs=' || spill_msgs || chr(10) || 'SrcInMemoryMsgs=' ||  (NUM_MSGS - SPILL_MSGS)
from V\$BUFFERED_QUEUES;

SELECT APPLY_NAME || '|DestSpilledTransactions=' || MESSAGE_COUNT
  FROM DBA_APPLY_SPILL_TXN;

select APPLY_NAME || '|DestTotalMessagesSpilled=' || TOTAL_MESSAGES_SPILLED from V\$STREAMS_APPLY_READER;

select case when status = 'ENABLED' then CAPTURE_NAME || '|CaptureProcess=1'
           else CAPTURE_NAME || '|CaptureProcess=0'
           end
      from dba_capture;

select case when status = 'ENABLED' then PROPAGATION_NAME || '|PropProcess=1'
           else PROPAGATION_NAME || '|PropProcess=0'
           end
      from dba_propagation;

select case when status = 'ENABLED' then APPLY_NAME || '|AppProcess=1'
           else APPLY_NAME || '|AppProcess=0'
           end
      from dba_apply;

 select CAPTURE_NAME || '|CaptureErrMsg=' || replace(error_message, ' ', '_') from dba_capture;
 select PROPAGATION_NAME || '|PropErrMsg='    || replace(error_message, ' ', '_') from dba_propagation;
 select APPLY_NAME || '|ApplyErrorMsg=' || replace(error_message, ' ', '_') from dba_apply;

 spool off

EOF!
Out something like this
SQL>  select QUEUE_NAME || '|SrcSpillMsgs=' || spill_msgs || chr(10) || 'SrcInMemoryMsgs=' ||  (NUM_MSGS - SPILL_MSGS)
  2  from V$BUFFERED_QUEUES;
CAP_QUEUE|SrcSpillMsgs=0 

sqlplus stream_mon/stream_mon<>

not above but below
sqlplus-s stream_mon/stream_mon<>

Tags: Database

Similar Questions

  • Csv output SQLCL differs from output csv SQLPLUS

    Hello

    I try to replace my script sqlplus generating a csv file.

    with a new one generated by sqlcl because sqlcl seem to handle it "natively".

    However, I have several problems, it's not so easy... (it is not possible, in fact, as a replacement for sqlplus by sqlcl to generate a csv file)

    There are several differences with the release made with my script in sqlplus. Let me explain

    NB: Please note I'm french therefore:

    * default csv separator is; (but I could accept this separator is)

    * decimal separator is ",".

    Script from SQLplus

    trigger the echo

    Set feedback off

    fixed term off

    set point

    Go head

    the Embedded value on

    set pagesize 0

    break off Set

    NEWP NONE Set

    set SPACE 0

    TAB SET OFF

    recsep off Set

    left the underline

    COLUMN of resource_type FORMAT A10 COLUMN TYPEE

    ALTER session set nls_date_format = "dd/mm/yyyy";

    ALTER SESSION SET NLS_NUMERIC_CHARACTERS = ",";

    set LINESIZE 30000

    Set trimspool on

    Coil test.csv

    SELECT "'sysdate';'" COL1 "; "" COL2 "; "" LENGTH "' double.

    SELECT

    '"' || SYSDATE | « « ; » »

    '"' || trunc (sysdate) | « « ; » »

    || To_char (sysdate, ' DD/MM/YYYY HH24:MI:SS'). « « ; » »

    || RM. LENGTH | '"'

    Of

    TABLE RM

    WHERE

    RM. CODE = "ABCD";

    spool off

    output

    SQLCL script

    trigger the echo

    Set feedback off

    fixed term off

    set point

    break off Set

    Set trimspool on

    Set sqlformat csv

    Coil test2.csv

    SELECT

    SYSDATE,

    trunc (sysdate),

    To_char (sysdate, ' DD/MM/YYYY HH24:MI:SS'),

    RM. LENGTH

    Of

    TABLE RM

    WHERE

    RM. COL = 'ABCD '.

    ;

    spool off

    output

    SQLplus output CSV (and the result is correct)

    "sysdate"; "' COL1 '; "" COL2 "; "" LENGTH ".

    "11/05/2015"; 11/05/2015; "11/05/2015-11:11:27 '; "6.07"

    SQLCL CSV output

    < blank line >

    "SYSDATE", "TRUNC (SYSDATE)", "TO_CHAR (SYSDATE," DD/MM/YYYY HH24:MI:SS) ',' LENGTH' "

    05/11/15 11:12:12, 000000000, 05/11/15 00:00:00000000000, ' 11/05/2015 11:12:12 ', 6,07

    --------

    You can see in the output of SQL CL

    * an empty line first (?)

    * the fields sysdate is followed, 0000000, which breaks the structure of the csv file. Don't know why this is displayed.

    * value sysdate is fine (date + hour) in sqlcl, trunc (sysdate) should not display the time (minor)

    * in sqlplus then I've not used instructions ALTER SESSION SET NLS_NUMERIC_CHARACTERS = ",".

    digital data are 6.07 (whereas it should be 6.07, and default sqlplus output. (In sqlplus to 6.07, I need to put the NLS_NUMERIC statement above))

    * in sqlplus, only char data are placed in square brackets. In my case it would be necessary to have each data attached to make sure that imposing CSV is safe.

    If too many problems, I can't currently use sqlcl to generate a csv result...

    Don (don't know if this is the place to talk about SQL imporvement, , but it would be great if the sqlcl could be improved: )

    * the date of issue (000000) would be fixed (unless there is a solution?)

    * Digital output default must be with '.'. And after having the opportunity to change the decimal separator, as in SQLPLUS

    * We wouldn't abilty to choose whether the data should be included or not in the media (even for digital data / date)

    * We would be able to change the csv separator

    * no first blank line ould generated (minor)

    Thanks for any suggestions you could provide, because at the moment, I can't use sqlcl to the output in csv format, although it has very promising output features

    > We are working on support for that now.

    What I wanted, it was, it does not work in the latest version available, but work soon.

  • You cannot change the output type and format in the page requests system - PeopleSoft process

    Hi all

    When I navigate to the PeopleSoft process scheduler page and try to run a process I see the output type and format web and txt only. I am unable to change the output type and format. All formats and types of output are marked as active in the system settings page. I'm super user of the system as well. I have as well the role of Admin ProcessScheduler. I would like to know if someone has already faced similar problems.

    Thank you

    Vimal

    Run the following SQL query to your OPRID:

    SELECT A.CLASSID, PSPRCSPRFL A.OVRDOUTDEST, PSOPRDEFN B WHERE B.PRCSPRFLCLS = A.CLASSID AND B.OPRID = '';

    Make sure that OVRDOUTDEST = 1.

    If it's 0 then you have to fix your configuration profile of the process as follows:

    -Main menu > PeopleTools > Security > list permission > CLASSID research (white list) back to top query

    -Go to the process tab

    -Click on "process the profile permissions

    S ' ensure that 'substitute an output Destination' is checked. Click OK, and then save.

    This should solve your problem.

  • Output of sqlplus

    Hello

    I use Oracle 10 g, and I want to know how can I enlarge the output in SQLPLUS:

    for example if I execute select * employee to get all of the data, for now I get just a few lines

    Thanks in advance

    Ahh, then use:

    set long 
    

    Once again check the current value with show in a long time.

  • Need to explain Plan output in HTML format

    Hello

    I have details slider sqlid and child. And I'm able to generate explain plan SQL running as below

    SELECT * FROM table (DBMS_XPLAN. DISPLAY_CURSOR('xxxxxxxxxxxxxx',0,'ALLSTATS'));

    I need send the output of this customer. and the problem is the customer wants in HTML format. Advice to reel in HTML format

    concerning

    Pravin

    You can always query the PLAN_TABLE directly, and use SQL * more to empty in HTML.

    Another option is to do this with SQL Developer. Paste the SQL statement into the worksheet, and then press the explain Plan. When you see the plan, right-click on it and choose export as HTML.

    See you soon,.
    Brian

  • sqlplus formatting / set

    Hi all

    I am creating a report with the help of SQL * Plus and shell.

    I use a lot of a shell script sql script. In my report, output, k I still see the actual query:

    SQL > select * from v version $;

    BANNER

    --------------------------------------------------------------------------------

    Oracle Database 11 g Enterprise Edition Release 11.2.0.2.0 - 64 bit Production

    PL/SQL Release 11.2.0.2.0 - Production

    CORE Production 11.2.0.2.0

    AMT for Linux: Version 11.2.0.2.0 - Production

    NLSRTL Version 11.2.0.2.0 - Production

    Is it possible to remove the query and get the result of the query in my report? What SET option would do that?

    I would really appreciate any suspicion!

    Thank you so much in advance!

    M

    Hello

    Have you tried SET POSITION OFF and SET ECHO OFF?

    Cat sql_test.sh:

    sqlplus-s $login<>

    Set serveroutput on

    trigger the echo

    set the position

    Select 'Testing' to double;

    output

    ++

  • Generate output in .xml format

    Hello gurus, I have a defined concurrent program that runs a simple database procedure. The output is done via FND_Output.put_line (FND_File.output). I want to get this in an .xml file. I tried to change the output format of the definition of concurrent program as XML, but it wouldn't work. All recommended documentation is much appreciated.

    Thanks, Naveen.

    This can be done as follows (example):

    QRYSTR: = ' SELECT * FROM per_all_people_f where full_name as "Smith %" ';

    L_QRYCTX: = DBMS_XMLGEN. NEWCONTEXT (QRYSTR);

    DBMS_XMLGEN. SETROWSETTAG (L_QRYCTX, 'EMP_SET');

    DBMS_XMLGEN. SETROWTAG (L_QRYCTX, 'EMP_RECORD');

    L_RESULT_CLOB: = DBMS_XMLGEN. GETXML (L_QRYCTX);

    L_RESULT_CLOB: = SUBSTR (L_RESULT_CLOB, INSTR (L_RESULT_CLOB, ' > ') + 1);

    DBMS_XMLGEN. CLOSECONTEXT (L_QRYCTX);

    CLOB_TO_FILE (L_RESULT_CLOB); -Writes the XML data to a physical file

    Thanks, Naveen

  • How do I increasing width output of sqlplus?

    I use sqlplus on windows;

    SQL > select * from employees where rownum < 2;

    EMPLOYEE_ID FIRST NAME LAST NAME

    ----------- -------------------- -------------------------

    E-MAIL PHONE_NUMBER HIRE_DATE JOB_ID SALARY

    ------------------------- -------------------- --------- ---------- ----------

    COMMISSION_PCT MANAGER_ID DEPARTMENT_ID

    -------------- ---------- -------------

    Donald Ollivier 198

    DOCONNEL 650.507.9833 21-GIU-07 SH_CLERK 2600

    50 of 124

    After a selection, I have this output

    It is possible the increase in width?

    SQL > set linesize 200

    Here are all the things that you can define in sql like:

    System of SETTING Variable summary

  • Misaligned output of SQLPlus

    Hello
    Yes, I know that this has to go in the forum of SQLPlus (tumbleweed), but someone there asked exactly the same question more than a month and he has yet to receive even an attempt to answer!

    So simple question; Why the next exit is misaligned? Specifically, the 14 for SAMPLE_SIZE value is placed in the middle of his column and therefore LAST_ANALYZED (February 21, 13) is pushed into the SAMPLE_SIZE column:
      1  select column_name, data_type, avg_col_len, density, num_distinct NDV, histogram, num_buckets buckets, sample_
    size, last_analyzed,data_type
      2  from dba_tab_cols
      3  where owner  = 'SCOTT'
      4  and table_name = 'EMP'
      5  and column_name = 'EMPNO'
      6* order by internal_column_id
    SYS@ORCL> /
    
    COLUMN_NAME               DATA_TYPE  AVG_COL_LEN     DENSITY          NDV HISTOGRAM       BUCKETS SAMPLE_SIZE LAST_
    ANAL DATA_TYPE
    ------------------------- ---------- ----------- ----------- ------------ --------------- ------- ----------- -----
    ---- ----------
    EMPNO                     NUMBER               4  .071428571           14 NONE                  1       14 21-FEB-1
    3 NUMBER
    
    SYS@ORCL>
    BTW, the * above should read A N E L (without the spaces) like LAST_ANALYZED, but a rather enthusiastic filter seems to be at work.


    Second question - I was wondering if I had entered a COLUMN... FORMAT command that had messed up things... but as far as I know, there is no way of recovering SQLPlus column formats list currently - or is it?

    Edit - ignore the second question - I just discovered that you can simply type
    COLUMN
    for a list of all the updated column shaped instructions in use. I checked to see if SAMPLE_SIZE has any formatting applied to him and he does not.




    Thank you very much
    Jason

    Published by: Jason_942375 on March 25, 2013 21:53

    Published by: Jason_942375 on March 25, 2013 21:55

    I mentioned in my other answer SET TAB OFF. You should see:

    SQL> select lpad('Z',100,'Z') dummy , X from T;
    
    DUMMY                                                                                                           X
    ---------------------------------------------------------------------------------------------------- --------------------
    ZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZ           14
    
    SQL> set tab off
    SQL> select lpad('Z',100,'Z') dummy , X from T;
    
    DUMMY                                                                                                                   X
    ---------------------------------------------------------------------------------------------------- --------------------
    ZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZ                   14
    
  • Output Bandicam - "Unsupported format or file damaged."

    Hello

    I recently used Bandicam to record 24 clips using the H264 60 FPS NVIDIA CUDA preset on 64-bit Windows 8. He produces opinions that play back fine in WMP and VLC, but Premiere Pro CS6 refuses to import one of them, saying "Unsupported format or corrupted file.»

    I've searched these forums carefully and used considerable Googling time but have found no mention of this problem, only of DV AVI import difficulties, which is not relevant to my problem.

    Here is a sample of modules for one of such files as reported by MediaInfo:

    GENERAL
    Complete name                            : F:\Bandicam Output\ffxiv 2014-03-31 23-04-48-870.avi
    Format                                   : AVI
    Format/Info                              : Audio Video Interleave
    File size                                : 317 MiB
    Duration                                 : 16mn 8s
    Overall bit rate mode                    : Variable
    Overall bit rate                         : 2 746 Kbps
    Writing application                      : BandiAviMuxer 1.0
    
    
    VIDEO
    ID                                       : 0
    Format                                   : AVC
    Format/Info                              : Advanced Video Codec
    Format profile                           : [email protected]
    Format settings, CABAC                   : No
    Format settings, ReFrames                : 1 frame
    Codec ID                                 : H264
    Duration                                 : 16mn 8s
    Bit rate mode                            : Variable
    Bit rate                                 : 2 534 Kbps
    Maximum bit rate                         : 40.0 Mbps
    Width                                    : 1 920 pixels
    Height                                   : 1 080 pixels
    Display aspect ratio                     : 16:9
    Frame rate                               : 60.000 fps
    Color space                              : YUV
    Chroma subsampling                       : 4:2:0
    Bit depth                                : 8 bits
    Scan type                                : Progressive
    Bits/(Pixel*Frame)                       : 0.020
    Stream size                              : 292 MiB (92%)
    
    
    AUDIO
    ID                                       : 1
    Format                                   : MPEG Audio
    Format version                           : Version 1
    Format profile                           : Layer 2
    Codec ID                                 : 50
    Duration                                 : 16mn 8s
    Bit rate mode                            : Constant
    Bit rate                                 : 192 Kbps
    Channel(s)                               : 2 channels
    Sampling rate                            : 48.0 KHz
    Compression mode                         : Lossy
    Stream size                              : 22.2 MiB (7%)
    Alignment                                : Aligned on interleaves
    Interleave, duration                     : 24 ms (1.44 video frame)
    Interleave, preload duration             : 48 ms
    
    

    Can I do to make these compatible with Premiere Pro CS6 files without having to transcode?

    Thanks in advance to anyone who can help you.

    PS I know that Bandicam has a "Preset" specifically for the work of creation/Vegas, but I was not aware at the time. Oh.

    Typical that I managed to find a solution almost immediately after the announcement. If anyone has this problem, I managed to work around it by converting (or reconditioning, I think) files to MP4s using ffmpeg: http://ffmpeg.zeranoe.com/builds/

    Use:

    -i "of entry fichier.avi" ffmpeg.exe vcodec - copy - acodec copy "output file. MP4.

    EDIT: Thank you Ann, the problem is that I want to use the files already saved by Bandicam using another preset, but in the future, I'll make sure to use the one specified in this thread. Thank you!

  • I want my interactive report output in pdf format

    Hello

    What is the best way to make pdf after the application of filters

    1 I use apex 5 universal theme.

    Apex 5 to support this new feature

    2. What is the best freeware plugin to achieve this

    Information appreciated

    Thank you

    Hi pauljohny100,

    pauljohny100 wrote:

    Thanks for the tip. Sorry for the late reply.

    1 I have managed to get the pdf via classic report report but not through interactive report. It is for this option, you mentioned.
    You must configure a server 'print' in the Instance Oracle APEX settings to use the PDF format to print interactive report.

    2 do not know if I can use apex_ir.get_report send out put it to jasper and get the result.
    3 I tried to use as_pdf2 plugin from Anton Scheffer.

    Again, it works in classic report. I am unable to get the report filtered ir to download in pdf format.

    So in the meantime if you have any link on the print server for interactive report let me know. I need to know where I can specify

    I need the PDF as an attachment.

    You can use "Oracle REST Data Services" as an option "print server".

    With ADR integrated to your instance of APEX, you could get the PDF blob from the server to print using APEX_UTIL. GET_PRINT_DOCUMENT API.

    Reference: Re: what value for p_print_server when you use the Rest Data Services as a print server?

    And then you can send it by using the APEX_MAIL API.

    Reference: https://oracleapexbynandinithakur.wordpress.com/2012/06/04/report-as-attachment-in-email-notification-in-oracle-apex/

    Kind regards

    Kiran

  • SQLPLUS formatting

    I have the following SQL code

    Select file_name, bytes/1024/1024 * 80 of dba_data_files

    I want the output for each line look like this (remove the line breaks, tabs...)  Y at - it an easy way to do it. I know you can use single quotes

    around the literals

    ALTER database datafile '+ DATA01/da01fmd_imkl065d/datafile/dw_daily_acct_sum.8.820408375' resize 24576 M Note size must be an integer

    Thanks to all those who responded


    Thank you all. Frank your example was a syntax error, so I used the following which works perfectly for me.

    Select 'alter database datafile ' | ''''|| file_name | '''' || "resize".

    || TO_CHAR (trunc (bytes/1024/1024 * 0.8)) | ' m;'    from dba_data_files

  • (Duplicated assets) When the output in HTML format.

    I was wondering why Muse will duplicate a current png when used multiple times on a page? It should not just a link to a version of the asset and the sweater for several instances of the page? Output folder DC that I use the png about 60 times in compositions it is duplicated 60 times in the HTML code. This seems wrong to me.

    Any info would be much appreciated.

    Thank you

    Ryan.

    I think we're good now. Tried checking and unchecking the "Convert opaque png" and it finally worked. A little strange. I would say that it worked for the most part well. It's still do duplicate an another place PNG file, but only a couple of times. Size shows to be the same for this one too, but I will work through to understand.  Thank you for the help mac_heibu and Zak.

    Sincerely,

    Ryan.

  • Snapshot of information output in html format

    Hello

    I have this beautiful oneliner to show some information snapshot:

    ' Get - VM | Get-Snapshot | SELECT name, Description, VM, SizeMB.

    I want to get this output and output to an html file.

    Is it possible to do that?

    Thank you

    Erik

    Since you have access to the .net PowerShell functions, you can make

    Get - VM | Get-Snapshot |

    Select VM,Name,Description,@{N="SizeGB; E = {[math]: tour ($_.)} {{SizeGB, 0}} |
    ConvertTo-HTML | Out-file C:\Scripts\Test.htm

  • How wrap us the output with sqlplus tab delimiter?

    Is there a way I can be rolled out via sqlplus?

    Just for example, here is my query. I want this reel with the tab delimiter.

    c:/test coil
    Select * from emp;
    spool off

    Try this:

    coil output_file.txt
    Select Column1 | Chr (9) | Column2 | Chr (9) | ....|| Chr (9) | columnX
    from my_table;
    spool off

    HTH,
    Brian

Maybe you are looking for