SlideShare a Scribd company logo
Oracle 11g-dən EXPORT alın Oracle 10g-ə IMPORT etmək
EXPDP istifadə edərək Oracle VB yüksək versiyasından alınmış dump faylını öncəki versiyaya necə yükləyəcəyimizi
görəcəyik. Bildiyiniz kimi DATAPUMP utilitası ilk dəfə Oracle 10g də təqdim olunmuşdur. Buna daha öncələr istifadə edilən
EXP/IMP nın daha da təkmilləşmiş və yaxşılaşdırılmış alətidir də demək olar. (EXP/IMP 10g, 11g də hələdə mövcuddur).
Sadəcə bu utilitin əlavə imkanları var ki, EXP/IMP da bu mümkün deyil, məsələn tablespace daşınması və s. Eyni zamanda
DATAPUMP server-də çalışdığı üçün EXP/IMP nəzərən daha sürətlidir və paralel olaraq çalışdırıla bilir.
Burada mən Oracle 11g R2 (11.2.0.1.0) və Oracle 10g R2 (10.2.0.4) istifadə edəcəm.
Gəlin Oracle 11g VB da bir directory quraq və ondan ulfet istifadəçisinə oxuma və yazma hüquqlarını verək.

SQL> create directory my_dir as '/u01/app/oracle/admin/ulfetdb/dpdump';

Directory created.

SQL> grant read, write on directory my_dir to ulfet;

Grant succeeded.

SQL>

İndisə mən ulfet istifadəçisi kimi VB bağlanıb yeni cədvəl quracam və 1 sətr daxil edəcəm.

SQL> conn ulfet/ulfet
Connected.

SQL> create table test_tbl (id number, name varchar2(10));

Table created.

SQL> insert into test_tbl values(1, 'Omar');

1 row created.

SQL> commit;

Commit complete.

DATAPUMP –ın EXPDP istifadə edərək müvafiq cədvəlin dampını alaq.

[oracle@localhost dpdump]$ expdp ulfet/ulfet@ulfetdb directory=my_dir dumpfile=test_tbl.dmp tables=test_tbl version=10.2

Export: Release 11.2.0.1.0 - Production on Mon Dec 10 14:45:54 2012

Copyright (c) 1982, 2009, Oracle and/or its affiliates. All rights reserved.

Connected to: Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
Starting "ULFET"."SYS_EXPORT_TABLE_01": ulfet/********@ulfetdb directory=my_dir dumpfile=test_tbl.dmp
tables=test_tbl version=10.2
Estimate in progress using BLOCKS method...
Processing object type TABLE_EXPORT/TABLE/TABLE_DATA
Total estimation using BLOCKS method: 64 KB
Processing object type TABLE_EXPORT/TABLE/TABLE
. . exported "ULFET"."TEST_TBL"                  5.289 KB      1 rows
Master table "ULFET"."SYS_EXPORT_TABLE_01" successfully loaded/unloaded
******************************************************************************
Dump file set for ULFET.SYS_EXPORT_TABLE_01 is:
 /u01/app/oracle/admin/ulfetdb/dpdump/test_tbl.dmp
Job "ULFET"."SYS_EXPORT_TABLE_01" successfully completed at 14:46:29

[oracle@localhost dpdump]$


--Oracle 11g aldığımız damp (dump) faylını Oracle 10g olan verilənlər bazasındakı maşına daşıyaq və DATAPUMP-ın
IMPDP istifadə edək.

--Bundan öncə Oracle 10g versiyası olan VB da directory mövcudluğundan və ona lazım olan hüqüqlarından əmin olun. Az
öncə Oracle 11g də qurmuş olduğum directory-nin eynisini Oracle 10g də qururam. (Adlar eyni olasada yol (path) fərlidir).

SQL> create directory my_dir as '/home/oracle/oracle/product/10.2.0/db_1/admin/mydb/dpdump';

Directory created.

SQL> grant read, write on directory my_dir to ulfet;

Grant succeeded.

SQL>

--İndisə gəlin damp-zı import edək

[oracle@localhost ~]$ impdp ulfet/ulfet@mydb directory=my_dir dumpfile=test_tbl.dmp tables=test_tbl

Import: Release 10.2.0.4.0 - Production on Monday, 10 December, 2012 13:43:54

Copyright (c) 2003, 2007, Oracle. All rights reserved.

Connected to: Oracle Database 10g Enterprise Edition Release 10.2.0.4.0 - Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
Master table "ULFET"."SYS_IMPORT_TABLE_01" successfully loaded/unloaded
Starting "ULFET"."SYS_IMPORT_TABLE_01": ulfet/********@mydb directory=my_dir dumpfile=test_tbl.dmp
tables=test_tbl
Processing object type TABLE_EXPORT/TABLE/TABLE
ORA-39083: Object type TABLE failed to create with error:
ORA-00959: tablespace 'REC_TBS' does not exist
Failing sql is:
CREATE TABLE "ULFET"."TEST_TBL" ("ID" NUMBER, "NAME" VARCHAR2(10)) PCTFREE 10 PCTUSED 40 INITRANS
1 MAXTRANS 255 NOCOMPRESS LOGGING STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS
2147483645 PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT) TABLESPACE
"REC_TBS"
Processing object type TABLE_EXPORT/TABLE/TABLE_DATA
Job "ULFET"."SYS_IMPORT_TABLE_01" completed with 1 error(s) at 13:44:07

[oracle@localhost ~]$
--Göründüyü kimi burda bir səhv var. Tablespace-iz fərqlidir.
Belə hal baş verməməsi üçün impdp da remap_tablespace parametrindən istifadə etmək lazımdır.
[oracle@localhost ~]$ impdp ulfet/ulfet@mydb directory=my_dir dumpfile=test_tbl.dmp tables=test_tbl
remap_tablespace=REC_TBS:USERS

Import: Release 10.2.0.4.0 - Production on Monday, 10 December, 2012 13:46:22

Copyright (c) 2003, 2007, Oracle. All rights reserved.

Connected to: Oracle Database 10g Enterprise Edition Release 10.2.0.4.0 - Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
Master table "ULFET"."SYS_IMPORT_TABLE_01" successfully loaded/unloaded
Starting "ULFET"."SYS_IMPORT_TABLE_01": ulfet/********@mydb directory=my_dir dumpfile=test_tbl.dmp tables=test_tbl
remap_tablespace=REC_TBS:USERS
Processing object type TABLE_EXPORT/TABLE/TABLE
Processing object type TABLE_EXPORT/TABLE/TABLE_DATA
. . imported "ULFET"."TEST_TBL"                  5.289 KB      1 rows
Job "ULFET"."SYS_IMPORT_TABLE_01" successfully completed at 13:46:24

[oracle@localhost ~]$

--İndisə ulfet istifadəçi kimi VB bağlanaq və cədvəlimizin və içindəki məlumatın mövcudluğunu yoxlayaq.

SQL> conn ulfet/ulfet
Connected.

SQL> select * from test_tbl;

       ID NAME
---------- ----------
        1 Omar

SQL>

--Cədvəl və data uğurlu olaraq yüklənilmişdir.

--Bəs istifadəçi export zamanı version=10.2 yazmaza və import etdikdə nə baş verir?
--Export normal çalışacaq lakin import zamanı ORA-39142 xəta alacaq.
--Gəlin yoxlayaq.

--Oracle 11g

[oracle@localhost dpdump]$ expdp ulfet/ulfet@ulfetdb directory=my_dir dumpfile=test_tbl2.dmp tables=test_tbl

Export: Release 11.2.0.1.0 - Production on Mon Dec 10 15:13:11 2012

Copyright (c) 1982, 2009, Oracle and/or its affiliates. All rights reserved.

Connected to: Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
Starting "ULFET"."SYS_EXPORT_TABLE_01": ulfet/********@ulfetdb directory=my_dir dumpfile=test_tbl2.dmp
tables=test_tbl
Estimate in progress using BLOCKS method...
Processing object type TABLE_EXPORT/TABLE/TABLE_DATA
Total estimation using BLOCKS method: 64 KB
Processing object type TABLE_EXPORT/TABLE/TABLE
. . exported "ULFET"."TEST_TBL"                          5.414 KB        1 rows
Master table "ULFET"."SYS_EXPORT_TABLE_01" successfully loaded/unloaded
******************************************************************************
Dump file set for ULFET.SYS_EXPORT_TABLE_01 is:
  /u01/app/oracle/admin/ulfetdb/dpdump/test_tbl2.dmp
Job "ULFET"."SYS_EXPORT_TABLE_01" successfully completed at 15:13:30



--Oracle 10g

[oracle@localhost ~]$ impdp ulfet/ulfet@mydb directory=my_dir dumpfile=test_tbl2.dmp tables=test_tbl
remap_tablespace=REC_TBS:USERS

Import: Release 10.2.0.4.0 - Production on Monday, 10 December, 2012 13:53:30

Copyright (c) 2003, 2007, Oracle. All rights reserved.

Connected to: Oracle Database 10g Enterprise Edition Release 10.2.0.4.0 - Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
ORA-39001: invalid argument value
ORA-39000: bad dump file specification
ORA-39142: incompatible version number 3.1 in dump file
"/home/oracle/oracle/product/10.2.0/db_1/admin/mydb/dpdump/test_tbl2.dmp"


EXPDP versiya parameteri aşağıdakı Oracle versiya və relizlərində çalışır:

       Oracle 10g R1
       Oracle 10g R2
       Oracle 11g R1
       Oracle 11g R2

More Related Content

Featured (20)

PDF
How to Leverage AI to Boost Employee Wellness - Lydia Di Francesco - SocialHR...
SocialHRCamp
 
PDF
2024 State of Marketing Report – by Hubspot
Marius Sescu
 
PDF
Everything You Need To Know About ChatGPT
Expeed Software
 
PDF
Product Design Trends in 2024 | Teenage Engineerings
Pixeldarts
 
PDF
How Race, Age and Gender Shape Attitudes Towards Mental Health
ThinkNow
 
PDF
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
marketingartwork
 
PDF
Skeleton Culture Code
Skeleton Technologies
 
PDF
PEPSICO Presentation to CAGNY Conference Feb 2024
Neil Kimberley
 
PDF
Content Methodology: A Best Practices Report (Webinar)
contently
 
PPTX
How to Prepare For a Successful Job Search for 2024
Albert Qian
 
PDF
Social Media Marketing Trends 2024 // The Global Indie Insights
Kurio // The Social Media Age(ncy)
 
PDF
Trends In Paid Search: Navigating The Digital Landscape In 2024
Search Engine Journal
 
PDF
5 Public speaking tips from TED - Visualized summary
SpeakerHub
 
PDF
ChatGPT and the Future of Work - Clark Boyd
Clark Boyd
 
PDF
Getting into the tech field. what next
Tessa Mero
 
PDF
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Lily Ray
 
PDF
How to have difficult conversations
Rajiv Jayarajah, MAppComm, ACC
 
PDF
Introduction to Data Science
Christy Abraham Joy
 
PDF
Time Management & Productivity - Best Practices
Vit Horky
 
PDF
The six step guide to practical project management
MindGenius
 
How to Leverage AI to Boost Employee Wellness - Lydia Di Francesco - SocialHR...
SocialHRCamp
 
2024 State of Marketing Report – by Hubspot
Marius Sescu
 
Everything You Need To Know About ChatGPT
Expeed Software
 
Product Design Trends in 2024 | Teenage Engineerings
Pixeldarts
 
How Race, Age and Gender Shape Attitudes Towards Mental Health
ThinkNow
 
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
marketingartwork
 
Skeleton Culture Code
Skeleton Technologies
 
PEPSICO Presentation to CAGNY Conference Feb 2024
Neil Kimberley
 
Content Methodology: A Best Practices Report (Webinar)
contently
 
How to Prepare For a Successful Job Search for 2024
Albert Qian
 
Social Media Marketing Trends 2024 // The Global Indie Insights
Kurio // The Social Media Age(ncy)
 
Trends In Paid Search: Navigating The Digital Landscape In 2024
Search Engine Journal
 
5 Public speaking tips from TED - Visualized summary
SpeakerHub
 
ChatGPT and the Future of Work - Clark Boyd
Clark Boyd
 
Getting into the tech field. what next
Tessa Mero
 
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Lily Ray
 
How to have difficult conversations
Rajiv Jayarajah, MAppComm, ACC
 
Introduction to Data Science
Christy Abraham Joy
 
Time Management & Productivity - Best Practices
Vit Horky
 
The six step guide to practical project management
MindGenius
 

Oracle 11g expdp alib oracle 10g import etmek

  • 1. Oracle 11g-dən EXPORT alın Oracle 10g-ə IMPORT etmək EXPDP istifadə edərək Oracle VB yüksək versiyasından alınmış dump faylını öncəki versiyaya necə yükləyəcəyimizi görəcəyik. Bildiyiniz kimi DATAPUMP utilitası ilk dəfə Oracle 10g də təqdim olunmuşdur. Buna daha öncələr istifadə edilən EXP/IMP nın daha da təkmilləşmiş və yaxşılaşdırılmış alətidir də demək olar. (EXP/IMP 10g, 11g də hələdə mövcuddur). Sadəcə bu utilitin əlavə imkanları var ki, EXP/IMP da bu mümkün deyil, məsələn tablespace daşınması və s. Eyni zamanda DATAPUMP server-də çalışdığı üçün EXP/IMP nəzərən daha sürətlidir və paralel olaraq çalışdırıla bilir. Burada mən Oracle 11g R2 (11.2.0.1.0) və Oracle 10g R2 (10.2.0.4) istifadə edəcəm. Gəlin Oracle 11g VB da bir directory quraq və ondan ulfet istifadəçisinə oxuma və yazma hüquqlarını verək. SQL> create directory my_dir as '/u01/app/oracle/admin/ulfetdb/dpdump'; Directory created. SQL> grant read, write on directory my_dir to ulfet; Grant succeeded. SQL> İndisə mən ulfet istifadəçisi kimi VB bağlanıb yeni cədvəl quracam və 1 sətr daxil edəcəm. SQL> conn ulfet/ulfet Connected. SQL> create table test_tbl (id number, name varchar2(10)); Table created. SQL> insert into test_tbl values(1, 'Omar'); 1 row created. SQL> commit; Commit complete. DATAPUMP –ın EXPDP istifadə edərək müvafiq cədvəlin dampını alaq. [oracle@localhost dpdump]$ expdp ulfet/ulfet@ulfetdb directory=my_dir dumpfile=test_tbl.dmp tables=test_tbl version=10.2 Export: Release 11.2.0.1.0 - Production on Mon Dec 10 14:45:54 2012 Copyright (c) 1982, 2009, Oracle and/or its affiliates. All rights reserved. Connected to: Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - Production With the Partitioning, OLAP, Data Mining and Real Application Testing options Starting "ULFET"."SYS_EXPORT_TABLE_01": ulfet/********@ulfetdb directory=my_dir dumpfile=test_tbl.dmp tables=test_tbl version=10.2 Estimate in progress using BLOCKS method... Processing object type TABLE_EXPORT/TABLE/TABLE_DATA Total estimation using BLOCKS method: 64 KB Processing object type TABLE_EXPORT/TABLE/TABLE . . exported "ULFET"."TEST_TBL" 5.289 KB 1 rows Master table "ULFET"."SYS_EXPORT_TABLE_01" successfully loaded/unloaded
  • 2. ****************************************************************************** Dump file set for ULFET.SYS_EXPORT_TABLE_01 is: /u01/app/oracle/admin/ulfetdb/dpdump/test_tbl.dmp Job "ULFET"."SYS_EXPORT_TABLE_01" successfully completed at 14:46:29 [oracle@localhost dpdump]$ --Oracle 11g aldığımız damp (dump) faylını Oracle 10g olan verilənlər bazasındakı maşına daşıyaq və DATAPUMP-ın IMPDP istifadə edək. --Bundan öncə Oracle 10g versiyası olan VB da directory mövcudluğundan və ona lazım olan hüqüqlarından əmin olun. Az öncə Oracle 11g də qurmuş olduğum directory-nin eynisini Oracle 10g də qururam. (Adlar eyni olasada yol (path) fərlidir). SQL> create directory my_dir as '/home/oracle/oracle/product/10.2.0/db_1/admin/mydb/dpdump'; Directory created. SQL> grant read, write on directory my_dir to ulfet; Grant succeeded. SQL> --İndisə gəlin damp-zı import edək [oracle@localhost ~]$ impdp ulfet/ulfet@mydb directory=my_dir dumpfile=test_tbl.dmp tables=test_tbl Import: Release 10.2.0.4.0 - Production on Monday, 10 December, 2012 13:43:54 Copyright (c) 2003, 2007, Oracle. All rights reserved. Connected to: Oracle Database 10g Enterprise Edition Release 10.2.0.4.0 - Production With the Partitioning, OLAP, Data Mining and Real Application Testing options Master table "ULFET"."SYS_IMPORT_TABLE_01" successfully loaded/unloaded Starting "ULFET"."SYS_IMPORT_TABLE_01": ulfet/********@mydb directory=my_dir dumpfile=test_tbl.dmp tables=test_tbl Processing object type TABLE_EXPORT/TABLE/TABLE ORA-39083: Object type TABLE failed to create with error: ORA-00959: tablespace 'REC_TBS' does not exist Failing sql is: CREATE TABLE "ULFET"."TEST_TBL" ("ID" NUMBER, "NAME" VARCHAR2(10)) PCTFREE 10 PCTUSED 40 INITRANS 1 MAXTRANS 255 NOCOMPRESS LOGGING STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645 PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT) TABLESPACE "REC_TBS" Processing object type TABLE_EXPORT/TABLE/TABLE_DATA Job "ULFET"."SYS_IMPORT_TABLE_01" completed with 1 error(s) at 13:44:07 [oracle@localhost ~]$ --Göründüyü kimi burda bir səhv var. Tablespace-iz fərqlidir. Belə hal baş verməməsi üçün impdp da remap_tablespace parametrindən istifadə etmək lazımdır.
  • 3. [oracle@localhost ~]$ impdp ulfet/ulfet@mydb directory=my_dir dumpfile=test_tbl.dmp tables=test_tbl remap_tablespace=REC_TBS:USERS Import: Release 10.2.0.4.0 - Production on Monday, 10 December, 2012 13:46:22 Copyright (c) 2003, 2007, Oracle. All rights reserved. Connected to: Oracle Database 10g Enterprise Edition Release 10.2.0.4.0 - Production With the Partitioning, OLAP, Data Mining and Real Application Testing options Master table "ULFET"."SYS_IMPORT_TABLE_01" successfully loaded/unloaded Starting "ULFET"."SYS_IMPORT_TABLE_01": ulfet/********@mydb directory=my_dir dumpfile=test_tbl.dmp tables=test_tbl remap_tablespace=REC_TBS:USERS Processing object type TABLE_EXPORT/TABLE/TABLE Processing object type TABLE_EXPORT/TABLE/TABLE_DATA . . imported "ULFET"."TEST_TBL" 5.289 KB 1 rows Job "ULFET"."SYS_IMPORT_TABLE_01" successfully completed at 13:46:24 [oracle@localhost ~]$ --İndisə ulfet istifadəçi kimi VB bağlanaq və cədvəlimizin və içindəki məlumatın mövcudluğunu yoxlayaq. SQL> conn ulfet/ulfet Connected. SQL> select * from test_tbl; ID NAME ---------- ---------- 1 Omar SQL> --Cədvəl və data uğurlu olaraq yüklənilmişdir. --Bəs istifadəçi export zamanı version=10.2 yazmaza və import etdikdə nə baş verir? --Export normal çalışacaq lakin import zamanı ORA-39142 xəta alacaq. --Gəlin yoxlayaq. --Oracle 11g [oracle@localhost dpdump]$ expdp ulfet/ulfet@ulfetdb directory=my_dir dumpfile=test_tbl2.dmp tables=test_tbl Export: Release 11.2.0.1.0 - Production on Mon Dec 10 15:13:11 2012 Copyright (c) 1982, 2009, Oracle and/or its affiliates. All rights reserved. Connected to: Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - Production With the Partitioning, OLAP, Data Mining and Real Application Testing options Starting "ULFET"."SYS_EXPORT_TABLE_01": ulfet/********@ulfetdb directory=my_dir dumpfile=test_tbl2.dmp tables=test_tbl Estimate in progress using BLOCKS method... Processing object type TABLE_EXPORT/TABLE/TABLE_DATA Total estimation using BLOCKS method: 64 KB Processing object type TABLE_EXPORT/TABLE/TABLE
  • 4. . . exported "ULFET"."TEST_TBL" 5.414 KB 1 rows Master table "ULFET"."SYS_EXPORT_TABLE_01" successfully loaded/unloaded ****************************************************************************** Dump file set for ULFET.SYS_EXPORT_TABLE_01 is: /u01/app/oracle/admin/ulfetdb/dpdump/test_tbl2.dmp Job "ULFET"."SYS_EXPORT_TABLE_01" successfully completed at 15:13:30 --Oracle 10g [oracle@localhost ~]$ impdp ulfet/ulfet@mydb directory=my_dir dumpfile=test_tbl2.dmp tables=test_tbl remap_tablespace=REC_TBS:USERS Import: Release 10.2.0.4.0 - Production on Monday, 10 December, 2012 13:53:30 Copyright (c) 2003, 2007, Oracle. All rights reserved. Connected to: Oracle Database 10g Enterprise Edition Release 10.2.0.4.0 - Production With the Partitioning, OLAP, Data Mining and Real Application Testing options ORA-39001: invalid argument value ORA-39000: bad dump file specification ORA-39142: incompatible version number 3.1 in dump file "/home/oracle/oracle/product/10.2.0/db_1/admin/mydb/dpdump/test_tbl2.dmp" EXPDP versiya parameteri aşağıdakı Oracle versiya və relizlərində çalışır:  Oracle 10g R1  Oracle 10g R2  Oracle 11g R1  Oracle 11g R2