If the extent of the Oracle tablespace is local, the value seems to be ignored even when the query below is executed.
Is this normal?
CREATE TABLESPACE TS1_FIXED2
DATAFILE
'\df1_fixed2.dbf'
SIZE 1024000
DEFAULT NOCOMPRESS STORAGE (
INITIAL 10240
NEXT 10240
MINEXTENTS 2
MAXEXTENTS 50
PCTINCREASE 50
)
SEGMENT SPACE MANAGEMENT MANUAL
TABLESPACE_NAME
INITIAL
NEXT
MINEXTENTS
MAXEXTENTS
PCTINCREASE
TS1_FIXED2
65536
null
1
2147483645
2147483645
This is expected.
The extents of a locally managed tablespace are managed efficiently in the tablespace by the Oracle database server.
However, if it was dictionary-managed tablespace, you could manage extents more
actively. And remember, Oracle does not recommend their use!
Related
how to create a tablespace in oracle with initial data size of 10MB and let it grow all the way to the capacity of the disk? so if the disk is 100GB the table should be able to grow until 100GB without any change in the configuration
Use MAXSIZE ( IMHO I don't think it's a good idea to fill your disk )
CREATE BIGFILE TABLESPACE BIGTBS1 DATAFILE '/u01/app/oracle/oradata/OCM/bigtbs01.dbf'
SIZE 10M AUTOEXTEND ON NEXT 10M MAXSIZE 100G;
Currently my Oracle 11g temp TABLESPACE value is 34GB. I need to increase the table space value to a large value (45GB)
I tired the following sql command to increase the temp table space.
ALTER TABLESPACE temp ADD TEMPFILE '/oradata/temp01.dbf' SIZE 45G
The error:
SQL Error: ORA-01144: File size (5536951 blocks) exceeds maximum of
4194303 blocks
01144. 00000 - "File size (%s blocks) exceeds maximum of %s blocks"
*Cause: Specified file size is larger than maximum allowable size value.
*Action: Specify a smaller size.
SELECT value FROM v$parameter WHERE name = 'db_block_size';
The "db_block_size" value is 8192
How do I decide the maximum allowed db_block_size and the corresponding temp TABLESPACE value
How do I increase the TEMP tablespace?
The error message is pretty clear, the maximum file size is 4194303 blocks. If you multiply that out
4194303 blocks * 8192 bytes/ block / 1024^3 = 32 GB
So you're limited to individual data/ temp files of up to 32 GB. You can, however, have thousands of data files in a tablespace. So you could have a 32 GB temp file and another 13 GB temp file or 2 22.5 GB temp files or 9 5 GB temp files.
I have a production table. The table is updating and deleting rows daily. So want to know about how many space allowed per table in oracle 10g and 11g? If exceed the limit how we fix the problem?
Practically, there is no limit. At least not one that any human is likely to hit.
If you want to be pedantic, a bigfile tablespace can be up to 32 TB in size if the database is using 8k blocks or 128 TB if the database is using 32k blocks. A table can have up to 1024k partitions. Each partition could be in a different tablespace but you can only have 64k tablespaces. So if you have 64k partitions and each partition in a separate bigfile tablespace with nothing else in the tablespace, you could have up to 128 TB * 64k = 8192 PB = 8 EB (exabytes). That's roughly 1,000 times all the data stored in the Library of Congress. If your table is that large, you've done something extraordinarily wrong.
Each version of the database has a couple of sections in the Oracle Reference on the physical limits and on the logical limits of the database that you can use to answer these sorts of questions.
Oracle has the concept of a tablespace. Does a tablespace resemble actual physical storage space on the disk? If this is true, and I delete a million records from the database, will the space on the disk be freed up immediately?
No and no.
A tablespace is made using one or more datafiles. A datafile comes closest to a disk. The data in a tablespace is striped over the datafiles. If you delete rows from a table, there will be free space in that table. If you then shrink that table, the free space in the tablespace grows and the same in the supporting tablespaces.
If you are lucky and your table data was in the end of the datafile[s], you might be able to also shrink the datafile, after which you end up with more free space on the OS.
Yes a tablespace represents actual physical storage space on the disks.
No, if you delete a million records then no space will be freed.
A tablespace is a collection of datafiles on the disk that are pre-sized; by removing data from one of these datafiles you don't free up any space because you haven't reduced the size of the tablespace. It has a predetermined size that has not changed.
You can manually resize a datafile but only if the amount of data stored in that file (not the tablespace) is less than the size you want to reduce it to. To use Oracle's example syntax:
ALTER DATABASE DATAFILE '/u02/oracle/rbdb1/stuff01.dbf'
RESIZE 100M;
This is not something to be playing around with. There are often good reasons for the size of datafiles and tablespaces. You should talk to your DBA before doing anything.
The tablespace in Oracle 10g is almost 100% used.
Size (MB) = 571,768.0
Used (MB) = 571,534.0
I just deleted (and committed) thousands of records in a table that belongs to a schema associated with that tablespace. Surprisingly, no space was freed up according to the Tablespaces page on Enterprise Manager.
Question: is there anything that I need to do to force Oracle to release the space corresponding to the deleted records?
The space you are seeing is for SEGMENTS on tablespace.
A Tablespace contains Segments. Each Segment is associated to an Index or a Table. Segments contains extends, and extends contains blocks. An for a table, a block contains rows.
When you delete rows on a table you are freeing the space ocuppied by rows but the space for new segments remains equal.
To free this space you can try to:
ALTER TABLESPACE xxx COALESCE;
or
ALTER TABLE xxx MOVE;
The first one, will "combine all contiguous free extents into larger contiguous extents". Depending on your configuracion, this can be executed by Oracle automatically. Also, may be it does not free to much because the location of data relative to the highwatermark on segment.
The second one "lets you relocate data of a nonpartitioned table or of a partition of a partitioned table into a new segment, optionally in a different tablespace, and optionally modify any of its storage attributes.". Be carefull with this because you need free space to achieve this, execute it against another tablespace or add more datafiles.
If you are using oracle 10g or greater, you can purge the recycle bin using command
purge recylebin
or even purge the contents related to the tablespace using
purge tablespace
This should free up the space which is deleted but not yet available , please note this would be made available automatically when the space stress occurs for the given tablespace.
In addition,
You can use the segment advisor to find all the segments that you can "shrink", and easily reclaim your space.
Read more at
Segment Shrink
And the last one you can use with locally managed tablespaces
Alter Tablespace tablespace_name shrink space
This would free as much space as possible while maintaining other attributes.
Rebuild your indexes.