Skip to Main Content

Oracle Database Discussions

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Create a new tablespace &datafiles

Dr.AntySep 25 2015 — edited Sep 29 2015

Hello Experts,

I have created a new database, with a new Schema. "KNB", below the command of create the new user.

I make the default tablesapce  is USERS, i mentioned the the USERS TABLESPACE statement.

As you know the DB will create with (SYSAUX,SYSTEM,TEMP,UNDO,USERS)

I will create tow  tablespaces, one for billing and one for normal CRM.

my questions as follows:

1) Regarding tablespace USERS, will keep it the size of data file as default size as below or needs to alter the size? need your advice plz.

CREATE TABLESPACE USERS DATAFILE

  '/data/KNB/users01.dbf' SIZE 5M AUTOEXTEND ON NEXT 1280K MAXSIZE UNLIMITED


2) will create as I mentioned 2 tbs, shall i create each tabs on specific disk, or both on one disk.

How many data files will created for each tbs?

the size for each data files?


3) in case when create a new table if will not assign to specifi tbs (CREATE TABLE my_team TABLESPACE my_space)

the table will created on USERS tbs by default? 

CREATE USER KNB

  IDENTIFIED BY <password>

  DEFAULT TABLESPACE USERS

  TEMPORARY TABLESPACE TEMP

  PROFILE DEFAULT

  ACCOUNT UNLOCK;

  -- 3 Roles for KNB

  GRANT CONNECT TO KNB;

  GRANT DBA TO KNB;

  GRANT RESOURCE TO KNB;

  ALTER USER KNB DEFAULT ROLE ALL;

  -- 1 System Privilege for KNB

  GRANT UNLIMITED TABLESPACE TO KNB;

  -- 1 Tablespace Quota for KNB

  ALTER USER KNB QUOTA UNLIMITED ON USERS;

CREATE TABLESPACE USERS DATAFILE

  '/data/KNB/users01.dbf' SIZE 5M AUTOEXTEND ON NEXT 1280K MAXSIZE UNLIMITED

regards,

Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Oct 27 2015
Added on Sep 25 2015
21 comments
2,805 views