Using expdp to backup database - oracle

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

Related

Oracle : impdp ORA-39001: invalid argument value

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

Import dmp file to Oracle

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.

On startup of database it denies with error ORA-01078: failure in processing system parameters | LRM-00109: could not open parameter file?

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/

unable to import dump using "imp"

I am trying to import into oracle using imp command and the output of the command is as below.
invincible:/home/invincible# imp
Import: Release 10.2.0.1.0 - Production on Thu Aug 12 22:19:00 2010
Copyright (c) 1982, 2005, Oracle. All rights reserved.
Username: n_data
Password:
IMP-00058: ORACLE error 1034 encountered
ORA-01034: ORACLE not available
ORA-27123: unable to attach to shared memory segment
Linux Error: 13: Permission denied
IMP-00005: all allowable logon attempts failed
IMP-00000: Import terminated unsuccessfully
invincible:/home/invincible#
user name and password are correct(I am able to connect using sqldeveloper). I have granted dba access to n_data. All the environment variables are set (I ran oracle_env.sh before running env ). So what might be the problem? I am running oracle on debian.
Check this blog post: ORA-27123: unable to attach to shared memory segment.
It describes same error as you have and problem was caused with incorrectly set permissions on oracle executable.
This is excerpt from the above blog post:
Here the oracle file permission has
-rwxrwxr-x i.e. 775, but this file must have the permission -rwsr-s- -x
i.e. 6751
Change the permissions for oracle
file.
$ cd $ORACLE_HOME/bin
$ chmod 6751 oracle
$ ls -l oracle
-rwsr-s--x 1 oracle dba 119582976 Feb 3 2008 oracle
After changing the permissions on
oracle executable file, all the users
are now able to connect to the
database without any errors.
Read blog post for detailed information.
The error suggests it is trying to connect to an instance on the same host that isn't there. Generally I'd say the database isn't actually up and running, but if you can connect with SQL Developer, it suggests it is. But check you are on the correct machine.
Also try
echo :${ORACLE_SID}:
There may be some stray character in the SID. If you are using XE, you want to see :XE: (in upper case, not mixed or lower)
Have you tried
imp n_data/password#XE

Error importing oracle dump

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.

Resources