oracle 資料庫常用命令

2022-09-03 14:12:13 字數 820 閱讀 1046

oracle 資料庫常用命令

建立表空間

create tablespace  dwz_demo datafile 'd:\oracle\dwz_demo.dbf' size 10m autoextend on;

建立使用者

create user zhanggaosong identified by "zhanggaosong"  default tablespace dwz_demo;

給使用者設定許可權

grant connect,resource to zhanggaosong;

grant dba to zhanggaosong;

刪除使用者

drop user zhanggaosong cascade;

刪除表空間

drop tablespace dwz_demo including contents and datafiles;

匯出exp cqyiyan/cqyiyan@orcl  file=d:\1234567.dmp

exp 使用者名稱/密碼 @ 例項名 file=匯出檔案所放位置路徑

exp cqyiyan/cqyiyan@orcl tablespaces=cqyiyan_data file=d:\1234567.dmp

exp 使用者名稱/密碼 @ 例項名 tablespaces=匯出的例項名稱 file=匯出檔案所放位置路徑

匯入imp cqyiyan/cqyiyan@orcl file=d:\1234567.dmp full=y

imp 使用者名稱/密碼 @ 例項名 file=匯入檔案所在位置路徑

說明 : 匯入前需要建立與匯出時相同的表空間名

Oracle資料庫常用命令

export oracle sid db name 伺服器 啟動資料庫伺服器 lsnrctl start sqlplus as sysdba sql startup 資料庫 建立資料庫 oracle home bin dbca 或者 oracle home bin dbassist 連線資料庫 co...

Oracle資料庫常用命令

誤刪正在使用的表空間後處理辦法 1 connect sys as sysdba 用sys登陸資料庫 2 shutdown 解除安裝資料庫,關閉資料庫 3 startup mount 例程啟動 4 alter database open 開啟資料庫 5 alter database datafile ...

Oracle資料庫常用命令

1 主鍵和外來鍵 主鍵 關係型資料庫中的一條記錄中有若干個屬性,若其中的某乙個屬性組 注意是組,可以是乙個,也可以是多個 能唯一標識一條記錄,那麼該屬性組就是主鍵 外來鍵 關係型資料庫表中的一列或者某幾列的組合,它的值與另外一張表的某一列或者某幾列相匹配,且為另一張表的主鍵 即這張表的某一列或某幾列...