SQL>
SQL> create or replace procedure AlterUser (usernameIn in varchar2) is
2 begin
3 execute immediate ( 'alter user ' ||usernameIn|| ' default tablespace users');
4 end;
5 /
Procedure created.
SQL>
SQL> create or replace trigger SystemAlterUser
2 after create on database
3 declare
4 jobno number;
5 begin
6 if ora_dict_obj_type = 'USER' then
7 dbms_job.submit(job => jobno, what => 'alteruser('''||ora_dict_obj_name||''');');
8 end if;
9 end;
10 /
Trigger created.
SQL>
SQL>
SQL>
|