How to calculate the row size
Hi,
I am having a table of 4 column. First column is varchar2(10), Second column is Number(5), Third column is char(10) and Fourth column is Number(12,2).
Now how to calculate the size of each row. I want to know how much space it will take for each row.
Thanx & Regards,
Swarup
For a complete discussion of storage requirements for different datatypes see the Oracle 8i Concepts manual.
All Oracle documentation is available on-line via the 'Documentation' link on the OTN home page.
Your Col2 NUMBER(5) will take 4 bytes if it holds a 5 digit positive or negative number.
Your Col4 NUMBER(12,2) will take 7 bytes if it holds a number with 12 digits that is positive and will take 8 bytes if it holds a number with 12 digits that is negative.
The following is from the Concepts manual Chapter 12 (Copyright by Oracle)
Built-In Datatypes 12-9
Internal Numeric Format
Oracle stores numeric data in variable-length format. Each value is stored in
scientific notation, with one byte used to store the exponent and up to 20 bytes to
store the mantissa. The resulting value is limited to 38 digits of precision. Oracle
does not store leading and trailing zeros. For example, the number 412 is stored in a
format similar to 4.12 x 10 2 , with one byte used to store the exponent (2) and two
bytes used to store the three significant digits of the mantissa (4, 1, 2). Negative
numbers include the sign in their length.
Taking this into account, the column size in bytes for a particular numeric data
value NUMBER ( p), where p is the precision of a given value, can be calculated
using the following formula:
ROUND((length( p)+ s)/2))+1
where s equals zero if the number is positive and s equals 1 if the number is
negative.
Zero and positive and negative infinity (only generated on import from Version 5
Oracle databases) are stored using unique representations. Zero and negative
infinity each require one byte; positive infinity requires two bytes.
null
Similar Messages
-
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 calculate the partition size in range partition,by value
hi all,
The primary key is number for the table.
I have 5543201 records in a table.
If I want to break them in 7 equal partition as per the primary key,how do i achieve this?
rgds
sI probably don't understand it...but I would say:
5543201/7=791886
range 1 : 0....791886 (1x 791886)
range 2 : 791887....1583772 (2 x 791886)
range 3 : 1583773 .... (3 x 781886)
tange 4 : ......
HoweverI doubt whether this is a smart aproach for partitioning.
I would say that a patitioning on date, or some key-value is more applicable.
But hey...I don't know the further requirements.
Cheers Martijn -
How do I calculate the total size of selected folders?
Hello
My question is:
How do I calculate the total size of selected folders?
Thank youIt does show the aggregate size.
Command-Option-I opens the Inspector window. (Or open the File menu and hold the Option key. Get Info turns into Show Inspector.) The Inspector is similar to the Get Info window but it shows aggregate info for multiple selections. It is also dynamic — if you change the selection while the Inspector is open, the info changes to reflect the current selection. -
How to calculate the size of web forms in hyperion planning?
Hi Experts,
I am trying to calculate the size of planning forms in Hyperion smart view., but i am unable to find out the way to calculate.
Can you pls explain how to calculate the size of web form in Smart view?
--- Srini.Hi Srini,
First, here is what Oracle says:
Data Form Size Estimation:
To get a rough estimate of data form size, open the data form and select File > Save As from the browser. The size of the .HTML file is the portion of the data form that changes based on grid size. The .JS files remain the same size and can be cached, depending on browser settings. Information such as data form definitions, pages, and .gif files are not compressed when data forms are opened and sent to the Web browser.
I have not been able to find out using their method.
In any case, you can find out the size of grid by using below
1. Right click on the form grid and click "View source"
2. Save the source file as "Example.html"
3. Right click the saved file and click "Properties"
4. The Form size whould be same as that of file..
Let me know if it helps.
Cheers
RS -
How to calculate the frequency of the search string in a row
Hi,
I would like to find the frequency of the number of the occurences of a search string in a row which is of type of xmltype content.
For ex: I would like to find the frequency of the word "oracle" in a row which is of type xmltype content.
Is there any fuction called frequency or freq...
Thanks in advance....Oh!
Then How to calculate the frequency of occurences in a row ?
I hope the Score formula is S=3f(1+log(N/n))
I want to calculate the f value alone, how is it possible.
Thanks in advance..... -
How to Increase the Rows and Columns Size of Bex Query in Enterprise Portal of SAP 7.3
Dear All,
Please let me know the process how to Increase the Rows and Columns Size of Bex Query in Enterprise Portal of SAP 7.3 .
Currently I am getting Only 4 columns and 10 rows in One Page .And I am getting 1,2 etc tabs for both row and column. So i want to increase the column length more than 100 and row length more than 10000.
Please suggest me a suitable solution to over come this issue.
Please find the Below screen shot.
Thanks
Regards,
SaiDear All,
Please find the attached screen shot.
The report be open with 4 or 5 columns and 5 or 6 rows.
So, please let me know how to increase the length of the table.
Do the needful for me to over come this issue.
Thanks
Regards,
Sai. -
How to calculate the HFM Cube size in SQL Server-2005
Hi
How to calculate the HFM Cube size in SQL Server-2005 ?
Below query used for Oracle. Then what is query for SQL Server?
SQL> select sum(bytes/1024/1024) from dba_segments where segment_name like 'FINANCIAL_%' and owner='HFM';
SUM(BYTES/1024/1024)
SQL> select sum(bytes/1024/1024) from dba_segments where segment_name like 'HSV FINANCIAL%' and owner='HFM';
SUM(BYTES/1024/1024)
Regards
SmileeWhat is your objective? The subcube in HFM is a concept which applies to the application tier - not so much to the database tier. The size of the subcube is the unique number of data strips (data values for January - December inclusive, for example) for the given entity, currency triplet or Parent.Child node. You have to account for parent accounts and customs which don't exist in the database but are generated in RAM in the application tier.
So, if your objective is to find the largest subcubes, you could do this by querying the database and counting the number of records per entity/value (DCE tables) or parent.child entity combination (DCN tables). I'm not versed in SQL, but I think the script below would just tell you the schema size and not the subcube sizes.
Check out Accelatis.com for a third party software product that can do this for you. The feature is called the Subcube Analyzer and was written by the same team that wrote HFM, so they ought to know how this works :-)
--chris -
Does anyone know if there is a decent algorithm/method to calculate the shared pool size in Oracle 8.1.7.
look my answer on your thread about db cache size
How to Calculate the DB Block Buffer value. -
How to calculate the size each PSA request or all PSA for the Datasources?
Hi All,
Can anybody tell me how to calculate the size of each PSA Request or all PSA's requests for all datasources?
Regards,
RajeshHi ,
PSA technical name can be found as,
1)Right click on your Data Target,go to Display dataflow,click on the PSA ,here you can find the technical name.
2)Goto RSRV tcode>PSA Table>Consistency between PSA Partitions and SAP Administration-->Give your Infosoure name,it gives u PSA technical name also,
Thanks&Regards,
Praveena. -
How to calculate the variance in PO price history?
hi
i hav standard report ME1P, since i need to do some modifications in this program i copied to Y prgrm,,,'
im getting all the values properly...
but my prblm is im not getting how to calculate the variance? im not getting the logic behid it...
can anybody expln me in breif plz....
Regards
SmithaHi Venu,
there is another way as well, however, you won't be able to see Variance and Variance% as a saperate keyfigure which is not under the period. Thats the reason I didn't mention it earlier.
What you can do is, Drag the period to the columns, Now create a structure that has the two keyfigures std price, moving price. Here if you add Variance and Variance%, Then these CKF's would come under period as well, which you don't need. And the system won't allow you to add these CKF's outside this structure. The reason being because the interpretation of the data then wouldn't make any sense here. You can create a new structure as well with these CKF's but they would become a subpart of your previous structure.
choose the required characteristics in the Rows section. Save it.
Let us know, Sorry man, can't help u much at this problem.
regards,
Sree. -
How to calculate the individual sums of multiple columns in a single query
Hello,
Using Oracle 11gR2 on windows 7 client. I have a question on calculating sum() on multiple columns on different columns and store the results in a view. Unfortunately I could not post the problem here as it keeps on giving error "Sorry, this content is not allowed", without telling where or what it is! So I had to post it in the stack-overflow forum, here is the link: http://stackoverflow.com/questions/16529721/how-to-calculate-the-individual-sums-of-multiple-columns-in-a-single-query-ora
Will appreciate any help or suggestion.
Thanksuser13667036 wrote:
Hello,
Using Oracle 11gR2 on windows 7 client. I have a question on calculating sum() on multiple columns on different columns and store the results in a view. Unfortunately I could not post the problem here as it keeps on giving error "Sorry, this content is not allowed", without telling where or what it is! So I had to post it in the stack-overflow forum, here is the link: http://stackoverflow.com/questions/16529721/how-to-calculate-the-individual-sums-of-multiple-columns-in-a-single-query-ora
Will appreciate any help or suggestion.
ThanksLooks like you want a simple group by.
select
yr
, mnth
, region
, sum(handled_package)
, sum(expected_missing_package)
, sum(actual_missing_package)
from test
group by
yr, mnth, region
order by
yr, mnth, region;I wouldn't recommend storing your data for year / month in 2 columns like that unless you have a really good reason. I would store it as a date column and add a check constraint to ensure that the date is always the first of the month, then format it out as you wish to the client.
CREATE TABLE test
year_month date,
Region VARCHAR2(50),
CITY VARCHAR2(50),
Handled_Package NUMBER,
Expected_Missing_Package NUMBER,
Actual_Missing_Package NUMBER
alter table test add constraint firs_of_month check (year_month = trunc(year_month, 'mm'));
ME_XE?Insert into TEST (year_month, REGION, CITY, HANDLED_PACKAGE, EXPECTED_MISSING_PACKAGE, ACTUAL_MISSING_PACKAGE)
2 Values (to_date('2012-nov-12', 'yyyy-mon-dd'), 'Western', 'San Fransisco', 200, 10, 5);
Insert into TEST (year_month, REGION, CITY, HANDLED_PACKAGE, EXPECTED_MISSING_PACKAGE, ACTUAL_MISSING_PACKAGE)
ERROR at line 1:
ORA-02290: check constraint (TUBBY.FIRS_OF_MONTH) violated
Elapsed: 00:00:00.03
ME_XE?Insert into TEST (year_month, REGION, CITY, HANDLED_PACKAGE, EXPECTED_MISSING_PACKAGE, ACTUAL_MISSING_PACKAGE)
2 Values (to_date('2012-nov-01', 'yyyy-mon-dd'), 'Western', 'San Fransisco', 200, 10, 5);
1 row created.
Elapsed: 00:00:00.01
ME_XE?select
2 to_char(year_month, 'fmYYYY') as year
3 , to_char(year_month, 'fmMonth') as month
4 , Region
5 , CITY
6 , Handled_Package
7 , Expected_Missing_Package
8 , Actual_Missing_Package
9 from test;
YEAR MONTH REGION CITY HANDLED_PACKAGE EXPECTED_MISSING_PACKAGE ACTUAL_MISSING_PACKAGE
2012 November Western San Fransisco 200 10 5
1 row selected.
Elapsed: 00:00:00.01
ME_XE?Then you have nice a nice and easy validation that ensures you data integrity.
Cheers, -
How to calculate the byte tranfer to the http server
Hi,
I'm developing a multiplayer game on mobile phone.
At the end of the connexion, I need to know how many bytes were sent and received from the http server.
Here is the part code for the connexion to the server :
HttpConnection connection = (HttpConnection)Connector.open(request);
connection.setRequestMethod(HttpConnection.GET);
InputStream is = connection.openInputStream();
long length = connection.getLength();
byte[] datach = new byte[1];
int ch = 0;
while(is.read(datach) != -1)
ch = datach[0];
b.append((char)ch);
String s = b.toString();The size of each data I have to send or receive is less than 50 bytes.
All I do for now is adding the request size and the server response size.
For each request, I have to count the header size and the data size. But I don't know how to find the header size of my request.
And for each response from the server, I count the header size and the data size with connection.getLength().
I don't know whether it's the right method.
Does anyone know a better method to calculate exactly the bytes sent and received?TCP/IP "overhead" is basically 20%.
-
How to set the Range size dynamically in an Iterator?
Hi,
One of my scenrio, i read the range size of Iterator and i performed the business logic validation. But in my case, range size is changed as per business requriement for a paricular Iterator.
Is it possible to set the Range size property dynamically in an Iterator of pageDef File.
I'm using JDeveloper 11.1.1.3.0
Can anyone help me regarding this???
Thanks & Regards,
Perumal SGood afternoon,
This works: f?p=1:#MYPAGENUMBERCOLUMN#::Session:Request:Debug:Clearcache:itemname:itemvalue:printerfreindly
It works very well. I have been struggling for a couple of hours trying to figure out how to calculate the page number I wanted to link to from a report column defined as a linked item. I ended up modifying my VIEW to include the page number for that particular type of data and use this technique to jump to the correct page.
Thanks for posting this. Nothing else seems to work.
Don. -
How to set the frame size?
Hi,
Can some one show me how to set the frame size in this program? History: I have created a window and added a button but its to small. So I want to increase the size of the frame to at least 600X400 pixel.
private static void showGUI() {
//Create and set up the window.
JFrame frame = new JFrame("ButtonDemo");
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
//Create and set up the content pane.
Main newContentPane = new Main();
newContentPane.setOpaque(true); //content panes must be opaque
frame.setContentPane(newContentPane);
//Display the window.
frame.pack();
frame.setVisible(true);
}It would be nice if you could show me how to do it.
Thank you very much for reading this.Challenger wrote:
Simply adding
frame.setSize(new Dimension(600,400));to the end of your code should work perfectly.Or, if you want to do it correctly, .setPreferredSize() on your frame before you .pack() it. The default layout manager for JFrame is BorderLayout, which uses the preferredSize of each component to calculate sizes during the .pack() call.
Maybe you are looking for
-
Help-multiple ipods on one computer
my husband and i each have an ipod with seperate user accounts on itunes. we would like to open his ipod on my computer and bring up all his songs without overwriting or adding my songs to his. does anyone know how to do this?
-
I have reset my iPod touch 4th generation and since yesterday, it is always trying tto reset
-
How can we create the DBC file?
Hi all, I am attempting to run the test_fwktutorial.jsp within the toolbox.jws/Tutorial.jpr project in Jdeveloper . We have to provide the Oracle application DB connection in the project properties ( we have to provide this as a DBC file) . How can w
-
Restricting the systems items on the 'find system items' window
I am trying to do some customizatiosn on form POXPOEPO. block PO_LINES and item_name is po_lines.item_number which is beside field 'Type' (line_type). when the three dots are pressed then a window appears to input 'enter reduction criteria for long l
-
Bluetooth BT500 Adapter Issues
I'm assuming I'm not the only one that has experienced this problem, but there seems to be no solution to this that I can find, which brings me here. I have a PSC 1510xi All-in-one printer which I've owned for a few years. The print works great, but