first, create a table space
1. Set the instance name
Echo $ORACLE _sid
Export Oracle_sid=mvbpbang
2, sqlplus login/sqlplus Command Login
When you install Oracle, you need to remember the set global database name (default = ORCL) and password when you log in two ways:
User name: sys (superuser ==SYSDBA)/System (Admin user and Sys think differently than the system cannot create tablespace) ...
Password: Sqlplus/as sysdba;
3. Create temporary tablespace/tablespace/create User/authorization
1: Create a temporary tablespace temporary tablespace user_temp tempfile ' Q:\oracle\product\10.2.0\oradata\Test\xyrj_ TEMP.DBF ' size 50m autoextend on next 50m maxsize 20480m extent management local; 2: Creating a data table space create tablespace user_data datafile ' Q:\oracle\product\10.2.0\oradata\Test\ XYRJ_DATA.DBF ' size 50m autoextend on next 50m maxsize Unlimited extent management Local
segment Space management auto; 3rd Step: Create a user and specify the tablespace created by the username identified by password default tablespace user_data Temporary Tablespace user_temp; 4th step: Grant CONNECT,RESOURCE,DBA to username the user permission ;
Second, delete user and table space
Delete User
Drop Userxxcascade
Note: Delete the user, just delete the schema objects under the user, will not delete the corresponding tablespace.
Delete tablespace
drop tablespace tablespace_name including contents and datafiles ;
SQL Code
--Delete empty tablespace, but no physical file
Drop Tablespace tablespace_name;
--Delete non-empty table spaces, but not physical files
drop tablespace tablespace_name including contents;
--Delete empty table space, including physical files
Drop tablespace tablespace_name including datafiles;
--Delete a non-empty tablespace containing physical files
drop tablespace tablespace_name including contents and datafiles;
--Add Cascade CONSTRAINTS if the table in the other tablespace is associated with a field of a table in this table space with a constraint such as a foreign key.
drop tablespace tablespace_name including contents and datafiles cascade constraints;
---reproduced---
Http://www.cnblogs.com/xmaomao/p/3273102.html
Oracle creates table spaces and users