標籤:刪除資料表空間 add size cal base default 命令 contents export
#搜尋使用者select default_tablespace,username from dba_users where default_tablespace like ‘NEWYZ%‘;#搜尋串連的使用者sessionid
select username,sid,serial# from v$session where username = ‘NEWYZ‘;#強行中斷使用者串連session
alter system kill session‘495,2285‘;select saddr,sid,serial#,paddr,username,status from v$session where username is not null and username = ‘NEWHJ‘ and status = ‘INACTIVE‘
#刪除資料表空間及檔案drop tablespace newyz including contents and datafiles;#刪除資料表空間使用者
drop user newyz cascade; #建立資料表空間newyzcreate tablespace newyz datafile “D:\oracldata\newyz.dbf” size 32m autoextend on next 32m maxsize 2048m extent management local;#建立資料表空間使用者newyz密碼123456789 並將資料表空間newyz授權給使用者newyz
create user newyz identified by "123456789" default tablespace newyz temporary tablespace temp profile default quota unlimited on newyz;#授權給使用者newyz
grant create session, resource to newyz;grant EXPORT FULL DATABASE to newyz;grant connect to newyzgrant dba to newyz
#變更資料表空間test為讀(寫)許可權alter tablespace test read only;alter tablespace test read write; #修改密碼alter user sw identified by sw;
oracle常用命令