Oracle
Oracle 導出未正確導入(缺少一半以上的表)
我有一個 75gb 數據庫的導出,分成 2gb 文件。當我在創建表空間和使用者以匹配原始數據庫後執行 imp 實用程序時,我不認為所有表都已創建。我認為這是因為表名(按字母順序)來自 AD。每個現有的表名都有一個匹配的序列。但是,序列來自 AW。所以“應該”有大約 2 倍以上以字母 CW 開頭的表格。
所以我的第一個問題是,數據庫的整個架構是否儲存在第一個 dmp 文件中(當它用 exp 拆分為多個文件時)?或者可以拆分成多個。查看第一個 dmp 文件,我看不到任何失去表的跡象。
或者,這只是一個糟糕的出口嗎?
不,架構定義不完全儲存在第一個文件中:
SQL> select segment_name, bytes/1024/1024 as size_mb from user_segments; SEGMENT_NAME SIZE_MB ------------ ---------- T1 80 T2 80 $ exp bp/bp tables=T1,T2 file=expdat1.dmp,expdat2.dmp,expdat3.dmp,expdate4.dmp filesize=50M Export: Release 12.1.0.2.0 - Production on Wed Sep 21 16:52:04 2016 Copyright (c) 1982, 2014, Oracle and/or its affiliates. All rights reserved. Connected to: Oracle Database 12c Enterprise Edition Release 12.1.0.2.0 - 64bit Production With the Partitioning, Automatic Storage Management, OLAP, Advanced Analytics, Real Application Testing and Unified Auditi Export done in US7ASCII character set and AL16UTF16 NCHAR character set server uses AL32UTF8 character set (possible charset conversion) About to export specified tables via Conventional Path ... . . exporting table T1 continuing export into file expdat2.dmp 675872 rows exported EXP-00091: Exporting questionable statistics. . . exporting table T2 continuing export into file expdat3.dmp continuing export into file expdate4.dmp 675872 rows exported EXP-00091: Exporting questionable statistics. Export terminated successfully with warnings.
第一個
CREATE TABLE
在第一個文件中,第二個CREATE TABLE
在第二個文件中:$ grep -a "CREATE TABLE" *dmp expdat1.dmp:CREATE TABLE "T1" ("OWNER" VARCHAR2(128), "OBJECT_NAME" VARCHAR2(128), "SUBOBJECT_NAME" VARCHAR2(128), "OBJECT_ID" NUMBER, "DATA_OBJECT_ID" NUMBER, "OBJECT_TYPE" VARCHAR2(23), "CREATED" DATE, "LAST_DDL_TIME" DATE, "TIMESTAMP" VARCHAR2(19), "STATUS" VARCHAR2(7), "TEMPORARY" VARCHAR2(1), "GENERATED" VARCHAR2(1), "SECONDARY" VARCHAR2(1), "NAMESPACE" NUMBER, "EDITION_NAME" VARCHAR2(128), "SHARING" VARCHAR2(13), "EDITIONABLE" VARCHAR2(1), "ORACLE_MAINTAINED" VARCHAR2(1)) PCTFREE 10 PCTUSED 40 INITRANS 1 MAXTRANS 255 STORAGE(INITIAL 83886080 NEXT 1048576 MINEXTENTS 1 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT) TABLESPACE "USERS" LOGGING NOCOMPRESS expdat2.dmp:CREATE TABLE "T2" ("OWNER" VARCHAR2(128), "OBJECT_NAME" VARCHAR2(128), "SUBOBJECT_NAME" VARCHAR2(128), "OBJECT_ID" NUMBER, "DATA_OBJECT_ID" NUMBER, "OBJECT_TYPE" VARCHAR2(23), "CREATED" DATE, "LAST_DDL_TIME" DATE, "TIMESTAMP" VARCHAR2(19), "STATUS" VARCHAR2(7), "TEMPORARY" VARCHAR2(1), "GENERATED" VARCHAR2(1), "SECONDARY" VARCHAR2(1), "NAMESPACE" NUMBER, "EDITION_NAME" VARCHAR2(128), "SHARING" VARCHAR2(13), "EDITIONABLE" VARCHAR2(1), "ORACLE_MAINTAINED" VARCHAR2(1)) PCTFREE 10 PCTUSED 40 INITRANS 1 MAXTRANS 255 STORAGE(INITIAL 83886080 NEXT 1048576 MINEXTENTS 1 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT) TABLESPACE "USERS" LOGGING NOCOMPRESS
執行導入時,您應該以正確的順序提供所有轉儲文件的名稱。