Average Row length in a table
Hi All,
I am new to oracle and I have to find the average row length for all tables in a schema.
Could anyone please help me.
What is the difference between data length and row length.
Thanks in advance
Anu
Message was edited by:
user448373
look at dba_tables
Similar Messages
-
Average Row Length for Indexes?
Hey guys, still working on my sizing model and had a question about indexes. Is there a comparable avg_row_length to indexes like there are for tables? I know how to formulate average row length on a table no problem... is it the same for indexes? Is there any other overhead aside from normal table overhead that I need to think about with indexes?
Much obliged.
TimSJustin,
Thanks, I was doing exactly that up until a couple hours ago and reached my conclusion, what you said. I applied 1,3,6,9,12 months worth of data according to dimensions based on time. After I crunched the numbers and did the work, I found my answer. Thanks for your comments.
Regards,
TimS
P.S. Luckily there aren't any deletes in this flow except for housekeeping which is just partition movement. I can only imagine how difficult it will be to start sizing up another data warehouse that already does that. But in this last rookie year I realized in a data warehouse environment (as opposed to OLTP), it's a lot safer to utilize partition movement than to delete, which inevitably leads to fragmentation.
Edited by: TimS on Jul 8, 2009 7:33 PM -
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 All,
How we can find Avg row length size of a table, without inserting data into a table. This is required to basically estimate table size (roughly). We might need to this for at least 100+ tables.
regards,
varaThe average row length depends on the data you are inserting into the table.
You can easily compute an approximation of the max row length from Oracle’s data dictionary:
select
table_name ,
sum(data_length)
from
user_tab_columns
group by
table_nameLet’s say we have a table with a number(10) and a varchar2(1000) column. For a data set where the varchar2 column contains at least 900 characters we would get average row size of 900+. For the same table, but with another data set where the varchar2 column has fewer than 50 characters, we would get average row size of less than 100.
Iordan Iotzov
http://iiotzov.wordpress.com/ -
How to get the number of rows in a HTML table in some other page
Hi,
I am incrementing HTML table rows on button click and saving number of rows in a javascript variable. But on submitting that page I need that number of row value in the following page
example:
HTML table is in the page first.jsp
and the javascript variable having the current row number is row_number
on submitting it goes to second.jsp page. There i need that row_number value.
Can anyone help me to solve this?
regards,
carryfunction buttonClick()
var table = profileTable;
var lnRow = table.rows.length;
var insertedRow = table.insertRow(parseFloat(lnRow));
var cell1 = insertedRow.insertCell();
cell1.innerHTML ="<tr><td><Input type=\"hidden\" >>>name=\"rowNum\" value="+cnt"+></td></tr>";
document.profileform.submit;
on submit it goes to the second page, but the value i got using >>>System.out.println("row number from text >>>box"+request.getParameter("rowNum")); is null. What is wrong with >>>my coding. Can anyone solve this.HI carry
Check the value of bold data
function buttonClick()
var table = profileTable;
var lnRow = table.rows.length;
var insertedRow = table.insertRow(parseFloat(lnRow));var cnt=inRow
var cell1 = insertedRow.insertCell();
cell1.innerHTML ="<tr><td><Input type=\"hidden\" >>>name=\"rowNum\" value="+cnt+"></td></tr>";
document.profileform.submit;
}try with it -
I have a 9.2 instance and I was wondering if there was a max row length in my tables.
Do you happen to have a small-ish test case the reproduces the problem? I can pretty much guarantee you that the database itself doesn't limit the size of the row, but I'm hard-pressed to imagine a cause for this sort of problem in the application stack.
For sanity, you might try applying the latest patchsets to your client and server to see whether that magically fixes something.
Justin
Distributed Database Consulting, Inc.
http://www.ddbcinc.com/askDDBC -
Dear,
Besides the dba_tab_columns view which can report the average column length in a table, are there any other views that can report the average record length in a table (i.e., average record length is the acutal bytes occupied by all records in that table divided by number of records.)?
I also assume that there is no need to turn on statistics to store the average column length in the dba_tab_columns view. Is it right?
ThanksHi,
AFAIK, DML is just manuplating the transaction records with in the table, how we can expect Optimizer to update stats of the table @each and every transaction, if that is the case, think of the Situatin where "N" number of users working on the DB, with parallel/ shared session on one single Objects or different objects and if you compared the maxtrans of particular objecti in DB with sessions transactions - then definitely the I/O is going to impact and there would be bottle neck, so looking into that, the the Optimizer automatically manage the stats instead based % of changes in transaction rate on tables (Objects) changes.
If you want to changem then I think alternatives are there, create a trigger where execute the job to run immedaitely to correct stat or else your custom code to update stat- but it not suggested performance would be cause on DB.
HTH
- Pavan Kumar N
Oracle 9i/10g - OCP
http://oracleinternals.blogspot.com/ -
Finding table row length using javascript in oa framework
hi all,
Can anybody suggest some idea to find out the table row length in js... but i had read the values by
document.getElementByid('N3:checval:'+i).value etc etc.
so can suggest me how to get the table row length in js or where can i find some examples on tables with javascript events associated with that.
this is urgent..hi,
Let me know ur target and what js function u have written for it. If you need to ask... getting no.of rows in js.... u can write in js :
table=document.getElementById(<table id>);
alert("rows>>"+table.rows.length);
--Mukul -
The 'Add' button lets the user dynamically add/remove of table rows.
I tried passing the value using hidden field but failed. How can I pass the table # of rows back to the servlet, and I also have problems getting the value from the new row created by the script. Please enlighten ASAP!
<script language="JavaScript" type="text/javascript">
function addRowToTable()
var tbl = document.getElementById('albumDetailsTbl');
var lastRow = tbl.rows.length;
var iteration = lastRow;
var row = tbl.insertRow(lastRow);
// SN cell
var cellLeft = row.insertCell(0);
var textNode = document.createTextNode(iteration);
cellLeft.appendChild(textNode);
// Song Title cell
var songTitle = row.insertCell(1);
var el = document.createElement('input');
el.setAttribute('type', 'text');
el.setAttribute('name', 'songTitle_' + iteration);
el.setAttribute('id', 'songTitle_' + iteration);
el.setAttribute('width', '150');
songTitle.appendChild(el);
// Composer cell
var composer = row.insertCell(2);
var el = document.createElement('input');
el.setAttribute('type', 'text');
el.setAttribute('name', 'composer_' + iteration);
el.setAttribute('id', 'composer_' + iteration);
el.setAttribute('width', '150');
composer.appendChild(el);
// Lyricist cell
var lyricist = row.insertCell(3);
var el = document.createElement('input');
el.setAttribute('type', 'text');
el.setAttribute('name', 'lyricist_' + iteration);
el.setAttribute('id', 'lyricist_' + iteration);
el.setAttribute('width', '150');
lyricist.appendChild(el);
// Artist cell
var artist = row.insertCell(4);
var el = document.createElement('input');
el.setAttribute('type', 'text');
el.setAttribute('name', 'artist_' + iteration);
el.setAttribute('id', 'artist_' + iteration);
el.setAttribute('width', '150');
artist.appendChild(el);
</script>
<form name="CreateAlbum_frm" method="post" action="/albumServlet">
<input type="button" value="Add" onclick="addRowToTable();" />
<table width="68%" border="1" align="center" cellpadding="1" cellspacing="1" id="albumDetailsTbl">
<tr>
<td width="29"><div align="center" class="style4 style2"><strong>SN</strong></div></td>
<td width="150"><div align="center" class="style5 style2"><strong>Song Title </strong></div></td>
<td width="150"><div align="center" class="style5 style2"><strong>Composer</strong></div></td>
<td width="150"><div align="center" class="style5 style2"><strong>Lyricist</strong></div></td>
<td width="150"><div align="center" class="style2 style5"><strong>Artist</strong></div></td>
</tr>
<tr>
<td width="29"><div align="center">01</div></td>
<td><input name="songTitle_0" type="text" id="songTitle_0"></td>
<td><input name="composer_0" type="text" id="composer_0"></td>
<td><input name="lyricist_0" type="text" id="lyricist_0"></td>
<td><input name="artist_0" type="text" id="artist_0"></td>
</tr>
</table>
<p align="center"></p>
<table width="664" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td width="189"><div align="center"></div></td>
<td width="41">�</td>
<td width="106"><input type="reset" name="Reset" value="Clear All"></td>
<td width="13"><div align="center"></div></td>
<td width="158"><div align="center"><input name="createSave_jBut" type="submit" id="createSave_jBut" value="Create Album & Save"></div></td>
<td width="157">�</td>
</tr>
</table>
<p><input name="rowCount" type="hidden" value= albumDetailsTbl.rows.length /></p>
</form>in my experience, you have to write a hack that goes something like this:
declare int to hold number of rows
do db search
move cursor to last row (i forget the function call name, but you can find it)
call getRow() or something to get the row number the cursor is on
then you call findFirst or getFirst or sometihng to go back to start -
XMLIndex: finding indexed XPaths and the number of rows in the path table
Hi,
I am storing non-schema-based binary XMLs in an XMLType column in 11g (11.1.0.6.0) and would like to index the XMLs either partially or fully using XMLIndex. I'm expecting to have a large number (tens of millions) of XML documents and have some concerns about the size of the XMLIndex path table.
In short, I am worried that the path table might grow unmanageable large. In order to avoid this and to plan for table partitioning, I would like to create a report of all indexed XPaths in an XMLIndex and to find out how many times each path is actualized in the path table. I would do this for a representative XML sample.
I have been creating XMLIndexes with different exclude/include paths, gathering stats with DBMS_STATS (estimate_percent = 100) and selecting the number of rows in the path table through USER_TABLES.
If anyone knows a more straightforward way of doing this all advice is very much appreciated.
Best Regards,
Rasko LeinonenThanks Marco,
I managed to get out all indexed paths using the following SQL. It took a while to understand how the join the XDB.X$PT39CW6BJR8W4VVE0G0LLGA0OCR5 and XDB.X$QN39CW6BJR8W4VVE0G0LLGA0OCR5 tables together but got there in the end. This helps to clarify which XPaths are being currently indexed by the XMLIndex.
begin
for v_row in (select PATH from XDB.X$PT39CW6BJR8W4VVE0G0LLGA0OCR5)
loop
declare
v_i BINARY_INTEGER := 1;
v_id raw(8);
v_len BINARY_INTEGER := 2;
v_skip BINARY_INTEGER := 1;
begin
while v_i < utl_raw.length(v_row.path) and
v_i + v_len <= utl_raw.length(v_row.path)
loop
v_i := v_i + v_skip;
v_id := utl_raw.substr(v_row.path, v_i, v_len);
--dbms_output.put_line(v_id);
for v_row2 in (select LOCALNAME, flags from XDB.X$QN39CW6BJR8W4VVE0G0LLGA0OCR5
where ID = v_id )
loop
if rawtohex(v_row2.flags) = '01'
then
dbms_output.put('@');
end if;
dbms_output.put(v_row2.localname);
if v_i + v_len < utl_raw.length(v_row.path)
then
dbms_output.put('/');
end if;
end loop;
v_i := v_i + v_len;
end loop;
dbms_output.put_line('');
end;
end loop;
end;
Example output:
RUN
RUN/@accession
RUN/@alias
RUN/@instrument_model
RUN/@run_date
RUN/@run_center
RUN/@total_data_blocks
RUN/EXPERIMENT_REF
RUN/EXPERIMENT_REF/@accession
RUN/EXPERIMENT_REF/@refname
RUN/DATA_BLOCK
RUN/DATA_BLOCK/@name
RUN/DATA_BLOCK/@total_spots
RUN/DATA_BLOCK/@total_reads
RUN/DATA_BLOCK/@number_channels
RUN/DATA_BLOCK/@format_code
RUN/DATA_BLOCK/@sector
RUN/DATA_BLOCK/FILES
RUN/DATA_BLOCK/FILES/FILE
RUN/DATA_BLOCK/FILES/FILE/@filename
RUN/DATA_BLOCK/FILES/FILE/@filetype
RUN/RUN_ATTRIBUTES
RUN/RUN_ATTRIBUTES/RUN_ATTRIBUTE
RUN/RUN_ATTRIBUTES/RUN_ATTRIBUTE/TAG
RUN/RUN_ATTRIBUTES/RUN_ATTRIBUTE/VALUE -
Maximum record length in internal table?
Is there a maximum record length in an internal table? Please note: My question is NOT related to table space. I'm referring only to the length of an individual record (A.K.A. row length).
I am using a work area to insert data into an internal table. Both the work area and internal table are defined by the same structure.
The structure has a total length of 672 bytes. For the sake of this discussion I'll point out that at the end of the structure, bytes 669, 670, 671, and 672 are four separate fields of 1 character each.
When viewing the work area record in the debugger I'm seeing all the fields and all the values. When viewing the internal table in the debugger after a record is inserted, the internal table ends with the field defined at Byte 670. The internal table does not include the two fields defined at Bytes 671 and 672.
Am I to assume from the above explanation that the length of a record ( A.K.A. row) in an internal table cannot exceed 670 bytes?
Thank you.Manish,
False alarm! While, technically, you didn't answer my question, your request for code ended up helping me answer my own question.
To provide you with some code I wrote a simple test program using the record layout referred to above, with a DO loop to put some records into the internal table, followed by a LOOP AT, with accompanying WRITE statements to display the contents of the internal table and demonstrate that the last two fields weren't being stored.
However, when I ran the test program, the last two fields were being displayed.
It was at that point, when stepping through the debugger that I noticed the scroll arrows above the last column of my internal table that allowed me to scroll to the right and see my final two fields.
Apparently, because of the large number of fields in my internal table I had reached the default display length of the debugger. While I was obviously aware of the scroll bar found at the bottom of the display, I had never worked with an internal table of that width in the past and hadn't even noticed the scroll arrows above the last column before.
Thanks for taking the time to respond helping me get to the solution. -
How to display the rows dynamically in the table display in web dynpro abap
Hi experts,
There is a visible row count tab where you can give the no of rows to be displayed in the output table, but i want it to be done dynamically as the row count of my table may change dynamically at runtime.
And i want to know how to reduce the width of a column as my table display is taking the length as per the binded table specifications.Can anyone please help me out in this issue.
Thanks in advance,
Anita.Hi Anita
You can bind the visiblerowcount property to the a context attribute. and at runtime you can set the context attribute to the no of rows you want in your table,
Regards
Naresh -
Calculating a record length of a table
Hi All,
In SAP 4.6C Oracle 9g I need to find a record length of a table.For that I am using :
Table name is ABC.
Tablespace in KBytes of ABC X
Total no records in ABC Y
Single record length in Kbytes (Z) = Tablespace (X) / Total no of records(Y)
I would like to know weather is this the correct way to calculate in approximation.I would also like to know any other methods of knowing it.
Any inputs are appreciated.
Thanks,
Priya.Hello,
>> I know that after major deletion frm db its necessary to do reorganization to enhance the db utilization.
Not mandatory ... it depends on many factors...
>> Pls help me to understand your statement that freed space isnt used by next entries.
It maybe not used for the next inserts... that depends on your tablespace (if it uses the ASMM feature) and essentially on the following parameters
- PCTUSED
- PCTFREE
Oracle Link: http://download.oracle.com/docs/cd/B28359_01/server.111/b28318/logical.htm
=> The PCTFREE parameter sets the minimum percentage of a data block to be reserved as free space for possible updates to rows that already exist in that block
=> The PCTUSED parameter sets the minimum percentage of a block that can be used for row data plus overhead before new rows are added to the block. After a data block is filled to the limit determined by PCTFREE, Oracle Database considers the block unavailable for the insertion of new rows until the percentage of that block falls beneath the parameter PCTUSED. Until this value is achieved, Oracle Database uses the free space of the data block only for updates to rows already contained in the data block.
Both parameters are used in a NON-ASSM tablespace and with an ASSM tablespace only PCTFREE is used.
Regards
Stefan -
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 dynamically display the data from a table base on row selection of another table in ADF
Hi ,
I have a requirement in ADF. I need to change the data of a table based on row selection of another Table . Both the table have a Parent Child relationship between them. They have a common attribute say department_id.
For this I created bind variable in view object of employees table and wrote a where clause in the sql query using that bind variable. Then I created method for selection listener of department Table in java bean.
My method is following
public void onrowselection(SelectionEvent selectionEvent) {
RichTable richTable = (RichTable)selectionEvent.getSource();
CollectionModel tableModel = (CollectionModel)richTable.getValue();
JUCtrlHierBinding adfTableBinding = (JUCtrlHierBinding)tableModel.getWrappedData();
Object selectedRowData = richTable.getSelectedRowData();
JUCtrlHierNodeBinding nodeBinding = (JUCtrlHierNodeBinding)selectedRowData;
oracle.jbo.domain.Number newVal = (oracle.jbo.domain.Number) nodeBinding.getAttribute("DepartmentId");
Number pallet = newVal.bigDecimalValue();
System.out.println("Selected values " + pallet);
BindingContext bindingctx = BindingContext.getCurrent();
BindingContainer bindings = bindingctx.getCurrentBindingsEntry();
DCBindingContainer bindingsImpl = (DCBindingContainer) bindings;
DCIteratorBinding dciter = bindingsImpl.findIteratorBinding("EmployeesView1Iterator");//access the iterator by its ID value in the PageDef file
ViewObject vo =dciter.getViewObject();
vo.setNamedWhereClauseParam("DepartmentId", pallet);//enter your value
vo.executeQuery();
It is printing the selected value of department id from department table in the log. But it is not able to pass the value to employees view. It is showing the following error in the log
"Definition DepartmentId of type Variable is not found in EmployeesView1."
I will be very thankful if someone helps me to solve this errror or is there any other way to achieve the same requirement.
Thanks
NileshNote quite sure why you simply wont create a viewlink for the viewobject the tables are based on..
The viewlink attribute will be based on the departmentId and it's a simple master detail relationship which automatically uses ppr.
However, if both tables are on the same page; using your hack about;
On the underlying viewobject, define a viewcriteria e.g. "listById" and set your bind variable here.
I would bind table two to a RichTable component:
RichTable t2;
public void onrowselection(SelectionEvent selectionEvent) {
RichTable richTable = (RichTable)selectionEvent.getSource();
CollectionModel tableModel = (CollectionModel)richTable.getValue();
JUCtrlHierBinding adfTableBinding = (JUCtrlHierBinding)tableModel.getWrappedData();
Object selectedRowData = richTable.getSelectedRowData();
JUCtrlHierNodeBinding nodeBinding = (JUCtrlHierNodeBinding)selectedRowData;
oracle.jbo.domain.Number newVal = (oracle.jbo.domain.Number) nodeBinding.getAttribute("DepartmentId");
Number pallet = newVal.bigDecimalValue();
System.out.println("Selected values " + pallet);
refreshTable2(pallet);
BindingContext bindingctx = BindingContext.getCurrent();
BindingContainer bindings = bindingctx.getCurrentBindingsEntry();
DCBindingContainer bindingsImpl = (DCBindingContainer) bindings;
DCIteratorBinding dciter = bindingsImpl.findIteratorBinding("EmployeesView1Iterator");//access the iterator by its ID value in the PageDef file
ViewObject vo =dciter.getViewObject();
vo.setNamedWhereClauseParam("DepartmentId", pallet);//enter your value
vo.executeQuery();
private void refreshTable2(Number pallet){
RichTable x=getT2();
CollectionModel cm=(CollectionModel)x.getValue();
JUCtrlHierBinding jcb=(JUCtrlHierBinding)cm.getWrappedData();
BindingContainer bindings = bindingctx.getCurrentBindingsEntry();
DCBindingContainer bindingsImpl = (DCBindingContainer) bindings;
DCIteratorBinding dciter = bindingsImpl.findIteratorBinding(jcb.getName()+"Iterator");
ViewObject vo =dciter.getViewObject();
ViewCriteriaManager vcm=vo.getViewCriteriaManager();
ViewCriteria vc=vcm.getViewCriteria("listById");
vo.applyViewCriteria(vc);
vo.setNamedWhereClauseParam("DepartmentId",pallet);
vo.executeQuery();
AdfFacesContext.getCurrentInstance().addPartialTarget(getT2());
Maybe you are looking for
-
Visio 2010 - Shape Data Fields Are Not Saving
I am having a problem with a number of shape data fields which are not saving data that has been entered into it, whether by entering it through the "shape data" or "define shape data" dialog boxes, or by editing the "shape sheet". All data fields a
-
How do I put terminals on my custom Vi
I've created a custom small vi (I guess considered as a sub vi) and attempted to bring it into my large vi application. I was able to bring it in to the larger application by going to the pallete and choose Open Vi menu and select the small vi from f
-
When I try update my N8 Ovi Suite shows error whit code number 17008. Know somebody what's going on?
-
Setting Useraccountcontrol to 512 in AD failed
HI, I m trying to set useraccountcontrol of AD to 512 using VBscript (with password set) and it got failed with message "Object not supported". I m able to set 514 though. FYI..my IC machine and AD machine are in 2 different domains I remember that w
-
Why does my CC APPS says DOWNLOAD ERROR?
I just reactivate my CC account since that nasty payment problem with Adobe , but after updating the CC widget in my mac I just noticed that the APPS tab shows an error , so I can not download or update any software. And when I clic the Download butt