對於Oracle使用者建立過程,估計大家在熟悉不過了,無論是自己練習玩,還是工作用,都免不了做這步,有的人已經熟練的記住了,有的人還是喜歡複製粘貼,把建立使用者的指令碼存在記事本裡,直接拿來用。但是這種指令碼太簡單,所以最容易被弄丟了。
關鍵時刻找不到,又沒記住。煩了吧!所以最好記住,忘了就看看這裡!
第一步:建立資料表空間
create tablespace ICB datafile 'D:\oracle\product\10.2.0\oradata\icb\icb.dbf' size 2048M
autoextend on next 256M maxsize unlimited logging extent management local autoallocate segment space management auto;
alter tablespace ICB add datafile 'D:\oracle\product\10.2.0\oradata\icb\icb01.dbf' size 2048M autoextend on next 256M;
注意:“maxsize unlimited logging extent management local autoallocate segment space management auto” 這段可以根據需要可不加;
“alter tablespace ICB add datafile 'D:\oracle\product\10.2.0\oradata\icb\icb01.dbf' size 2048M autoextend on next 256M" 不需要可不加。
第二步:建立使用者
create user test
identified by "test"
default tablespace ICB
temporary tablespace TEMP
profile DEFAULT
quota unlimited on system
quota unlimited on test
quota unlimited on users;
第三步:授權
-- Grant/Revoke role privileges
grant connect to test with admin option;
grant resource to test with admin option;
-- Grant/Revoke system privileges
grant create any table to test;
grant create any view to test;
grant create table to test with admin option;
grant select any table to test;
grant unlimited tablespace to test with admin option;
注意:許可權根據需要自己來設定。
最後:就是退出
exit;
總結:oracle使用者的建立一共就三個步驟,
1)建立資料表空間(如果資料表空間已存在,則可以不做這步)
2)建立使用者
3)授權
參考閱讀:
Oracle教程:使用者管理的備份
Oracle基礎教程之通過RMAN複製資料庫
RMAN備份策略制定參考內容
RMAN備份學習筆記
OracleDatabase Backup加密 RMAN加密