Home > database >  expdp/impdp connection string
expdp/impdp connection string

Time:03-04

I am currently trying to copy a schema with the name in lowercase. So in order to connect via sqlplus I simply do:

sqlplus \"schema_name\"/schema_pass@localhost/DBRAZRAB

That works well.

Of course naively I tried the same approach for expdp/impdp, but that does not work this time:

[oracle@3e7716e807ed ~]$ expdp \"schema_name\"/schema_pass@localhost/DBRAZRAB schemas=\"schema_name\" <...>

Export: Release 19.0.0.0.0 - Production on Thu Mar 3 13:44:43 2022
Version 19.3.0.0.0

Copyright (c) 1982, 2019, Oracle and/or its affiliates.  All rights reserved.
Password: 

Could someone please give me a hint, what am I doing wrong? Which format should I use?

CodePudding user response:

Hmm. The documentation does mention that quotation marks can be an issue with calling expdp/impdp, and recommends using a PARFILE, but that doesn't help with the username issue.

As a workaround, you could run the export as SYSTEM (or similar user with DATAPUMP_EXP_FULL_DATABASE privilege):

sqlplus SYSTEM/pass@localhost/DBRAZRAB PARFILE=params.txt

with a parameter file like:

SCHEMAS="schema_name"
DUMPFILE=...etc...

CodePudding user response:

After an evening of a research I came up with the following:

Added a user with the privileges DATAPUMP_EXP_FULL_DATABASE, DATAPUMP_IMP_FULL_DATABASE;

Configured parfiles and applied them:

schema_exp.par:

SCHEMAS=\"schema_123\"
DUMPFILE=schema.dmp
DIRECTORY=schema_dir
LOGFILE=schema_exp.log
[oracle@3e7716e807ed ~]$ expdp expimp_user/expimp_pass@localhost/DBRAZRAB parfile=/schema_exp.par

schema_imp.par:

SCHEMAS=\"schema_123\"
DUMPFILE=schema.dmp
DIRECTORY=schema_dir
LOGFILE=schema_imp.log
REMAP_SCHEMA=\"schema_123\":SCHEMA_123
REMAP_TABLESPACE=\"schema_123\":SCHEMA_123
[oracle@3e7716e807ed ~]$ impdp expimp_user/expimp_pass@localhost/DBRAZRAB parfile=/schema_imp.par
  • Related