Oracle: How much data is there (GB or MB) stored in a BLOB column in a Table? - oracle

I have 3 columns in table which are of blob size.
I would like to calculate how much data is in JPEG PHOTO i.e not whole table size but size of data in particular column using Oracle.
How may i? (I have ADmin user and this table is in other user. Other.Employee table

You can get the size of a particular value with the dbms_lob.getlength function, and then aggregate that across all of the values in the table with:
sum(dbms_lob.getlength(jpegphoto))
You can then divide that number of bytes by [a suitable value] to get mebabytes, mebibytes etc.:
select
sum(dbms_lob.getlength(jpegphoto)) as b,
sum(dbms_lob.getlength(jpegphoto)) / 1024 as kib,
sum(dbms_lob.getlength(jpegphoto)) / (1024*1024) as mib,
sum(dbms_lob.getlength(jpegphoto)) / (1024*1024*1024) as gib
from employee
fiddle with a couple of really small BLOBs just to demonstrate the principle.

Related

Vertica GET_COMPLIANCE_STATUS() discrepancy

We use Vertica Community Edition which allows us to store data up to 1 TB. Vertica is hosted on-premise and we have allocated 153 GB for it to use, out of which 57 GB (39%) is used so far.
When I run SELECT GET_COMPLIANCE_STATUS(), it shows I have used 0.91 TB (91%) of the allowed disk space. I have executed SELECT AUDIT_LICENSE_SIZE() to make sure we get the latest compliance data.
I am wondering why these numbers do not match.
The disk usage is the compressed/encoded ROS files.
For license calculation Vertica uses uncompressed files to sum over the total size. 1 TB for community edition is uncompressed size of the files.
Disk usage can vary depending upon how many projections you create.
Note: Additional Projections does not count to the license size. Only additional Tables and External tables do.
As #minatverma says - the audit size is the uncompressed size of the data.
It's actually the answer to the question of how many terabytes the export files would occupy if you exported all data tables to CSV files, not counting the delimiters and counting 0 bytes for NULL values.
This has only a very theoretical correlation with the size of the ROS files on disk. Vertica is a columnar database. Each column , roughly , is one file.
So, if you have, for example, a gender column that can only assume 'M' or 'F', have the projection ordered by this column first, and the column encoded as Run-Length-Encoding (RLE), this file will not occupy more than some twenty bytes - whether the table has 100 or 1 million rows: The value 'F', followed by the integer 500002 (the value occurs so many times), and the value 'M', followed by the integer 499998.
So, you see, they have little to do with each other: in the CSV file, you have one million times 1 byte for that.

Oracle - Whats the best way to find Partition overhead

I somehow want to calculate partition overhead for very small tables. I have a Oracle DB with 5K tables sizing from lets say 10KB to 1TB. All of them are range partitioned based on a DATE column. What I want to calculate is the difference in the table size if I will store all data in 1 partition Vs if I store it in lets say 30 partitions. Block Size is 16KB.

Estimate Oracle Database Size

I have a total of 50,000 records with each row has 20 columns of a combination of character, date, and numeric fields. I need to estimate how many mega bytes of database space Oracle will require for table, indexes, and other considerations such as block size.
Could you please help.
Thanks so much!
Go my answers. Thank you for your time.
Check view USER_SEGMENTS, there you see data size (column BYTES) for tables and indexes. Take these values and divide by 50'000, then you get the average size per row and you can estimate the total size.
I think 50'000 rows as sample size should be fine. If the sample is too small then your estimation would be poor.
Nowadays you typically use Locally Managed Tablespaces where PCTINCREASE does not apply. For block_size use default 8K. Don't waste so much effort for such little data.

Oracle 12 limits

I'm newbie on Oracle and I want to know the following limitations on Oracle 12 :
Maximum Database Size
Maximum Table Size
Maximum Row Size
Maximum Rows per Table
Maximum Columns per Table
Maximum Indexes per Table
Currently I found these limitations
Maximum Database Size = 8000T
Maximum Table Size
Maximum Row Size
Maximum Rows per Table = Unlimited
Maximum Columns per Table = 1000
Maximum Indexes per Table = Unlimited
Thank you for your help
All this information is in the docs:
Physical limits:
https://docs.oracle.com/database/121/REFRN/GUID-939CB455-783E-458A-A2E8-81172B990FE9.htm
Logical limits:
https://docs.oracle.com/database/122/REFRN/logical-database-limits.htm
Maximum row size:
For Oracle8, Release 8.0 and later, the answer is 4,000GB (or 4GB per
LOB, 1,000 LOBs per table). Just take the maximum varchar2 size (4000)
or char size (2000) and add them up—4000x1000=4,000,000 bytes of
structured data.

What is the maximum physical table size in Oracle?

Is there some limit on the maximum total amount of data that can be stored in a single table in Oracle?
I think there shouldn't be because tables are anyways stored as a set of rows and rows can be chained as well. Does such a limit exist?
See Physical Database Limits and Logical Database Limits documentation.

Resources