Hello,
I am using ORACLE 11g Standard edition and RHEL 4.
I have a situation in which i want to know the size of the limited rows of the table.
I am moving table's rows from one table(one tablespace) to another table(another tablespace) While moving the rows I want to be sure that the size of the rows is good enough to fit in the another table's tablespace free size. So before inserting rows in another table i will check the size of rows and the free space in tablespace and perform the action as per.
Here is the senario with example :-
I have a table called MAIN_TAB which has a column as DATE_TIME which stores the systimestamp when the data was inserted. See the code below ...
select * from main_tab;
ID VALUE DATE_TIME
---- --------- ----------------------------------------------------
1 DATA 18-MAY-11 12.00.00.000000000 AM
2 DATA 18-MAY-11 12.00.00.000000000 AM
3 DATA 17-MAY-11 12.00.00.000000000 AM
4 DATA 17-MAY-11 12.00.00.000000000 AM
Now i will fire a group by date_time query to know how many rows for each systimestamp.
select trunc(date_time),count(id)
from MAIN_TAB
group by trunc(date_time)
DATE_TIME COUNT(ID)
------------------ ----------------
17-MAY-11 2
18-MAY-11 2
So now you can see i have 2 rows for 17th and 18th May. I want to know what is the size of the data for 17th and 18th May in MB. I know how to get the size of the whole table but i want only the limited rows size as per date.
So the question is how can i get the size of a table's 2 rows data ???
Provide me some guidance.
If the question is not clear to you , let me know ....
Thanks in advance ...