Oracle 11g expdp or impdp DDL without compression - oracle

I'm trying to export some schemas DDL (no need for data) using expdp on Oracle 11.2.0.3.0. I need to try and find a way of either exporting these without compression enabled or importing ignoring the compression.
I understand you can remove compression on the import using the TRANSFORM param on 12 but I can't find anything similiar for 11.
export:
expdp /#schema_name DIRECTORY=DMP_FILES DUMPFILE=schema_name.dmp CONTENT=METADATA_ONLY exclude=STATISTICS log=schema_name.log;
import:
impdp /#schema_name DIRECTORY=DMP_FILES DUMPFILE=schema_name.dmp log=schema_name.log;

Looks like the only way in 11g was to use the sqlfile param as part of impdp to turn the existing dmp files into DDL files. I then ran these through SQLplus on the server.

Related

Import Oracle DUMP file in oracle instance 19c

I have an oracle .dmp file and I do not know any other information about that, I want to import this dump file to my oracle 19c database.
When I use the imdb command like this:
impdp DIRECTORY=E:\Oracle19c\db_home\admin\sample\bdump DUMPFILE=tf20200325.dmp
I get these errors:
Connected to: Oracle Database 19c Enterprise Edition Release 19.0.0.0.0 - Production
ORA-39002: invalid operation
ORA-39070: Unable to open the log file.
ORA-39087: directory name E:\ORACLE19C\DB_HOME\ADMIN\SAMPLE\BDUMP is invalid
When I use the imp command like this:
imp file=E:\Oracle19c\db_home\admin\sample\bdump\tf20200325.dmp full=y;
I get these errors:
IMP-00038: Could not convert to environment character set's handle
IMP-00000: Import terminated unsuccessfully
I tried after searching on the web, but not found any solution to help me.
notable: I am not creating any databases, I only create a user with all privileges.
The directory you specify is the name of a database directory object, not the actual directory. So, connect to your db as SYS, and do
create directory xyz as 'E:\Oracle19c\db_home\admin\sample\bdump\';
grant all on directory xyz to (put your user name);
and then you can use it like this:
impdp directory=xyz .....

How to restore database with impdp

I have Oracle 12c database and I execute expdp command to create dump file. Later I want to be able to restore database using this dump file, on the same location as where the dump was created from. I don't want to stop database, which is required to drop schema (or execute any 'shutdown immediate', which is required for doing the same with flashbacks).
If I execute impdp with remap_schema=myschema:myschema, I get many errors. When I try it with table_exists_action=replace, I also get errors (ORA numbers: 31684, 39111, 39083, 31085, 39325, 31061, 06512, 29329).
How can I restore database in the same location? Thanks!

How do I export a 12c schema dump?

I have successfully imported an 11g dump into my local 12c installation like this:
-- CREATE DATA_DUMP_DIR and give priviledges to SYSTEM
CREATE DIRECTORY main_data_pump_dir as 'C:\ade\aime_v\oracle\admin\seeddata\dpdump';
GRANT READ, WRITE ON DIRECTORY main_data_pump_dir TO SYSTEM;
impdp system/Oracle_1#pdborcl directory=main_data_pump_dir dumpfile=myshema.dmp nologfile=Y
Now I am trying to export like this:
expdp myschema dumpfile=main_data_pump_dir:myschema.dmp reuse_dumpfiles=y nologfile=Y
or maybe this:
expdp myschema#pdborcl dumpfile=main_data_pump_dir:myschema.dmp reuse_dumpfiles=y nologfile=Y
But I can't seem to get it working.
Do I need to grant write to myschema?
This ended up working for me:
expdp System/Oracle_1#pdborcl schemas=myschema dumpfile=main_data_pump_dir:myschema.dmp nologfile=yes reuse_dumpfiles=yes

Importing Oracle dmp file into AWS RDS

We're trying to import a dmp file that is on our local machine onto an external database on AWS RDS. We have tried using the Toad GUI tool and get the error:
IMP-00038: Could not convert to environment character set's handle
The dmp file is encoded with ANSI encoding which I'm assuming is what Toad should be expecting.
From what we have read we need to use imp rather than impdp (PL/SQL developer import dump) since we have the file locally.
There doesn't seem to be an option on Oracle SQL Develop to import from a dmp file.
We have tried using IMPDP with the command:
IMPDP usr/pass#connection directory='our_local_dir' dumpfile='file.dmp' logfile='log.txt'
We got the error:
UDI-00014: invalid value for parameter, 'directory'
I'm just looking for any advice on how to import this dmp file and which tools we need to use.

How can I export Oracle schema from my local machine to Remote using expdp and impdp command

I want to take the back up of my local Oracle instance and want it to import on my remote server.
I have searched the web but couldn't find any solution. The solution I got is:
Export from local and import into only local.
Export from Remote and import into only remote server.
But my requirement is:
I have a schema in my local oracle instance. Now I want to take it's backup and import it on to my remote server.
Below are commands I am running for exporting and importing.
for Local--
expdp HR/HR#ORCL directory=Export SCHEMAS=MUKESH DUMPFILE=MUKESH.dmp LOGFILE=MUKESH.log
impdp HR/HR#ORCL directory=Export SCHEMAS=MUKESH DUMPFILE=MUKESH.dmp LOGFILE=MUKESH.log
for Remote--
expdp FASTAdmin/password#db-m3-medium.coplvukvijdo.us-east-1.rds.amazonaws.com:1521/ORCL network_link=to_rds directory=Data_pump_dir dumpfile=MUKESH.dmp logfile=MUKESH.log SCHEMAS='MUKESH'
impdp FASTAdmin/password#db-m3-medium.coplvukvijdo.us-east-1.rds.amazonaws.com:1521/ORCL directory=DATA_PUMP_DIR dumpfile=MUKESH.dmp logfile=MUKESH.log SCHEMAS=MUKESH
Note:Please give me the solution using expdp and impdp command only.
Three simple steps:
EXPDP on your local to generate the dump file.
Move the dump file to the remote server and place it in the required directory, by default from 10g and up you could use DATA_PUMP_DIR
EXPDP on the remote server using the dump file you placed in step 2.
In step 2, if you don't know the directory, you could do:
SELECT directory_path FROM dba_directories WHERE directory_name = 'DATA_PUMP_DIR';
See an example here.

Resources