Oracle 基本(1)

備份數據庫
exp tpemr/tpemr@//192.168.1.238/tpemr file=e:/tpemr_%date%.dmp
exp tpemr_qx2010/tpemr@//192.168.1.111/tpemr file=e:/tpemr_qx2010.dmp
exp tpemr_tx/tpemr@//192.168.1.206/tpemr file=e:/tpemr_tx.dmp
刪除表空間
drop tablespace TSP_TPEMR including contents and datafiles
增加表空間容量
alter tablespace TSP_TPEMR add datafile 'd:\tpemr_2010_5.dbf' size 1G
表增加一個字段
--EMR_PAT_DIAG表中添加的字段
alter table EMR_PAT_DIAG add Remarks VARCHAR2(200);
-- Add comments to the columns
comment on column EMR_PAT_DIAG.Remarks is '診斷備註';
--查看oracle中當前連接用戶
select * from v$session where username='TPEMR_2010'
--結束當前連接用戶的進程
alter system kill session 'sid,serial#';
--創建用戶並指定表空間
create user tpemr_2010 identified by tpemr
default tablespace TSP_TPEMR_2010;
--更改用戶默認表空間
ALTER user tpemr_2010 default tablespace TSP_TPEMR_2010;
--給用戶授予權限
grant connect,resource,dba to tpemr_2010;
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章