DATAPUMP EXPDP $ IMPDP

Hi I am going to present you how to take export/import backup using datapump.

CREATE DIRECTORY EXP_PRD AS  '/export_backup';

sqlplus / as sysdba


set lines 200 pages 200

select name, open_mode, host_name from v$database, v$instance;

column owner format a10

column DIRECTORY_PATH format a80

select * from dba_directories;
 
YOU SHOULD BE ABLE TO SEE THE DIRECTORY(LOGICAL) you created.
 
CREATE A PAR FILE.
 


PRODMETAIMP.par

DIRECTORY=EXPIMP
DUMPFILE=prdmetexp%U.dmp
FILESIZE=5G
LOGFILE=prdmetaimp.log
JOB_NAME=PRDMETAIMP
SCHEMAS=GAKHAN
CONTENT=METADATA_ONLY
PARALLEL=4


__________________________________
PRE IMPORT TASK

-------------------------------------------------------

Select distinct TABLESPACE_NAME from dba_segments where owner='GAKHAN'
ORDER BY 1;

Connected to:
Oracle Database 10g Enterprise Edition Release 10.2.0.4.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options

SQL> set lines 200 pages 200
SQL> select * from dba_tab_privs where table_name='EXPORT_GAKHAN';

no rows selected

SQL>  grant read, write on directory EXPORT_GAKHAN to system;

Grant succeeded.

SQL>  select * from dba_tab_privs where table_name='EXPORT_GAKHAN';

GRANTEE                        OWNER                          TABLE_NAME                     GRANTOR                        PRIVILEGE                                GRA HIE
------------------------------ ------------------------------ ------------------------------ ------------------------------ ---------------------------------------- --- ---
SYSTEM                         SYS                            EXPORT_GAKHAN                  SYS                            READ                                     NO  NO
SYSTEM                         SYS                            EXPORT_GAKHAN                  SYS                            WRITE                                    NO  NO


=====================================================
POST EXPORT

COLUMN object_name FORMAT A30
SELECT owner,
       object_type,
       object_name,
       status
FROM   dba_objects
WHERE  status = 'INVALID'
ORDER BY owner, object_type, object_name;




select count (*)from dba_objects where status='INVALID';

alter . compile;


alter VIEW GAKHAN.USER_FLDS_012509 compile;


select object_type,count(*) from dba_objects where status = 'INVALID' group by object_type;



SQL> @?/rdbms/admin/utlrp.sql

select 'alter ' ||object_type || ' '|| owner ||'.'||object_name ||' compile;' from dba_objects where status='INVALID'
_____________________________________________________________
 

Comments

Popular posts from this blog

ORACLE BACKUP AND RECOVERY