Quote:
Originally posted by bazza
I'm feeling generous:
spool r1_create_users.sql
select 'create user '||username||
decode(password,'EXTERNAL',' identified externally',
' identified by values '||''''||password||'''')||
' default tablespace '||default_tablespace||
' temporary tablespace '||temporary_tablespace||';'
from sys.dba_users
where username NOT IN ('ADAMS', 'BLAKE', 'CLARK', 'JONES', 'SCOTT',
'ANONYMOUS','AURORA$JIS$UTILITY$','AURORA$ORB$UNAUTHENTICATED',
'CTXSYS', 'DBSNMP', 'LBACSYS', 'MDSYS', 'MTSSYS',
'ODM', 'ODM_MTR', 'OLAPSYS', 'ORDPLUGINS', 'ORDSYS',
'OSE$HTTP$ADMIN', 'OUTLN', 'OAS_PUBLIC',
'HR', 'OE', 'PM', 'QS', 'QS_ADM', 'QS_CB', 'QS_CBADM',
'QS_CS', 'QS_ES', 'QS_OS', 'QS_WS', 'SH',
'PERFSTAT', 'REPADMIN', 'RMAN',
'SYS', 'SYSTEM', 'TRACESVR', 'WEBSYS',
'WKPROXY', 'WKSYS', 'WMSYS', 'XDB')
order by username
/
spool off
The list of users you can edit as reuired, but its handy as it stops you getting the standard set of users etc.
just run the spool file against your new database and chocks away. Your users will still have their old passwords. You can use this script as a basis to do a similar thing with roles, and then grants.
Barry
Thanks Barry, you hit the bullseye!