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

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.

Related

29283. 00000 - "invalid file operation"

I want to load data from a CSV file, using UTL_FILE, but an error has occurred (see below), please note that I'm connecting to the database remotely and the CSV file is in my local machine.
29283. 00000 - "invalid file operation"
*Cause: An attempt was made to read from a file or directory that does
not exist, or file or directory access was denied by the
operating system.
*Action: Verify file and directory access privileges on the file system,
and if reading, verify that the file exists.
Is it necessary to put the CSV file where the DB is mounted?
If the file is local to your machine, your options are:
transfer the file to the server, or
make a location on your machine visible/mountable by the server, or
use a client tool to load the data from your machine to the server
Assuming we'll be going with the last one, you can do this with:
SQL Developer
- Expand the "Tables" tab, right click on your table and choose Import
SQL Loader
- SQL Loader can be run locally (assuming you have the Oracle client) installed on your machine
Plenty of SQL Loader examples on https://asktom.oracle.com, or via the standard documentation
https://docs.oracle.com/en/database/oracle/oracle-database/12.2/sutil/oracle-sql-loader.html

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

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

ora-09925 unable to create audit trail file no such file or directory

I have just installed a oracle 12c 12.1.0 DB on a linux machine.
after completing the installation i tried to login to database as sysdba
[oracle#bjorn adump]$ sqlplus sys as sysdba/welcome
SQL*Plus: Release 12.1.0.2.0 Production on Wed Oct 12 16:41:17 2016
Copyright (c) 1982, 2014, Oracle. All rights reserved.
Enter password:
Connected to an idle instance.
Now i tried to startup the DB using below command
SQL> startup mount
ORA-09925: Unable to create audit trail file
Linux-x86_64 Error: 2: No such file or directory
Additional information: 9925
and this error pop up !
my ENV variable are --
[oracle#bjorn adump]$ echo $ORACLE_BASE
/oracle
[oracle#bjorn adump]$ echo $ORACLE_HOME
/oracle/product/12.1.0/db_1
I have checked into pfile which is $ORACLE_HOME/dbs/init.ora
there is the entry for audit file
audit_file_dest="/oracle/admin/orcl/adump"
I also go to this location and check if the folder exists or nt but the folder was there and it aleady has some files in it like
orcl_m000_21634_20161012143245012051143795.aud
there are lots of file with names like this.
I gave permission to this folder
chmod -R 755 /oracle/admin/orcl/adump
tried creating a new file using
touch afile
and file get created.
It also got connect to the idle session but when i tried to do a startup the error pops up !
Please suggest what i am overlooking here which needs to be corrected.
Usually this could happen because:
AUDIT_FILE_DEST is not writable(chown +w $AUDIT_FILE_DEST)
$ORACLE_BASE/admin/$ORACLE_SID/adump exists and is not writable
$ORACLE_HOME/rdbms/audit is not writable
PS: Make sure to check permissions for the oracle user
Also please check for disk space availability
In our case, one of the drives in one of our 2-node RAC servers was failing - the reason why the OS (Linux) limited anyone's access, including root, to read-only.
The amber light was suppose to turn on but it didn't. It only turned on when we restarted that particular node.
You also have 3 things to verify:
- As already mentionned, check free space with df -have
- Check if the file system are Read/Write or read-only: cat /proc/mounts
- Finally, you can check free inodes space with df -i
Detailled information can be found here: https://www.oracle-scripts.net/unable-to-create-audit-trail-file-read-only-file-system/

How can I solve "Got minus one from a read call" in oracle sql developer?

When I run the sql developer and set the all data,click the connect but i get this error:
Status : Failure -Test failed: IO Error: Got minus one from a read call
I am beginner in Oracle. How can I solve that error?
I use 64-bit Windows7 and oracle 12c.
In my case the error is connected to a problem about the client's (SQL Developer) ojdbc8 driver and the Oracle 19.3 docker container. The solution for me was to set a system property on the client -- you can do it within the JDBC connection string):
jdbc:oracle:thin:#tcp://host:port/service?oracle.net.disableOob=true
This is the thread that lead me to the answer.
The cause of the error is described here:
https://support.oracle.com/epmos/faces/DocumentDisplay?_afrLoop=357910144923387
You can also solve this problem by dissabling OOB on server side in the sqlnet.ora:
DISABLE_OOB=ON
Another workaround is to use the ojdbc7 driver.
Hope this helps some of us.
From your inputs in the dialog, you are using port 5500. That port is what is used for EM Express. It answers to HTTPs traffic only. So in this case the -1 error message means the protocol negotiation failed. SQLDEV is trying to talk SQL*NET to something listening for HTTPs.
The port you are looking for is 1521 if it wasn't altered. If it was check the $ORACLE_HOME/network/admin/listener.ora for the proper port number.
You need set "tcp.validnode_checking = no" or comment this parameter in sqlnet.ora file then restart listener on db server and test again.
Try it.
I got the same issue but following steps worked for me, it seems Gaurav also has shared it already:
1.Go to the folder where you have installed the database (Like: F:\app)
2.Here you will be able to see many folders, go to product\11.2.0("your databse version")\dbhome_1\NETWORK\ADMIN
3.find listener.ora file and open as text file
4.Check for the port number in that file
5.Now provide that port number while doing connection in sql developer.
Seems you have enabled ACL on the listener.
You can follow these steps to avoid the error:
1. Go to directory $ORACLE_HOME/network/admin
2. Modify sqlnet.ora file with following parameter:
tcp.validnode_checking = no
3. If you don't want to disable this, you can put the machine names as follows:
tcp.invited_nodes=(machine1, machine2)
3. Bounce the listener.
Hope that helps
Ensure the DB is up and running and you can connect locally AS SYSDBA to the database using Oracle binaries owner (usually oracle:oinstall Unix / Linux user). If it does not work, probably you encounter a different problem.
Check privileges of an Oracle file on Unix / Linux host where database is running:
cd $ORACLE_HOME/bin
ls -ltr oracle
-rwxr-xr-x 1 oracle oinstall 136803483 Mar 16 20:32 oracle
Change permissions as below:
chmod 6751 oracle
ls -ltr oracle
-rwsr-s--x 1 oracle oinstall 136803483 Mar 16 20:32 oracle
Most of the answers out there for this problem point to using the wrong PORT number in your connection options, or similar. In my case, after a couple hours of searching, the reason showed to be something else.
Mind which user you are using when starting Oracle listener. You should do it with the oracle user, not as root. Otherwise you end up with listener files being created as e.g. user deamon group root instead of user oracle group dba. This in turn leads to:
TNS-12555: TNS:permission denied
TNS-12560: TNS:protocol adapter error
TNS-00525: Insufficient privilege for operation
Linux Error: 1: Operation not permitted
To check whether this is the case, go to
/var/tmp/.oracle
and list all files (ls -la). If you find out some of the s#* files being created by a root-group user, stop the listener (lsnrctl stop), delete the above files as root and restart the listener as oracle user.
Unfortunately sqldeveloper doesn't show the full stack-trace when reading "Got minus one from a read call". I could find the problem thanks to switching to SQL-Squirrel.
In my case, I was given wrong host and port. I typed "tnsping yourServiceName" in command line in window 10. It returns a different host and port, then I used the correct one in sql developer and it worked.
In my case, it happened when I was using Docker with Oracle 19C.
The workaround is to find the listener.ora file, change 'PORT' and restart the container, ORACLE DB, listener.
It is presumed to be an error that occurred when the host tried to access TCP because it was already LISENT (HOST) by another process.
(When accessing Docker, consider that in most cases, you are accessing localhost.)
I changed the port to 1523, and all the problems were solved.
Try to do what the link , or check listener directory permission, or use command /dbhome/bin/relink all
Try
Connection name: HR_ORCL
Username: HR ,
Password: hr ,
Connection type : local,
Role: SYSDBA
Click on connect.
It will work.
Actually, It is not database specific issue. it is related to port value generated by database during your installation. To overcome on this issue, please follow below.
Go to the folder where you have installed the database (Like: F:\app)
Here you will be able to see many folders, go to product\11.2.0("your databse version")\dbhome_1\NETWORK\ADMIN
find listener.ora file and open as text file
Check for the port number in that file
Now provide that port number while doing connection in sql developer.
Hope it will resolve your issue.

Resources