1.首先以sysdba的身份登錄oracle
conn /as sysdba
查詢用戶:
select username from dba_users;
查詢表空間
select username, default_tablespace from dba_users where username='用戶名‘;
查詢數據文件
select file_name, tablespace_name from dba_data_files;
2.然后就可以來創建用戶.
create user 用戶名 identified by 密碼;
3.修改用戶的密碼
alter user 用戶名 identified by 新密碼;
4.創建一個表空間
create tablespace 表空間名 datafile '空間物理存儲路徑(f:\ts_zzg\zzg_data.dbf后綴隨意)' size 大小(200M);
5.將表空間分配給用戶
alter user 用戶名 default tablespace 表空間名;
6.為用戶分配權限
grant create session,create table,create view,create sequence,unlimited tablespace to 用戶名;
grant all privileges to 用戶名;(全部權限)
7.查看所有用戶所在的表空間
select username,default_tablespace from dba_users;
8.查詢用戶所具有的權限
select *from session_privs;
9.刪除用戶及其相關對象
drop user 用戶名;
