在進(jìn)行數(shù)據(jù)泵遷移時,通常是按照用戶進(jìn)行導(dǎo)入導(dǎo)出,因此需要確認(rèn)當(dāng)前數(shù)據(jù)庫中存在那些非系統(tǒng)用戶! 查看數(shù)據(jù)庫中用戶狀態(tài)為 OPEN 的用戶: select username,account_status,created,PROFILE from dba_users where account_status='OPEN' order by created; 通過上述sql查詢出的結(jié)果中,根據(jù) 查看數(shù)據(jù)庫中的角色: select * from dba_roles; 創(chuàng)建用戶 SQL: select 'create user ' || t.username || ' identified by values ' || chr(39) || u.password || chr(39) || ' default tablespace ' || t.default_tablespace || ' profile ' || p.name || ' Temporary TABLESPACE '|| TEMPORARY_TABLESPACE ||';' create_user_withoutpass from dba_users t, sys.user$ u, sys.profname$ p, sys.user_astatus_map m where t.user_id = u.user# and u.resource$ = p.profile# and u.astatus = m.status# and t. username in ('需要創(chuàng)建的用戶名,用逗號隔開'); 用戶授權(quán): select 'GRANT connect,resource,unlimited tablespace,DBA to ' ||username|| ';' from dba_users where username in ('需要創(chuàng)建的用戶名,用逗號隔開'); ?? 注意:如果是使用expdp,則不需要創(chuàng)建用戶和授權(quán)! 本次分享到此結(jié)束啦~ 如果覺得文章對你有幫助,點(diǎn)贊、收藏、關(guān)注、評論,一鍵四連支持,你的支持就是我創(chuàng)作最大的動力。 |
|