1. 程式人生 > >oracle中,建立資料表空間、使用者,為使用者賦許可權

oracle中,建立資料表空間、使用者,為使用者賦許可權

在cmd中輸入

sqlplus/nolog

使用者oracle超級管理員使用者登入

SQL>conn / as sysdba;

建立表空間(刪除表空間語句:drop tablespace test;)

SQL> create tablespace test
  2  datafile 'E:/app/test/oradata/orcl/test.dbf'
  3  size 1m autoextend on;
--查詢資料庫表空間
select distinct TABLESPACE_NAME from tabs;
--檢視你能管理的所有使用者
select * from all_users;
--刪除使用者
drop user test cascade;
建立使用者並指定表空間
create user test identified by test123
default tablespace test
--temporary tablespace rmdb_temp;
給使用者授予許可權
grant connect,resource,dba to test;

匯入資料

imp test/[email protected]/資料庫名稱 file=資料庫dmp檔案目錄 full=y