How to find Tuple(row) size in a Data Block
hi,
I want to find out the size of 1 row and total size of a table in a data block in Oracle 11g. For Example I've a Employee table with 300 rows. I want to find out how much space these rows are occupying in a data block (8192 default) and also the size of 1 individual row.
I'll appreciate the valuable suggestions.
Thanks alot.
Regards,
Kamran
Hi,
Welcome to the forum!
See [Calculating Oracle average row length|http://www.dba-oracle.com/t_average_row_length.htm], I hope it helps
Regards,
Similar Messages
-
How to estimate average row size without populating data
hi all
I have a work of estimating the average row size of some tables. Because I don't want to populate these tables with data(It's alot work to do it),so I am not able to get the arerage row size from dba_tables by analyzing these tables.
Is there other way around to do my job easily?
Thanks alot.Hi,
I am not a coder,I am a DBA.Do you think that it's coder's responsibility to do such kind of works?Still i think it part of the dba role to suppport the developers or to provide guidance, the easiet way would be the using package DBMs_SPACE, perhaps if you take the help of developer, ask him to populate the single record with full length or say max length in each table and generate the 10053 trace with basic select clauses, You can the information from the trace too...
- Pavan Kumar N -
Hi ,
Please tell me how to find the db size.
Thanks,
Kumar.If I understand correctly, the above query will give the space allocated to the database. This isn't necessarily the same as the space used by the database. Or do I need to clean my glasses ?
I use the following to get sizes for tablespaces (may need some formatting done - works in 9i and 10g) :
SELECT
Total.name "TABLESPACE_NAME",
total_space "TABLESPACE_SIZE",
nvl(Free_space, 0) Free_space,
nvl(total_space-Free_space, 0) Used_space
FROM
select
tablespace_name,
sum(bytes/1024/1024) Free_Space
from
sys.dba_free_space
group by
tablespace_name
) Free,
select
b.name,
sum(bytes/1024/1024) TOTAL_SPACE
from
sys.v_$datafile a,
sys.v_$tablespace B
where
a.ts# = b.ts#
group by
b.name
) Total
WHERE
Free.Tablespace_name(+) = Total.name
ORDER BY
Total.name
; -
How to find the Model size in Semantics
Hi All,
Please can you tell me how to find the model size in Semantics.
Thanks,
InduHi,
Instead of looking up the ID for the Entailment in DB_VIEWS you can better use MDSYS.SEM_NETWORK_INDEX_INFO
For example:
select name, type, id from MDSYS.SEM_NETWORK_INDEX_INFO;
NAME TYPE ID
MYMODEL MODEL 60
MYMODEL_INF ENTAILMENT 69
*** Space about the B-tree indexes on models and entailments ***
Indexes created in RDF_LINK$ for a specific model:
SQL> select name, type, id, index_name from MDSYS.SEM_NETWORK_INDEX_INFO;
NAME TYPE ID INDEX_NAME
MYMODEL MODEL 60 RDF_LNK_PCSGM_IDX
FAMILY100 MODEL 59 RDF_LNK_PSCGM_IDX
FAMILY100 MODEL 59 RDF_LNK_PCSGM_IDX
FAMILY2 MODEL 56 RDF_LNK_PCSGM_IDX
FAMILY2 MODEL 56 RDF_LNK_PSCGM_IDX
FAMILY MODEL 57 RDF_LNK_PCSGM_IDX
FAMILY MODEL 57 RDF_LNK_PSCGM_IDX
OTHERMODEL MODEL 58 RDF_LNK_PSCGM_IDX
OTHERMODEL MODEL 58 RDF_LNK_PCSGM_IDX
0 NETWORK 0 RDF_LNK_PCSGM_IDX
0 NETWORK 0 RDF_LNK_PSCGM_IDX
MYMODEL_INF ENTAILMENT 69 RDF_LNK_PCSGM_IDX
MYMODEL_INF ENTAILMENT 69 RDF_LNK_PSCGM_IDX
Then get the size from DBA_SEGMENTS
select bytes/1024/1024 MB, partition_name from dba_segments where segment_name in ('RDF_LNK_PSCGM_IDX','RDF_LNK_PCSGM_IDX');
Specifically for our model 60 and Entailment 69:
select bytes/1024/1024 MB, partition_name from dba_segments where segment_name in ('RDF_LNK_PSCGM_IDX','RDF_LNK_PCSGM_IDX') and partition_name in ('MODEL_60','MODEL_69');
MB PARTITION_NAME
192 MODEL_60
192 MODEL_60
60.0625 MODEL_69
62.375 MODEL_69
You would add them all for the size of the indexes -
How to find Average transaction size and average number of transactions/sec
Would like to know
1. how to find average transaction size
2. number of transactions per sec
using SQL queries. We also have statspack installed.
Regards,
AnirbanSQL> select maxval,minval,average from SYS.V_$SYSMETRIC_SUMMARY where metric_name in ('User Transaction Per Sec');
MAXVAL MINVAL AVERAGE
.7 0 .149170735
SYS.V_$SYSMETRIC_SUMMARY have to many other metrics check the one you need. (10G and above)
Coskan Gundogar
http://coskan.wordpress.com
Edited by: coskan on Mar 31, 2009 12:42 PM -
How to find out the size of files transferred over the SQL * Net?
I am trying to test the Advanced Compress (AC) for 11g Data Guard. When the AC is turned on, the archived log files are supposed to be compressed on the primary database server and sent over SQL*Net, then decompressed on the standby db server. We will see the file sizes are the same on both primary and standby servers. I want to verify that the AC works by monitoring how much data are sent over SQL*Net. Per Oracle, AC uses 35% less of the bandwith. That means the size of the files transferred should be at least 65% of the original size.
Is there a way to find out the size through Oracle utilities? If not, how to find out by OS utilities? OS is Solaris 5.10.
Thanks.I'm not sure this can be done via SQL*Net, but a network packet sniffer between the two servers should be able to help - you might want to contact your network team.
HTH
Srini -
Urgent: How to find out the size in bytes of java object
Hi Experts,
We've a requirement that we need to find out the size of a java object at run time, is there a direct java API to get the size of a composite object in memory?
Here is my requirement: We are adding string objects (which is an xml string of considerable size) into a List. After reaching certain size limit (lets say 5MB) of the list i need to put this data into DB as a CLOB. So every time I add a string object to the list, I need to see if the total size of the list exceeds the limit and if yes, flush the results into DB.
I am not sure if java has a direct API for this, if not what is the beast way to do it, it s critical requirement for us.
It would be really great if someone could help us out.
Thank you,
-Shibu.>
We've a requirement that we need to find out the size of a java object at run time, is there a direct java API to get the size of a composite object in memory?
Here is my requirement: We are adding string objects (which is an xml string of considerable size) into a List. After reaching certain size limit (lets say 5MB) of the list i need to put this data into DB as a CLOB. So every time I add a string object to the list, I need to see if the total size of the list exceeds the limit and if yes, flush the results into DB.
I am not sure if java has a direct API for this, if not what is the beast way to do it, it s critical requirement for us.
It would be really great if someone could help us out.
>
Could you explain your actual requirement a little more fully.
1. Is each individual string a separate XML string? Or is it just a fragment? Why would you just concatenate them together into a CLOB? That won't produce valid XML and it won't let you easily separate the pieces again later. So provide a simple example showing some strings and how you need to manipulate them.
2. Are you using these xml strings in Java at all? Or are you just loading them into the database?
For example if you are just loading them into the database you don't need to create a list. Just create a CLOB in Java and append each string to the CLOB. Before you append each one you can check to see if the new string will put you over your length limit. If it will then you write the CLOB to the database, empty the CLOB and start appending again to the new clob instance.
If you explain what you are really trying to do we might be able to suggest some better ways to do it. -
How to find the client size?
i want to know how to find the size of the client?
Hi Gadangi,
Check OSS note# "118823 - CC-ADMIN: Size of a client".
Best regards,
Orkun Gedik -
Hi,
How to find the size of the schema in a daabase.
Thanks,
MahiMahi,
One more option, though not so clean would be use Data Pump and its estimate file size option for the schema. The estimate would tell you the info about the size of the schema.
HTH
Aman.... -
How to find duplicate row in sql query?
Hi All,
Please solve my query, find duplicate row and how to count its. your suggestion would be greatly appreciated.You can use group by and having.
SQL> WITH t
2 AS (SELECT LEVEL id
3 FROM DUAL
4 CONNECT BY LEVEL <= 5
5 UNION ALL
6 SELECT LEVEL + 2
7 FROM DUAL
8 CONNECT BY LEVEL <= 3)
9 SELECT *
10 FROM t;
ID
1
2
3
4
5
3
4
5
8 rows selected.
SQL> WITH t
2 AS (SELECT LEVEL id
3 FROM DUAL
4 CONNECT BY LEVEL <= 5
5 UNION ALL
6 SELECT LEVEL + 2
7 FROM DUAL
8 CONNECT BY LEVEL <= 3)
9 SELECT id, COUNT (*)
10 FROM t
11 GROUP BY id
12 HAVING COUNT (*) > 1;
ID COUNT(*)
3 2
4 2
5 2
SQL> -
How to find out image size (in pixels) of jpg and gif files
this seems to work, though i doubt that it would very time:
Image img = Toolkit.getDefaultToolkit().getImage("car.jpg");
int w = img.getWidth(null);
int h = img.getHeight(null);
while(w <= 0 || h <= 0)
try{Thread.sleep(10);}catch(InterruptedException ix){}
w = img.getWidth(null);
h = img.getHeight(null);
JOptionPane.showMessageDialog
null,
filenames[i] + ": " + w + "x" + h,
"ImgSize",
JOptionPane.INFORMATION_MESSAGE
);please suggest a better solution.
thanks>
We've a requirement that we need to find out the size of a java object at run time, is there a direct java API to get the size of a composite object in memory?
Here is my requirement: We are adding string objects (which is an xml string of considerable size) into a List. After reaching certain size limit (lets say 5MB) of the list i need to put this data into DB as a CLOB. So every time I add a string object to the list, I need to see if the total size of the list exceeds the limit and if yes, flush the results into DB.
I am not sure if java has a direct API for this, if not what is the beast way to do it, it s critical requirement for us.
It would be really great if someone could help us out.
>
Could you explain your actual requirement a little more fully.
1. Is each individual string a separate XML string? Or is it just a fragment? Why would you just concatenate them together into a CLOB? That won't produce valid XML and it won't let you easily separate the pieces again later. So provide a simple example showing some strings and how you need to manipulate them.
2. Are you using these xml strings in Java at all? Or are you just loading them into the database?
For example if you are just loading them into the database you don't need to create a list. Just create a CLOB in Java and append each string to the CLOB. Before you append each one you can check to see if the new string will put you over your length limit. If it will then you write the CLOB to the database, empty the CLOB and start appending again to the new clob instance.
If you explain what you are really trying to do we might be able to suggest some better ways to do it. -
How to find selected rows in REUSE_ALV_GRID_DISPLAY
HEllo All,
In OO we have a method to find get_selected_rows but i am unable to what is the way to find selected rows in REUSE_ALV_GRID_DISPLAY.
I am able to find a single row but i have to find multiple cleans in ALV. How can i do this.
Please help me with some ideas or please post some sample codes.
Regards,
LisaHi,
Check this code..
REPORT zdayatest1.
TABLES :t247.
TYPE-POOLS slis. "Type definitions for alv report
TYPES: BEGIN OF ty_func_tab,
fcode TYPE rsmpe-func,
END OF ty_func_tab.
DATA: it_fieldcat TYPE lvc_t_fcat,
wa_fieldcat TYPE lvc_s_fcat.
DATA: is_lvc_s_glay TYPE lvc_s_glay.
DATA: wa_layout TYPE lvc_s_layo.
DATA: is_rxtab TYPE ty_func_tab.
DATA: BEGIN OF it_final OCCURS 0,
check(1),
mnr LIKE t247-mnr,
ltx LIKE t247-ltx,
END OF it_final.
DATA: wa_final LIKE it_final.
DATA: w_repid LIKE sy-repid.
START-OF-SELECTION.
w_repid = sy-repid.
REFRESH it_final.
SELECT mnr ltx
FROM t247
INTO CORRESPONDING FIELDS OF TABLE it_final
WHERE spras EQ 'E'.
wa_fieldcat-fieldname = 'CHECK'.
wa_fieldcat-tabname = 'IT_FINAL'.
wa_fieldcat-checkbox = 'X'.
wa_fieldcat-edit = 'X'.
wa_fieldcat-outputlen = '3'.
wa_fieldcat-col_pos = '1'.
APPEND wa_fieldcat TO it_fieldcat.
CLEAR wa_fieldcat.
wa_fieldcat-fieldname = 'MNR'.
wa_fieldcat-tabname = 'IT_FINAL'.
wa_fieldcat-outputlen = '8'.
wa_fieldcat-col_pos = '2'.
wa_fieldcat-coltext = 'Month'.
APPEND wa_fieldcat TO it_fieldcat.
CLEAR wa_fieldcat.
wa_fieldcat-fieldname = 'LTX'.
wa_fieldcat-tabname = 'IT_FINAL'.
wa_fieldcat-outputlen = '20'.
wa_fieldcat-col_pos = '3'.
wa_fieldcat-coltext = 'Month Desc'.
APPEND wa_fieldcat TO it_fieldcat.
CLEAR wa_fieldcat.
wa_layout-zebra = 'X'.
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY_LVC'
EXPORTING
i_callback_program = w_repid
i_callback_pf_status_set = 'SUB_PF_STATUS'
i_callback_user_command = 'USER_COMMAND'
i_grid_title = 'TESTING'
is_layout_lvc = wa_layout
it_fieldcat_lvc = it_fieldcat
TABLES
t_outtab = it_final
EXCEPTIONS
program_error = 1
OTHERS = 2.
IF sy-subrc <> 0.
MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ENDIF.
*& Form USER_COMMAND
FORM user_command USING ucomm LIKE sy-ucomm
selfield TYPE slis_selfield.
IF selfield-fieldname = 'CHECK'.
DATA ref1 TYPE REF TO cl_gui_alv_grid.
CALL FUNCTION 'GET_GLOBALS_FROM_SLVC_FULLSCR'
IMPORTING
e_grid = ref1.
CALL METHOD ref1->check_changed_data.
LOOP AT it_final WHERE check = 'X'.
IF it_final-check IS INITIAL.
it_final-check = 'X'.
ELSE.
CLEAR it_final-check.
ENDIF.
MODIFY it_final.
ENDLOOP.
selfield-refresh = 'X'.
ENDIF.
ENDFORM. "USER_COMMAND
*& Form sub_pf_status
* text
* -->RT_EXTAB text
FORM sub_pf_status USING rt_extab TYPE slis_t_extab. "#EC CALLED
CLEAR is_rxtab.
is_rxtab-fcode = 'TEST'.
APPEND is_rxtab TO rt_extab.
SET PF-STATUS 'PF_STATUS' ."EXCLUDING rt_extab.
ENDFORM. "sub_pf_status -
How to computer the row size of a table
Hi
How can i compute the row size of a table. My general Idea is
create table emp(
empno number(4),
ename varchar2(10),
hire_date date,
update_yn timestamp);
the character set is UFT8
how can i compute the size of this table
thanksHi,
for Avg. row length see this
SQL> desc dba_tables
Name Null? Type
OWNER NOT NULL VARCHAR2(30)
TABLE_NAME NOT NULL VARCHAR2(30)
TABLESPACE_NAME VARCHAR2(30)
CLUSTER_NAME VARCHAR2(30)
IOT_NAME VARCHAR2(30)
PCT_FREE NUMBER
PCT_USED NUMBER
INI_TRANS NUMBER
MAX_TRANS NUMBER
INITIAL_EXTENT NUMBER
NEXT_EXTENT NUMBER
MIN_EXTENTS NUMBER
MAX_EXTENTS NUMBER
PCT_INCREASE NUMBER
FREELISTS NUMBER
FREELIST_GROUPS NUMBER
LOGGING VARCHAR2(3)
BACKED_UP VARCHAR2(1)
NUM_ROWS NUMBER
BLOCKS NUMBER
EMPTY_BLOCKS NUMBER
AVG_SPACE NUMBER
CHAIN_CNT NUMBER
AVG_ROW_LEN NUMBER
AVG_SPACE_FREELIST_BLOCKS NUMBER
NUM_FREELIST_BLOCKS NUMBER
DEGREE VARCHAR2(10)
INSTANCES VARCHAR2(10)
CACHE VARCHAR2(5)
TABLE_LOCK VARCHAR2(8)
SAMPLE_SIZE NUMBER
LAST_ANALYZED DATE
PARTITIONED VARCHAR2(3)
IOT_TYPE VARCHAR2(12)
TEMPORARY VARCHAR2(1)
SECONDARY VARCHAR2(1)
NESTED VARCHAR2(3)
BUFFER_POOL VARCHAR2(7)
ROW_MOVEMENT VARCHAR2(8)
GLOBAL_STATS VARCHAR2(3)
USER_STATS VARCHAR2(3)
DURATION VARCHAR2(15)
SKIP_CORRUPT VARCHAR2(8)
MONITORING VARCHAR2(3)
CLUSTER_OWNER VARCHAR2(30)
DEPENDENCIES VARCHAR2(8)
SQL> Regards! -
How to find last row in itab?
hi experts,
How to find the last row or item in an itab.I am using if statement for which i have to check the last row and if it is the last row some set of statements should trigger.
thanks
maniJust, find the last record :
* Standard table
DESCRIBE TABLE itab LINES n.
READ TABLE itab INDEX n.
Check on the table with special work at last record :
* Loop
LOOP AT itab.
MOVE itab TO wa_itab.
AT LAST.
* here wa_itab is the last record (itab is *****)
ENDAT.
ENDLOOP.
Regards -
How to find middle row in a table ?
Hi Friends,
Is it possible to find middle row in a table by SQL Query.
KarTiK.Solution: sort the rows in order to create an ordered
sequence and then there will be a "middle row".Well, not quite.
If there are an odd number of rows then, yes, there will be a middle row in an ordered sequence, however if there is an even number of rows then the middle is between two rows... or... you could take it as the two rows either side of the middle....
SQL> select * from emp order by empno;
EMPNO ENAME JOB MGR HIREDATE SAL COMM DEPTNO
7369 SMITH CLERK 7902 17/12/1980 00:00:00 800 20
7499 ALLEN SALESMAN 7698 20/02/1981 00:00:00 1600 300 30
7521 WARD SALESMAN 7698 22/02/1981 00:00:00 1250 500 30
7566 JONES MANAGER 7839 02/04/1981 00:00:00 2975 20
7654 MARTIN SALESMAN 7698 28/09/1981 00:00:00 1250 1400 30
7698 BLAKE MANAGER 7839 01/05/1981 00:00:00 2850 30
7782 CLARK MANAGER 7839 09/06/1981 00:00:00 2450 10
7788 SCOTT ANALYST 7566 19/04/1987 00:00:00 3000 20
7839 KING PRESIDENT 17/11/1981 00:00:00 5000 10
7844 TURNER SALESMAN 7698 08/09/1981 00:00:00 1500 0 30
7876 ADAMS CLERK 7788 23/05/1987 00:00:00 1100 20
7900 JAMES CLERK 7698 03/12/1981 00:00:00 950 30
7902 FORD ANALYST 7566 03/12/1981 00:00:00 3000 20
7934 MILLER CLERK 7782 23/01/1982 00:00:00 1300 10
14 rows selected.
SQL> select e.empno, e.ename, e.job, e.mgr, e.hiredate, e.sal, e.comm, e.deptno
2 from (select emp.*, row_number() over (order by empno) as rn from emp) e
3 ,(select round(count(*)/2) as middle, round(((count(*)+1)/2)) as middle2 from emp) m
4 where e.rn in (m.middle, m.middle2)
5 /
EMPNO ENAME JOB MGR HIREDATE SAL COMM DEPTNO
7782 CLARK MANAGER 7839 09/06/1981 00:00:00 2450 10
7788 SCOTT ANALYST 7566 19/04/1987 00:00:00 3000 20
SQL> insert into emp values (1111, 'WILLIS', 'CLERK', 7902, sysdate, 900, null, 20);
1 row created.
SQL> select * from emp order by empno;
EMPNO ENAME JOB MGR HIREDATE SAL COMM DEPTNO
1111 WILLIS CLERK 7902 18/01/2008 12:18:14 900 20
7369 SMITH CLERK 7902 17/12/1980 00:00:00 800 20
7499 ALLEN SALESMAN 7698 20/02/1981 00:00:00 1600 300 30
7521 WARD SALESMAN 7698 22/02/1981 00:00:00 1250 500 30
7566 JONES MANAGER 7839 02/04/1981 00:00:00 2975 20
7654 MARTIN SALESMAN 7698 28/09/1981 00:00:00 1250 1400 30
7698 BLAKE MANAGER 7839 01/05/1981 00:00:00 2850 30
7782 CLARK MANAGER 7839 09/06/1981 00:00:00 2450 10
7788 SCOTT ANALYST 7566 19/04/1987 00:00:00 3000 20
7839 KING PRESIDENT 17/11/1981 00:00:00 5000 10
7844 TURNER SALESMAN 7698 08/09/1981 00:00:00 1500 0 30
7876 ADAMS CLERK 7788 23/05/1987 00:00:00 1100 20
7900 JAMES CLERK 7698 03/12/1981 00:00:00 950 30
7902 FORD ANALYST 7566 03/12/1981 00:00:00 3000 20
7934 MILLER CLERK 7782 23/01/1982 00:00:00 1300 10
15 rows selected.
SQL> select e.empno, e.ename, e.job, e.mgr, e.hiredate, e.sal, e.comm, e.deptno
2 from (select emp.*, row_number() over (order by empno) as rn from emp) e
3 ,(select round(count(*)/2) as middle, round(((count(*)+1)/2)) as middle2 from emp) m
4 where e.rn in (m.middle, m.middle2)
5 /
EMPNO ENAME JOB MGR HIREDATE SAL COMM DEPTNO
7782 CLARK MANAGER 7839 09/06/1981 00:00:00 2450 10
SQL>
Maybe you are looking for
-
Unable to print to shared windows printer (lexmark)
My Windows printer is shared on the network through an XP machine. Other XP PCs can see and print fine to the printer , but not my OS X (tried it with tiger and Leopard). The printer is Lexmark P6250, and the mac driver for that printer works fine be
-
IE doesn't show my body background
This is a very strange problem. I feel that the different aspects of this mistake are related, though. IE does not display my body background or recognize some of my links as working links. (except for the briefest of moment as it is loading the page
-
Is is possible to attach an external hard drive or add an internal memory card for more storage? I can only store 20 hours of HD programming. I was able to store 60 hours on my Dishnetwork DVR. Solved! Go to Solution.
-
Hide icon in menu...
Hi There, I am using developer 6i, I want to know an easy way how to hide default Oracle runtime icon in menu and MDI window at runtime. OR if possible can i give icons of my choice both in Menu runtime and in MDI window. please help! Thanks! Imran [
-
Why am I unable to upgrade to OS X Mavericks?
Hello there, Since OS X Mavericks came out I went and tried to upgrade ML to Mavericks but somehow when it was downloaded and ready to install I got this following message: I followed the instructions on how to change the partition but unfortunately