需要一个 sql 查询来克隆 Oracle 用户.作为来源,我拥有拥有所有必要权限的用户.我想知道是否可以在同一个数据库中创建相同的用户名但使用不同的用户名.
Have a need for a sql query which will do cloning of Oracle user. As source I have user which has all necessary privileges. I wonder if it is possible to create the same one, but with different username in the same database.
Briefly(来自 这里)
Briefly (from here)
select dbms_metadata.get_ddl('USER', '...') FROM DUAL;
SELECT DBMS_METADATA.GET_GRANTED_DDL('ROLE_GRANT','...') FROM DUAL;
SELECT DBMS_METADATA.GET_GRANTED_DDL('SYSTEM_GRANT','...') FROM DUAL;
SELECT DBMS_METADATA.GET_GRANTED_DDL('OBJECT_GRANT','...') FROM DUAL;
SELECT DBMS_METADATA.GET_granted_DDL('TABLESPACE_QUOTA', '...') FROM dual;
然后只需将用户名替换为您要创建的新用户名即可.
Then just replace the username with the new one you want to create.
这篇关于如何在 Oracle 中克隆用户的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!