Avg_row_len always 1 byte extra

Hi
Anyone can help to explain the different in vsize and avg_row_len in the following example? Thanks
create table t (n1 varchar2(10));
INSERT INTO t values('aaaaaaaaaa')
SELECT vsize(n1) FROM t;  -- 10 bytes
SELECT avg_row_len FROM user_tables
WHERE table_name = 'T';  -- 11 bytes
Thanks. I found the answer in Note 1301462, 231214.1
Edited by: Kok Aik on Mar 16, 2009 6:02 PM

The OP's comparison is invalid to begin with. The vsize function returns the interanl size of the column value while the avg_row_len is supposed to be the size of the row. Even for a one column row these are not the same thing as every row also includes a three byte row header. The dbms_stats module currently fails to include the length of the row header in the average row length. This can result in a significant error for high row count tables when trying to estimate space usage requirements. The analyze command does count the row header.
mtu1 > !vi analvsstat.txt
"analvsstat.txt" 45 lines, 935 characters
mtu1 > desc marktest
Name Null? Type
C1 NUMBER
C2 VARCHAR2(10)
mtu1 > select * from marktest;
no rows selected
mtu1 > insert into marktest values (1,'xxxxxxxxxx');
1 row created.
mtu1 > analyze table marktest compute statistics;
Table analyzed.
mtu1 > c /lena/le_na/
1* select avg_row_len from dba_tables where table_name = 'MARKTEST'
mtu1 > /
AVG_ROW_LEN
17
mtu1 > analyze table marktest delete statistics;
Table analyzed.
mtu1 > @gts
Enter Table Owner mpowel01
Enter Table Name marktest
Enter Est % 100
Enter Degree % 1
PL/SQL procedure successfully completed.
mtu1 > select avg_row_len from dba_tables where table_name = 'MARKTEST';
AVG_ROW_LEN
14
:1
Mtu1 > desc marktest
Name Null? Type
C1 NUMBER
C2 VARCHAR2(10)
mtu1 > select * from marktest;
no rows selected
mtu1 > insert into marktest values (1,'xxxxxxxxxx');
1 row created.
mtu1 > analyze table marktest compute statistics;
Table analyzed.
mtu1 > c /lena/le_na/
1* select avg_row_len from dba_tables where table_name = 'MARKTEST'
mtu1 > /
AVG_ROW_LEN
8 substitutions were made
Table analyzed.
> @gts
Enter Table Owner mpowel01
Enter Table Name marktest
Enter Est % 100
Enter Degree % 1
PL/SQL procedure successfully completed.
> select avg_row_len from dba_tables where table_name = 'MARKTEST';
AVG_ROW_LEN
14
HTH -- Mark D Powell --

Similar Messages

  • IN MIRO for planned delivery costs always .19 paise extra coming?

    In MIRO for planned delivery costs always .19 paise extra is showing?
    very strage issue, kindly suggest me on the same
    archana

    ACtually when I am doing MIRO price is taking as USD * exchange rate = as local currency, instead of the price entered in INR for particular condition type like local freight in PO,
    because of which value is increased by .19 paise..
    like in PO local freight  entered charge is 5000000 rs in first column but the same is displayed 111160.52 usd in second column... but exchange rate is 44.98..
    IN MIRO it should take 5000000 for me but it is taking 111160.52 * 44.98 = 5000000.19 rs.. kindly let me know the solution for this
    regards,
    archana

  • Cheque printing form always prints an extra page...

    Hello Experts,
    I have a custom form the cheque printing program RFFOUS_C. Now, my problem is that it
    always prints an extra page even though the MAIN page doesnt have any line items. So instead of
    expecting only 1 page it always shows 2 pages. And the worst thing here is that they I cannot customize
    the standard program since it is the client's rule.
    Any of you have encountered this problem before?

    Hi,
    in your Form there is only One Page created?
    just check if  there exists any other page and in the Standard attributes of the page in "Next Page", the other page is set.
    Ideally there should not be any page as the Next Page.

  • Report Builder: ContentType Field shows always "System.Byte[]"

    Hello Community!
    I use the following systems:
    SharePoint 2013
    SQL Server 2012 Report Builder 3.0
    So, I have a SharePoint List with some columns (Responsible Person, Serial Number, Content Type).
    Responsible Person and Serial Number is displayed correctly. But in the field Content Type, I have seen "System.Byte[]" instead of the realy value of Content Type.
    When I execute query, I have seen realy value of the field Content Type!
    Could anybody help me?
    Thanks a lot und greets from austria!
    Daniel

    Hi Daniel ,
    According to your description, when you use SharePoint list as data source, the Content Type display as "System.Byte[]" instead of real value when running the report.
    As we tested in our environment, Content Type can display correctly both in query designer and preview results. Please refer to our test results below to check if you design the report correctly:
    1. Type the query in dataset like below:
    2. Run the report:
    Besides, it has reported the same issue with Content Type. In your scenario, please also try to use XML data source to connect to SharePoint list to retrieve data. For more information, please refer to this similar thread:
    Reporting: ContentType Field Value always "System.Byte[]". If issue persists, please create the same report in SSDT and run the report, then check if there are warning messages in output.
    If you have any question, please feel free to ask.
    Best regards,
    Qiuyun Yu
    Qiuyun Yu
    TechNet Community Support

  • 6980 always prints an extra sheet before job

    I have had two HP6980 printers. the first one failed through a faulty printhead. It always used to print an extra page before printing a check (Versacheck). I replaced it with an identical model and guess what, same thing! A blank page spits out first before the check prints. I have contacted the software vendor (Versacheck) and they insist that their software could not do that. So I tested to an HP LaserJet and no extra page, only on the 6980.
    All suggestions are welcome. I have tried firmware, latest drivers, USB, networked connection all to no avail. Has anyone else experienced this?

    Hi,
    in your Form there is only One Page created?
    just check if  there exists any other page and in the Standard attributes of the page in "Next Page", the other page is set.
    Ideally there should not be any page as the Next Page.

  • Avg row len is always 6 bytes ?

    Hi ,
    I created a test table with ID as number(2), inserted bunch of rows (single digits), analyzed table and looked at avg_row_len, it shows 6 bytes. I repeated the same experiment with id as number(6), it made no difference.
    Doesn't the field size change the avg row len ?. Why does it need 6 bytes to store 2 digits?
    Thanks
    Vissu

    Doesn't the field size change the avg row len ?. Why does it need 6 bytes to store 2 digits?RTFM [url http://oraclesvca2.oracle.com/docs/cd/B10501_01/server.920/a96524/c13datyp.htm#784]Internal Numeric Format, [url http://oraclesvca2.oracle.com/docs/cd/B10501_01/server.920/a96540/functions167a.htm#80073]VSIZE, [url http://oraclesvca2.oracle.com/docs/cd/B10501_01/server.920/a96540/functions38a.htm#77280]DUMP, [url http://oraclesvca2.oracle.com/docs/cd/B10501_01/server.920/a96524/c11schem.htm#2747]Row Format and Size

  • Why is there always "0 bytes" in Cache in Control Panel? It never increases, yet the stored data size continues to increase.

    This is annoying. I just updated to version 19 almost a week ago and still Firefox never seeks to keep anything in "Cache". After using firefox for a few days, it crashed a couple times already and now the browser randomly freezes (to the point to where my screen on/off button wont even respond). After maybe a few seconds...things will start moving, but sluggish to where I have to shut down FF in my task manager. There us "0" bytes cache shown, but stored data is at 70MB. I went into firefox and cleared cache via the settings but that did nothing. There is still 70MB of stored data and of course it alwats shows 0 bytes cache. What's up with that? Am I going to have to "Clear Data" just to fix this and lose my bookmarks and logins tet again?

    I think it's possible that Firefox, while emptying some database files, is not compacting them, so they continue to consume the same amount of "disk" space as they did before. On desktop versions of Firefox, you can use extensions such as the following for that purpose, but I don't know whether any such thing is available for mobile. Also, it would be nice to have it built in.
    * https://addons.mozilla.org/en-us/firefox/addon/places-maintenance/
    * https://addons.mozilla.org/en-us/firefox/addon/placescleaner/
    Unfortunately, in a quick search, I do not see a general purpose Android SQLite app that will runs on Firefox profile databases without root access (unless they are on the SD card, which seems highly doubtful).

  • When I try to open a Hyperlink in Excel, the Firefox pop up the page I request with an extra tab of error message. How to fix it?

    Hey guys. The problem actually bothers me for a while.
    If I input a URL in an (microsoft) Excel Cell then turn it into a hyperlink, when I click on it. The Firfox, which is my default net browser will pop up and show the page I request. But there always has an extra tabs show some other things. Here is a sample:
    The url I request is: http://privacy.microsoft.com/zh-cn/default.mspx
    OK, the page is showed up and an extra tab's url is:
    http://privacy.microsoft.com/zh-cn/default.mspxFirefoxHTML%5CShell%5COpen%5CCommand
    the later part: 【FirefoxHTML%5CShell%5COpen%5CCommand】 is automatally added behind the url I request. And the correspond page reads: The resource you are looking for has been removed, had its name changed, or is temporarily unavailable.
    how to fix this problem? and many thanks.:)

    Can you post the original link you have in Excel. We need to see what the
    full link looks like.

  • Why oracle.exe is taking 8G virtual; bytes,  memroy target can not go beyond 5G. How to minimized the virtual byte in perfmon

    Dear Experts,
    Please help me in checking why virtual bytes in perfmon is taking more than memory we allocated.
    OS
    Windows Server 2003 R2 Enterprise x64 Edition Service Pack 2 (build 3790)
    ORACLE
    Oracle Database 11g Enterprise Edition Release 11.1.0.6.0 - 64bit Production
    PL/SQL Release 11.1.0.6.0 - Production
    CORE    11.1.0.6.0      Production
    TNS for 64-bit Windows: Version 11.1.0.6.0 - Production
    NLSRTL Version 11.1.0.6.0 - Production
    Total RAM on box is 8G
    Page File
    Windows virtual memory equal on C,D,E,F drives is set to  12273M and allocated now is 11262M
    LPENABLED is not set
    SQL> show parameter pga_
    pga_aggregate_target   0
    SQL> show sga
    Total System Global Area 5344731136 bytes
    Fixed Size                  2114736 bytes
    Variable Size            4630514512 bytes
    Database Buffers          671088640 bytes
    Redo Buffers               41013248 bytes
    SQL> show parameter memory
    hi_shared_memory_address  0      
    memory_max_target    5G                
    memory_target      5G                  
    shared_memory_address  0             
    SQL> show parameter sga
    lock_sga   FALSE                         
    pre_page_sga     FALSE                   
    sga_max_size   5G                     
    sga_target      0
    Question :
    Why oracle.exe is taking 8G virtual; bytes,  memroy target can not go beyond 5G. How to minimized the virtual byte in perfmon
    Thanks in advance your time and help.

    John, Thanks for the reply.
    Please find the output of query
    SQL> select pool,sum(bytes) from v$sgastat group by pool;
    POOL         SUM(BYTES)
                  915543216
    java pool      67108864
    streams pool  268503944
    shared pool  2147494008
    large pool     67108864
    SQL>
    SQL> select * from v$pgastat;
    NAME                                                                  VALUE UNIT
    aggregate PGA target parameter                                    671088640 bytes
    aggregate PGA auto target                                         147564544 bytes
    global memory bound                                               104857600 bytes
    total PGA inuse                                                   533962752 bytes
    total PGA allocated                                               810819584 bytes
    maximum PGA allocated                                            1244466176 bytes
    total freeable PGA memory                                          90243072 bytes
    process count                                                           450
    max processes count                                                     588
    PGA memory freed back to OS                                      1.9883E+10 bytes
    total PGA used for auto workareas                                  28210176 bytes
    maximum PGA used for auto workareas                                39973888 bytes
    total PGA used for manual workareas                                       0 bytes
    maximum PGA used for manual workareas                                531456 bytes
    over allocation count                                                     7
    bytes processed                                                  2.6307E+10 bytes
    extra bytes read/written                                                  0 bytes
    cache hit percentage                                                    100 percent
    recompute count (total)                                               72720
    19 rows selected.
    SQL>
    SQL>  show parameter _target
    NAME                                 TYPE                             VALUE
    archive_lag_target                   integer                          0
    db_flashback_retention_target        integer                          1440
    fast_start_io_target                 integer                          0
    fast_start_mttr_target               integer                          0
    memory_max_target                    big integer                      5G
    memory_target                        big integer                      5G
    pga_aggregate_target                 big integer                      0
    sga_target                           big integer                      0
    SQL> sho parameter sga_max
    NAME                                 TYPE                             VALUE
    sga_max_size                         big integer                      5G

  • GUI_DOWNLOAD give 2 bytes for each chinese character - I need fixed length

    Due to the Unicode system takes each Chinese character as a byte, the field(10) can take 10 Chinese Characters, not like before only 5 characters allowed.
    The problem is when the data is downloaded to a txt file. Some records contains only Western Europe charactes and will fill 10 bytes in the output file and other records contains only Chinese characters and will fill up 20 bytes in the output file.
    The data is exported for a system that can upload chinese characters, but only allow fixed record length file (always 10 bytes).
    In other words: the records with Western Europe characters should contain 10 characters = 10 bytes but the records with Chinese characters should only contain 5 characters = 10 bytes.
    Anyone who can solve this, thanks in advance.
    My code:
      CALL METHOD CL_GUI_FRONTEND_SERVICES=>GUI_DOWNLOAD
        EXPORTING
          FILENAME                = p_file
          CONFIRM_OVERWRITE       = 'X'
          codepage                = '8400' "Chinese
        CHANGING
          DATA_TAB                = it_output
        EXCEPTIONS

    Hi Thomas,
    Now I understand.
    Pl. check the class CL_ABAP_CONV_X2X_CE.
    May it can help u.
    Here is it's documentation.
    CL CL_ABAP_CONV_X2X_CE
    Short Text
    Code Page and Endian Conversion Between External Formats
    Functionality
    Instances of the class CL_ABAP_CONV_X2X_CE allow you to convert text data between different character sets and numeric data between different number formats (byte order).
    Using the class corresponds to transforming data from a binary input stream to a binary output stream: The data objects are read from the input buffer sequentially and written to an output buffer.
    The class methods are normally used as follows:
    CL_ABAP_CONV_X2X_CE=>CREATE
    This creates a conversion instance. Among other options, you can specify the following as parameters: The input buffer (that is the binary string that contains the data to be read), the character format at used in the input buffer, the byte order used in the input buffer, the character format to be used in the output buffer, or the byte order to be used in the output buffer.
    CONVERT_C, CONVERT_...
    This converts the data. Calling this method several times consecutively allows you to read data from the input buffer sequentially and add it to the end of the output buffer.
    GET_OUT_BUFFER
    This gets the output buffer, making it available for further processing (such as writing to a file, sending using RFC).
    RESET
    This allows you to reset individual attributes of the conversion instance. (This method is especially designed for restarting on a new input buffer and deleting the output buffer while retaining the remaining attributes.)
    Relationships
    CL_ABAP_CONV_IN_CE
    Converting Binary Data into ABAP Data Objects
    CL_ABAP_CONV_OUT_CE
    Converting ABAP Data Objects to a  Binary Format.
    CL_ABAP_CHAR_UTILITIES
    Various Attributes and Methods for Character Sets and Byte Order
    Example
    In the following example, UTF-8 texts are converted to the codepage 1100 (Latin-1) and numbers are converted from little-endian to big-endian format:
    DATA:
      in_buffer TYPE XSTRING,
      out_buffer TYPE XSTRING,
      conv TYPE REF TO cl_abap_conv_x2x_ce.
    in_buffer = '414220C3B602010000'.
    conv = cl_abap_conv_x2x_ce=>create(
             in_encoding = 'UTF-8'
             in_endian = 'L'
             out_encoding = '1100'
             out_endian = 'B'
             input = in_buffer
    CALL METHOD conv->convert_c( n = 5 ).
    CALL METHOD conv->convert_i( ).
    out_buffer = conv->get_out_buffer( ).
    The content of the in_buffer variable is made up of  5 bytes (hexadecimal "414220C3B6"), which represent 4 UTF-8 characters (A, B, SPACE, o-Umlaut), and 4 bytes (hexadecimal "02010000"),  which represent the value 258 in little-endian format. This data is converted and the out_buffer variable now contains the hexadecimal string "414220F600000102". It is made up of:
    4 bytes (hexadecimal "414220F6"), which represent the above  4 characters in codepage 1100 (ISO-8859-1). Note that the length specification n = 5 refers to the number of elementary characters to be converted. For multi-byte codepages like UTF-8 this means that the multi-byte character "C3B6" is counted in length 2.
    4 Bytes (hexadecimal "00000102"), which represent the value 258 in big-endian format.
    If you have the desired byte order in the old format as expected by TRANSLATE ... NUMBER FORMAT (as an N(4) value), you can proceed as follows:
    TYPE-POOLS: ABAP.
    CLASS cl_abap_char_utilities DEFINITION LOAD.
    DATA:
      in_number_format(4) TYPE N VALUE '0101',
      out_number_format(4) TYPE N VALUE '0000'.
    DATA:
      in_endian TYPE ABAP_ENDIAN,
      out_endian TYPE ABAP_ENDIAN,
      conv TYPE REF TO cl_abap_conv_x2x_ce..
    in_endian  = cl_abap_char_utilities=>number_format_to_endian(
                   in_number_format
    out_endian = cl_abap_char_utilities=>number_format_to_endian(
                   out_number_format
    conv = cl_abap_conv_x2x_ce=>create(
             in_encoding = 'UTF-8'
             in_endian = in_endian
             out_encoding = '1100'
             out_endian = out_endian
             input = in_buffer
    Notes
    For details refer to the documentation for the individual methods.
    Regards,
    Joy.

  • Extra zeros in numeric fields when I create spreadsheet from data files

    I created a form with Live Cycle, and then in Adobe I use the option "create a spread sheet from data files" to import the answers to a xls file.
    I have two problems with this action: the first one is that I get 8 extra zeros in each numeric field, the second one is that fields are ordered by type and not by appearance.
    I tried a different approach importing directly in Excel, in that way there are no extra zeros and the order is correct, but I get just one form each time, and in a "stairways" fashion (i. e. first field in A1, second in B2, and so on)
    I'd appreciate any help

    Where do you find the command "create a spread sheet from data files"?
    Anyway i have a similar problem: when i export data in a .csv file and than i import it in excel, i always get 8 extra zeros... how can i solve the problem?

  • UTL_FILE - File Size limit does not exceed 32990 bytes

    Hi,
    We are using UTL_FILE package of oracle for writing data into a file.We are using "UTL_FILE.FOPEN" function to open the file in the write mode and "UTL_FILE.PUT" function to write data into it.
    We have specified the max size of the record as 32767 bytes as one of the parameters to the fopen function.
    Oracle : 8.1.6
    Platform : NT
    Problem:
    The amount of data written to the file is incomplete. The number of bytes written to the file is always 32990 bytes and it does not write the remaining data. Can u please explain this.
    When using "UTL_FILE.PUT_LINE" function, the entire data is written to the file.However I cannot use this because this function inserts a new line characte as the line terminator which is not our requirement..
    I would appreciate your replies in this regard.
    null

    It's a DBMS_OUTPUT error. You are restricted to 255 bytes when using it to output data. From Note: 1010445.6 on MetaLink:
    Problem Description
    You receive the following errors when trying to use
    DBMS_OUTPUT.PUT_LINE() to output a string > 255 characters:
    ORA-20000 a package-specific exception raised
    ORU-10028 line length overflow, limit of 255 bytes per line
    Solution Description
    This is a restriction of the package DBMS_OUTPUT(). The restriction
    and resulting error messages are documented in the file dbmsotpt.sql.
    This file can be found in the directory $ORACLE_HOME/rdbms/admin
    on UNIX platforms.

  • How could I choose some bytes from HEX string and then convert it to a decimal value?

    Hi I am working with an OMRON E5EN temperature controller using VISA serial to get data, I send the Read from Variable Area command and get this string  in hexa 0230 3130 3030 3030 3130 3130 3030 3030 3030 3030 3041 3203 71 or .01000001010000000000A2.q in ASCII this string means:
    02 STX
    3031 3030 Node and subadress
    3030 End Code Normal Completion
    3031 3031 Command Read from Variable Area
    3030 3030 respt code Normal completion
    3030 3030 3030 4132 Hexadecimal A2 = 162  (this is the temperature data that I want to show in decimal)
    03 ETX
    71 Block Check Character
    I want to choose the eight bytes for the temperature data and convert it to a decimal number. I have seen the examples to convert a Hexa string to decimal but I do not know how to choose the specifics bytes that I need.
    I have look for a driver but i didn´t find any. I am a beginner so please include especific topics for me to study in your answer.
    Thanks
    Carlos Fuentes Silva Queretaro Mexico 

    If the response always has the temperature starting with byte 15 and is always 8 bytes in length, you can use the String Subset function to get those bytes out of the string.  Then use Hex String to Number to convert to a decimal number.
    Well someone already beat me to the solution:
    Message Edited by tbob on 01-04-2008 04:42 PM
    - tbob
    Inventor of the WORM Global
    Attachments:
    HexStr2Decimal.png ‏7 KB

  • Trash always has 8 items

    Hi everyone,
    I have just upgraded to SL and have installed all the recent software upgrades.
    I have noticed that although my trash appears empty, when I put something in it and then empty, it always starts at 8 items and takes about that long to empty, ie, it is not instant or as quick as the file size would usually dictate in 10.5.
    When I put more than 8 items in it always adds an extra 8.
    I have heard about a virus, not on Macs, which automatically deletes items when playing a game, but I am dreading that this is a virus and worse still deleting things which I have no ability to track and it may well be months before I would notice.
    Any help would be appreciated.
    Olly

    Oliver_ Thompson wrote:
    Hi everyone,
    I have just upgraded to SL and have installed all the recent software upgrades.
    I have noticed that although my trash appears empty, when I put something in it and then empty, it always starts at 8 items and takes about that long to empty, ie, it is not instant or as quick as the file size would usually dictate in 10.5.
    go to finder preferences->advanced and uncheck the option to empty trash securely.
    When I put more than 8 items in it always adds an extra 8.
    I have heard about a virus, not on Macs, which automatically deletes items when playing a game, but I am dreading that this is a virus and worse still deleting things which I have no ability to track and it may well be months before I would notice.
    oh lord, the insanity about that has started already. this is not a virus. there are NO known OS X viruses. as in none or zero. that game is for idiots who want to nuke their accounts. it's certainly not a virus. you have to download it, install it, read the warning that tells you what it will do if you play it and then disregard the warning and actually play it.
    http://www.macworld.com/article/143649/2009/11/loselose.html
    Any help would be appreciated.
    Olly

  • V3.0, NLS_LENGTH_SEMANTICS byte vs. char for CREATE TABLE

    Hi,
    When creating a new table (via "New Table" or "Data Load ...")
    NLS_LENGTH_SEMANTICS of table columns are always in byte even when NLS_LENGTH_SEMANTICS
    is set to char for the instance (and so as default for all sessions) and has not explicitly changes for the current session.
    Is there a way to change this behavior or could this be a gebnerell problem in 3.0.
    I would like SQL Developer to use the standard settings of the instance as long as I don't set it different for a session.
    Please give me a littel hint how to solve this issue.
    Thanks in advance.
    Andre
    --2011/07/15-------------------------------------------------------------------------------------------
    Hello,
    I'm not sure wether or not this is a too complicated or just as silly question.
    However it's still an issue for me.
    It would be great if someone could at least confirm or refuse it.
    Hoping for an answer- Thank you again!
    Andre
    Edited by: andreml on Jul 15, 2011 2:10 AM
    Edited by: andreml on Jul 15, 2011 2:11 AM

    Hi,
    If you click on any given table in the Connections view, an object viewer opens for that table. Its column tab lists all columns with attributes for column_name, data_type, and so on. The data_type info includes the length semantics, e.g., VARCHAR2(30 BYTE).
    Regards,
    Gary Graham
    SQL Developer Team

Maybe you are looking for