Oracle Direct では、EXPで使用できたパラメータのほとんどを利用することができます。IMPでパラメータを指定することにより、EXPで作成したダンプファイルからさらに対象デ ータを絞りこんでインポートすることが可能です。ダンプファイル

  • Published on
    21-Apr-2018

  • View
    227

  • Download
    9

Embed Size (px)

Transcript

  • Oracle Direct Seminar

    !? Export/Import

  • Copyright 2010, Oracle. All rights reserved. 2

    Agenda

    Export/Import

    Data Pump

    Oracle Direct Concierge

    http://www.oracle.com/lang/jp/direct/services.html

    Oracle Database Oracle (Sizing)SQL ServerDB2SybaseMySQLPostgreSQLAccessOracle Developer/2000 Web

  • Copyright 2010, Oracle. All rights reserved. 3

    Agenda

    Export/Import

    Data Pump

    Oracle Direct Concierge

    http://www.oracle.com/lang/jp/direct/services.html

    Oracle Database Oracle (Sizing)SQL ServerDB2SybaseMySQLPostgreSQLAccessOracle Developer/2000 Web

  • Copyright 2010, Oracle. All rights reserved. 4

    Export/Import

    OS

    FTP

    OS

  • Copyright 2010, Oracle. All rights reserved. 5

    Export/Import

    Database

    Backup

    Database

    Oracle

    Export

    Import

  • Copyright 2010, Oracle. All rights reserved. 6

    Export/Import

    Oracle Database

    Export/Import

  • Copyright 2010, Oracle. All rights reserved. 7

    Export/Import

    Export/Import expimp

    Data Pump Oracle Database10gexpdpimpdp

  • Copyright 2010, Oracle. All rights reserved. 8

    Export/Import

    Import Utility

    IMP

    Oracle Net

    Oracle Net

    Oracle Database

    Export Utility

    EXP

    xxx.dmp

  • Copyright 2010, Oracle. All rights reserved. 9

    Data Pump

    Import Utility

    IMPDP

    Oracle Net

    Oracle Database

    Export Utility

    EXPDP

    Oracle Net

    PL/SQL Package Access Driver xxx.dmp

    EXPDP/IMPDP

  • Copyright 2010, Oracle. All rights reserved. 10

    Data Pump

    API

    Data Pump

    Export/Import

    Data Pump

  • Copyright 2010, Oracle. All rights reserved. 11

    Export/Import

    Export/Import

    Enterprise Manager

  • Copyright 2010, Oracle. All rights reserved. 12

    Agenda

    Export/Import

    Data Pump

    Oracle Direct Concierge

    http://www.oracle.com/lang/jp/direct/services.html

    Oracle Database Oracle (Sizing)SQL ServerDB2SybaseMySQLPostgreSQLAccessOracle Developer/2000 Web

  • Copyright 2010, Oracle. All rights reserved. 13

    Export/Import

    Catexp.sqlcatalog.sql

    Export/ImportSYS1catalog.sql

    EXP_FULL_DATABASE EXP_FULL_DATABASEIMP_FULL_DATABASE

    DBAEXP_FULL_DATABASEIMP_FULL_DATABASE

    catexp.sql

  • Copyright 2010, Oracle. All rights reserved. 14

    Export/Import

    Export/ImportOS

    Export/ImportCREATE SESSIONEXP_FULL_ DATABASE

  • Copyright 2010, Oracle. All rights reserved. 15

    Export/Import

    expimp /

    Oracle Database 11g 111.1

    20-3

    http://otndnld.oracle.co.jp/document/products/oracle11g/111/doc_dvd/server.111/E05768-02/exp_imp.htm#12189

    Export/Import

    Ex. exp(imp) scott/tiger owner=oracle file=exp.dmp

  • Copyright 2010, Oracle. All rights reserved. 16

    FULL=

    OWNER=user[, ]

    TABLES=table[, ]

    TABLESPACES=tablespace[, ]

    EXP

    1: > exp scott/tiger full=y

    2: > exp scott/tiger file=exp.dmp tables=(emp,dept)

    Export Export Utility

    EXPexpimp

    SYS ORDSYSCTXSYS MDSYS ORDPLUGINS

  • Copyright 2010, Oracle. All rights reserved. 17

    TRIGGERS

    GRANTS

    INDEXES

    CONSTRAINTS

    COMMAND > EXP scott/tiger TABLES=(wendy.emp) GRANT=n

    COMMAND > EXP scott/tiger TABLES=(wendy.emp) TRIGGERS=n

    COMMAND > EXP scott/tiger TABLES=(wendy.emp) INDEXES=n

    COMMAND > EXP scott/tiger TABLES=(wendy.emp) CONSTRAINTS=n

    y

  • Copyright 2010, Oracle. All rights reserved. 18

    exp

    COMMAND > EXP scott/tiger TABLES=(wendy.emp) CONSISTENT=n

    CONSISTENT

    CONSISTENT

    SYSAS SYSDBACONSISTENT=y

    CONSISTENT=n

  • Copyright 2010, Oracle. All rights reserved. 19

    A

    B

    TABLE1

    TABLE1TABLE2

    TABLE1

    TABLE2

    CONSISTENT = n TABLE2

    TABLE1

    CONSISTENT = y TABLE1TABLE2

  • Copyright 2010, Oracle. All rights reserved. 20

    COMMAND > EXP scott/tiger TABLES=(wendy.emp) DIRECT=n

    DIRECT

    DIRECT=n

    TRANSPORT_TABLESPACES=Y

  • Copyright 2010, Oracle. All rights reserved. 21

    Oracle

    SELECT

  • Copyright 2010, Oracle. All rights reserved. 22

    Oracle

  • Copyright 2010, Oracle. All rights reserved. 23

    Import Import Utility

    IMPimp

    COMMAND > imp scott/tiger tables=emp,dept

    IMPEXP

    IMPEXP

    empdept

    COMMAND > imp scott/tiger owner=wendy

    wendy

  • Copyright 2010, Oracle. All rights reserved. 24

    IGNORE=y

    COMMAND > IMP scott/tiger FILE=exp.dmp IGNORE=y

    IGNORE

    IGNORE=n

    IGNORE=y/

    IGNORE=n

  • Copyright 2010, Oracle. All rights reserved. 25

    Option

    Oracle Database 11g 111.1

    http://otndnld.oracle.co.jp/document/products/oracle11g/111/doc_dv

    d/server.111/E05768-02/exp_imp.htm#12994

    Oracle Database 11g 111.1

    http://otndnld.oracle.co.jp/document/products/oracle11g/111/doc_dv

    d/server.111/E05768-02/exp_imp.htm#16740

    http://otndnld.oracle.co.jp/document/products/oracle11g/111/doc_dvd/server.111/E05768-02/exp_imp.htmhttp://otndnld.oracle.co.jp/document/products/oracle11g/111/doc_dvd/server.111/E05768-02/exp_imp.htmhttp://otndnld.oracle.co.jp/document/products/oracle11g/111/doc_dvd/server.111/E05768-02/exp_imp.htmhttp://otndnld.oracle.co.jp/document/products/oracle11g/111/doc_dvd/server.111/E05768-02/exp_imp.htmhttp://otndnld.oracle.co.jp/document/products/oracle11g/111/doc_dvd/server.111/E05768-02/exp_imp.htmhttp://otndnld.oracle.co.jp/document/products/oracle11g/111/doc_dvd/server.111/E05768-02/exp_imp.htmhttp://otndnld.oracle.co.jp/document/products/oracle11g/111/doc_dvd/server.111/E05768-02/exp_imp.htmhttp://otndnld.oracle.co.jp/document/products/oracle11g/111/doc_dvd/server.111/E05768-02/exp_imp.htm

  • Copyright 2010, Oracle. All rights reserved. 26

    Agenda

    Export/Import

    Data Pump

    Oracle Direct Concierge

    http://www.oracle.com/lang/jp/direct/services.html

    Oracle Database Oracle (Sizing)SQL ServerDB2SybaseMySQLPostgreSQLAccessOracle Developer/2000 Web

  • Copyright 2010, Oracle. All rights reserved. 27

    Data Pump()

    Oracle Database10g

    Oracle Data Pump

    expdp/impdp

    Enterprise Manager

    DBMS_DATAPUMP PL/SQL

    Oracle Database 11g 111.1http://otndnld.oracle.co.jp/document/products/oracle11g/111/doc_d

    vd/server.111/E05768-02/toc.htm

  • Copyright 2010, Oracle. All rights reserved. 28

    Data Pump!

    APIExport2

    Import1540

    Oracle Data Pump

    Data Pump

    Data Pump

  • Copyright 2010, Oracle. All rights reserved. 29

    Sun Enterprise 3000

    400MHz * 4CPU

    4GB Memory

    (53partitions21,000,000rowsData Pump

    1.15GB

    750.418

    136.45774.708 55.193

    0

    200

    400

    600

    800

    imp impdp impdp(2p) impdp(4p)

    Data Pump

    443.483

    80.005 49.664 51.269

    0

    200

    400

    600

    800

    exp expdp expdp(2p) expdp(4p)

    Data Pump

    Data Pump 2

    91Data Pump 4

    131

  • Copyright 2010, Oracle. All rights reserved. 30

    DB

    DIRECTORY

    SQL > CREATE DIRECTORY DPUMP_DIR1 AS /home/oracle/oradata/dpump_dir;

    SQL > GRANT READ, WRITE ON DIRECTORY dpump_dir1 TO scott;

    COMMAND > expdp scott/tiger tables=emp,dept directory=dpump_dir1

    OSDATA_PUMP_DIR DATA_PUMP_DIR

    COMMAND > set DATA_PUMP_DIR=DPUMP_DIR1; export DATA_PUMP_DIR

    COMMAND > expdp scott/tiger schemas=scott

    Data Pump

    Export/Import Data Pump

  • Copyright 2010, Oracle. All rights reserved. 31

    9i

    FULL=y

    SCHEMAS=schema[, ]

    TABLES=table[, ]

    TABLESPACES=tablespace[, ]

    EXPDP

    1: > expdp scott/tiger full=y

    2: > expdp scott/tiger dumpfile=exp.dmp tables=emp,dept

    Export Data Pump Export Utility

    EXPDP

    Data Pump

  • Copyright 2010, Oracle. All rights reserved. 32

    INCLUDE

    COMMAND > expdp scott/tiger include=table

    EXCLUDE

    COMMAND > expdp scott/tiger exclude=index:LIKE EMP%

    LIKEIN

    OS

    INCLUDEEXCLUDE

    COMMAND > expdp scott/tiger include=index

    INCLUDE / EXCLUDE

    Data Pump

  • Copyright 2010, Oracle. All rights reserved. 33

    SCN

    SCNFLASHBACK_SCN

    COMMAND > expdp scott/tiger flashback_scn=364909 SCN

    FLASHBACK_TIME

    COMMAND > cat parfile.txt

    FLASHBACK_TIME=TO_TIMESTAMP(2004/03/20 10:00,YYYY/MM/DD HH:MI)

    COMMAND > expdp scott/tiger parfile=parfile.txt

    TO_TIMESTAMP()

    FLASHBACK_SCN / FLASHBACK_TIME

    Data Pump

  • Copyright 2010, Oracle. All rights reserved. 34

    PARALLEL

    COMMAND > expdp scott/tiger parallel=3 dumpfile=dpump_dir1:expdat%U.dmp,

    dpump_dir2%U.dmp

    COMMAND > ls lR

    dpump_dir1:

    .expdat01.dmp

    .expdat02.dmp

    dpump_dir2:

    .expdat01.dmp

    Enterprise Edition

    (U)dumpfileparallel

    PARALLEL

    Data Pump

  • Copyright 2010, Oracle. All rights reserved. 35

    ESTIMATE

    ESTIMATE

    BLOCKS

    STATISTICS

    ESTIMATE_ONLY=

    COMMAND > expdp scott/tiger tables=emp,dept estimate=blocks

    estimate_only=y

    Data Pump

  • Copyright 2010, Oracle. All rights reserved. 36

    (402GB)dbms_stats100

    COMMAND > expdp scott/tiger tables=test estimate=blocks estimate_only=y

    Estimate in progress using BLOCKS method...

    Processing object type TABLE_EXPORT/TABLE/TBL_TABLE_DATA/TABLE/TABLE_DATA

    . estimated SCOTT".TEST" 3.062 GB

    Total estimation using BLOCKS method: 3.062 GB

    COMMAND > expdp scott/tiger tables=test estimate=statistics estimate_only=y

    Estimate in progress using STATISTICS method...

    Processing object type TABLE_EXPORT/TABLE/TBL_TABLE_DATA/TABLE/TABLE_DATA

    . estimated SCOTT".TEST" 1.947 GB

    Total estimation using STATISTICS method: 1.947 GB

    COMMAND > ls l

    . 2092179456 . expdat.dmp

    1.948GB

    BLOCKS

    STATISTICS

    Data Pump

  • Copyright 2010, Oracle. All rights reserved. 37

    Import Data Pump

    9i

    COMMAND > impdp scott/tiger tables=emp,dept

    Import Utility

    IMPDP

    IMPDPEXPDP

    IMPDPEXPDP

    empdept

    COMMAND > impdp scott/tiger include=index

    Data Pump

  • Copyright 2010, Oracle. All rights reserved. 38

    NETWORK_LINK

    COMMAND > impdp scott/tiger tables=emp,dept directory=dpump_dir

    network_link=scott.jp.oracle.com

    NETWORK_LINK

    DB LINK

    10g

    Data Pump

  • Copyright 2010, Oracle. All rights reserved. 39

    Agenda

    Export/Import

    Data Pump

    Oracle Direct Concierge

    http://www.oracle.com/lang/jp/direct/services.html

    Oracle Database Oracle (Sizing)SQL ServerDB2SybaseMySQLPostgreSQLAccessOracle Developer/2000 Web

  • Copyright 2010, Oracle. All rights reserved. 40

    ExportImport

    ExportImport

    COMMAND> expdp system/manager ;

    SQL> alter table emp disable constraint emp_no_fk ;

    disable

    COMMAND> impdp system/manager ;

    SQL> alter table emp enable constraints emp_no_fk ;

    enable

    disableImport enable

    / Data Pump

  • Copyright 2010, Oracle. All rights reserved. 41

    Export

    deletecommit !!

    COMMAND> impdp system/manager

    remap_schema=oradirect:dummy

    SQL> insert into oradirect.emp select * from dummy.emp

    where emp_id=100;

    SQL> drop table dummy.emp

    SQL> delete from oradirect.emp

    where emp_id=100;

    SQL> commit;

    !

    emp_id=100

    / Data Pump

  • Copyright 2010, Oracle. All rights reserved. 42

    Option FILESIZE

    1

    FILESIZE

    exp scott/tiger TABLES=emp FILESIZE=2048

    (KB)(MB)(GB)

    FILESIZE=5MB

    5MB

    expdat.dmp expdat2.dmp expdat3.dmp

    5MB 5MB

    / Data Pump

  • Copyright 2010, Oracle. All rights reserved. 43

    WHERE

    Option QUERY

    QUERYSELECTWHERE

    SALESMAN1600

    exp scott/tiger TABLES=emp

    QUERY="WHERE job='SALESMAN' and sal

  • Copyright 2010, Oracle. All rights reserved. 44

    CREATE TABLE

    Option INDEXFILE

    imp scott/tiger TABLES=(wendy.emp) INDEXFILE=index.txt

  • Copyright 2010, Oracle. All rights reserved. 45

    Data PumpSQL

    Data Pump

    Option SQLFILE

    SQL DDL

    impdp scott/tiger TABLES=(wendy.emp) SQLFILE=index.txt

    SQL

    DDLCONNECT

    TEST_TABLESQLFILE

    impdp oradirect/oradirect dumpfile=test_table.dmp tables=test_table

    sqlfile=sqlfile.txt

  • Copyright 2010, Oracle. All rights reserved. 46

    SQLFILEData Pump

    CREATE TABLE

    CREATE INDEX

    INSERT

  • Copyright 2010, Oracle. All rights reserved. 47

    Data Pump 11g

    11g Advanced Compression Option

    Advanced Security Option

  • Copyright 2010, Oracle. All rights reserved. 48

    Data Pump

    $ expdp scott/tiger DIRECTORY=dpump_dir DUMPFILE=scott.dmp

    COMPRESSION=ALL SCHEMAS=scott

    Advanced Compression

    Option

    COMPRESSION={ALL | DATA_ONLY | METADATA_ONLY | NONE}

    NONE... METADATA_ONLY(default)...

    (Advanced Compression) DATA_ONLY...

    ALL...

    (scott.dmp

    Data Pump

  • Copyright 2010, Oracle. All rights reserved. 49

    $ expdp scott/tiger DIRECTORY=dpump_dir DUMPFILE=scott_enc.dmp

    SCHEMAS=scott ENCRYPTION=data_only ENCRYPTION_PASSWORD=tiger

    Advanced Security

    Option

    Data Pump

    ENCRYPTION = {ALL | DATA_ONLY |

    ENCRYPTED_COLUMNS_ONLY | METADATA_ONLY | NONE}

    ALL

    DATA_ONLY

    ENCRYPTED_COLUMNS_ONLY

    METADATA_ONLY

    NONE

    ()

    Data Pump

  • Copyright 2010, Oracle. All rights reserved. 50

    Agenda

    Export/Import

    Data Pump

    Oracle Direct Concierge

    http://www.oracle.com/lang/jp/direct/services.html

    Oracle Database Oracle (Sizing)SQL ServerDB2SybaseMySQLPostgreSQLAccessOracle Developer/2000 Web

  • Copyright 2010, Oracle. All rights reserved. 51

    2(10g) Export/ImportData Pump

    Oracle Database 10gData Pump Oracle Database 10g

    OptionExport/Import Advanced Compression

    Advanced Security

  • Copyright 2010, Oracle. All rights reserved. 52

    OTN !!

    OTN

  • Copyright 2010, Oracle. All rights reserved. 53

    Oracle

    http://blogs.oracle.com/oracle4engineer/

    Oracle Database 11gR2 RAC ASM Microsoft Windows x86-64

    Oracle Database 11gR2

    http://blogs.oracle.com/oracle4engineer/

  • Copyright 2010, Oracle. All rights reserved.

    54

    Enterprise Edition!!

    !

    !

    !

    !

    Oracle Database

    http://www.oracle.co.jp/campaign/kurukuru/index.html

    Oracle Database Enterprise Edition!!

    http://www.oracle.co.jp/inq_pl/INQUIRY/quest?rid=28

    5

    5

    5

  • Copyright 2010, Oracle. All rights reserved. 55

    http://www.oracle.co.jp/inq_pl/INQUIRY/quest?rid=28

    Oracle Direct

    Oracle Direct

    Web

    Oracle Direct Seminar

    0120155096~ 9:00~12:0013:00~18:00

    IT

    /

    http://www.oracle.co.jp/inq_pl/INQUIRY/quest?rid=28

  • Copyright 2010, Oracle. All rights reserved. 56

    OTN !!

    OTNOracle100%

    Oracle Technology Network(OTN)

    OTN

    http://otn.oracle.co.jp/forum/index.jspa?categoryID=2

    OTN

    OTN

    http://www.oracle.com/technology/global/jp/ondemand/otn-seminar/index.html

    OTN

    http://otn.oracle.co.jp/forum/index.jspa?categoryID=2

  • Copyright 2010, Oracle. All rights reserved. 57

    OraclePeopleSoftJD EdwardsSiebel

Recommended

View more >