linux system to create Oracle table space and user

Create a table space and user

Switching oracle user

su - oracle

Connect to the database

sqlplus /nolog

Here Insert Picture Description

conn /as sysdba

Here Insert Picture Description
Create a temporary table space, temporary table space name and path can specify your own

create temporary tablespace MES_TEMP tempfile '${ORACLE_HOME}\oradata\MES_TEMP.bdf' size 100m reuse autoextend on next 20m maxsize unlimited;  

Here Insert Picture Description
Create a table space and table space path names can specify your own

create tablespace MES datafile '${ORACLE_HOME}\oradata\MES.dbf' size 100M reuse autoextend on next 40M maxsize unlimited default storage(initial 128k next 128k minextents 2 maxextents unlimited);  

Here Insert Picture Description
Create a user and specify the table space

create user mes identified by mes default tablespace MES temporary tablespace MES_TEMP; 

Or use the default table space

create user mes identified by mes

Here Insert Picture Description
To authorized users

grant dba to mes;  
grant connect,resource to mes;  
grant select any table to mes;  
grant delete any table to mes;  
grant update any table to mes;  
grant insert any table to mes; 

Here Insert Picture Description

The user is created, users can use the new test connection

Delete the temporary table space

Queries temporary table space file

select name from v$tempfile;

Here Insert Picture Description
Delete the temporary table space file

drop tablespace MES_TEMP including contents and datafiles;

Here Insert Picture Description

Re-query the temporary table space file

select name from v$tempfile;

Here Insert Picture Description
Table space delete temporary success,

Delete table space

Query table space file

select name from v$datafile;

Here Insert Picture Description
Stop the use of table space

alter tablespace MES offline;

Here Insert Picture Description

Delete the table space file

drop tablespace MES including contents and datafiles;

Here Insert Picture Description

Re lookup table space file

select name from v$datafile;

Here Insert Picture Description
Table space deleted successfully

delete users

drop user mes cascade;

Here Insert Picture Description

Published 11 original articles · won praise 0 · Views 134

Guess you like

Origin blog.csdn.net/u012590718/article/details/104951918