Understanding tablespaces
I need a detailed explanation of the oracle tablespaces... More like Tablespaces of understanding for Dummies.
How change the default tablespace and the reason why you would have to.
And also creation of tablespace.
N.B: Need people experienced industry who can relate to real life situations.
I need a detailed explanation of the oracle tablespaces... More like Tablespaces of understanding for Dummies.
You understand the reasoning behind the creation OS files (or directories)? They are used to group logically related files. The advantage to this is so much easier (you can move the entire folder and its entire contents from one place to another) management and administration. It's the same is the concept of the tablespace. Tablespaces group files in them which are supposed to contain logically related content. For example, a tablespace named that HR is supposed to contain tables that hold the data related to employees.
That said, it is very well explained in the documentation online as well.
How change the default tablespace and the reason why you would have to.
And also creation of tablespace.
It's your homework. Search the documentation (http://www.oracle.com/pls/db121) commands to create, edit and drop tablespaces.
N.B: Need people experienced industry who can relate to real life situations.
Hmm
Aman...
Tags: Database
Similar Questions
-
Newbie - understanding Tablespace Priviledges
Hello
I created a tablespace called Test and also a user called test. saved until SYS in SQL Developer then I created a table in the Test called Test_table tablespace:
CREATE TABLE test.test_table)
EmpNo NUMBER (5) PRIMARY KEY,.
Ename VARCHAR2 (15) NOT NULL)
Test TABLESPACE
STORAGE (INITIAL 50K);
Always connected as SYS I then try to do an insert in the table as follows:
INSERT INTO test.test_table VALUES (1, 'User1');
But I get an error of
SQL error: ORA-01950: no privileges on tablespace 'TEST '.
01950 00000 - "no privileges on tablespace"%s '"
* Cause: The user does not have the privileges to allocate an extent in the
specified tablespace.
* Action: Grant the user appropriate access privileges or grant the user
resource space in the tablespace.
It's surprising to me that I am logged on as user SYS. I tried to give permissions to SYS tablespace TEST but I was unable to grant permissions to myself. What have I done wrong?
Thanks in advance.The table is owned by test. So test must tablespace quota (quota of user test change on...) or unlimited tablespace privilege (not recommended because that would test create objects in any tablespace).
I'm curious: rising ora-1950 would have probably avoided this question. Can you explain why you apparently doesn't have, see the documentation and knowing that this is not a discussion forum, choose to display an another Doc issue yet?
---------
Sybrand Bakker
Senior Oracle DBA -
ASMCMD Free_MB &; free Tablespace MB are different?
Hello Experts-
I am trying to understand how much free space I have left on the data plan.
ASMCMD > lsdg-> gives a MB free different value compared to the use of space tablesapce.
Should what value be addressed?
I want to ASMCMD will be more accurate but I still need to understand why they are different.
Thank you
SQL> column dummy noprint column pct_used format 999.9 heading "%|Used" column name format a16 heading "Tablespace Name" column Kbytes format 999,999,999 heading "Total_GB" SQL> SQL> SQL> SQL> column used format 999,999,999 heading "Used_GB" column free format 999,999,999 heading "Free_GB" SQL> SQL> column largest format 999,999,999 heading "Largest" break on report compute sum of kbytes on report compute sum of free on report compute sum of used on report select nvl(b.tablespace_name, nvl(a.tablespace_name,'UNKOWN')) name, SQL> SQL> SQL> SQL> SQL> SQL> 2 3 kbytes_alloc kbytes, kbytes_alloc-nvl(kbytes_free,0) used, nvl(kbytes_free,0) free, ((kbytes_alloc-nvl(kbytes_free,0))/ kbytes_alloc)*100 pct_used, 4 5 6 7 8 nvl(largest,0) largest from ( select sum(bytes)/1024/1024/1024 Kbytes_free, max(bytes)/1024/1024/1024 largest, tablespace_name from sys.dba_free_space 9 10 11 12 13 group by tablespace_name ) a, 14 ( select sum(bytes)/1024/1024/1024 Kbytes_alloc, 15 tablespace_name from sys.dba_data_files 16 17 group by tablespace_name )b 18 where a.tablespace_name (+) = b.tablespace_name ; 19 % Tablespace Name Total_GB Used_GB Free_GB Used Largest ---------------- ------------ ------------ ------------ ------ ------------ SYSTEM 4 1 3 25.1 0 SYSAUX 6 4 2 69.4 2 UNDOTBS1 16 0 16 2.2 4 USERS1 237 224 13 94.4 4 ------------ ------------ ------------ sum 263 229 34 ASMCMD> lsdg State Type Rebal Sector Block AU Total_MB Free_MB Req_mir_free_MB Usable_file_MB Offline_disks Voting_files Name MOUNTED EXTERN N 1024 4096 1048576 307200 4636 0 4636 0 N DATA/ MOUNTED EXTERN N 1024 4096 1048576 204800 159010 0 159010 0 N FLASH_RECOVERY/
Storage spaces are a subset of the ASM starts they are created in.
Segments in storage are a subset of the Tablespaces.
You might have a DG ASM to 100 GB with a 32 GB that has Tables and the indexes Tablespace that adds up to 10 GB.
Looking to 68 or 22 GB as free space? The 68 GB means that the tablespace can * growth * by an another 68 GB by adding new data files or the extension of existing data files.
The 22GB guess never add new data files or expand existing data files (resize).
68GB becomes more complicated when you have Normal or high redundancy and several FailureGroups of the DG of the DSO.
Hemant K Collette
-
Defragmentation of the tablespaces?
DB version: 11.2.0.4
Platform: Oracle Linux 6.5
3-node RAC DB
We have a TB 23 DB, and we met some performance issues lately. Sound mainly due to poorly written queries, large volume of data in the result set,... etc. But, this application was asked at a meeting if I could check that storage space (not tables) are fragmented. Apparently, in his old store DBA there did some 'Defragmenting' of tablespaces for the same application solve some performance problems.
To resize the data files, move to another tablespace DB objects so that the HWM in a particular data file is reset and then we could run the RESIZE command. But this isn't "defragmentation".
In the thread below, Justin cave explains that "a managed tablespace locally cannot effectively be fragmented."
That Justin is meant by that? Why have we not need "defragmentation" to locally managed Tablespaces?
Since I worked on 11g, I don't know the history. Done, DBA do a sort of defragmentation for older versions?
https://community.Oracle.com/thread/2508361
In general, you don't need to defragment of LMT because they re - operate segments more effectively. That assumes a particular definition of the fragmentation that don't understand what some people call "Gruyère" fragmentation, which means free space holes, spread across the tablespace. Sometimes it is wise to reclaim this space, generally do not, since generally the trend is to use space.
Many more details are in the link given Aman, but there are a few somewhat obscure situations where you would not automatically exclude the defragmentation:
A tablespace that has been migrated from DMT could have a few deferred maintenance on the lookout for defragmentation.
You might still have DMTs. You shouldn't, but there is nothing no longer this deferred maintenance upgrades of version (I do not forget something hope).
Some applications do stupid things like add and remove tables and if done in a strange order (as drop any other individual and adding more), can travel on limits of segment requirements (as Jonathan explains in some links on the moving objects until the beginning of storage spaces).
It is also possible to be unlucky and have performance issues based on the distribution of physical data get worse by moving data autour.
In general, Oracle did some good things, but be prepared to do an investigation of mind, when it is not. It allows to be confident and knowledgeable on the bases then. For the 'fragmentation' in particular, a Manager may well have been seduced by myths or the specific practices that don't apply generally. "Best practices" may suffer, too.
-
How to check the value of the space of the tablespaces and tables when errors occur?
Hi Experts,
For example, lets say we get ORA-01653: unable to extend table of error. How to check the size of the table and a tablespace? And how understanding is full?
Thanks for your help
Hello
Select df.tablespace_name "Tablespace"
totalusedspace 'Used MB',
(df.totalspace - tu.totalusedspace) "MB free.
DF. TotalSpace 'Total MB. "
round (100 * ((df.totalspace-tu.totalusedspace) / df.totalspace))
"PCT free."
Of
(select nom_tablespace,
Round (Sum (bytes) / 1048576) TotalSpace
from dba_data_files
Group by tablespace_name) df,.
(select round (sum (bytes) /(1024*1024)) totalusedspace, nom_tablespace)
from dba_segments
you group by tablespace_name)
where df.tablespace_name = tu.tablespace_name
and df.tablespace_name = "
"; For example, lets say we get ORA-01653: unable to extend table of error. How to check the size of the table and a tablespace? And how understanding is full?
Is to say clearly to the question (you can let us know what you have understood so we can fix)
[oracle@machine1 ~] $01653 oerr ora
01653, 00000, "impossible to extend %s.%s table by %s in %s tablespace»
* Cause: Failed to allocate a certain measure the required number of blocks for
a segment of the table in the specified tablespace.
* Action: Use ALTER TABLESPACE ADD DATAFILE statement to add one or more
storage of files indicate.
-Thank you
Pavan Kumar N
-
Remove the users tablespace of some users
Hi all.
I just want to ask whether it is possible to remove the table space 'users' of user 'X '. I understand that when you create a new user is assigned the default users tablespace, what is the command to do this X user cannot use the users tablespace?
Is there a table where I can see assigned to any user in the database tablespaces?
Thanks in advance.
Kind regards.
"assignment" is made through QUOTA.
Use DBA_TS_QUOTAS to display the amount of space to a tablespace, a user can use. (-1 = unlimited, 0 = is unusable)
to ban the USER_X to use the USERS tablespace...
change the quota of the user user_x 0 users;
(Make sure that you add a quota to the storage space they will use...)
MK
-
collect statistics for the tablespace
Friends...
OS: Linux
DB: 11 GR 2
Data size: 1 TB
I spend monthly multiple partitioned table spaces and bring together in a single annual partition. (for example tbs_2014_01, tbs_2014_02 - tbs_2014_12... all combine them into tbs_2014 as a tablespace)
Over the weekend, work of database gets executed that collects statistics that are obsolete, it collects all the segments that have been moved from the storage.
Given that the collection of statistics at the end of the week takes too long, I tried to find a smart way to collect statistics after each tablespace move rather than waiting for job to weekend which will take two or three days to complete.
1. is there a way to gather statistics at the tablespace level and collect statistics for all objects in this table space?
2. how to determine the overall stats of collection of statistics part?
That is, suppose I have move the tbs_2014_01 tablespace and collect statistics with global stats that could take 2 hours but it will be difficult to spend 2 hours for each stats global tablespace which in my opinion is not good and we should be collecting global stats only once.
3. any other advice?
977272 wrote:
@sol.beach... Thanks for your comments...
I've not been asked to collect statistics to the tablespace but level to collect statistics after that finish objects move in storage.
Given the size of the data, it is difficult to gather all the statistics at the weekend so trying to understand another method to collect the statistics the weekend load will be less.
You can collect statistics object on an object by object basis level after that each object has been moved.
-
Oracle 11.2.0.1.0
RHEL5
My database is to have a 'WHITE' tablespace with size 1200M.
When I exported this schema using datapump, I got a dumpfile of size about 50 M and later I imported the dumpfile even into another schema 'BLANK_ALL' with an another tablespace using datapump BLANK_ALL tablespace size is approx. 70 M.
How can we get there such a huge difference between the size of the two storage spaces?
11 g DBA wrote:
Here's my status of tablespace size
Tablespace used free PCT Total free
1293 87 1380 6 VACUUM
72 1928 2000 96 BLANK_ALL
Here's another one for you: maybe now you understand:
SQL >
SQL > select TABLESPACE_NAME, sum (BYTES) BYTES
2 from dba_free_space a
3 where a.TABLESPACE_NAME = "TEST_TST."
Group by TABLESPACE_NAME 4
5.
NOM_TABLESPACE BYTES
------------------------------ ----------
TEST_TST 9437184
SQL >
SQL >-Create table
SQL > create table TEST_TABLE
() 2
3 a number.
4B varchar2 (100)
5)
6 tablespace TEST_TST
7 storage
8 (
9 first 64K
10 minextents 1
11 maxextents unlimited
(12);
Table created
SQL > insert into test_table
2
2. Select t.OBJECT_ID, dba_objects t.OBJECT_NAME t
3 where rownum<=>=>
4.
10000 rows inserted
SQL > commit;
Validation complete
SQL > insert into test_table
2
2. Select t.OBJECT_ID, dba_objects t.OBJECT_NAME t
3 where rownum<=>=>
4.
10000 rows inserted
SQL > /.
10000 rows inserted
SQL > /.
10000 rows inserted
SQL > /.
10000 rows inserted
SQL > /.
10000 rows inserted
SQL > /.
10000 rows inserted
SQL > validation
2.
Validation complete
SQL >
SQL >
SQL >
SQL > select a.TABLESPACE_NAME,
2 (a.BYTES/1024)/1024 bytes,
3 (b.BYTES/1024)/1024, bytes_free,
4 round(((a.BYTES-b.BYTES)/a.BYTES)*100,2) percent_used,.
5 (((sum (a.BYTES) (order 1)) / 1024) / 1024) / 1024 as sum_bytes_used
6 of
7 (
8 select nom_tablespace,
9 sum (BYTES) BYTES
10 of dba_data_files
11 group by TABLESPACE_NAME
(12) one
left join 13
(14)
15 select nom_tablespace,
16 sum (BYTES) BYTES,
17 max (BYTES) largest
dba_free_space 18
19 group by TABLESPACE_NAME
(20) b
21 on a.TABLESPACE_NAME = b.TABLESPACE_NAME
22 where a.TABLESPACE_NAME = "TEST_TST."
23.
NOM_TABLESPACE PERCENT_USED SUM_BYTES_USED BYTES_FREE BYTES
------------------------------ ---------- ---------- ------------ --------------
TEST_TST 10 6 40 0.009765625
SQL > delete from test_table;
70000 lines deleted
SQL > commit;
Validation complete
SQL >
SQL > select count (*) from test_table;
COUNT (*)
----------
0
SQL >
SQL > select a.TABLESPACE_NAME,
2 (a.BYTES/1024)/1024 bytes,
3 (b.BYTES/1024)/1024, bytes_free,
4 round(((a.BYTES-b.BYTES)/a.BYTES)*100,2) percent_used,.
5 (((sum (a.BYTES) (order 1)) / 1024) / 1024) / 1024 as sum_bytes_used
6 of
7 (
8 select nom_tablespace,
9 sum (BYTES) BYTES
10 of dba_data_files
11 group by TABLESPACE_NAME
(12) one
left join 13
(14)
15 select nom_tablespace,
16 sum (BYTES) BYTES,
17 max (BYTES) largest
dba_free_space 18
19 group by TABLESPACE_NAME
(20) b
21 on a.TABLESPACE_NAME = b.TABLESPACE_NAME
22 where a.TABLESPACE_NAME = "TEST_TST."
23.
NOM_TABLESPACE PERCENT_USED SUM_BYTES_USED BYTES_FREE BYTES
------------------------------ ---------- ---------- ------------ --------------
TEST_TST 10 6 40 0.009765625
SQL >
Do you have it?
----
Ramin Hashimzade
-
Base on the tablespace compression
11.2.0.2.0
I have a number of large paintings that I can compress because they either DML little or not go forward. We have Enterprise edition, but not so advanced compression Im limited to compression in the license database. Ive read the docs and reviewed JLs note Compression in Oracle & amp; #8211; Part 1: Base Table Compression & amp; #8211; All things Oracle
and I know how to create a table with a compression of base and understand that the only direct inserted data are compressed post compression.
Question, is possible to put compression based on a tablespace and add tables here as I see good or compression of base is at the level of the table? I can't find a doc to say one or the other.
Hello
I think it works - I've never used this way (only on a per table basis), but the syntax allows
create tablespace default test compresses; -I use omf therefore no need of sizes or paths etc.
And it's on 10.2 before the existence of advanced compression.
Try it and see...
Kind regards
Rich
-
Hello
1. create tablespace TS1
2. create restore RP1 point;
3 drop tablespace TS1 (datafile ' / c:/ts1.dbf ') including files
4 restore database to RP1
5 alter database open resetlogs failed with this error:
ERROR on line 1:
ORA-01245: offline file 7 will be lost if RESETLOGS is done
ORA-01110: data file 7: ' / c:/ts1.dbf '
Can you help me please to solve this problem and to understand why it happened.Hello
If you check the log of alerts you will get message similar to
Remove the #7 file recovery:'
/db/dbs/UNNAMED00007 ' of controlfile. Now you have 2 possible
1. If you have backup of the tablespace TS1, then you can restore and recover
If you do not need this tablespace then you drop that datafile offline 7. Open the database in resetlogs mode and drop the tablespace TS1
Thank you
-
understand an impdp (remap_tablespace)
Dear Experts,
I am new to Oracle database and try to understand the IMPDP (remap_tablespace) features. Please my clear understanding (this may sound stupid, but I'm trying to understand the concept here)
Using remap_tablespace in impdp we move content (table, index, etc.) available in the source tablespace to different destination in all of database tablespace.
In my test environment, I properly exported the dump of a tablespace (SOUTHERN_TB that has a schema called South and has 3 tables)
Now, I'm trying to import the dump in the new table space available in the same database.so PHILIPPE I see all 3 tables imported Philip tablespace. (Please correct me if my interpretation is wrong!)
When I try to import I get error.can below you please try to make me understand the concept of a better way.
C:\Users\Pranav > impdp directory = dumpfile Datapump_testing = SOUTHERN_TB. Schema DMP
s = South remap_schema = South: Philippe REMAP_TABLESPACE = PENNY
THERN_TB:KAMESH
Import: Free 11.2.0.1.0 - Production Tue Oct 3 19:27:17 2013
Copyright (c) 1982, 2009, Oracle and/or its affiliates. All rights reserved.
User name: sys as sysdba
Password:
Connected to: Oracle Database 11 g Enterprise Edition Release 11.2.0.1.0 - 64 bit
Production
With partitioning, OLAP, Data Mining and Real Application Testing options
ORA-31655: no data or metadata of objects selected for employment
ORA-39039: pattern Expression 'IN (SELECT object_name 'SYS'. '. EXPORT_ORA"WHE
(RE process_order =-56 ET dupliquer ENTRE 1 ET 1) "contains no valid schema
.
Table main 'SYS '. "' EXPORT_ORA ' properly load/unloaded
Departure 'SYS '. "' EXPORT_ORA ': sys / * directory AS SYSDBA = Datapump_testing
dumpfile = SOUTHERN_TB. DMP = job_name South schemas = export_ora remap_schema = South
ERN: Philippe REMAP_TABLESPACE = SOUTHERN_TB:KAMESH
Job 'SYS '. "" EXPORT_ORA "managed to 19:27:25
question 2:
When there are already 3 tables available in the source tablespace (SOUTHERN_TB), is it still possible to have the same tables in PHILIPPE tablespace by impdp function?
Thank you
Philippe
Hello
command must be how to remove the clause of schemas
Impdp directory is dumpfile Datapump_testing = SOUTHERN_TB. Remap_schema DMP = South: Philippe REMAP_TABLESPACE = SOUTHERN_TB:KAMESH
-
Column of type BLOB in own tablespace in partition in the table, tablespace to move
Hi all
First off I use Oracle Database 11.2.0.2 on AIX 5.3.
We have a table is partitioned on a monthly basis.
In this table, there is a partition (BOTTOM), this lower score is 1.5 TB in size thanks to a BLOB column called (ATTACHMENT).
The rest of the table is not large, about 30 GB, it's the BLOB column that uses all the space.
The lower part is in its own default tablespace (DefaultTablespace), the BLOB column in the lower score is also in its own tablespace (TABLESPACE_LOB) - 1.5 to
I was invited in order to free up space by moving the TABELSPACE_LOB (from the low partition) to a data archive, confirming the data is there and then remove the lower score of the production.
I do not have enough free space (or time) make an expdp, I think not only its doable with data so much.
CREATE TABLE tablename ( xx VARCHAR2(14 BYTE), xx NUMBER(8), xx NUMBER, ATTACHMENT BLOB, xx DATE, xx VARCHAR2(100 BYTE), xx INTEGER, ) LOB (ATTACHMENT) STORE AS ( TABLESPACE DefaultTablespace ENABLE STORAGE IN ROW NOCOMPRESS TABLESPACE DefaultTablespace RESULT_CACHE (MODE DEFAULT) PARTITION BY RANGE (xx) ( PARTITION LOWER VALUES LESS THAN ('xx') LOGGING COMPRESS BASIC TABLESPACE DefaultTablespace LOB (ATTACHMENT) STORE AS ( TABLESPACE TABLESPACE_LOB ENABLE STORAGE IN ROW ) ...>>
My idea was to take a table, excluding the attachment column datapump, export using external tables.
Then to create the table on the database archive 'with' the attachment column.
Import data only, as I understand that if you use a dump file that has too many columns Oracle he will manage, I hope it will work the other way around.
Then on the production, make the TABLESPACE_LOB read-only and move it to the new file system.
It's a little more complicated that a normal gesture of tablespace because of how the table is split.
Any advice would be much appreciated.
I was thinking about an approach as:
SWAP PARTITION allows to separate the partition of the table
- Create a non-partitioned table which is otherwise identical in structure to tablename (nonpart_tablename)
- ALTER TABLE TableName LOWER WITH nonpart_tablename SWAP PARTITION
Move the segment of the table at TABLESPACE_LOB, or to a different tablespace on its own. It is, as you say, only 30 GB and I think (but not strongly enough to go forward without testing/validation on a smaller scale) that the displacement of the segment of the table in this way does not disrupt the LOB segment, as long as you don't say MOVE LOB.
- ALTER TABLE nonpart_tablename MOVE TABLESPACE TABLESPACE_LOB
Now the TABLESPACE_LOB tablespace is self-contained and you can make it transportable.
-
backup and restore a tablespace
Hi all
I recently started reading about backup and restore oracle concepts, and I needed to understand what happens when we put a tablespace in a backup mode (alter tablespace nom_tablespace start backup)?
Thanks for help
Yes my database is in archivelog, my concern, this is what happens when we publish the alter tablespace nom_tablespace start backup command
and on the redo logs, you have to backup theme as well because during the backup period, a logfile switch could occur if you need to save the theme too
-
Is a separate tablespace is the only solution to disable recovery for LMD logs?
Hello! We have both Oracle 10 & 11 G Edition and standard Edition.
We have a few tables several process insert and then select at the same time. However, we could not less concerned if the data in these tables are lost (some temp, debug, trace and errors).
These paintings are contributors of #1 to the size of the Oracle redo logs. I understand that NOLOGGING and / * + APPEND * / lock tables. This option does not work in my scenario.
What are my options to disable the generation of log REDO for all Inserts / updates / deletes per table? I never set up a tablespace with No Logging option.
What are the caveats?
Any help is greatly appreciated in advance!
Sincerely,
M
You cannot disable generation remake for classic DML.
-
sorting data - more great temp tablespace and temporary tablespace
Hello
Using oracle 11.2.0.3 and have a general question.
If have a query which has to say read 100 million records and the Group results it takes a bigger temporary tablespace to sort these data
Rathet than agnist an identical query summed up version of table (mview) including 25% of this amount - gbe that same but cliniquesdans need to read much less lines.
s.EG
Thank you very muchselect dimesnion.attribute1, dimesnion,.attribute2..., sum(sales) from fact, dimension where .... group by dimesnion.attribute1, dimesnion,.attribute2
If I understand your question right, I think both group by must take the same temporary as space ' group by ' sorts data in the end after read data. As both the results of queries in the same number of lines, so group by clause will take same tablespace temporary unless there are fewer columns in the materialized view as the original table.
Maybe you are looking for
-
Hi all, someone can tell me where I can get a replacement for a Satellite Pro 4600 recovery CD. Thanks in advance, Jimmy McLachlan
-
Satellite A60: Is it possible for a boot from USB?
It is so, seems there is no way to boot on USB or HD satellite (mine is an A60E). Do you have someone have the head or read that the next version of the bios might do?
-
Any chance we can get confidence * WIFI networks?
I like the feature to be on a Bluetooth device (in the car) and stas unlocked phone But what about when we are at home or at work, on a specific WIFI network? We might have this feature of this situation? I know that the bike will do things like read
-
I have a hp laptop pavilion g6. I formatted it win 7 DVD unfortunately I lost my original win 7 home top after that recovery options. so I'm worried if you can pleace tell me how to get my original option of recovery step by step thank you...
-
People, There are printers HP laserjet capable of 2 sides print A6? Thanks in advance James