BC remote Oracle DBA - Call (800) 766-1884  
Oracle Consulting Oracle Training Development

Remote DBA

Remote DBA Plans  

Remote DBA Service

Remote DBA RAC

   
Remote DBA Oracle Home
Remote DBA Oracle Training
Remote DBA SQL Tuning Consulting
Remote DBA Oracle Tuning Consulting
Remote DBA Data Warehouse Consulting
Remote DBA Oracle Project Management
Remote DBA Oracle Security Assessment
Remote DBA Unix Consulting
Burleson Books
Burleson Articles
Burleson Web Courses
Burleson Qualifications
Oracle Links
Remote DBA Oracle Monitoring
Remote DBA Support Benefits
Remote DBA Plans & Prices
Our Automation Strategy
What We Monitor
Oracle Apps Support
Print Our Brochure
Contact Us (e-mail)
Oracle Job Opportunities
Oracle Consulting Prices





   

 

 

 

Remote DBA services

Remote DBA Support

Remote DBA RAC

Remote DBA Reasons

Remote Oracle Tuning

Remote DBA Links

Oracle DBA Support

Oracle DBA Forum

Oracle Disaster

Oracle Training

Oracle Tuning

Oracle Training

 Remote DBA SQL Server

Remote MSSQL Consulting

Oracle DBA Hosting

Oracle License Negotiation

 

 


 

 

 

 

 
 

EnterpriseDB: GRANT SCHEMA

Oracle Tips by Burleson Consulting
 

You can grant CREATE, USAGE or ALL permissions to a user.  CREATE allows the user to create new objects in the schema, USAGE allows a user to "see" objects in the schema and ALL grants both CREATE and USAGE.

You can grant CREATE TO tom, USAGE to fred and ALL to bill on the schema "foo":

GRANT CREATE ON SCHEMA foo TO tom;
GRANT USAGE ON SCHEMA foo TO fred;
GRANT ALL ON SCHEMA foo TO bill;
REVOKE SCHEMA

You can also revoke those from the same users:

REVOKE CREATE ON SCHEMA foo FROM tom;
REVOKE USAGE ON SCHEMA foo FROM fred;
REVOKE ALL ON SCHEMA foo FROM bill;

DROP SCHEMA

You would drop a schema with the DROP SCHEMA command.  If the schema has objects, and you want to drop those objects, use the cascade keyword.

To drop the schema foo and drop all objects within the schema:

DROP SCHEMA foo CASCADE;

TABLESPACE

As discussed in Chapter 2, a tablespace is a way to physically separate database objects.  The pg_default and pg_global tablespaces are automatically created and if you do not specify a tablespace on create table commands, the pg_default tablespace is automatically used.  These tablespaces are created on ALL platforms.

* User defined tablespaces are not available on MS-Windows.  Tablespaces use symbolic links and only operating systems that support symbolic links can create tablespaces.  Linux and Solaris both support symbolic links and can create tablespaces.

CREATE TABLESPACE
CREATE TABLESPACE <tablespace name>
            [ OWNER username ]
            LOCATION 'directory'

We can create a tablespace named foo with a default location of /bar:

CREATE TABLESPACE foo LOCATION '/bar';
ALTER TABLESPACE
ALTER TABLESPACE name
            RENAME TO newname
            OWNER TO newowner

We can rename tablespace foo to foobar:

ALTER TABLESPACE foo
  RENAME TO foobar;



GRANT TABLESPACE

You can grant CREATE or ALL permissions to a user.  CREATE allows the user to create tables and indexes in the tablespace, ALL does the same.

You can grant CREATE TO tom on tablespace "foo":

GRANT CREATE ON TABLESPACE foo TO tom;
REVOKE TABLESPACE

You can also revoke create from tom:

REVOKE CREATE ON TABLESPACE foo FROM tom;
DROP TABLESPACE

You may drop a tablespace with the DROP TABLESPACE command. 

* You cannot drop a tablespace that contains objects.  You MUST drop those objects manually or DROP TABLESPACE will return an error.

You can drop the tablespace foo:

DROP TABLESPACE foo;




This is an excerpt from the book "EnterpriseDB: The Definitive Reference" by Rampant TechPress.


Expert Remote DBA

BC is America's oldest and largest Remote DBA Oracle support provider.  Get real Remote DBA experts, call
BC Remote DBA today.

 

 

Remote DBA Service
 

Oracle Tuning Book

 

Advance SQL Tuning Book 

BC Oracle support

Oracle books by Rampant

Oracle monitoring software

 

 

 

 

 

 

BC Remote Oracle Support

Remote DBA

Remote DBA Services

Copyright © 1996 -  2013 by Burleson. All rights reserved.

Oracle® is the registered trademark of Oracle Corporation.



Hit Counter