How to know exact size of table with blob column
I have a table with one BLOB column. I ran this query.
select bytes/1024/1024 from user_segments where segment_name='GMSSP_REQUEST_TEMP_FILES'
(user_segments is a view)
it gave me 0.125
It means size of table is 0.125. I have uploaded 3 files to this table. Each of them is of 5 mb. After that I check size of table. but result was same. i.e 0.125.
Can any body tell me how to know exact amount of space consumed by files. I am expecting following result
size should be (5+5+5+0.125)MB
Any help is appreciated.
Thanks.
Akie
http://download.oracle.com/docs/cd/B19306_01/server.102/b14237/statviews_1092.htm#i1581211
http://asktom.oracle.com/pls/asktom/f?p=100:11:0::::P11_QUESTION_ID:266215435203#993030200346552097
Similar Messages
-
Calculate size of table with BLOB column
Hello,
when trying to calculate the occupied space for a table, I'm using DBA_SEGMENTS, which works fine as long as the table does not have a BLOB column.
As far as I can tell, the size of the BLOB data is stored with the SEGMENT_TYPE = 'LOBSEGMENT', but I cannot find a view that tells me which DBA_SEGMENT row belongs to the BLOB column in the table I'm checking.
To give you an example:
select sum(BYTES)
from DBA_SEGMENTS
where owner = user
and segment_name = 'MY_TABLE'
group by SEGMENT_NAMEreturns 262144
running:
SELECT sum(length(blob_column))
FROM my_tablereturns 821333
There are entries in DBA_SEGMENTS for my user with the type LOBSEGMENT, but I cannot find a way to map the correct DBA_SEGMENTS row to the table I am checking.
Any ideas?
I'm using Oracle 10.2.0.3.0 on Redhat
Thanks in advance
Thomashttp://download.oracle.com/docs/cd/B19306_01/server.102/b14237/statviews_1092.htm#i1581211
http://asktom.oracle.com/pls/asktom/f?p=100:11:0::::P11_QUESTION_ID:266215435203#993030200346552097 -
Error while importing a table with BLOB column
Hi,
I am having a table with BLOB column. When I export such a table it gets exported correctly, but when I import the same in different schema having different tablespace it throws error
IMP-00017: following statement failed with ORACLE error 959:
"CREATE TABLE "CMM_PARTY_DOC" ("PDOC_DOC_ID" VARCHAR2(10), "PDOC_PTY_ID" VAR"
"CHAR2(10), "PDOC_DOCDTL_ID" VARCHAR2(10), "PDOC_DOC_DESC" VARCHAR2(100), "P"
"DOC_DOC_DTL_DESC" VARCHAR2(100), "PDOC_RCVD_YN" VARCHAR2(1), "PDOC_UPLOAD_D"
"ATA" BLOB, "PDOC_UPD_USER" VARCHAR2(10), "PDOC_UPD_DATE" DATE, "PDOC_CRE_US"
"ER" VARCHAR2(10) NOT NULL ENABLE, "PDOC_CRE_DATE" DATE NOT NULL ENABLE) PC"
"TFREE 10 PCTUSED 40 INITRANS 1 MAXTRANS 255 STORAGE(INITIAL 65536 FREELISTS"
" 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT) TABLESPACE "TS_AGIMSAPPOLOLIVE030"
"4" LOGGING NOCOMPRESS LOB ("PDOC_UPLOAD_DATA") STORE AS (TABLESPACE "TS_AG"
"IMSAPPOLOLIVE0304" ENABLE STORAGE IN ROW CHUNK 8192 PCTVERSION 10 NOCACHE L"
"OGGING STORAGE(INITIAL 65536 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEF"
"AULT))"
IMP-00003: ORACLE error 959 encountered
ORA-00959: tablespace 'TS_AGIMSAPPOLOLIVE0304' does not exist
I used the import command as follows :
imp <user/pwd@conn> file=<dmpfile.dmp> fromuser=<fromuser> touser=<touser> log=<logfile.log>
What can I do so that this table gets imported correctly?
Also tell me "whether the BLOB is stored in different tablespace than the default tablespace of the user?"
Thanks in advance.Hello,
U can either
1) create a tablespace with the same name in destination where you are trying to import.
2) get the ddl of the table, modify the tablespace name to reflect the existing tablespace name in destination and run the ddl in the destination database, and run your import command with option ignore=y--> which will ignore all the create errors.
Regards,
Vinay -
Find size of table with XMLTYPE column STORE AS BINARY XML
Hi,
I have a table with structure as:
CREATE TABLE XML_TABLE_1
ID NUMBER NOT NULL,
SOURCE VARCHAR2(255 CHAR) NOT NULL,
XML_TEXT SYS.XMLTYPE,
CREATION_DATE TIMESTAMP(6) NOT NULL
XMLTYPE XML_TEXT STORE AS BINARY XML (
TABLESPACE Tablespace1_LOB
DISABLE STORAGE IN ROW
CHUNK 16384
RETENTION
CACHE READS
NOLOGGING)
ALLOW NONSCHEMA
DISALLOW ANYSCHEMA
TABLESPACE Tablespace2_DATA
- So HOW do I find the total size occupied by this table. Does BINARY storage work as LOB storage. i.e. I need to consider USER_LOBS as well for this.
OR foll. will work
select segment_name as tablename, sum(bytes/ (1024 * 1024 * 1024 )) as tablesize_in_GB
From dba_segments
where segment_name = 'XML_TABLE_1'
and OWNER = 'SCHEMANAME'
group by segment_name ;
- Also if I am copying it to another table of same structure as:
Insert /*+ append */ into XML_TABLE_2 Select * from XML_TABLE_1.
Then how much space in ROllbackSegment do I need. Is it equal to the size of the table XML_TABLE_1?
Thanks..I think foll query calculates it right while including the LOB storage as:
SELECT SUM(bytes)/1024/1024/1024 gb
FROM dba_segments
WHERE (owner = 'SCHEMA_NAME' and
segment_name = 'TABLE_NAME')
OR (owner, segment_name) IN (
SELECT owner, segment_name
FROM dba_lobs
WHERE owner = 'SCHEMA_NAME'
AND table_name = 'TABLE_NAME')
It's 80 GB for our Table with XMLType Column.
But for the second point:
Do we need 80GB of UNDO/ROLLBACK Segment for performing:
Insert /*+ append */ into TableName1 Select * from TableName;
Thanks.. -
How to read/write a binary file from/to a table with BLOB column
I have create a table with a column of data type BLOB.
I can read/write an IMAGE file from/to the column of the table using:
READ_IMAGE_FILE
WRITE_IMAGE_FILE
How can I do the same for other binary files, e.g. aaaa.zip?There is a package procedure dbms_lob.readblobfromfile to read BLOB's from file.
http://download-east.oracle.com/docs/cd/B19306_01/appdev.102/b14258/d_lob.htm#sthref3583
To write a BLOB to file you can use a Java procedure (pre Oracle 9i R2) or utl_file.put_raw (there is no dbms_lob.writelobtofile).
http://asktom.oracle.com/pls/ask/f?p=4950:8:1559124855641433424::NO::F4950_P8_DISPLAYID,F4950_P8_CRITERIA:6379798216275 -
Sample insert into table with BLOB column
This is my first opportunity to work with BLOB columns. I was wondering if anyone had some sample code that shows the loading of a blob column and inserted into the table with a blob column.
I have to produce a report (including crlf) and place it into a blob column. The user will download the report at a later time.
Any suggestions / code samples are greatly appreciated!!!!You can enable string binding in TopLink.
login.useStringBinding(int size);
or you could enable binding in general,
login.bindAllParameters(); -
How to know the size of data in some columns of a table?
Hi,
How can the size of of data for some specified column be determined?
For example : TableA has 20 columns and the size of table is 20 GB. I want to know the size of data kept in last four columns.
Thanks in Advance,
VishuYou could use vsize to determine the size of a column element and sum them upselect sum(vsize(column_of_interest)) from whatever_table;
-
How to define form within a table with two columns?
Hallo,
i want to design a form with two columns side by side.
My way is to define a table within the form:
<af:panelForm>
<afh:tableLayout width="100%">
<afh:rowLayout halign="left">
<af:inputText value="#{bindings.StsNr.inputValue}"
label="#{bindings.StsNr.label}"
required="#{bindings.StsNr.mandatory}"
columns="#{bindings.StsNr.displayWidth}"
readOnly="true">
<af:validator binding="#{bindings.StsNr.validator}"/>
<f:convertNumber groupingUsed="false"
pattern="#{bindings.StsNr.format}"/>
</af:inputText>
<af:selectOneChoice value="#{bindings.StammsaetzeStsEmpfangsart.inputValue}"
label="#{bindings.StammsaetzeStsEmpfangsart.label}"
tip="Brief, Fax, Mail">
<f:selectItems value="#{bindings.StammsaetzeStsEmpfangsart.items}"/>
</af:selectOneChoice>
</afh:rowLayout>
</afh:tableLayout>
</af:panelForm>
Is there a better way to do it?Hi reiasmus ,
Try <af:panelForm row="X">, that specifies the number of fields by columns. If you have ten fields and you fix row="5", you will obtain two columns with 5 rows on each.
Regards,
Tif -
How to give relationship between two tables with comon column with between oprator
Hi Folks,
I am using Sql Server 2008R2. I am getting a problem to establish relationship between two tables.
I have two Tables, 1.Inventory Details Table another one is Inventory Header Table.
Inventory Details Table having a column Card No and inventory Header Table having columns From card No and To Card No.
I want to give relationship between these two tables with Card no. Could you please provide me the Sql Query.
Your help would be greatly appreciated .
Regards
hasthi.
email:[email protected]Hi Raju,
We have two way that we can relate to the table either join or quality condition use following syntax/Query for relating two tables
select * from Inventory_Details ID inner join Inventory_Header IH on ID.CardNo between IH.FrmCardno and IH.ToCardNo
or
Select * from Inventory_Details ID ,Inventory_Header IH where ID.CardNo=IH.CardNo OrSelect * from Inventory_Details ID ,Inventory_Header IH where ID.CardNo between IH.FrmCardno and IH.ToCardNo
Hope this will help you
Niraj Sevalkar -
Table with BLOB column re-partitioning
Currently I have a table with a blob column Z partitioned on Column X I want to re-partition the table on Column Y is there a quick way of doing this.
INSERT INTO SELECT * has limitations on the blob size I guess.
Can someone explain this?
Edited by: user10229350 on Mar 1, 2010 7:36 AMI am using hash partitioning looks like split partition doesn't apply for hash partition:
"The SPLIT PARTITION clause of the ALTER TABLE or ALTER INDEX statement is used to redistribute the contents of a partition into two new partitions. Consider doing this when a partition becomes too large and causes backup, recovery, or maintenance operations to take a long time to complete. You can also use the SPLIT PARTITION clause to redistribute the I/O load.
This clause cannot be used for hash partitions or subpartitions." -
ORA-03237 when creating table with BLOB columns on Oracle 9i
I am playing with my new Oracle 9i database. I am trying to copy
tables from my 8.1.6 db. Three tables won't create due to this
new message. The 9i documentation says it's soemthing to do with
freelist groups but my DBA says he hasn't set up any.
The tablespace is one of these newfangled locally managed
tablespaces (predetermined size 8k).
I can create these tables if I change the BLOB column to datatype
VARCHAR2(4000).
I have raised this through the usual channels, but I thought I'd
try this site as well.
Cheers, APCvictor_shostak wrote:
Figured, Virtual Columns work only for Binary XML.They are only supported, currently, for Binary XML. -
Hello All :
I have been trying to figure out for a simple code I can use in my JSP to upload a file (of any format) into an Oracle table with a BLOB column type. I have gone through a lot of existing forums but couldnot find a simple code (that doesnot use Servlet, for eg.) to implement this piece.
Thanks a lot for your help !!Hi.
First of all to put a file into Oracle you need to get the array of bytes byte[] for that file. For this use for example FileInputStream.
After you get the byte array try to use this code:
try {
Connection conn = myGetDBConnection();
PreparedStatement pstmt = conn.prepareStatement("INSERT INTO table1 (content) VALUES(?)");
byte[] content = myGetFileAsBytes();
if (content != null) {
pstmt.setBinaryStream(0, new ByteArrayInputStream(content), content.length);
pstmt.close();
conn.close();
} catch (Exception ex) {
ex.printStackTrace();
}or instead of using ByteArrayInputStream try pstmt.setBinaryStream(0, new FileInputStream(yourFile), getFileSize());Hope this will help...
regards, Victor Letunovsky -
Migrating a table with BLOB column from one db to another
Hello everybody,
I have two databases D1 and D2. Each database contains table T1 (same structure in both databases). T has a BLOB column and is populated in D1. I have to move all the data from T database D1 into T database D2.
D1 and D2 are located on different machines. T in D1 is a huge table (milions of records). What is the best solution to migrate the T data between the 2 databases?
Any help will be appreciated.
Thank you in advance.
danielaDepending on the version of the database you have, you could use transportable tablespaces.
http://download-east.oracle.com/docs/cd/B10501_01/server.920/a96524/c04space.htm#9370 -
hi
I would like to export table "A" containing data in BLOB column and then import the same table into another user's table "B".
i got the following error
ORA-06502PL/SQL: numeric or value errorWhen you export from one user's table A to another user table B. you should have privilege to import from the user X.
Do this
exp system/password file=filename.dmp log=filename.log tables=A owner=X
exp scott/tiger file=emp.dmp tables=(emp,dept)
imp scott/tiger file=emp.dmp full=yes
imp system/password file=filename.dmp log=filename1.log fromuser=X touser=Y tables=A
Now table A is imported into Y schema. drop the table B(if you do not need old table B) then rename table A to B.
If you need old data in Table B then generate insert statements for the data and insert them into new table B -
Replicate Table with spatial columns
I'd like to know how to
replicate (updatable snapshot) a table
with spatial columns.
when i try to create a master repobject
i've got ORA-23318 error.
What can i do?
nullHi Vincent,
Oracle does not support replication of object in 8.1.6 or 8.1.7. I believe replication support is expected for the version after.
Sorry,
Dan
Maybe you are looking for
-
JMS Control - receive-correlation-property
Hi, I am using JMS Control in WLI 8.1. This is not a WLI JMS Control. Some application puts a message to Weblogic Queue. My JMS Control is subscribed to the queue. It gives the following error - when it receives the message... <Jun 15, 2004 4:02:56 P
-
Obviously Apple won't answer my question. I'll just buy it thru Amazon. They answer questions!
-
Will audition 3.0 work with win 8.1
Migrating from Vista to Win 8.1, We have been using audition 3.0 with Vista
-
Reader not displaying full document
I am currently using Reader 10.1.2 on Windows 7. I am using Report Viewer to display the contents of a .docx file. The viewer seems to cut off the last few lines of the document regardless of whether or not the .docx file is 2 pages or 20. When I
-
hi there .. i needed to perform reconfigure reboot, i also touched /reconfigure and did with -r, removed etc/path_to_inst but result is always this (in case of `{0} ok boot -r` and removed path_to_inst): WARNING: /etc/path_to_inst empty or not found