I've taken a full database backup from one server to be moved to another using the following command (both using Oracle 11g):
exp SYSTEM/password#db1 full=y grants=y rows=y file=backup.dmp
And now when I want to import it into the other database using this:
imp SYSTEM/password file=backup.dmp fromuser=scott touser=scott
I first get an error related to database link:
Create Database Link Failed. ORA-01031: insufficient privileges.
If someone could explain why the imp command tried to link my new database to the source one which is not connected that would be helpful.
But otherwise that's not my main issue...
After that first error it continues with the import and imports all the rows and tables then at the end I get a series of errors related to 'CREATE TRIGGER's with error
ORA-00942: table or view does not exist
Am I missing something in my import parameters?
You don't seem to have privileges to create a database link, Please run this as sys user
SQL> grant create database link to scott;
Grant succeeded.
Then reimport the dumpfile, the triggers are failing because the related tables are not existing which i'm assuming the database link would be used to create the tables in the first place.
if you only want the scott user to be export then no need to connect to sys,
this will work,
export command
exp scott/pwd#db1 file=backup.dmp log=backup_log.log owner=scott
import command
imp scott/pwd#db? file=backup.dmp log=imp_backup.log full=y
Related
I have a dmp file from a CDB(don't know exactly) in another server from where, I was given a dmp file which was exported using expdp(possibly). I want to import it into a PDB instance on an Oracle 12c server which I have.
I extracted the sql file for the dmp file and there is profile by the name of 'C##APPPROF'. This dmp is of 2 schemas and the import fails where it tries to run 'CREATE USER' because the profile name doesn't exist.
According to Oracle 12c docs, I cannot create a profile for a PDB instance in Oracle 12c starting with 'C##' since that is the convention for creating profiles in a CDB instance.
In a non-CDB, a profile name cannot begin with C## or c##.
This is the command which is currently used.
impdp "sys/Oradoc_db1#ORCLPDB1 as sysdba" directory=MY_DATA_PUMP_DIRECTORY dumpfile=corp.dmp logfile=MY_DATA_PUMP_DIRECTORY:logfile.log exclude=GRANT
Is there a way, I can overcome this ?
With the help of the comment made by pmdba, I created the users in my db before importing the dmp file and then the impdp command as follows
impdp \"sys/Oradoc_db1#ORCLPDB1 as sysdba\" directory=MY_DATA_PUMP_DIRECTORY dumpfile=corp.dmp logfile=MY_DATA_PUMP_DIRECTORY:log.log exclude=GRANT schemas=user1,user2 transform=OID:n transform=segment_attributes:n
The system will still try to create the users and will show error that user cannot be created, but the dmp file will work just fine.
Also, every time I have to reimport a new dmp file or do an import again,
I do the following commands:
DROP USER USER1 CASCADE;
DROP USER USER2 CASCADE;
CREATE USER "USER2" IDENTIFIED BY "PASSWORD123"
DEFAULT TABLESPACE "CORPORATE"
TEMPORARY TABLESPACE "TEMP";
CREATE USER "USER1" IDENTIFIED BY "PASSWORD1234"
DEFAULT TABLESPACE "TB1"
TEMPORARY TABLESPACE "TEMP";
I am trying to import data from Db dump
I have created a user 'user' and Granted following permissions:
CONNECT RESOURCE UNLIMITED TABLESPACE DBA ALL PRIVILEGES IMP_FULL_DATABASE
I am running the following command:
imp <user>/<password>#<server> touser=<user>
FILE=C:\App\<path>\admin\orcl\dpdump\EXPDAT.DMP full=y log=imp.log;
While running I am getting the following error message.
IMP-00401: dump file "C:\App\<path>\admin\orcl\dpdump\EXPDAT.DMP" may
be an Data Pump export dump file IMP-00000: Import terminated unsuccessfully
There are two import and export utilities.
One is client - server based, and is also deprecated. That would be IMPORT and EXPORT, shortened as IMP and EXP.
Data Pump is the 'new,' server based set of utilities - much more powerful and efficient at getting data in and out of your database.
You'll need to place your DMP file in a Database 'DIRECTORY' - these are known OS directories to the database, you can see them in the data dictionary via
SELECT * FROM ALL_DIRECTORIES
It's likely you already have a directory already defined just for data pump, look for something like 'DATA PUMP DIR'
Data Pump has a utility you can run from the OS, a PL/SQL API, and there is a Wizard in SQL Developer.
View > DBA menu.
Add a connection (not SYS), right-click on the Data Pump category, select Import Wizard...then walk the dialog.
We'll create and kick off the job for you, you can also watch the progress of the job and check for any errors.
how can i import to one data pump file to table in Oracle data integrator?
i have on local directory
i should read file(data Pump) from this directory
and import to table in oracle.
By Oracle Data Integrator How is it possible?
To import a dumpfile you must run the "impdp" command.
There are a few ways you can make ODI do that for you:
You can create a shell script file that calls the impdp with all necessary parameters and create an ODI package (using OdiOSCommand) that simply runs the shell script. For this to work your ODI agent must have access to the script and also to the database client (or the database home) so it can run impdp. (you can also use OdiOSCommand to run impdp directly)
The same idea from step 1 can be done using an ODI Procedure (if maybe the import is just part of a bigger integration flow)
ODI also has an LKM that uses Data Pump, but it is used to export a source table into a dumpfile and import it into a target database... If you have access to the source table metadata inside ODI Studio, you can create a simple mapping between source and target tables, choose to use the Data Pump LKM and simulate the execution. ODI will create all the necessary code to import the dumpfile
I have been assigned to move 10g database to Oracle 12c on a Solaris. Size of data is around 68 GB.
So far I have managed to install the Oracle 12c on Solaris and also created the default DB it asks for. Now I'm trying to import the dump into Oracle 12c db which is proving to be problematic to me. I didn't take the dump, it was provided to me and told me that it was taken of the entire DB with exp utility.
I'm trying to import it using this:
imp file=/bkofa/dump/backup_dmp.dmp full=y;
and then
when it asks me for Username I provide this:
/ as sysdba
but it never imports anything and always gives me with errors like Users this and this doesn't exist and so on>
So I tried to create Users manually like this:
CREATE USER c##AFXAML
IDENTIFIED BY VALUES 'B010B6069516DE73'
DEFAULT TABLESPACE AFXUSER
PROFILE DEFAULT
ACCOUNT UNLOCK;
I also tried with simply providing name like AFXAML without appending c## but still gives me an error that invalid username.
Please help me how to resolve this by either pointing me to a guide that shows how to setup a 12c db from the get go for import and please tell me why the full option doesn't work and it asks to create all the users separately. Currently there's something like 30 users and 4 tablespaces.
i have an existing database which is old version and i want to replace it with the latest version of database(.dmp file).i am newbie so Could someone show me step by step on how to import a full database to it.
Thanks in advance.
FYI: i put the oracle sql developer in virtualbox ,WIN7 64bit.
To replace everything, it's usually easier and faster to just drop and recreate the schema instead of dropping all objects in the schema individually.
drop user WHATEVERMYNAMEIS cascade;
create user WHATEVERMYNAMEIS identified by MYSECREDPASSWORD default tablespace USERS;
grant CONNECT, RESOURCE to WHATEVERMYNAMEIS;
(Note that this is just an example. You need to supply your own username, password, tablespace name, privileges etc.)
Once that is done, the .dmp file can easily be imported from the command line:
imp WHATEVERMYNAMEIS/MYSECREDPASSWORD#MYDATABASE file=whatever.dmp fromuser=WHATEVERMYNAMEIS touser=WHATEVERMYNAMEIS