##  DBA Command Post - create_user.sql


accept usr prompt 'New User               : '
accept pwd prompt 'Password  [Externally] : '
accept ts  prompt 'Default Tspace [Users] : '
accept tmp prompt 'Temp Tspace     [Temp] : '
accept prf prompt 'User Profile        [] : '

set term off
set veri off

col pwd  new_value pwd
col ts   new_value ts   
col tmp  new_value tmp 
col prf  new_value prf   

select decode('&pwd','','EXTERNALLY','BY &pwd') pwd,
       decode('&ts','','USERS','&ts') ts,
       decode('&tmp','','TEMP','&tmp') tmp,
       decode('&prf','',' ','profile &prf') prf
from   dual 
/
set term on
set feed on

create user &usr
identified  &pwd
default tablespace &ts
quota unlimited on &ts
temporary tablespace &tmp
quota unlimited on &tmp &prf
/
grant connect to &usr
	