--mkusrexp.sql

set verify off;
--set feedback off;
set serveroutput on;


DECLARE
v_sql varchar2(200);
usu varchar2(20);
BEGIN

		usu := '&1';
		v_sql:= 'CREATE USER '||usu||' IDENTIFIED BY '||usu||
		' DEFAULT TABLESPACE USERS '||
		'TEMPORARY TABLESPACE TEMP2 '||
		'PROFILE DEFAULT';
		dbms_output.put_line(v_sql);
		EXECUTE IMMEDIATE v_sql;
		v_sql:= 'GRANT EXPLOTACION TO '||usu;
		dbms_output.put_line(v_sql);
		EXECUTE IMMEDIATE v_sql;
		v_sql:= 'AUDIT USER, SYSTEM GRANT BY '||usu||' BY ACCESS';
		dbms_output.put_line(v_sql);
		EXECUTE IMMEDIATE v_sql;

END;
/

exit

