You are on page 1of 9

select * from dba_directories;

prod:
select object_type,count(1) from dba_objects where OWNER='FLEXPCM' group by obj
ect_type;
dev:
select object_type,count(1) from dba_objects where OWNER='RWMSGLA4' group by ob
ject_type;
CREATE OR REPLACE DIRECTORY DATA_PUMP AS '/repository/Oracle/dump/dpdump';
GRANT READ, WRITE ON DIRECTORY DATA_PUMP TO SYSTEM;
getting table details:
select OWNER,OBJECT_NAME from all_objects where OBJECT_NAME='TRACKED_OBJECT_STAT
US' and OWNER='DSWP145';
select OWNER,SEGMENT_NAME,TABLESPACE_NAME,BYTES/1024/1024/1024 from dba_segments
where SEGMENT_NAME='TRACKED_OBJECT_STATUS' and OWNER='DSWP145';
rwmsglp3
rtmsglt3
SQL> select sum(BYTES/1024/1024/1024) from dba_segments where OWNER='WMOPT';
SUM(BYTES/1024/1024/1024)
-------------------------
236.830933
================================================================================
===========%%%%%%%%=
SQL> select object_type,count(*) from dba_objects where OWNER='WMTNS' group by o
bject_type;
OBJECT_TYPE COUNT(*)
------------------- ----------
INDEX 113
PROCEDURE 1
TABLE 62
VIEW 2
TRIGGER 2
SEQUENCE 1
LOB 17
7 rows selected.
SQL> select segment_type,tablespace_name,count(*) from dba_segments where OWNER=
'WMTNS' group by segment_type,tablespace_name;
SEGMENT_TYPE TABLESPACE_NAME COUNT(*)
------------------ ------------------------------ ----------
INDEX WMTNS_DAT 53
LOBSEGMENT WMTNS_DAT 17
INDEX WMADMIN_IND 1
INDEX WMTNS_IND 59
TABLE WMADMIN_DAT 1
LOBINDEX WMTNS_DAT 17
TABLE WMTNS_DAT 61
7 rows selected.
===============================================================================
set pages 120
set lines 160
col OPERATION for a15
col JOB_MODE for a25
col OWNER_NAME for a10
select * from dba_datapump_jobs;
==================================================
expdp schemas=BOUSER4_1 dumpfile=BOUSER4_1_sep06.dmp logfile=BOUSER4_1_sep06.log
directory=DATAPUMP_DIR
SYS DATA_PUMP_DIR
/md1/oradata/arch/
/mp1d/oradata/arch
/mp1/oradata/arch
CREATE OR REPLACE DIRECTORY DATA_123 AS '/ds2t/dump';
GRANT READ, WRITE ON DIRECTORY DATA_123 TO SYSTEM;
==================================
SYS
DATA_DIR
/mp1/oradata/data01/
expdp schemas=flexpcm dumpfile=prodflexpcm_july31.dmp logfile=prodflexpcm_july31
.log directory=DATA_DIR
scp -rp oracle@sacvs178.sac.flextronics.com:/mp1/oradata/data01/prodflexpcm_jul
y31.dmp /mp1d/oradata/arch/prodflexpcm_july31.dmp
impdp system remap_schema=XEWGNP1:XEWGNT2 REMAP_TABLESPACE=XEWGNP1:XEWGNT2 dumpf
ile=XEWGNP1may242012.dmp logfile=impXEWGNP1may242012.dmp.dmp directory=DATA_PUMP
_DIR
select OWNER,SEGMENT_NAME,BYTES/1024/1024/1024,TABLESPACE_NAME from dba_segments
where OWNER='RWMSGLD1' and SEGMENT_NAME='USR_DLYTRN';
expdp schemas=RWMSGLT2 dumpfile=RWMSGLT2_sep27.dmp logfile=WMSGLT2_sep27.log dir
ectory=DATAPUMP_1
impdp schemas=flexpcm REMAP_TABLESPACE=FLEXPCMDAT:FLEXPCM dumpfile=prodflexpcm_j
uly31.dmp logfile=impprodflexpcm_july31.log directory=DATA_PUMP_DIR
FLEXPCMDAT
drop & create user:
CREATE USER FLEXPCM
IDENTIFIED BY VALUES '802C61450F6BEE9D'
DEFAULT TABLESPACE FLEXPCM
TEMPORARY TABLESPACE TEMP
PROFILE APPLICATION_NO_EXPIRY
ACCOUNT UNLOCK;
-- 2 Roles for FLEXPCM
GRANT RESOURCE TO FLEXPCM;
GRANT CONNECT TO FLEXPCM;
ALTER USER FLEXPCM DEFAULT ROLE ALL;
-- 10 System Privileges for FLEXPCM
GRANT CREATE PROCEDURE TO FLEXPCM;
GRANT CREATE SYNONYM TO FLEXPCM;
GRANT UNLIMITED TABLESPACE TO FLEXPCM;
GRANT CREATE SEQUENCE TO FLEXPCM;
GRANT CREATE VIEW TO FLEXPCM;
GRANT CREATE SESSION TO FLEXPCM;
GRANT ANALYZE ANY TO FLEXPCM;
GRANT SELECT ANY TABLE TO FLEXPCM;
GRANT CREATE TRIGGER TO FLEXPCM;
GRANT CREATE TABLE TO FLEXPCM;
===========================================================
oracle 11g password getting :
select 'alter user '||username||' identified by values '||REGEXP_SUBSTR(DBMS_MET
ADATA.get_ddl ('USER',USERNAME), '''[^'']+''')||';' from dba_users where usernam
e='FLEXPCM';
select 'alter user '||username||' identified by values '||REGEXP_SUBSTR(DBMS_MET
ADATA.get_ddl ('USER',USERNAME), '''[^'']+''')||';' from dba_users where usernam
e='FLEXPCM';
alter user FLEXPCM identified by values 'S:978E51BD6CDDA3925CE3981B08763F6968E5A
';
select 'alter user '||name||' identified by values '||password||';' FROM SYS.USE
R$ WHERE password is not null and name='RWMSGTA2';
===
set long 9999
SELECT DBMS_METADATA.GET_DDL('USER', 'FGS_BI_DW') FROM dual;
===
select USERNAME,ACCOUNT_STATUS,DEFAULT_TABLESPACE,TEMPORARY_TABLESPACE from dba_
users where USERNAME='BAAN';
select OWNER,OBJECT_NAME from all_objects where OBJECT_NAME='TGDGLD001360';
select OWNER,SEGMENT_NAME,TABLESPACE_NAME,SEGMENT_TYPE,BYTES/1024/1024/1024 from
dba_segments where SEGMENT_NAME='TGDGLD001360';
BAAN.TGDGLD001360
==
select OWNER,SEGMENT_NAME,TABLESPACE_NAME,SEGMENT_TYPE,BYTES/1024/1024/1024 from
dba_segments where SEGMENT_NAME='TGDGLD001360';
Baan.tgdgld001360
Baan.tgdgld002360
Baan.ttfgld201360
Baan.ttfgld202360
Baan.ttfgld203360
Baan.ttfgld204360
Baan.ttfgld205360
Baan.ttfgld206360
======================================
select OWNER,SEGMENT_NAME,TABLESPACE_NAME,SEGMENT_TYPE,BYTES/1024/1024/1024 from
dba_segments where SEGMENT_NAME='BAAN.TGDGLD001360';
select OWNER,SEGMENT_NAME,TABLESPACE_NAME,SEGMENT_TYPE,BYTES/1024/1024/1024 from
dba_segments where SEGMENT_NAME='BAAN.TGDGLD002360';
select OWNER,SEGMENT_NAME,TABLESPACE_NAME,SEGMENT_TYPE,BYTES/1024/1024/1024 from
dba_segments where SEGMENT_NAME='BAAN.TTFGLD201360';
select OWNER,SEGMENT_NAME,TABLESPACE_NAME,SEGMENT_TYPE,BYTES/1024/1024/1024 from
dba_segments where SEGMENT_NAME='BAAN.TTFGLD202360';
select OWNER,SEGMENT_NAME,TABLESPACE_NAME,SEGMENT_TYPE,BYTES/1024/1024/1024 from
dba_segments where SEGMENT_NAME='BAAN.TTFGLD203360';
select OWNER,SEGMENT_NAME,TABLESPACE_NAME,SEGMENT_TYPE,BYTES/1024/1024/1024 from
dba_segments where SEGMENT_NAME='BAAN.TTFGLD204360';
select OWNER,SEGMENT_NAME,TABLESPACE_NAME,SEGMENT_TYPE,BYTES/1024/1024/1024 from
dba_segments where SEGMENT_NAME='BAAN.TTFGLD205360';
select OWNER,SEGMENT_NAME,TABLESPACE_NAME,SEGMENT_TYPE,BYTES/1024/1024/1024 from
dba_segments where SEGMENT_NAME='BAAN.TTFGLD206360';
-----------------------
sacvs046 {oracle}:BR1P1 #pwd
/br1/oradata/data04
exp file=comp360tables.dmp tables=BAAN.TGDGLD001360,BAAN.TGDGLD002360,BAAN.TTFG
LD201360,BAAN.TTFGLD202360,BAAN.TTFGLD203360,BAAN.TTFGLD204360,BAAN.TTFGLD205360
,BAAN.TTFGLD206360 log=comp360tables.log
imp file=tableSkyDataCols.dmp log=prodimptableHRSYS.SkyDataCols.log fromuser=HR
SYS touser=HRSYS tables=SKYDATACOLS
DROP TABLE BAAN.TGDGLD001360 CASCADE CONSTRAINTS;
DROP TABLE BAAN.TGDGLD002360 CASCADE CONSTRAINTS;
DROP TABLE BAAN.TTFGLD201360 CASCADE CONSTRAINTS;
DROP TABLE BAAN.TTFGLD202360 CASCADE CONSTRAINTS;
DROP TABLE BAAN.TTFGLD203360 CASCADE CONSTRAINTS;
DROP TABLE BAAN.TTFGLD204360 CASCADE CONSTRAINTS;
DROP TABLE BAAN.TTFGLD205360 CASCADE CONSTRAINTS;
DROP TABLE BAAN.TTFGLD206360 CASCADE CONSTRAINTS;
imp file=comp360tables.dmp log=imp2comp360tables.log fromuser=BAAN touser=BAAN
tables=BAAN.TGDGLD001360,BAAN.TGDGLD002360,BAAN.TTFGLD201360,BAAN.TTFGLD202360,B
AAN.TTFGLD203360,BAAN.TTFGLD204360,BAAN.TTFGLD205360,BAAN.TTFGLD206360
scp -rp oracle@sacvs046.sac.flextronics.com:/br1/oradata/data04/comp360tables.d
mp /br1t/oradata/data/comp360tables.dmp
=================================
sacux115 {oracle}:BR1T1 #pwd
/br1t/oradata/data
exp file=oldtestcomp360tables.dmp tables=BAAN.TGDGLD001360,BAAN.TGDGLD002360,BA
AN.TTFGLD201360,BAAN.TTFGLD202360,BAAN.TTFGLD203360,BAAN.TTFGLD204360,BAAN.TTFGL
D205360,BAAN.TTFGLD206360 log=oldtestcomp360tables.log
select INDEX_NAME,INDEX_TYPE,TABLE_OWNER,TABLE_NAME,STATUS from dba_indexes wher
e TABLE_OWNER='BAAN'and TABLE_NAME='TGDGLD001360';
imp file=comp360tables.dmp log=imp2comp360tables.log tables=BAAN.TGDGLD001360,
BAAN.TGDGLD002360,BAAN.TTFGLD201360,BAAN.TTFGLD202360,BAAN.TTFGLD203360,BAAN.TTF
GLD204360,BAAN.TTFGLD205360,BAAN.TTFGLD206360
================
Import> STOP_JOB=IMMEDIATE
Are you sure you wish to stop this job ([y]/n): y
The job is placed in a stopped state and exits the client.
After finishing his other work, the DBA wants to resume the export job and the c
lient machine from where he actually started the job is locked because,
the user has locked his/her cabin. So now the DBA will go to another client mach
ine and he reattach to the job by typing the following command
$impdp hr/hr@mydb ATTACH=myfulljob
After the job status is displayed, he can issue the CONTINUE_CLIENT command to r
esume logging mode and restart the myfulljob job.
Import> CONTINUE_CLIENT
A message is displayed that the job has been reopened, and processing status is
output to the client.
Note: After reattaching to the Job a DBA can also kill the job by typing KILL_JO
B, if he doesnt want to continue with the import job.
http://www.oracle-dba-online.com/data_pump_import_utility.htm
parfile:(creating muiltple dumps)
oracle@sacvs157$ more expdp_TRX_BASE.par
directory=IVX
dumpfile=expdp_TRX_BASE_1.dmp,
expdp_TRX_BASE_2.dmp,
expdp_TRX_BASE_3.dmp,
expdp_TRX_BASE_4.dmp,
expdp_TRX_BASE_5.dmp,
expdp_TRX_BASE_6.dmp,
expdp_TRX_BASE_7.dmp,
expdp_TRX_BASE_8.dmp,
expdp_TRX_BASE_9.dmp,
expdp_TRX_BASE_10.dmp
filesize=30g
logfile=expdp_TRX_BASE.log
tables=DSWP175.TRX_BASE
PARALLEL=4
oracle@hkdvs110$ more impdp_dswp175_TRX_BASE.par
DIRECTORY=IVX
dumpfile=expdp_TRX_BASE_1.dmp,
expdp_TRX_BASE_2.dmp,
expdp_TRX_BASE_3.dmp,
expdp_TRX_BASE_4.dmp,
expdp_TRX_BASE_5.dmp,
expdp_TRX_BASE_6.dmp,
expdp_TRX_BASE_7.dmp,
expdp_TRX_BASE_8.dmp,
expdp_TRX_BASE_9.dmp,
expdp_TRX_BASE_10.dmp
logfile=impdp_TRX_BASE.log
TABLES=DSWP175.TRX_BASE
PARALLEL=4
==================================
TRANSFORM=oid:n ===> for get type objects during import
impdp system remap_schema=EAM85:EAM85QA REMAP_TABLESPACE=DATA85:DATA85QA,INDX85:
INDX85QA dumpfile=EAM85_20feb2013.dmp logfile=1impEAM85_20feb2013.log directory=
DPUMP TRANSFORM=oid:n
expdp schemas=EAM85 dumpfile=EAM85_20feb2013.dmp logfile=EAM85_20feb2013.log CON
TENT=METADATA_ONLY directory=DPUMP
CONTENT=METADATA_ONLY ===> to export only table with strecture
TRANSFORM=oid:n
===========================================================
=============
CREATE OR REPLACE DIRECTORY DATA_123 AS '/recover/rp6t1donotdelete/';
GRANT READ, WRITE ON DIRECTORY DATA_123 TO SYSTEM;
expdp_RTMSGLT3.par
directory=DATA_123
dumpfile=expdp_RTMSGLT3_1.dmp,
expdp_RTMSGLT3_2.dmp,
expdp_RTMSGLT3_3.dmp,
expdp_RTMSGLT3_4.dmp,
expdp_RTMSGLT3_5.dmp,
expdp_RTMSGLT3_6.dmp,
expdp_RTMSGLT3_7.dmp,
expdp_RTMSGLT3_8.dmp,
expdp_RTMSGLT3_9.dmp,
expdp_RTMSGLT3_10.dmp,
expdp_RTMSGLT3_11.dmp,
expdp_RTMSGLT3_12.dmp,
expdp_RTMSGLT3_13.dmp,
expdp_RTMSGLT3_14.dmp
filesize=40g
logfile=expdp_RTMSGLT3.log
schemas=RTMSGLT3
PARALLEL=5
expdp PARFILE=expdp_RTMSGLT3.par
expdp parfile=expdp_RTMSGLT3.par
================================================

You might also like