/* divided into four steps */
/* Step 1th: Create a temporary tablespace */
Create temporary tablespace emaoyi_temp
Tempfile ' D:\app\Administrator\product\11.2.0\dbhome_1\database\emaoyi_temp.dbf '
Size 10m
Autoextend on
Next 10m maxsize 20480m
Extent management Local;
/* Step 2nd: Create a data table space */
Create Tablespace Emaoyi
Logging
DataFile ' D:\app\Administrator\product\11.2.0\dbhome_1\database\emaoyi.dbf '
Size 10m
Autoextend on
Next 10m maxsize 20480m
Extent management Local;
/* 3rd step: Create user and specify Tablespace */
Create user Emaoyi identified by Emaoyi
Default Tablespace Emaoyi
Temporary tablespace emaoyi_temp;
/* Step 4th: Grant permissions to users */
Grant CONNECT,RESOURCE,DBA to Emaoyi;
--Query the current table space
Select Tablespace_name,file_id,file_name,bytes
From Dba_data_files
ORDER BY file_id
where Tablespace_name= ' Emaoyi '
--Delete Table space
Drop tablespace em;
--Delete User
Drop user E [CASCADE];
oracle11g script Create tablespace and user