close

------------------------------------------------------------------
-- Backup Oracle User Account With Password
-- Applied Version: Oracle 9i and up
------------------------------------------------------------------

set long 9999999 trimspool on trimout on
spool c:\user_account_backup.txt

select trim(dbms_metadata.get_ddl('USER', username)) || '/'  as usercreate
from dba_users;

spool off

[Reference]
http://www.oraclealchemist.com/news/trick-1-copying-users-the-right-way/



------------------------------------------------------------------
-- Backup Oracle User Account With Password
-- Applied Version: Oracle 8i
------------------------------------------------------------------

set long 9999999 trimspool on trimout on
spool c:\user_account_backup.txt

select 'create user '||username||' identified by values ''' ||password||''''||
' default tablespace '||default_tablespace||' temporary tablespace '||temporary_tablespace ||';' as create_user
from dba_users
/
spool off


 

arrow
arrow
    全站熱搜
    創作者介紹
    創作者 DanBrother 的頭像
    DanBrother

    DanBrother的部落格

    DanBrother 發表在 痞客邦 留言(0) 人氣()