Oracle Import dump files to another user(schema) - oracle

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.

Related

how to export schema and import it to another schema in PL\SQL Developer

I am using PL\SQL Developer by AllroundAutomations.
My task is to import schema named EN to another schema (it doesn't exist now) called E9.
I managed to make a dump of a scheme using Tools --> Export User Objects, so now I have EN.sql file
So, here are my questions?
How can I make EN.dump file?
To import it to another scheme, I need firstly to create new (E9) scheme from sysdba user?
And is there any opportunity to import scheme from PL\SQL Developer interface? For some reason I can't connect to sqlplus which makes things worse.
Thank you in advance.
update: i just reinstalled my instant client from ver 11_2 to 12_2 with the tools and sql*plus
PL/SQL Developer has tools Export Tables and Import Tables witch can import/export dmp files using EXP and IMP utilites. See PL/SQL Developer's help :
Export Tables:
The Export Tables tool allows you to export one or more table definitions and their data into a file, so that you can import the tables later. After starting the Export Tables tool, you can select the user and the
tables you wish to export, choose an export method (Oracle Export, SQL Inserts, or PL/SQL Developer), and set various options that apply to the export method...
Import Tables:
The Import Tables tool allows you to import table definitions and data from a file that was previously exported with the Export Tables tool described in the previous chapter. Just like with the Export Table
tool, there are 3 methods to import tables, each with its own file format...
P.S. As you see schema where you want import to must already exists.
But in such a way you can export/import only tables.
So if you want export whole schema use utility througth command line, see example:
Command to export a schema:
exp userid=dba/dbapassword OWNER=username DIRECT=Y FILE=filename.dmp
This will create the export dump file.
To import the dump file into a different user schema, first create the new user in SQLPLUS:
SQL> create user newuser identified by 'password' quota unlimited users;
Then import the data:
imp userid=dba/dbapassword FILE=filename.dmp FROMUSER=username TOUSER=newusername

How to export/import full OracleDB data dump?

I am new to Oracledb. please help me to export whole data Dump and import same to another db to create another copy of database.
You need an administrative account (for example SYSTEM). Assuming you have this, the steps are:
create a directory object inside the database to map to a physical directory on both source and target
export the source database
import into the target database
For example
SQL> create directory X as '/u01/big_directory';
expdp system/mypassword#source full=Y directory=X dumpfile=full.dmp logfile=fullexp.log
impdp system/mypassword#target full=Y directory=X dumpfile=full.dmp logfile=fullimp.log
Also, check the "Database Utilities" guide in the standard Oracle documentation set for your release at docs.oracle.com

username and password for importing Oracle .dmp file

Need to import an Oracle .dmp file, and wondering if there is a way to skip original username and password for the source Oracle database when we export the .dmp file? I have sys/system permission on the destination Oracle database.
thanks in advance,
Lin
Using the impdp utility you can import using the system user. Specify remap_schema and remap_tablespace to import your tables into a different schema and tablespace.
impdp system/password#database dumpfile=dump.dmp directory=directory remap_schema=from:to remap_tablespace=from:to
Oracle documentation:
http://docs.oracle.com/cd/B19306_01/server.102/b14215/dp_import.htm

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.

Oracle 11g IMP functionality

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.

Resources