简体   繁体   English

是否可以在Oracle 11g中的我们的架构中复制整个HR架构?

[英]Is it possible to copy entire HR schema in our schema in Oracle 11g?

I am unable to unlock HR schema no matter what. 无论如何,我都无法解锁HR模式。 Now I am thinking that is it possible to copy all tables from HR into different schema some how? 现在我在想,是否有可能将所有表从HR复制到不同的架构中? I need to access tables from HR schema for testing purposes. 我需要从HR模式访问表以进行测试。

You can use datapump to export the schema and import it into another schema. 您可以使用datapump导出架构并将其导入另一个架构。 However if you don't have access to "unlock" HR, you may not have privileges to do this. 但是,如果您无权访问“解锁” HR,则可能没有权限执行此操作。 Your DBA can create the test schema or give you permissions to HR. 您的DBA可以创建测试架构或向您授予HR权限。 Remapping the tablespace is optional. 重新映射表空间是可选的。

sql> create or replace directory EXPDIR as 'c:\data';
sql> grant read, write on directory EXPDIR to user;

c:\> expdp user/psw schemas=HR directory=EXPDIR dumpfile=HR.dmp  logfile=expdpHR.log

c:\>impdp user/psw schemas=HR remap_schema=HR:HRTST remap_tablespace=HRTS:HRTSTTS directory=EXPDIR dumpfile=HR.dmp logfile=impdpHRTST.log

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM