davis987 发表于 2015-1-13 13:57:45

oracle 12c的impdp使用方法

在oracle 12c中,我创建CDB名为RC12C,即ORACLE_SID=RC12C,两个PDB为:OCBI1,OCBI2
我想用impdp直接把另一数据库scott用户通过dblink导入到其中一个PDB当中,在操作进出现下面的问题

当使用CDB为SID时
# export ORACLE_SID=RC12C
# impdp system/Oracle2015 network_link=link_5195 schemas=scott directory=exp_dir

提示在CDB中不能创建新用户,原因为:
$ oerr ora 65096
65096, 00000, "invalid common user or role name"
// *Cause:  An attempt was made to create a common user or role with a name
//          that was not valid for common users or roles.  In addition to
//          the usual rules for user and role names, common user and role
//          names must start with C## or c## and consist only of ASCII
//          characters.
// *Action: Specify a valid common user or role name.

但当使用PDB为SID时

显然这样的设置不正确

请问如何通过impdp把其它数据库的数据导入到PDB数据当中呢?
谢谢

Liu Maclean(刘相兵 发表于 2015-1-13 14:03:26

使用service_name

FYI

1. Add newpdb to  tnsnames.ora ?
2. connect to pluggable database create a directory.
sqlplus sys/<password>@newpdb as sysdba

create or replace directory exp_dir as '/u01/app';
grant read, write on directory exp_dir to scott;

3. export emp table of scott user.  -- with sys user

expdp directory=exp_dir dumpfile=TDUMP.DMP TABLES='SCOTT'.'EMP'

username: sys@newpdb as sysdba
password: <password>

Regards
Mahir M. Quluzade

https://community.oracle.com/thread/2606970
页: [1]
查看完整版本: oracle 12c的impdp使用方法