--創建表空間
create tablespace TBS_OTHERS datafile 'G:\APP\ORCL\ORADATA\ORCL\TBS_OTHERS01.dbf' size 1000m;
-- 創建用戶
create user C##JHGL identified by jhgl default tablespace TBS_OTHERS
create user C##YJYJHGL identified by jhgl default tablespace TBS_OTHERS
create user C##WCJHGL identified by jhgl default tablespace TBS_OTHERS
grant dba,resource,connect to C##JHGL,C##YJYJHGL,C##WCJHGL
grant dba,connect to C##WCJHGL
-- Drop tablespace TBS_OTHERS;
drop user C##JHGL cascade;
drop user C##YJYJHGL cascade;
drop user C##WCJHG cascade;
--刪除session
--查詢session對應的sid,serial#
select saddr,sid,serial#,paddr,username,status from v$session where username is not null;
--kill session
alter system kill session 'sid,serial#' ;
導出命令 后創建
創建邏輯目錄,該命令不會在操作系統創建真正的目錄,最好以system等管理員創建。
create directory dpdata1 as 'd:\test\dump';
按用戶導
expdp scott/tiger@orcl schemas=scott dumpfile=expdp.dmp DIRECTORY=dpdata1;
還原數據
1)導到指定用戶下
impdp scott/tiger DIRECTORY=dpdata1 DUMPFILE=expdp.dmp SCHEMAS=scott;
impdp user/password directory=dpdir dumpfile=logontab.dmp table_exists_action=replace
logfile=implogontab.log
able_exists_action選項:{skip 是如果已存在表,則跳過并處理下一個對象;append是為表增加數據;truncate是截斷表,然后為其增加新數據;replace是刪除已存在表,重新建表并追加數據}
總結
以上是編程之家為你收集整理的oracle命令基本操作全部內容,希望文章能夠幫你解決oracle命令基本操作所遇到的程序開發問題。
如果覺得編程之家網站內容還不錯,歡迎將編程之家網站推薦給程序員好友。
本圖文內容來源于網友網絡收集整理提供,作為學習參考使用,版權屬于原作者。