How to backup Oracle database from server - oracle

I connect to Oracle database server for backup database (.dmp file) to my computer with windows command line
I use syntax
expdp myuser/1234#[server_ip]:[serverport]/listener directory=my_data_pump_dir dumpfile=my_pump_backup.dmp nologfile=Y full=y
But Error message
Connected to: Oracle Database 11g Release 11.2.0.1.0 - 64bit Production
ORA-39001: invalid argument value
ORA-39000: bad dump file specification
ORA-31641: unable to create dump file "C:\app\User\admin\orcl\dpdump_DIR\my_pump_backup.dmp"
ORA-27040: file create error, unable to create file
OSD-04002: unable to open file
O/S-Error: (OS 3) The system cannot find the path specified.
What should I do?

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 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 .....

Errors on importing Oracle backup

I have created a directory:
SQL> create or replace directory dir as '/home/oracle12c/Desktop/latest_exp.dmp';
I am trying to run an import, as sysdba:
impdp \'/as sysdba\' full=Y directory=dir dumpfile=importDump.dmp logfile=import.log;
I am getting these errors:
Connected to: Oracle Database 12c Enterprise Edition Release 12.1.0.2.0 - 64bit Production
With the Partitioning, OLAP, Advanced Analytics, and Real Application Testing options
ORA-39002: invalid operation
ORA-39070: Unable to open the log file.
ORA-29283: invalid file operation
ORA-06512: at "SYS.UTL_FILE", line 536
ORA-29283: invalid file operation
As far as I can see from the result on my search, it as to do with permissions. The Oracle user should own the files.
The permission to the file I am trying to import looks like this:
-rw-r--r-- 1 oracle12c root 2201247744 Feb 21 16:51 latest_exp.dmp
What is my problem here, and how do I overcome it? Is there a problem when the owner of the file is oracle12? Some solutions on the internet say that the files must be owned by the user trying to access the files, who in my case is sysdba. But I cannot change the owner to my file to be sysdba, as that user does not exist on my Ubuntu.
Also, we specify the dumfile and logfile, but we do not specify the location. Where will it create the locations for these? I assumed it would look for them here: /u01/app/oracle/oradata/orcl$ where orcl is my SID
I have not been able to solve my problem with the help of Google and Oracle Doc.
I am running on Ubuntu.
The Oracle directory object should point to an operating system directory, not a file; instead of:
create or replace directory dir as '/home/oracle12c/Desktop/latest_exp.dmp'
it should just be:
create or replace directory dir as '/home/oracle12c/Desktop'
The dump file should sit in that directory, and by default the log and bad files will be created in there too.
At the moment you're asking it to create log file under the directory /home/oracle12c/Desktop/latest_exp.dmp, i.e. /home/oracle12c/Desktop/latest_exp.dmp/import.log - which clearly isn't a valid full path; and also to look for the file importDump.dmp under that not-a-directory.
Your command line looks like it has the wrong name anyway:
impdp ... directory=dir dumpfile=latest_exp.dmp logfile=import.log

Export Import Full Database

I have two computers. operating system: windows 7 in both, oracle 11g in both
I have created a database in computer 1. and created dumpfile using export utility
expdp usersname/password directory=dir dumpfile=full.dmp full=y
now i have transaferd the dump file & log file in another computer.
when i am running command
impdp username/password directory=dir dumpfile=full.dmp
I got the following errors:
ORA-39002: invalid operation.
ORA-39070: Unable to open the log file.
ORA-29283: invalid file operation.
ORA-06512: at "SYS.UTL_FILE", line 536.
ORA-29283: invalid file operation

Oracle 11g directory objects to remote path

We're in the process of migrating over a system from Oracle 10G (windows 2003 32 bit) to 11G (on windows 2008 R2 64bit), where currently, our backup process consist a directory object that points to a remote (unc) path on our storage box so that we don't have to perform the expdp locally, and then move the file, which seems to work without issue, however on our new windows 2008 box with 11G, I can create the directory object and test it through the EM console, however whenever I try to run my import, I get the following:
Connected to: Oracle Database 11g Release 11.2.0.2.0 - 64bit ProductionWith the Automatic
Storage Management option
ORA-39002: invalid operation
ORA-39070: Unable to open the log file.
ORA-29283: invalid file operation
ORA-06512: at "SYS.UTL_FILE", line 536
ORA-29283: invalid file operation
Any ideas?? Just trying to test with metadata_only right now to troubleshoot this, but still no luck.
E:\>impdp xxxxx/xxxxx#prod CONTENT=METADATA_ONLY directory=Restoreloc dumpfile=XXXXX_
MAY172011.DMP logfile=XXXXXIMPDP.log exclude=grant
Ensure that the oracle process has write access to the directory.
or
You have to manually create directory in specified path then try your operation.
Check this post.

Resources