Oracle 使用命令列建立新賬戶

暖楓無敵發表於2012-10-10

進入cmd:

--以sys賬戶進入

sqlplus sys/admin as sysdba;


--建立表空間
create temporary tablespace SMS_Temp
tempfile 'E:\oracle\product\10.2.0\oradata\orcl\SMS_Temp.dbf' size 20M
autoextend on;

create tablespace SMS_Data
datafile 'E:\oracle\product\10.2.0\oradata\orcl\SMS_Data.dbf' size 20M
autoextend on;

  
   ---建立使用者
CREATE USER SMS IDENTIFIED BY admin
DEFAULT TABLESPACE SMS_DATA
TEMPORARY TABLESPACE SMS_TEMP;

-- ROLES
GRANT "RESOURCE" TO SMS ;
GRANT "CONNECT" TO SMS ;
GRANT "DBA" TO SMS ;

-- SYSTEM PRIVILEGES

-- QUOTAS
ALTER USER SMS QUOTA UNLIMITED ON SMS_DATA;

-- USER SQL
ALTER USER SMS
DEFAULT TABLESPACE SMS_DATA
TEMPORARY TABLESPACE SMS_TEMP
ACCOUNT UNLOCK ;

-- ROLES
ALTER USER SMS DEFAULT ROLE "RESOURCE","CONNECT","DBA";

-- SYSTEM PRIVILEGES
REVOKE UNLIMITED TABLESPACE FROM SMS;

-- QUOTAS
ALTER USER SMS QUOTA UNLIMITED ON SMS_DATA;

 

相關文章