วันจันทร์ที่ 13 พฤษภาคม พ.ศ. 2556

Oracle : Create new user

1. Check all users.
Start SQLPlus
If u are administrator
type
sqlpus / as sysdba
for login as sysdba
your password is sys password
type
select * from all_users;
for check all users.

2. Create new Table Space for new user (Or use old one.)
create tablespace TableSapceName datafile '[path]'
size 32m autoextend on
next 32m maxsize 2048m extent management local;
your default path for Oracle 11g Express is
'c:\oraclexe\app\oracle\oradata\XE\TableSpaceName.dbf'
dbf file will create automatically

3. Create new user with default table space.
CREATE USER [Name] IDENTIFIED BY [pass]
DEFAULT TABLESPACE "TableSpaceName"
TEMPORARY TABLESPACE "TEMP";

4. Alter user to unlimited with this tablespace.
ALTER USER [username] QUOTA UNLIMITED ON [TablespaceName];
5. Grant user permission
GRANT create procedure, create session, create table,
create type, create view, create synonym, create trigger,
resource TO [username];

grant imp_full_database to [username];

ไม่มีความคิดเห็น: