Showing posts with label creating the user and granting the permission checking dba directories.. Show all posts
Showing posts with label creating the user and granting the permission checking dba directories.. Show all posts

Saturday, September 30, 2017

How to import and export data in Oracle-11g and 12 c

Step by step procedure to the impdp/expdp utilities 

Step1-Login into the system

username : Sys@database_name as sysdba 
password : manager

Step 2-check the session status

SELECT 'ALTER SYSTEM KILL SESSION '||''''||sid ||','|| serial#||''''||' immediate;'
FROM v$session WHERE status ='INACTIVE';

Step 3-drop the user  
drop user user1 cascade;
drop user user1_log cascade;

Step 4-Create the users user1 and user1_log  

create user user1 identified by database_password;
create user user1_log identified by database_password;

step 5-grant the permission 

grant dba to user1,user1_log;
grant read, write on directory database_name_DUMP to user1,user1_log;
alter system set sec_case_sensitive_logon=false;

Step6-Check the directories and set the path 

SELECT * FROM DBA_DIRECTORIES;

DUMP PATH: D:\database_name\DUMP

Command Prompt:

Step7-for import using the impdp utilities

impdp user1@database_name/database_password directory=database_name_DUMP dumpfile= EXPDP_user1.DMP schemas=user1 logfile=user1imp

impdp user1_log@database_name/database_password directory=database_name_DUMP dumpfile= EXPDP_user1_LOG.DMP schemas=user1_log logfile=user1_logimp



       *************************
 Step8-for export using the expdp utilities

expdp user1@database_name/database_password directory=database_name_DUMP dumpfile=user1.DMP schemas=user1  logfile=user1EXP

expdp user1_log@database_name/database_password directory=database_name_DUMP dumpfile=user1_log.dmp schemas=user1_LOG logfile=user1_logEXP