Errors on importing Oracle backup - oracle

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

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

Getting Oracle errors while importing with impdp

I'm trying to do an import using impdp utility. but I'm Seeting
impdp system/system remap_schema=ieulive:ieusystem directory=pump_dir dumpfile=IEULIVE.DMP logfile=imp.log
ORA-39002: invalid operation
ORA-39070: Unable to open the log file
ORA-29283: invalid file operation
ORA-29283: invalid file operation
thats's what I get when I use nologfile=y option
ORA-39001: invalid argument value
ORA-39000: bad dump file specification
ORA-31640: unable to open dump file "F:\data_pump\IEULIVE.DMP"
ORA-27041: unable to open file
OSD-04002: unable to open file
O/S-Error: <os 5> access is denied
I read that its a permission issue. I have imported before onto this DB, now I'm not able to do so.
I tried everything on the internet but didn't get the solution.
Thank you for your help
Updated
when I installed oracle, I used the windows virtual account(which I don't know what it is exactly)
Either the permissions for the folder or for the specific file are not set correctly. Both must be accessible (read/write for the directory, at least read for the file) by the account which is running the Oracle processes, which is most likely the Windows SYSTEM account. Is F: a local disk drive or a network-mounted drive? On Windows network-mounted drives generally cannot be accessed using directory objects...
directory=pump_dir
Your default data pump directory location and the actual directory where you have placed your export dump files could be different.
ORA-31640: unable to open dump file "F:\data_pump\IEULIVE.DMP"
Verify the data pump directory matches with "F:\data_pump\IEULIVE.DMP":
SELECT DIRECTORY_PATH FROM dba_directories WHERE DIRECTORY_NAME = 'PUMP_DIR';
If it matches, then you need to set the appropriate permissions to the directory and files.

Has anyone tried oracle export : EXPDP on the remote machine?

I am trying to export a dump file and log file on a remote machine using oracle expdp.
However i am getting the following error :
Connected to: Oracle Database 11g
Enterprise Edition Release 11.2.0.4.0 - 64bit Production
With the Partitioning, OLAP, Data Mining 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
Command run on remote machine host-name 'Local' using oracle client are :
SQL> create directory expdp_dir as '/vault2/expdp_dir';
SQL> grant read,write on directory expdp_dir to dbuser;
expdp dbuser/dbpwd#SID SCHEMAS=dbuser DIRECTORY=expdp_dir DUMPFILE=testDB24NOV17.dmp logfile=testDB24NOV17.log EXCLUDE=STATISTICS
Note vault 2 is mounted on a remote machine with hostname 'Local'. The database is on a machine with hostname TestDB.
The OS is RHEL6.
Any thoughts /ideas on making this operation successful would be appreciated.
Please check this one:
as per Oracle Doc.ID Doc ID 1305166.1
The errors can have multiple causes. Known causes are listed below.
One of the usual reasons for this problem to occur is when the listener process has not been started under the same account as the database instance service. The listener forks the new server process and when this runs under a different security context as the database, then access to directories and files are likely impacted.
Please verify the following information:
1) the output of:
ps -ef | grep SMON
2) the output of:
ps -ef | grep tnslsnr
3) the output of:
ps -ef|grep LIST
4) the output of:
ls -ld
Note:
When using ASM, the listener may have been started from the ASM Home instead of the RDBMS Home. Depending on your security settings, this may give to this issue.
One more:
4. Directory path/folder exists but create directory is executed by a different user in the database and the import is run by a different user.
Solution:
1. Make sure the listener and instance services are started from the same account.
Make sure that the directory are shared between nodes so that the directory can be accessed on any instance, or, create a folder similar to the other nodes locally, if there is already a folder created locally on the all the node with the same file directory path structure check if the permission are correct.
Make sure the folder exist has specified in during creation in the "CREATE DIRECTORY" syntax command.
Grant the required permission to the importing user to use the directory.
grant read, write on directory to ;
If above 4 possible causes and solutions are not applicable at your end, please check if the user has proper permission to export to run utl_file package.
Hope it helps.

Failure while exporting table from Oracle XE Database

We have XE running on a docker container. When trying to export a table I got the below error
expdp test/test#XE tables=UserProfile directory=/tmp dumpfile=profile.dmp logfile=logger
ORA-39006: internal error
ORA-39213: Metadata processing is not available
I googled a bit and found that I need to execute the below command but that failed too
execute dbms_metadata_util.load_stylesheets
ERROR at line 1:
ORA-31609: error loading file "kucolumn.xsl" from file system directory
"/u01/app/oracle/product/11.2.0/xe/rdbms/xml/xsl"
ORA-06512: at "SYS.DBMS_METADATA_UTIL", line 2397
ORA-06512: at line 1
I traversed to the directory and found that the "xsl" directory was missing, is this directory created by default with XE installation or we require a specific setting to get the "xsl" folder?
XE was installed using the rpm - oracle-xe-11.2.0-1.0.x86_64.rpm. Any idea what could be the issue?
The value you specify as directory needs to be an Oracle database directory object, not the value of a directory on your file system.
create directory export_directory as '/tmp';
expdp test/test#XE tables=UserProfile directory=export_directory dumpfile=profile.dmp logfile=logger
There is a 2011 discussion about this at https://community.oracle.com/thread/2278841. It says you have to copy the directory $ORACLE_HOME/rdbms/xml/xsl from a working installation. So the problem seems to be a known one, and if you do not have a working installation you are out of luck.
The problem does not seem to be limited to Linux (I used the same rpm as the OP), as the discussion says the working installation can be “even a Linux one.”

upgrade failed oracle apex 4.0 to 4.2

i got stuck in a failed upgrade from apex 4.0 to 4.2
The following is the log after the upgrade. I only see application login page no other page including apex admin is working i-e. admin page loads but its blank.
1> my 11g XE installation is in G:\ORAXE.
2> i downloaded the application upgrade in downloads folder, and moved the extracted contents of apex folder to C:.
3> i am on hp desktop using windows 7 64bit.
C:\apex>sqlplus /nolog
SQL*Plus: Release 11.2.0.2.0 Production on Mon Sep 29 10:01:00 2014
Copyright (c) 1982, 2014, Oracle. All rights reserved.
SQL> connect sys as sysdba
Enter password:
Connected.
SQL>#apexins SYSAUX SYSAUX TEMP /i/
...
...
...
PL/SQL procedure successfully completed.
SQL> #apxldimg.sql C:\apex
...
declare
*
ERROR at line 1:
ORA-22288: file or LOB operation FILEOPEN failed
The system cannot find the path specified.
ORA-06512: at "SYS.XMLTYPE", line 296
ORA-06512: at line 16
PL/SQL procedure successfully completed.
PL/SQL procedure successfully completed.
Commit complete.
Directory dropped.
timing for: Load Images
Elapsed: 00:00:10.98
SQL>
you are loading images at wrong location,load image at as follows
SQL> #apxldimg.sql C:\
for more
refer installation guide http://www.oracle.com/technetwork/developer-tools/apex/application-express/upgrade-apex-for-xe-154969.html
unzip your apex zip on a folder, for example: c:\apex
go to c:\apex
sqlplus sys as sysdba
run previous scripts...
SQL> #apxldimg.sql C:\
Notice that if you use c:\apex, the script will try to create a folder named images on c:\apex/apex/ , which is an inexistent directory
After having the same issue installing apex in dev enviroment for the third time, and reading, and searching, and guessing, this link confirmed what I was beginning to suppose.
When you download APEX from Oracle page, you get a zip file. This error is the result hardcoding paths in scripts, so when you unzip your downloaded file you have to unzip it to a folder named "apex" otherwise EPG configuration and images configuration will fail. If you want to keep track of the version of the unzipped apex version, you can have something like c:\oracle\apex_18.2\apex.
I had the same problem ... I tried everything I found that was supposed to resolved the problem ...
Noted that this apply to windows installation and NOT Linux one.
The fact is that someone mess it up when he made the script ... or maybe its a unix script that has been put in the windows installation kit by mistake, I don't know but the problem is :
Search in the files of your Apex upgrade folder where you unzip all the migration files for the upgrade and search all files for exactly "/apex/images".
You should find it in the file "apex_epg_config_core.sql".
Open this file and change (I found it only once in the file) "/apex/images" for "\apex\images" (change the slashs for back-slashs). Noticed that mean that when you will enter the command in SQL, you should not include the "apex" directory in the path parameter to the script because the code in the script should not have been written "/apex/images" but only "\images" ... You can also correct it in the script and remove the "\apex" from the path in the sql file.
As an instance, in my case, I unzipped all the files in the folder "C:\temp\apex" ... so the right command for me to get it successfull without removing the "\apex" part from the path in the sql file was exactly "#apex_epg_config.sql C:\temp" and not "#apex_epg_config.sql C:\temp\apex" ...
After this, i can now log properly on my apex environment at "http://localhost:8080/apex/apex_admin" as stated in the installation guide ...
Hope this will help you guys ... (sorry for my poor english guys, i usually speak french...)
Thank you!

Resources