Home » SQL & PL/SQL » SQL & PL/SQL » Need help in tablespace (Oracle 10g XE, Windows 7)
Need help in tablespace [message #635459] Mon, 30 March 2015 10:51 Go to next message
dark_prince
Messages: 121
Registered: June 2013
Location: India
Senior Member
I want to create a tablespace which going to store record more than 10 lakh
so for that I have created this :-

CREATE TABLESPACE MWF_TABLESPACE
DATAFILE 'MWF_TABLESPACE.dat' SIZE 50M
DEFAULT STORAGE
(
    INITIAL 10M NEXT 50M
    MINEXTENTS 1 MAXEXTENTS 999
    PCTINCREASE 10
)
ONLINE;


I want to know the size, initial, minextents maxextents and pctincrease which I have are given correct or not.
Re: Need help in tablespace [message #635460 is a reply to message #635459] Mon, 30 March 2015 10:53 Go to previous messageGo to next message
BlackSwan
Messages: 26766
Registered: January 2009
Location: SoCal
Senior Member
what is maximum size for a row?

BTW, 10g is obsoleted & unsupported
Re: Need help in tablespace [message #635462 is a reply to message #635460] Mon, 30 March 2015 11:12 Go to previous messageGo to next message
dark_prince
Messages: 121
Registered: June 2013
Location: India
Senior Member
can you tell me how to find maximum size for a row?

and I have installed Oracle 10g XE in windows 7 64-bit if this is not supported then which version should I used
Re: Need help in tablespace [message #635463 is a reply to message #635462] Mon, 30 March 2015 11:15 Go to previous messageGo to next message
BlackSwan
Messages: 26766
Registered: January 2009
Location: SoCal
Senior Member
>can you tell me how to find maximum size for a row?
add up maximum size of every column

>and I have installed Oracle 10g XE in windows 7 64-bit if this is not supported then which version should I used
V10 Oracle is no longer available for download
http://www.oracle.com/technetwork/database/database-technologies/express-edition/downloads/index.html
Re: Need help in tablespace [message #635465 is a reply to message #635459] Mon, 30 March 2015 11:44 Go to previous messageGo to next message
Michel Cadot
Messages: 68645
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator

Use LMT (Locally Managed Tablespace) system managed and get rid of storage clause.

Re: Need help in tablespace [message #635471 is a reply to message #635465] Mon, 30 March 2015 14:59 Go to previous messageGo to next message
dark_prince
Messages: 121
Registered: June 2013
Location: India
Senior Member
thanks and can you tell me how to allocate size to datafile. As there are more than 20 tables and each contain maximum 10 columns
Re: Need help in tablespace [message #635472 is a reply to message #635471] Mon, 30 March 2015 15:07 Go to previous messageGo to next message
BlackSwan
Messages: 26766
Registered: January 2009
Location: SoCal
Senior Member
dark_prince wrote on Mon, 30 March 2015 12:59
thanks and can you tell me how to allocate size to datafile. As there are more than 20 tables and each contain maximum 10 columns



unwilling or incapable to Read The Fine Manual yourself?

https://docs.oracle.com/database/121/SQLRF/statements_7003.htm#SQLRF01403
Re: Need help in tablespace [message #635473 is a reply to message #635472] Mon, 30 March 2015 15:12 Go to previous messageGo to next message
dark_prince
Messages: 121
Registered: June 2013
Location: India
Senior Member
its not about unwilling or incapable, i already read that page the thing i did not understand is the difference between bigfile and smallfile
Re: Need help in tablespace [message #635477 is a reply to message #635473] Mon, 30 March 2015 16:28 Go to previous messageGo to next message
BlackSwan
Messages: 26766
Registered: January 2009
Location: SoCal
Senior Member
What part of below confuses you?

BIGFILE | SMALLFILE

Use this clause to determine whether the tablespace is a bigfile or smallfile tablespace. This clause overrides any default tablespace type setting for the database.

A bigfile tablespace contains only one data file or temp file, which can contain up to approximately 4 billion (232) blocks. The maximum size of the single data file or temp file is 128 terabytes (TB) for a tablespace with 32K blocks and 32TB for a tablespace with 8K blocks.

A smallfile tablespace is a traditional Oracle tablespace, which can contain 1022 data files or temp files, each of which can contain up to approximately 4 million (222) blocks.

If you omit this clause, then Oracle Database uses the current default tablespace type of permanent or temporary tablespace set for the database. If you specify BIGFILE for a permanent tablespace, then the database by default creates a locally managed tablespace with automatic segment-space management.

Restriction on Bigfile Tablespaces 
You can specify only one data file in the DATAFILE clause or one temp file in the TEMPFILE clause.
Re: Need help in tablespace [message #635483 is a reply to message #635473] Tue, 31 March 2015 00:25 Go to previous messageGo to next message
Michel Cadot
Messages: 68645
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator

In addition, given the figures you gave us, you have no need of big files.

Re: Need help in tablespace [message #635499 is a reply to message #635483] Tue, 31 March 2015 01:59 Go to previous messageGo to next message
dark_prince
Messages: 121
Registered: June 2013
Location: India
Senior Member
what I'm not understanding is how to check which file should I used either BIGFILE or SMALLFILE, like michel cadot said
Quote:

In addition, given the figures you gave us, you have no need of big files.

how to decide
Re: Need help in tablespace [message #635500 is a reply to message #635499] Tue, 31 March 2015 02:15 Go to previous messageGo to next message
Michel Cadot
Messages: 68645
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator

BlackSwan's latest answer did not help you?
If no, then forget big files and always use small files.

Re: Need help in tablespace [message #635502 is a reply to message #635500] Tue, 31 March 2015 02:32 Go to previous messageGo to next message
dark_prince
Messages: 121
Registered: June 2013
Location: India
Senior Member
ok michel thanks for your help
Re: Need help in tablespace [message #635503 is a reply to message #635459] Tue, 31 March 2015 03:42 Go to previous messageGo to next message
John Watson
Messages: 8931
Registered: January 2010
Location: Global Village
Senior Member
Perhaps the whole question is not relevant to the real world. If I remember correctly, XE release 10.x has a hard limit of 4GB for user data. So all you need do is create your tablesapce with a single file, autoextend on, and watch it grow as necessary up to that limit.

I have no idea if your data wll fit within that limit (what is a "lakh"? It is certainly not an SI unit) but you can work that out. Insert a few million rows, look at the space occuped, and extrapolate accordingly.
Re: Need help in tablespace [message #635548 is a reply to message #635503] Tue, 31 March 2015 15:27 Go to previous messageGo to next message
Bill B
Messages: 1971
Registered: December 2004
Senior Member
according to Wikipedia a lakh is 100,000 records. 10 lakh is one million records.

[Updated on: Tue, 31 March 2015 15:28]

Report message to a moderator

Re: Need help in tablespace [message #635575 is a reply to message #635503] Wed, 01 April 2015 10:29 Go to previous messageGo to next message
dark_prince
Messages: 121
Registered: June 2013
Location: India
Senior Member
John Watson wrote on Tue, 31 March 2015 15:42
Perhaps the whole question is not relevant to the real world. If I remember correctly, XE release 10.x has a hard limit of 4GB for user data. So all you need do is create your tablesapce with a single file, autoextend on, and watch it grow as necessary up to that limit.

If it reach the limit then what will happen..and what should I do in that case
Re: Need help in tablespace [message #635576 is a reply to message #635575] Wed, 01 April 2015 10:30 Go to previous messageGo to next message
dark_prince
Messages: 121
Registered: June 2013
Location: India
Senior Member
Is this the correct one
CREATE TABLESPACE EXP_TABLESPACE
DATAFILE 'EXP_TABLESPACE.dat' SIZE 1GB
AUTOEXTEND OFF
EXTENT MANAGEMENT LOCAL AUTOALLOCATE
ONLINE;

Re: Need help in tablespace [message #635577 is a reply to message #635576] Wed, 01 April 2015 10:46 Go to previous messageGo to next message
BlackSwan
Messages: 26766
Registered: January 2009
Location: SoCal
Senior Member
It works for me.
Re: Need help in tablespace [message #635578 is a reply to message #635576] Wed, 01 April 2015 10:57 Go to previous messageGo to next message
gazzag
Messages: 1118
Registered: November 2010
Location: Bedwas, UK
Senior Member
I would make two slight changes:
CREATE TABLESPACE EXP_TABLESPACE
DATAFILE 'EXP_TABLESPACE01.dbf' SIZE 1GB
AUTOEXTEND OFF
EXTENT MANAGEMENT LOCAL AUTOALLOCATE
ONLINE;

The convention for Oracle datafiles is a suffix of ".dbf" as well as to enumerate them. You may not feel that you will need to add a EXP_TABLESPACE02.dbf in the future but why constrain yourself now?
Re: Need help in tablespace [message #635579 is a reply to message #635577] Wed, 01 April 2015 11:06 Go to previous messageGo to next message
dark_prince
Messages: 121
Registered: June 2013
Location: India
Senior Member
Thanks. In Oracle 11g XE hard limit is upto 11GB for user data so even if I provide size 10Gb there will be no problem right, like reaching the limit.
Re: Need help in tablespace [message #635580 is a reply to message #635579] Wed, 01 April 2015 11:15 Go to previous messageGo to next message
dark_prince
Messages: 121
Registered: June 2013
Location: India
Senior Member
thanks gazzag
Re: Need help in tablespace [message #635581 is a reply to message #635579] Wed, 01 April 2015 12:52 Go to previous messageGo to next message
joy_division
Messages: 4963
Registered: February 2005
Location: East Coast USA
Senior Member
I would also give it a full path so you know where the file is going to be.
Re: Need help in tablespace [message #635583 is a reply to message #635578] Wed, 01 April 2015 13:21 Go to previous messageGo to next message
EdStevens
Messages: 1376
Registered: September 2013
Senior Member
gazzag wrote on Wed, 01 April 2015 10:57

The convention for Oracle datafiles is a suffix of ".dbf" as well as to enumerate them. You may not feel that you will need to add a EXP_TABLESPACE02.dbf in the future but why constrain yourself now?


Good point. People seem to forget that names mean something and one should have a naming convention that reflects that and allows for future growth. Of course, I'm a dinosaur who came from an age where shops had formal manuals of coding standards, including naming standards. Now it seems the attitude is to just make everything up as you go and every developer/DBA/SA for himself when it comes to quaint notions of 'standards'.
Re: Need help in tablespace [message #635597 is a reply to message #635580] Thu, 02 April 2015 02:46 Go to previous messageGo to next message
gazzag
Messages: 1118
Registered: November 2010
Location: Bedwas, UK
Senior Member
You're welcome. But Joy Division makes a very good point. You should fully qualify the pathname when creating your datafile. In Windows a good convention with XE might be something like:
CREATE TABLESPACE EXP_TABLESPACE
DATAFILE '<drive_letter>\oracle\oradata\XE\EXP_TABLESPACE01.dbf' SIZE 1GB
AUTOEXTEND OFF
EXTENT MANAGEMENT LOCAL AUTOALLOCATE
ONLINE;

Re: Need help in tablespace [message #635598 is a reply to message #635583] Thu, 02 April 2015 03:20 Go to previous messageGo to next message
gazzag
Messages: 1118
Registered: November 2010
Location: Bedwas, UK
Senior Member
Quote:
Now it seems the attitude is to just make everything up as you go and every developer/DBA/SA for himself when it comes to quaint notions of 'standards'.

Agreed. In my experience this is a result of companies wanting to minimise expenses with IT as much as anything else. It results in cheaper paid and, therefore, less qualified staff being hired to "build" a system pretty much as they see fit. These staff, by definition, will have little or no knowledge of any existing methodologies or standards that us dinosaurs have been brought up with. Google is a fantastic tool once you have the right background in a given field - I can achieve so much more with its help than in the olden days of looking through shelves-full of documentation some of which might be outdated, incorrect and/or missing.

For example, these days I could probably Google my way to building you a house. Sadly I wouldn't be able to guarantee how long it would stand up for so you might as well pay me to live in it with you, fixing any issues as and when they arise. Unfortunately, it'll end up costing you much more than getting a qualified builder to do the work in the first place. Oh, wait... Wink
Re: Need help in tablespace [message #635599 is a reply to message #635597] Thu, 02 April 2015 03:20 Go to previous messageGo to next message
John Watson
Messages: 8931
Registered: January 2010
Location: Global Village
Senior Member
People whose opinions i respect have contributed to this. But I do not agree. I try to forget all the naming covention stuff, and use OMF instead.
When OMF was first introduced, in 9.x, I thought "I'm a real DBA: I don't need this stuff". Then I stared thinking "Well, for low end systems where the client doesn't have a full time fully skilled DBA, OK, OMF is OK". Now, I use it everywhere I can. If you want to override the defaults for the initial file size, the max size, and te increment size, you can. You get sensible paths and names (or simalar tags on ASM). It makes all file management (including database duplication) so much easier.
You can't argue with this:
orclz>
orclz> create tablespace jwts datafile size 1g;

Tablespace created.

orclz>
Re: Need help in tablespace [message #635606 is a reply to message #635599] Thu, 02 April 2015 06:45 Go to previous messageGo to next message
EdStevens
Messages: 1376
Registered: September 2013
Senior Member
John Watson wrote on Thu, 02 April 2015 03:20
People whose opinions i respect have contributed to this. But I do not agree. I try to forget all the naming covention stuff, and use OMF instead.


Ah, but John, by using OMF, you are using a very rigorous naming standard. In this case the software fully automates that for you. Now if we could just get software to do the same for table names, column names, common nouns and abbreviations as part of table and column names .. etc.
Re: Need help in tablespace [message #635607 is a reply to message #635606] Thu, 02 April 2015 06:55 Go to previous messageGo to next message
gazzag
Messages: 1118
Registered: November 2010
Location: Bedwas, UK
Senior Member
Additionally, it needs to be set up by somebody who knows what they're doing to begin with.

[Edit: typo]

[Updated on: Thu, 02 April 2015 06:55]

Report message to a moderator

Re: Need help in tablespace [message #635640 is a reply to message #635607] Fri, 03 April 2015 20:00 Go to previous messageGo to next message
dark_prince
Messages: 121
Registered: June 2013
Location: India
Senior Member
I wanted to know on an average how many rows are going to stored in tablespace if its size is 1gb.
Re: Need help in tablespace [message #635641 is a reply to message #635640] Fri, 03 April 2015 21:37 Go to previous message
BlackSwan
Messages: 26766
Registered: January 2009
Location: SoCal
Senior Member
dark_prince wrote on Fri, 03 April 2015 18:00
I wanted to know on an average how many rows are going to stored in tablespace if its size is 1gb.


what is the average row length?
just do the simple math.
Previous Topic: explicit and implicit cursor loop
Next Topic: how to user regexp to put single quotes
Goto Forum:
  


Current Time: Fri Apr 26 01:59:57 CDT 2024