We help IT Professionals succeed at work.

We've partnered with Certified Experts, Carl Webster and Richard Faulkner, to bring you a podcast all about Citrix Workspace, moving to the cloud, and analytics & intelligence. Episode 2 coming soon!Listen Now

x

how to allocate table space to schema

gudii9
gudii9 asked
on
Medium Priority
875 Views
Last Modified: 2013-12-18
Hi
I have Schema name XYZ. I need to  Allocate 14 GB Tablespace for XYZ_TBS. How can i achieve it. Any syntax, links, resources highly appreciated. Thanks in advance.
Comment
Watch Question

Database Developer & Administrator
CERTIFIED EXPERT
Most Valuable Expert 2011
Top Expert 2012
Commented:
you can't really allocate space to a schema per se

you can create a tablespace and then choose to only use it for one schema though.

Here's a simple example that creates a new tablespace with 2 datafiles,  one 10Gb and one 4Gb with rules to allow it to grow to 20Gb if needed.  This will use local extent management with system generated extent sizes.
CREATE TABLESPACE XYZ_TBS 
DATAFILE 
  '/your/path/your_file2.dbf' SIZE 4096M AUTOEXTEND ON NEXT 100M MAXSIZE 10240M,
  '/your/path/your_file1.dbf' SIZE 10240M AUTOEXTEND OFF
LOGGING
PERMANENT
EXTENT MANAGEMENT LOCAL AUTOALLOCATE
BLOCKSIZE 8K
SEGMENT SPACE MANAGEMENT AUTO
FLASHBACK ON;

Open in new window

Not the solution you were looking for? Getting a personalized solution is easy.

Ask the Experts
David VanZandtSr Software Engineer
CERTIFIED EXPERT

Commented:
Sean, other than personal preferance and assuming logical file systems, what reason for multiple datafiles?
Sean StuberDatabase Developer & Administrator
CERTIFIED EXPERT
Most Valuable Expert 2011
Top Expert 2012

Commented:
simply to illustrate how to use more than one and to show both autoextend on and off.

I couldn't create a single file that was auto on and auto off.

I figured it would be easy enough to extend to multiple files or reduce to just one if needed/desired.

My personal preference would be more like this...  
(start small and allocate as needed, unless I was "sure" I was going to immediately populate it to

CREATE TABLESPACE XYZ_TBS
DATAFILE
  '/my/path/my_xyz_tbs_file1.dbf' SIZE 100M AUTOEXTEND ON NEXT 100M MAXSIZE 14G
LOGGING
PERMANENT
EXTENT MANAGEMENT LOCAL AUTOALLOCATE
BLOCKSIZE 8K
SEGMENT SPACE MANAGEMENT AUTO
FLASHBACK ON;
Sean StuberDatabase Developer & Administrator
CERTIFIED EXPERT
Most Valuable Expert 2011
Top Expert 2012

Commented:
or "really"  what my preference would be is...

create tablespace xyz_tbs;


and let omf do the rest  :)
Commented:
alter user xyz quota unlimited on XYZ_TBS;
or

alter user xyz quota 14G on XYZ_TBS;
David VanZandtSr Software Engineer
CERTIFIED EXPERT
Commented:
I guess at 14 Gb I'd be looking at BIGFILE.  No "big" deal.
Sean StuberDatabase Developer & Administrator
CERTIFIED EXPERT
Most Valuable Expert 2011
Top Expert 2012
Commented:
really? 14Gb is a "bigfile"?


on Fayyaz's post, maybe quota is what the author was asking,  that is "sort of" allocating space to a schema,
It doesn't restrict it though if that was the goal as user abc could also be granted a 14Gb or unlimited quota on XYZ_TBS

I say "sort of" because a quota doesn't actually allocate any space.  A 14Gb quota on a 100 Mb file is not 14Gb of space, it's still only 100Mb and even then only
if no other schema happens to use any of it.
David VanZandtSr Software Engineer
CERTIFIED EXPERT

Commented:
Hey, I'm working to re-educate some DBAs here that it's no longer necessary to use 4Gb max file sizes....

Author

Commented:
Thank you very much. I appreciate your help
Access more of Experts Exchange with a free account
Thanks for using Experts Exchange.

Create a free account to continue.

Limited access with a free account allows you to:

  • View three pieces of content (articles, solutions, posts, and videos)
  • Ask the experts questions (counted toward content limit)
  • Customize your dashboard and profile

*This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

OR

Please enter a first name

Please enter a last name

8+ characters (letters, numbers, and a symbol)

By clicking, you agree to the Terms of Use and Privacy Policy.