1、創建表空間
create tablespace test1_tablespace datafile 'test1file.dbf' size 10m;

2、創建臨時表空間
create temporary tablespace temptest1_tablespace tempfile 'tempfile1.dbf' size 10m;

3、查看創建的表空間的位置
select file_name from dba_data_files where tablespace_name='TEST1_TABLESPACE';

4、查看創建的臨時表空間的位置
select file_name from dba_temp_files where tablespace_name='TEMPTEST1_TABLESPACE';

5、創建用戶
create user wyl identified by 123456 default tablespace test1_tablespace temporary tablespace temptest1_tablespace;

6、查看用戶
select username from dba_users;

7、授予用戶連接數據庫的權限
grant connect to wyl;

8、連接到用戶wyl

9、更改密碼
alter user wyl identified by 123;

10、連接到用戶wyl

11、若希望用戶不能登錄,但又不想刪除它,可將用戶鎖住
①conn sys/orcl as sysdba
②alter user wyl account lock;

12、刪除用戶(加上cascade則將用戶連同其創建的東西全部刪除)

