• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 451
  • Last Modified:

Moving Users, grants, privileges

I have to move all users from the dev to QA environment in oracle database with all grants, privilege, login credentials. Is there a way to do this efficiently? Please Help!
0
mishradba
Asked:
mishradba
  • 2
1 Solution
 
OP_ZaharinCommented:
- the following is a simple script to be run on sqlplus which will generate a script that contain the creation of user, grant and roles:

SET ECHO OFF NEWPAGE 0 SPACE 0 PAGESIZE 0 FEEDBACK OFF HEADING OFF TRIMSPOOL ON;
SPOOL c:\temp\createuser.sql;
select dbms_metadata.get_ddl( 'USER', 'USERNAME' ) from dual
    UNION ALL
    select dbms_metadata.get_granted_ddl( 'SYSTEM_GRANT', 'USERNAME' ) from dual
    UNION ALL
    select dbms_metadata.get_granted_ddl( 'OBJECT_GRANT', 'USERNAME' ) from dual
    UNION ALL
    select dbms_metadata.get_granted_ddl( 'ROLE_GRANT', 'USERNAME' ) from dual;
    UNION ALL
    select dbms_metadata.get_granted_ddl( 'TABLESPACE_QUOTA', 'USERNAME' ) from dual;
    UNION ALL
    select dbms_metadata.get_granted_ddl( 'DEFAULT_ROLE', 'USERNAME' ) from dual;
SPOOL OFF;

0
 
OP_ZaharinCommented:
0
 
slightwv (䄆 Netminder) Commented:
mishradba,

Based on your previous question it appears that none of these solutions work for you.  Can you please explain where they fail to do what you are after?

You also mentioned the urgency of your request.  I suggest you contact Oracle Support to see what additional options are available to you.
0
 
mishradbaAuthor Commented:
I got the major idea with this solution
0

Featured Post

Transaction-level recovery for Oracle database

Veeam Explore for Oracle delivers low RTOs and RPOs with agentless transaction log backup and transaction-level recovery of Oracle databases. You can restore the database to a precise point in time, even to a specific transaction.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now