How to create a new Oracle scheme step by step

In order to be able to make all the steps you must initiate the session in the database with a user with administration permissions, you can use the SYSTEM user, for example

  • Creation of tablespace for data, and another one for index.

These tablespaces are the location where Oracle will save the objects of the scheme which we are going to create.

Tablespace for data, with initial size of 1024 Mb, and autoextensive

CREATE TABLESPACE "APPDAT" LOGGING DATAFILE '/export/home/oracle/oradata/datafiles/APPDAT.dbf' SIZE 1024M EXTENT MANAGEMENT LOCAL SEGMENT SPACE MANAGEMENT AUTO

  • Tablespace for indices, with initial size of 512 Mb, and autoextensive

CREATE TABLESPACE "APPIDX" LOGGING DATAFILE '/export/home/oracle/oradata/datafiles/APPIDX.dbf' SIZE 512M EXTENT MANAGEMENT LOCAL SEGMENT SPACE MANAGEMENT AUTO

  • Creation of the user who is going to work on these tablespaces, and who will be the owner of the objects that are created in them

CREATE USER “APP” PROFILE “DEFAULT” IDENTIFIED BY “APPPWD”

DEFAULT TABLESPACE “APPDAT” TEMPORARY TABLESPACE “TEMP” ACCOUNT UNLOCK;

  • Assign the permissions necessary to work.

    “Connect” and “Resource” rolls provide minimum permissions

GRANT “CONNECT” TO “APP”;

GRANT “RESOURCE” TO “APP”;

We can complete the allocation of permissions with specific privileges on objects to assure that user can conduct all the operations he needs.

GRANT ALTER ANY INDEX TO “APP”;

GRANT ALTER ANY SEQUENCE TO “APP”;

GRANT ALTER ANY TABLE TO “APP”;

GRANT ALTER ANY TRIGGER TO “APP”;

GRANT CREATE ANY INDEX TO “APP”;

GRANT CREATE ANY SEQUENCE TO “APP”;

GRANT CREATE ANY SYNONYM TO “APP”;

GRANT CREATE ANY TABLE TO “APP”;

GRANT CREATE ANY TRIGGER TO “APP”;

GRANT CREATE ANY VIEW TO “APP”;

GRANT CREATE PROCEDURE TO “APP”;

GRANT CREATE PUBLIC SYNONYM TO “APP”;

GRANT CREATE TRIGGER TO “APP”;

GRANT CREATE VIEW TO “APP”;

GRANT DELETE ANY TABLE TO “APP”;

GRANT DROP ANY INDEX TO “APP”;

GRANT DROP ANY SEQUENCE TO “APP”;

GRANT DROP ANY TABLE TO “APP”;

GRANT DROP ANY TRIGGER TO “APP”;

GRANT DROP ANY VIEW TO “APP”;

GRANT INSERT ANY TABLE TO “APP”;

GRANT QUERY REWRITE TO “APP”;

GRANT SELECT ANY TABLE TO “APP”;

GRANT UNLIMITED TABLESPACE TO “APP”;

Now this user can connect and start working on his scheme

 

Well, if you are looking

Well, if you are looking forward to create a new Oracle theme, there are certain aspects that you need to take into account and initiating the session in database is the first and foremost thing to do. Of course, the user should have complete administrative privileges. I personally use the USER as it has complete administrative permissions. However, when you perform the step by step instructions given here, make sure you assign all the permissions accordingly! business continuity planning software