(Oracle)
Prepare an Oracle database
We need to prepare an Oracle database development environment by creating a table space and user.
Procedure
- Create an Oracle database table space with the following steps:
- Create a table space.
CREATE TABLESPACE tablespace_name DATAFILE 'tablespace_name.dbf' SIZE 100M REUSE AUTOEXTEND ON NEXT 2M MAXSIZE UNLIMITED;For example, to create table space wcs_t:
CREATE TABLESPACE wcs_t DATAFILE 'wcs_t.dbf' SIZE 100M REUSE AUTOEXTEND ON NEXT 2M MAXSIZE UNLIMITED;
- Create a temporary table space.
CREATE TEMPORARY TABLESPACE temp_tablespace_name TEMPFILE 'temp_tablespace_name.dbf' SIZE 100M REUSE AUTOEXTEND ON NEXT 2M MAXSIZE UNLIMITED;For example, to create temporary table space wcs_temp_t:
CREATE TEMPORARY TABLESPACE wcs_temp_t TEMPFILE 'wcs_temp_t.dbf' SIZE 100M REUSE AUTOEXTEND ON NEXT 2M MAXSIZE UNLIMITED;
- Create a database user with the following steps:
- Create a database user.
CREATE USER user_name IDENTIFIED BY database_name DEFAULT TABLESPACE tablespace_name TEMPORARY TABLESPACE temp_tablespace_name QUOTA UNLIMITED ON tablespace_name;For example, to create database user wcs:
CREATE USER wcs IDENTIFIED BY wcs1 DEFAULT TABLESPACE wcs_t TEMPORARY TABLESPACE wcs_temp_t QUOTA UNLIMITED ON wcs_t;
- Grant authorities to the user with the following command:
GRANT CREATE MATERIALIZED VIEW, ALTER ANY TABLE, CREATE TABLE, UNLIMITED TABLESPACE, CREATE VIEW, DROP ANY SYNONYM, CREATE SYNONYM, DROP ANY INDEX, ALTER ANY INDEX, DELETE ANY TABLE, UPDATE ANY TABLE, INSERT ANY TABLE, DROP ANY TABLE, CREATE ANY TABLE, CREATE ANY SYNONYM, LOCK ANY TABLE, CREATE TRIGGER, CREATE ANY INDEX, SELECT ANY TABLE, CREATE SESSION, CREATE PROCEDURE, CREATE SEQUENCE, CREATE ANY VIEW to user_name;