I want to import a dmp file I have it in this path:
C:\Users\ASUS\Desktop\pr\projects\db\test.dmp
I created a directory like this :
SQL> create directory testdir as 'C:\Users\ASUS\Desktop\pr\projects\db';
Directory created.
SQL> grant read, write on directory testdir to c##stage;
Grant succeeded.
When I run the following command
impdp c##stage/stage SCHEMAS=stage DIRECTORY=testdir DUMPFILE=test.DMP EXCLUDE=CONSTRAINT,REF_CONSTRAINT,INDEX TABLE_EXISTS_ACTION=REPLACE nologfile=y
I got this errors
Copyright (c) 1982, 2019, Oracle and/or its affiliates. All rights reserved.
Connected to: Oracle Database 19c Enterprise Edition Release 19.0.0.0.0 - Production
ORA-39001: invalid argument value
ORA-39000: bad dump file specification
ORA-31640: unable to open dump file "C:\Users\ASUS\Desktop\pr\projects\db\test.DMP" for read
ORA-27041: unable to open file
OSD-04002: ouverture impossible du fichier
O/S-Error: (OS 5) Acc┐refus┐
notes:
I don't know if the exporter used exp or expdp to export file.
What is the c##?
Try narrowing it down by setting
CONTENT=DATA_ONLY
If you are doing content=data_only, then all of the metadata is excluded by default so you don't need any of these:
EXCLUDE=REF_CONSTRAINT
EXCLUDE=CONSTRAINT
Related
my customer has provided a dmp file (10 GO), and i tried the following:
Create a user:
create user USERNAME identified by PASSWORD;
Grant read write access
Import the dump file(using imp and impdp)
impdp or imp system/password#db dumpfile=EXPDAT.DMP FULL=Y logfile=dice.log
and here's the error message:
Import: Release 18.0.0.0.0 - Production on Tue Feb 23 11:46:07 2021
Version 18.4.0.0.0
Copyright (c) 1982, 2019, Oracle and/or its affiliates. All rights reserved.
Connected to: Oracle Database 18c Express Edition Release 18.0.0.0.0 - Production
ORA-39002: invalid operation
ORA-39059: dump file set is incomplete
ORA-39246: cannot locate master table within provided dump files
Can anyone help on that?
First, imp and impdp are not interchangeable; they have different file formats and options. You need to know exactly which was used to create the file you have.
Second, assuming the file was created with expdp (aka datapump, the more modern choice) and you should be using impdp to load it, the error indicates that there's a problem with the datafile itself.
ORA-39246 cannot locate master table within provided dump files
Cause: Check the export log file and make sure all of the files that
were exported are included in the current job.
Action: A Data Pump IMPORT or SQL_FILE operation was being performed
but not all of the files from the Data Pump export dump file set were
included. In particular, the dump file containing the export job's
master table was not provided.
It seems likely that your customer has not provided you with the complete data dump and you should have received additional files. This is possible if either the "parallel" or "filesize" option was used during the export. Confirm with them the number and size of the files you should have.
SQL*Plus: Release 12.2.0.1.0 Production on Thu Jul 9 15:06:37 2020
Copyright (c) 1982, 2016, Oracle. All rights reserved.
SQL> conn sys#Databasename as sysdba
Enter password:
Connected to an idle instance.
SQL> shutdown abort;
ORACLE instance shut down.
SQL> startup nomount;
ORA-01078: failure in processing system parameters
LRM-00109: could not open parameter file 'C:\APP\ADMINISTRATOR\VIRTUAL\PRODUCT\12.2.0\DBHOME_1\DATABASE\INITdatabasename.ORA'
SQL>
If I go to C:\APP\ADMINISTRATOR\VIRTUAL\PRODUCT\12.2.0\DBHOME_1\DATABASE\ There is no file with this name INITdatabasename.ORA
After search I found that I should create a pfile from spfile.
SQL> create pfile from spfile;
create pfile from spfile
*
ERROR at line 1:
ORA-01565: error in identifying file '?=\DATABASE\SPFILE%ORACLE_SID%.ORA'
ORA-27041: unable to open file
OSD-04002: unable to open file
O/S-Error: (OS 5) Access is denied.
SPfile is available in database folder. But is unable to open. Please help.
You can specify spfile and pfile locations:
create pfile='path_to_pfile' from spfile='path_to_spfile';
Maybe you could try to restore it from backups if you have any.
Bellow you have a good guide:
https://www.thegeekstuff.com/2014/11/oracle-rman-restore/
I've been provided with a Oracle database dump which I'm attempting to import using the following:
impdp myuser/myuser DUMPFILE=/u01/app/oracle/oradata/dumpfile.dmp FULL=y LOGFILE=/u01/app/oracle/oradata/dumplog.log
The output is
Import: Release 12.1.0.1.0 - Production on Fri May 1 09:46:59 2015
Copyright (c) 1982, 2013, Oracle and/or its affiliates. All rights reserved.
UDI-00942: operation generated ORACLE error 942
ORA-00942: table or view does not exist
Is there anyway I can find out what the problem is or get more information? The user myuser has all privileges.
After running though the setup again it turned out this database has not had the catalog.sql and catproc.sql scripts run on it. Rerunning the import once this has been run resolved this error.
When I backup Oracle using this statement:
EXPDP userid=scott/tiger#orcl directory=DATA_PUMP_DIR dumpfile=%filename%.DMP
It has this error:
Ora-39002:The operation is invalid
Ora-3970:can not open the log file
Ora-39087:directory name DATA_PUMP_DIR is invalid
When I run:
select * from dba_directories;
The DATA_PUMP_DIR is
D:\app\Administrator\admin\orcl\dpdump\
More importantly, I created the directory by myself. It still gives the same error and I am very sure the directories exist.
You need to grant read and write permission on directory to user for taking backup.(Assuming that you have all the rights)
GRANT read, write ON DIRECTORY data_pump_dir TO scott;
What the error message is telling you, is that the user SCOTT does not have the privileges to write to DATA_PUMP_DIR.
As the DBA run
grant read, write on directory DATA_PUMP_DIR to scott;
Is D:\app\Administrator\admin\orcl\dpdump\ a directory on the server? It has to be accessible from the Oracle server software to be valid, as the export actually runs on the server and not the client.
Error :
ORA-39087: directory name C:\DUMP\PUB is invalid
solution :
grant create any directory to ATGDB_EB_PUB;
create directory YOUR_PATH as 'C:\dump\pub';
impdp user/pass12#ETATD directory=EDWEXPORT dumpfile=NETWORK_ACTIVITY_SETT_TEMP.dmp logfile=NETWORK_ACTIVITY_SETT_TEMP.log full=y;
Import: Release 12.2.0.1.0 - Production on Sun May 12 09:42:02 2019
Copyright (c) 1982, 2017, Oracle and/or its affiliates. All rights reserved.
Connected to: Oracle Database 12c Enterprise Edition Release 12.2.0.1.0 - 64bit Production
ORA-39002: invalid operation
ORA-39070: Unable to open the log file.
ORA-39087: directory name EDWEXPORT is invalid
I am trying to import a dump into two schema in the same oracle DB.Following a workaround to do this.
I am trying to run the imp command with the INDEXFILE option to be able to modify the tablespace names in the sql. This is what I get :
E:\oracle_10_2\BIN>imp atlantis/atlantis#orcl file=ABCD1_EXCLUDE_CLOB_TABS_BAK.dmp indexfile=index.sql full=y log=imp.log
Import: Release 10.2.0.1.0 - Production on Thu Mar 12 15:31:44 2009
Copyright (c) 1982, 2005, Oracle. All rights reserved.
Connected to: Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - Produc
tion
With the Partitioning, OLAP and Data Mining options
IMP-00002: failed to open ABCD1_EXCLUDE_CLOB_TABS_BAK.dmp for read
Import file: EXPDAT.DMP >
Looked like a file permission issue to me so I tried changing it.
E:\oracle_10_2\BIN>cacls E:\ABCD1_EXCLUDE_CLOB_TABS_BAK.dmp /p atlantis:F
Are you sure (Y/N)?y
processed file: E:\ABCD1_EXCLUDE_CLOB_TABS_BAK.dmp
E:\oracle_10_2\BIN>cacls E:\ABCD1_EXCLUDE_CLOB_TABS_BAK.dmp
E:\ABCD1_EXCLUDE_CLOB_TABS_BAK.dmp CORP\atlantis:F
But the problem persists.
If you are using Oracle 10g consider using new export/import tool Oracle Data Pump in which you can use REMAP_TABLESPACE parameter.
Anyway, you missed the path of the exportfile (bassed on the commands fo give permissions). Then You wrote:
file=ABCD1_EXCLUDE_CLOB_TABS_BAK.dmp
instead of
file=E:\ABCD1_EXCLUDE_CLOB_TABS_BAK.dmp
Then, the result export command to work is:
imp atlantis/atlantis#orcl file=E:\ABCD1_EXCLUDE_CLOB_TABS_BAK.dmp indexfile=index.sql full=y log=imp.log
Open window command line as administrator
imp user/pass#databasename(listenername) file='DMP path'
log=indexfile.log full=y;
Don't forget to add your database or listener name.