I use this tuotrial to export/import schema. The steps in the tutorial are working until the expdp command, see the screenshot:
I am using oracle12c. Any Idea?
The article you linked to notes that:
The directory object is only a pointer to a physical directory, creating it does not actually create the physical directory on the file system of the database server.
You have to create the physical operating system directory separately, outside the database. That physical directory has to be readable and writable by the operating system user that is running the Oracle database; as you seem to be on Windows that will be the account the services are running under.
You can create the physical directory before or after creating the directory object as they are completely independent, except when Oracle is trying to access it through a UTL_FILE or related activity - data pump uses UTL_FILE, as you can see from the error message stack.
The CREATE DIRECTORY doesn't check that the physical directory it points to exists; and you can delete or create the physical directory without Oracle noticing; as long as it is there are accessible when you try to use it.
From the Oracle documentation:
A directory object specifies an alias for a directory on the server file system ...
and
For file storage, you must also create a corresponding operating system directory, an Oracle Automatic Storage Management (Oracle ASM) disk group, or a directory within an Oracle ASM disk group. Your system or database administrator must ensure that the operating system directory has the correct read and write permissions for Oracle Database processes.
Privileges granted for the directory are created independently of the permissions defined for the operating system directory, and the two may or may not correspond exactly. For example, an error occurs if sample user hr is granted READ privilege on the directory object but the corresponding operating system directory does not have READ permission defined for Oracle Database processes.
Related
Facts
My Server running on AIX
some files (to sftp) generate by Oracle and put in to a CBSINTERFACE directory
Different user created for sftp (lets say sftpusr) will access and get the files from CBSINTERFACE and remove the files after get.
Problem
sftpusr is unable to remove files since files generated by Oracle and aftpusr does not have write permission to those files.
what i did
I granted permission CBSINTERFACE directory but still files created by oracle cannot be removed by sftpusr
Requesting help to grant permission to sftpusr
I granted permission CBSINTERFACE directory but still files created by oracle cannot be removed by sftpusr
Not sure what you did here, but sftpuser - which is presumably an operating system user and not a database user - must have write permissions to the directory through the operating system (not the database) since it interacts through the operating system. Permissions granted on a DIRECTORY object within the database only apply to database users.
I am trying BFILE functionality in Oracle. My plan is all the files should be stored in file server, whose IP is 192.165.1.10.
Based on this I created a directory in my local PC database like this
create directory TEST_DIR as `\\192.165.1.10\c\ATTACH_FILES\STUDENT`
Directory is created. My doubt is being my db system and file server are in different locations so should I give any other privileges in Oracle?
Please give your opinion as Bfile is not working properly for me.
Note, my database server and file server are both Windows.
"My doubt is being my db system and file server in different locations "
That's a very good doubt to have. The database can only access OS directories on its local server, and directories which have been shared with that server. So you will need to share your file server directory using System Tools > Shared Folders > Shares.
As the database server is Windows you will need to map the shared directory if it isn't mapped already. The mapping must be owned by the OS user that owns the Oracle database, or the mapping owner must grant permissions to Oracle OS user( or its group). So that requires sysadmin access. Find out more. Also you may have to bounce the database.
I'm trying to import the Oracle BISAMPLE.dmp schema and I've got this error ( unable to open the log file )
The argument to the directory parameter is the name of an Oracle directory object, not a direct reference to the operating system directory.
If you do not already have an Oracle directory object pointing to that operating system directory, which has to be on the database server not a client machine, you (as DBA) will have to create it, and grant privileges to any other Oracle users who will need to use it.
For example:
create directory MY_DATAPUMP_DIR as 'C:\installs\datapumpdir`;
and then
impdp directory=MY_DATAPUMP_DIR dumpfile=...
Alternatively you can move your .dmp file to the default directory, and either omit the directory parameter or specify the default for that, DATA_PUMP_DIR.
Also, note the big warning from the documentation:
Do not invoke Import as SYSDBA, except at the request of Oracle technical support. SYSDBA is used internally and has specialized functions; its behavior is not the same as for general users.
I'm trying to import few users from .dmp file from a net drive. Unofrtunately it seems that I lack some rights to do so since I get
ORA-39001: invalid argument value
ORA-39000: bad dump file specification
ORA-31640: unable to open dump file "\\net\drive\directory\placeholder\my_dump.dmp" for read
ORA-27041: unable to open file
OSD-04002: unable to open file
O/S-Error: (OS 5) Access is denied.
I'm not sure why, because I can both access that directory, and for example save a txt file there.
Directory is saved on database as '\net\drive\directory\placeholder'. Log file has other directory specified (not on net drive).
Is there any workaround to import this dump without actually moving it to local drive? Dump is really big, and I don't have space for it (not even close) and neither can I (probably) change my rights on this mapped drive.
Also I can't really make dump smaller.
On one site I've found this advice - " Remember, your OS user ID may not be the ID that is running a submitted RMAN job, in an operating system, UNIX, Linux or Windows."
The solution was to "
In the ControlPanel services:
Right click on service
Select ?properties?
Select ?logon?
Change the default user ID to an Oracle user with Windows administrator privileges"
But I'm not sure what changing this would actually do to server/database, and I'm working on client's server so I don't want to act rashly. I also don't want to reset database or server itself.
Any help with what should I do?
The problem is that your Oracle instance is running under different user account which doesn't have an access to the network drive.
Unless you don't want to run Oracle under different account, you can give the read access to the current Oracle's instance user account (usually LocalSystem for Windows platform) to your network share. Another option could be to import data from the source database via dblink (you won't need dump file in this case at all)
I have a oracle external table. There is a oracle directory created for use of external table to read input CSV file. DISCARD, LOG and BAD files of external table will be created in the same directory.
When corresponding directory on unix has permissions "1770", external table can not read or write from that directory. When permissions for that directory are changed to "1777", external table is able to read write into that directory.
I am not able to figure out what is the issue when permissions for that directory are 1770. Please provide me with any hint on this weird behavior.
Please note that oracle schema user has READ and WRITE grants on that directory.
What user and group owns the operating system directory? What operating system user runs the Oracle database? What group(s) is that operating system user that runs Oracle in?
It sounds from your description that the operating system user that runs Oracle does not own the operating system directory and is not part of the group that owns the directory. In Unix, privileges on a directory are granted to the user (the first 7), the group (the second 7), and to the public (the third digit, either a 7 or a 0 in your example). If changing the privileges associated with the public are changing the behavior, that implies that the Oracle operating system user only has the privileges granted to the public on this directory.