Oracle 學習筆記之SQLPLUS

說明:在使用此文檔命令前需要安裝Oracle數據庫

創建表空間語法

 

Creat[TEMPORARY] TABLESPACE tablespace_name TEMPFILE|DATAFILE ‘xx.dbf’ SIZE xx;

例如:

Create  tablespace  test1_tablespace  datafile ‘test1file.dbf’ size 10m;

Create  temporary  tablespace  temptest1_tablespace tempfile ‘tempfile1.dbf’ size 10m;

查看錶地址

Select  file_name from dba_data_files where tablespace = ‘TEST1_TABLESPACE’;

創建用戶語法格式

Create user <user_name> identified by <password> default tablespace <default tablespace> temporary  tablespace <temporary tablespace>;

注意:創建用戶時一定要把表空間加上,防止佔用系統默認空間導致宕機。

用戶授權

Grant 權限 to 用戶名

更改用戶密碼

Alter user 用戶名 identified by 新密碼

鎖定用戶

Alter user 用戶名 account lock;

刪除用戶

Drop user 用戶名 cascade;

//cascade 將用戶連同創建的東西一起刪除

創建用戶、角色

給角色授權

給用戶授權​​​​​​​(給用戶一角色)

撤銷用戶權利

刪除角色​​​​​​​

 

 

 

 

 

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章