GetLength errors on CLOB. Retrieves the size of a table with CLOB columns

Hello

I try to find the size of a CLOB to a table column and get the error

PLS-00306: wrong number or types of arguments in the call to "GETLENGTH.

When you try to use dbms_lob.getlength. Here is the code


declare
number num.
Start
for rec in (select xmlupload from FILE_TABLE where file_table_id = 33635) loop
NUM: = dbms_lob.getLength (rec.xmlupload);
end loop;
dbms_output.put_line (num);
end;

Database version: Oracle Database 10g Enterprise Edition Release 10.2.0.4.0 - 64bi


I'm actually trying to find the size of a table with CLOB columns, is there an easy way to do this Besides using getlength and without having to contact the Administrators (they are outsourced)?

It works fine on my computer, the version is also 10g.

SQL> declare
  2  num number;
  3  begin
  4  for rec in (select cntnt from ims_toms_msge where rownum<3) loop
  5  num := dbms_lob.getLength(rec.cntnt);
  6  dbms_output.put_line(num);
  7  end loop;
  8
  9  end;
 10  /
3837
3837

PL/SQL procedure successfully completed.

You should check if xmlupload is the CLOB data type.
In addition, if you just want to get the CLOB size, you can use LENGTH() as well, you will get the same result;

SQL>  select length(cntnt), dbms_lob.getLength(cntnt) from ims_toms_msge where rownum<2;

LENGTH(CNTNT) DBMS_LOB.GETLENGTH(CNTNT)
------------- -------------------------
         3837                      3837

Published by: PhoenixBai on September 24, 2009 13:40

Tags: Database

Similar Questions

  • Find the size of a table with partitions; Two questions

    DB version: 11.2.0.4

    Platform: Oracle Linux 6.4

    The slot table MH_PKT_HEADR in UTMSBL schema has more than 5000 partitions.

    Because there partitions, you cannot use just view DBA_SEGMENTS to determine the size of the table.

    So, I tried to use 2 SQLs mentioned below. Query1 returned 5 GB. But Query2 has returned a value zero. Query2 is actually a note metalink mentioned below, so he cannot deceive you, I guess.

    That is the reliable accurate query: Query1 or Query2?

    No idea why Query2 returns a Null value?

    - Query1

    fixed lines 200

    Col TABLE_NAME format a18

    with

    BaseData as)

    Select the owner

    nom_segment

    segment_type

    , round (sum (bytes) / 1024/1024/1024) GB

    sum (bytes) bytes

    count (*) segment_count

    of s dba_segments

    Group by owner, nom_segment, segment_type

    )

    ,

    LOB type as data)

    Select the owner

    table_name

    nom_segment

    of dba_lobs

    )

    ,

    all_segs like)

    Select coalesce (lobs.table_name, basedata.segment_name) table_name

    basedata.*

    of basedata

    left outer join

    type LOB data

    on (basedata.segment_name = lobs.segment_name

    and basedata.owner = lobs.owner)

    )

    Select table_name

    sum (bytes) bytes

    sum (gb) GB

    of all_segs

    where table_name = 'MH_PKT_HEADR'.

    and owner = 'UTMSBL. '

    Table_name group;

    TABLE_NAME BYTES GB

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

    5869469696 5 MH_PKT_HEADR

    - Request 2

    -Source: how to calculate the size of a Table that contains outline CLOB and BLOB (Doc ID 118531.1()

    SELECT

    (SELECT SUM (S.BYTES) - the Segment of Table size

    FROM DBA_SEGMENTS S

    WHERE S.OWNER = UPPER ('UTMSBL') AND

    (S.SEGMENT_NAME = UPPER ('MH_PKT_HEADR'))) +

    (SELECT SUM (S.BYTES) - the size of the Lob Segment

    FROM DBA_SEGMENTS S, DBA_LOBS L

    WHERE S.OWNER = UPPER ('UTMSBL') AND

    (L.SEGMENT_NAME = S.SEGMENT_NAME AND L.TABLE_NAME = UPPER('MH_PKT_HEADR') AND L.OWNER = UPPER('UTMSBL'))) +

    (SELECT SUM (S.BYTES) - the size of the Lob Index

    FROM DBA_SEGMENTS S, DBA_INDEXES I

    WHERE S.OWNER = UPPER ('UTMSBL') AND

    (I.INDEX_NAME = S.SEGMENT_NAME AND I.TABLE_NAME = UPPER('MH_PKT_HEADR') AND INDEX_TYPE = 'LOB' AND I.OWNER = UPPER('UTMSBL')))

    "TOTAL TABLE SIZE.

    FROM DUAL;

    TOTAL TABLE SIZE

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

    SELECT

    (SELECT nvl (SUM (S.BYTES), 0)-dimensions of the Segment Table)

    FROM DBA_SEGMENTS S

    WHERE S.OWNER = UPPER ('UTMSBL') AND

    (S.SEGMENT_NAME = UPPER ('MH_PKT_HEADR'))) +

    (SELECT nvl (SUM (S.BYTES), 0)-Segment Lob size)

    FROM DBA_SEGMENTS S, DBA_LOBS L

    WHERE S.OWNER = UPPER ('UTMSBL') AND

    (L.SEGMENT_NAME = S.SEGMENT_NAME AND L.TABLE_NAME = UPPER('MH_PKT_HEADR') AND L.OWNER = UPPER('UTMSBL'))) +

    (SELECT nvl (SUM (S.BYTES), 0)-size of the Lob Index)

    FROM DBA_SEGMENTS S, DBA_INDEXES I

    WHERE S.OWNER = UPPER ('UTMSBL') AND

    (I.INDEX_NAME = S.SEGMENT_NAME AND I.TABLE_NAME = UPPER('MH_PKT_HEADR') AND INDEX_TYPE = 'LOB' AND I.OWNER = UPPER('UTMSBL')))

    "TOTAL TABLE SIZE.

    FROM DUAL;

    David Fitzjarrell

  • How to find the size of a table with CLOB

    Hello

    I have a table with CLOB as follows:

    SQL > desc INFO_MESSAGES

    Name                                      Null?    Type

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

    CLNT_OID NOT NULL VARCHAR2 (16)

    USR_OID NOT NULL VARCHAR2 (16)

    LAST_client_msg_ID VARCHAR2 (36)

    LAST_client_msg_DATE DATE

    LAST_client_msg CLOB

    LAST_USR_MSG_BOD_ID VARCHAR2 (36)

    DATE OF LAST_USR_MSG_DATE

    CLOB LAST_USR_MSG

    Now I just want to find out what is the size/area total absorbed by the table (including the CLOB columns), so how can I find? I think that the usual command does not - the

    Select format from dba_segments where nom_segment = "INFO_MESSAGES" is only showing 7 MB, while I think that the table has several GB of space due to the CLOB.

    Also to add one more detail: when dba_segments seeking, I see a result like this:

    Select * of dba_segments order by bytes DESC;

    MIGRTN SYS_LOB0000111131C00008$ $ LOBSEGMENT SAMS DATA1 20690 6 1963 14528000 119013376000 <-the top row

    MIGRTN this is the schema where this INFO_MESSAGES table is present.

    Thanks,

    OrauserN

    you will need to add the segment_size of the LOB segments to the segment_size of the table. The connection between the two pieces of information you find in USER_LOBS (or the corresponding ALL_, DBA_ objects).

  • Retrieve the index of a table with a value greater than zero

    How is it possible to extract the indices of the elements above zero in a 2D array?

    Example:

    Table:

    0 12 11 33 0

    1 0 0 0 0

    2 99 0 9 0

    Need to get 12,11,33 table indexes and so on...

    Nghtcrwlr,

    Attached is the first thing that comes to mind.

    Dan

  • retrieve the information of partition table with lack of offline data file

    I just restored a backup of a database. When I unzipped data files, I discovered that a single data file was so damaged in the starting order of the database, I had to put the offline data file. The tablespace which reports the data file holds the information of partition of a table. Since I have no archives from when the data file has been created, I know it is not possible to recover the data file, I have to recover as many lines as possible other files in the tablespace data but when export or create the table as what to choose in the affected partition get ORA-00376 : cannot read file 1624 at the moment.

    is there a way to tell oracle to ignore the data offline file and export the remaining data file information?

    Just to clarify my situation a little more;
    iI have a table called PPGA_ACTABOPRE that is partitioned by HASH and has 20 partitions, each partition in a different tablespace and tablespace each have about 8 files of data. A data file in the partition 9 is missing and I want is to get the information from the files of the remaining data, but whenever I issue a select statement or an exp or anything I get ORA-00376.

    I try to set the flag to ignore blocks corrupt with run DBMS_REPAIR. SKIP_CORRUPT_BLOCKS ('PPGA', 'PPGA_ACTABOPRE'); and then select the info but it did not work.

    Any suggestion would be appreciated;
    Thanks in advance

    For the actabopre_p08 partition, some files are available, and we're not. You can access data at the segment level, because some extensions are missing.

    You would need to access the data by rowid. You could loop through dba_extents and use dbms_rowid.create to generate a list of ROWID that may exist in the available data files.

    This may help: -.

    http://kerryosborne.Oracle-guy.com/2009/02/saving-rows-from-corrupt-blocks/
    http://kerryosborne.Oracle-guy.com/scripts/save_u.SQL

    Published by: Robert Geier on March 12, 2010 15:33

  • I need to write a vbscript script to retrieve the size of an access database

    Could someone help me write a vbscript script to retrieve the size of an access database. I need to put this in my schedular system to run every morning.

    Hi Rob,

    Your question is more complex than what is generally answered in the Microsoft Answers forums. It is better suited for the IT Pro TechNet public. Please post your question in the Office IT Pro. You can follow the link to your question:

    http://social.technet.Microsoft.com/forums/en-us/officeitpro/threads

  • Error occurred in retrieving the provided user bindDN.The user must have attribute/s firstName, lastName, email BindDN.

    When I go through the wizard and setting to the top of my base and bind DN, I get the following error. What Miss me? Error saving configuration of the directory. Error occurred in retrieving the provided user bindDN.The user must have attribute/s firstName, lastName, email BindDN.

    The usename you use AD administrator (IE CN = admin) must have the required attributes with non-empty values - firstName, lastName, email.

    When HW connect to AD with bindDN he added that makes the system user who applies the required properties.

    These properties are required for each user that needs to be added/synchronized to the workspace of horizon.

    To correct this error, you must go to AD and adds these admin user attributes.

  • need help to determine the size of all tables in a table space

    Hello

    I want to know the size of individual Tables belonging to a particular Tablespace (ULTGNP), ordered by the size in MB. I have to analyze the tables before I have a discovery of the size. I tried this script, could someone please go through the script and correct it, if necessary errors.

    Select owner, segment_name, tablespace_name, sum ((bytes/1024/1024)) bytes
    of sys.dba_extents
    where owner in 'ULTGNP' and segment_type = 'TABLE '.
    Group by tablespace_name, owner, nom_segment
    order by owner, nom_tablespace, nom_segment bytes


    Thank you
    SELECT
    SUBSTR(s.segment_name,1,20) TABLE_NAME,
    SUBSTR(s.tablespace_name,1,20) TABLESPACE_NAME,
    ROUND(DECODE(s.extents, 1, s.initial_extent,
    (s.initial_extent + (s.extents-1) * s.next_extent))/1024000,2) ALLOCATED_MB,
    ROUND((t.num_rows * t.avg_row_len / 1024000),2) REQUIRED_MB
    FROM
    dba_segments s,
    dba_tables t
    WHERE
    s.owner = t.owner AND
    s.segment_name = t.table_name
    and SUBSTR(s.tablespace_name,1,20)='TABLESPACE_NAME',
    SUBSTR(s.segment_name,1,20) )='Your_table'
    
    ORDER BY s.segment_name;
    

    Published by: Adigozalov Qurban on January 25, 2011 11:08

  • Set the size of fixed table

    Hello. I am developing a VI to a FPGA target and I'm trying to make sure who is using the VI can specify the size of an array of input when they instantiate (such as by the presence of an entry to the VI who said "maximum table size" or something). So far, it seems that the only way to do something like this is to go into the VI himself and manually set the size of table for each entry in the table for the VI (open the VI, do a right-click on each input array, select 'Set the size Dimension', choose 'fixed', set number of items). I would like to have a point where I can set the size of all tables at once (as in my case, they are all the same size) and let the person using the VI set it to the right size for which application they use it for (to be clear, let's say I have two uses for this VI and in one case (, I have a table of entry of size 100 and other use of size 1000, I would like to be able to put these in some way rather than do it through the dialog box). Thank you.

    It's a little more work, but it could be a case of good use for a memory block on the FPGA.  Make it bigger you wait, you need, and then store the actual number of items somewhere.  This will allow you to vary the amount of data without consuming large amounts of FPGA resources on an oversized table.

  • Error "unable to register the DLL/OCX: Regsvr32 failed with exit code 0x5" when installing a WinUtilities

    Hello

    After the installation of WinUtilities, I get the error: failed to register the DLL/OCX: Regsvr32 failed with exit code 0 x 5.

    My system is Windows XP.

    Are there any missing service or not started?

    Thank you.

    Access the Run item on the start menu and type:

    regsvr32

  • How to connect to an Adobe Javascript(Folder Level Script) SAP Web Service and retrieve the response in a table of the Adobe Javascript/AcroJS. Could you please it explain with an example. I have two required input parameters that must be filled.

    How to connect to an Adobe Javascript(Folder Level Script) SAP Web Service and retrieve the response in a table of the Adobe Javascript/AcroJS. Could you please it explain with an example. I have two required input parameters that must be filled.

    I s generic SOAP example/tutorial on my blog: get a serial number in a form using SOAP - KHKonsulting LLC

    The web service uses only a single parameter, but you should be able to adapt the code to two arguments without problems.

  • LR fills the entire screen. How can I reduce this so I can control the size or reduce it with the help of the control-M?

    LR fills the entire screen. How can I reduce this so I can control the size or reduce it with the help of the control-M?

    Hi DP,.

    Are full-screen mode in Lightroom, you can it exist by pressing SHIFT + F.

    Kind regards

    Mohit

  • How will I know "the size of a table special VS size of RAM"

    Hi all

    How will I know "the size of a table special VS size of RAM"?

    I should know because I want to understand what join method to use.

    Please correct me if my attempt to catch the truth is crazy.

    Thanks in advance.

    You can get the size of a table of DBA_SEGMENTS.  I'm sure you can get the amount of RAM of other tables of data dictionary as well if you can define precisely what memory segment you are interested in (e.g. CMS?)  PGA?  The amount of physical RAM on the box?  The size of the buffer cache?  The amount of virtual memory available?)

    That being said, comparing the two is not as significant.  You, as a developer, are generally not in the business of choosing a join method.  It's the job of the optimizer.  And the optimizer takes into account a range of data that you have not begun to ask about yet.  The size of the table is not even particularly relevant for calculations - the optimizer the amount of data operations are back, the relative size of the data on each side of the join, the availability of indexes, etc. are all much more important than the raw size of the table (but the raw size of the array is a factor in the assessment of the amount of data that is returned).

    Justin

  • Reduce the size of a table.

    Hello group,

    To reduce the size of a table, that I was asked to remove about 2 million lines, however queriying dba_segments after having removed the lines, the value of the BYTES column to the same value stay.

    Why?, how ask Oracle to reduce the table itself.

    Thank you very much.

    user12003066 wrote:
    Hello group,

    To reduce the size of a table, that I was asked to remove about 2 million lines, however queriying dba_segments after having removed the lines, the value of the BYTES column to the same value stay.

    Why?, how ask Oracle to reduce the table itself.

    What happens when you run this?

    exec dbms_stats.gather_table_stats ('schema', 'your_table_name');

    Aman...

  • Newbie Question on the use of the size of a table in a schema

    Hi all,

    Newbie Alert!

    I tried to work on the size of a table in a schema and struggled to get the exact number. Could someone help me please with getting an exact figure.

    Thanks to all who responded!

    SELECT sum (blocks) * db_block_size/1024 MB of dba_extents
    where owner = SCHEMA_OWNER and nom_segment = TABLE_NAME;

    http://Waqas-DBA.blogspot.com

Maybe you are looking for