Sunday, 14 April 2013

Oracle Handy script: copy schemas

select 'CREATE USER '|| username||' IDENTIFIED by '||username ||' DEFAULT TABLESPACE TBS_1 TEMPORARY TABLESPACE TEMPTS1 PROFILE DEFAULT  ACCOUNT UNLOCK;',
  ' GRANT CONNECT TO '|| username||';',
  ' GRANT RESOURCE TO '|| username||';',
  ' GRANT UNLIMITED TABLESPACE TO '|| username||';',
  ' GRANT ALTER SESSION TO '|| username||';',
  ' GRANT CREATE SESSION TO '|| username||';',
' imp system/sys file=/oradata/AEMEDB/AEMEDB_FULL_14042013.dmp  fromuser='|| username||' touser='|| username||';'
 from dba_users
 order by created desc;




No comments:

Post a Comment

Number of Visitors