Oracle 11g IMP functionality - oracle

Just looking for a little clarification on Oracle 11g imports.
I have a user that DOES have privileges to import & a second user that DOESN'T have privileges to import, I was basically wondering if I can use the user that does have privileges to import into the shemea for the user the does not.
So if for example:
User CANIMP does have privileges
User NOIMP does not have privileges
Would this import into the user that does not?
imp CANIMP/password123#localhost/ORCL file=my_dumpfile.dmp fromuser=CANIMP touser=NOIMP log=import_details.log

The FROMUSER parameter is the schema owner of the exported data. It seems unlikely that this is the CANIMP user, but perhaps it is.
If in fact the export structures already belong to NOIMP you do not need to specify TOUSER. You only need to specify the TOUSER if you are changing the owning schema from the export. This has nothing to do with the user running the import job.
Incidentally, you're on 11g, so why are you still using IMP ? The IMP and EXP utilities have been deprecated in favour of DATAPUMP for a long time now. Find out more.

Related

Export & Import in SQL DEVELOPER without datapump

I want to export below things from SQL developer
1-Only schema (tables structure)
2-Only data in excel form
3-Schema with data
after exporting this i want to import the same to the another database
So what steps should i follow for export and import?
I can not use DATA PUMP as i don't have DBA privilege
As you use Oracle 11g, I'd suggest you to forget about SQL Developer and use the original EXP and IMP utilities. Doing so, you'd avoid DBA-related-problems as these utilities don't require access to the directory (an Oracle object which points to (usually database server's) filesystem directory, and - in order to be able to use it - you'd need to have read/write privileges on it).
So - if you don't already have these, install Oracle Client which contains EXP/IMP and use them.

How to generate DDL for all Users and privileges in Oracle

I'm trying to migrate a database instance from RDS Oracle to On-premise Oracle. I'm still pretty new to database scripting. I found this script that does the work for me for a single user that I pass via SQLDeveloper. However I have 200+ users on my RDS Oracle instance.
https://oracle-base.com/dba/script?category=script_creation&file=user_ddl.sql
I have tried removing the variable here for the user name and the rownum but this generates a lot of duplicate entries. Can someone guide me what is the best way to achieve the result set of the above script for all users.
Much appreciated!
I'd suggest another approach (if you can use it): data pump.
You'd perform export
using user SYSTEM or SYS as they own the database and can export ...
... FULL database
content would be METADATA_ONLY (so that you'd skip data; I understood you don't need that)
That would be something like
expdp system/pwd file=your_db.dmp full=y content=metadata_only
Import goes the same way, in the target database.

impdp in Oracle. Why it does not create users?

I am newbie in oracle and I am facing troubles with impdp. I have a production server and I have created a new server for testing purposes, so I installed centos, oracle and created the database "sire". Now I make a dump from the production server with the following command:
expdp system/password#sire full=Y
directory=pump_dir dumpfile=sire_dump.dmp logfile=sire.log
The I come to the new server, and I execute impdp:
impdp system/password#sire full=Y
directory=pump_directorio dumpfile=sire_dump.dmp logfile=sire_imp.log
It starts to do the import but then I receive errors such as:
"the user vberrios does not exist". And also error beause it cannot
found some schemas and tablespaces.
My question is: It is not supposed that impdp full=Y must import all users and schemas? I have read that I have to create the users in the destination server but I have about 300 users in the database. How can I do a full import in a empty server. I just want to import the full database and user and all objects.
The documentation states, that impdp will create uses, when the dump file contains the create user statements:
If the schema you are remapping to does not already exist, the import
operation creates it, provided the dump file set contains the
necessary CREATE USER metadata and you are importing with enough
privileges.
So either your dump file is incomplete (for example due to missing privileges) or you are lacking privileges on the target database.
So please check your privileges on both, the source database and the target database. Please update your question with then according information. For the export to include the schema definitions, you must have the DATAPUMP_EXP_FULL_DATABASE privilege.

How can I use imp command with REMAP_TABLESPACE?

With Oracle 11g, how can I use imp command to import schema from a different database that was already exported to a dmp file and which its tablespace needs to be renamed during the import?
I understand that there's a REMAP_TABLESPACE command but I only found how to use it with impdp and I need System DBA privileges for that, and I don;t have it.
Thanks
We closed this issue with one of our DBAs to refresh the schema with the relevant data, but yes it seems that impdp/expdp was the best way if we had the permissions.
Thanks for all the help.

Oracle Import dump files to another user(schema)

I am very new to DBA works. I have already exported (expdp) table and saved the dump files in a directory. I don't know the password of SCOTT user (default & example user). I want to import my tables to scott, but how can I? I am able to import (impdp) the table to system schema because I can do impdp system/password ..... because I know it's password.
First, run impdp help=y and go over the options.
Second, if you have privs for the sys schema you can access every other schema using it's name. e.g scott.emp. If you want to log into it directly you can just change the password.
Lastly, To import one schema into another you can use REMAP_SCHEMA option.

Resources