建议使用以下浏览器,以获得最佳体验。 IE 9.0+以上版本 Chrome 31+ 谷歌浏览器 Firefox 30+ 火狐浏览器
请选择 进入手机版 | 继续访问电脑版
设置昵称

在此一键设置昵称,即可参与社区互动!

确定
我再想想
选择版块

Roger的数...

发帖: 1粉丝: 0

级别 : 新手上路

Rank: 1

发消息 + 关注

发表于2020-2-14 14:09:16 1075 3 楼主 显示全部楼层
[交流求助] 这是gauss100 exp 的bug吗 ?

这是正常的情况:

SQL> exp users=roger CONTENT=all file="test.dmp" PARALLEL=2;

Parsing export options ...

Verify options ...

 verify schema ...

Starting export ...

Preparing to export ...

-- EXPORT TYPE = SCHEMA

-- EXPORT OBJECTS = ROGER

-- FILE TYPE = TXT

-- DUMP FILE = test.dmp

-- LOG FILE =

-- QUERY = ""

-- COMPRESS = N

-- CONSISTENT = N

-- CONTENT_MODE = ALL

-- SKIP_COMMENTS = N

-- FORCE = N

-- SKIP_ADD_DROP_TABLE = N

-- SKIP_TRIGGERS = N

-- QUOTE_NAMES = Y

-- TABLESPACE = N

-- COMMIT_BATCH = 1000

-- INSERT_BATCH = 1

-- FEEDBACK = 10000

-- PARALLEL = 2

-- CREATE_USER = N

-- ROLE = N

-- GRANT = N

-- WITH_CR_MODE = N


Exporting schema ROGER ...

Exporting sequence of schema ROGER ...

Exporting tables of schema ROGER ...

Reading table objects of ROGER


The order of exporting table is:

TABLE NAME                                                       LEVEL    

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

TEST                                                             1        


Exporting tables (scripts or data) of ROGER

exporting table ROGER.TEST ...

 exporting DDL of ROGER.TEST ...

 exporting indexes on ROGER.TEST ...

 exporting constraints on ROGER.TEST ...


Exporting procedures/functions/triggers of schema ROGER ...

Exporting views of schema ROGER ...

End of export schema ROGER ...


Logical export succeeded.


在没有压缩的情况下,可以直接strings查看表结构,相对来讲dmp结构比较简单:

[roger@mysqldb GaussDB_100_1.0.1-TOOLS]$ strings test.dmp

--** The script is dumped by *ZSQL/EXP* tool, Zenith@Huawei Gauss Dept.

--** Dumped time: 2020-02-14 11:53:58.708

-- EXPORT TYPE = SCHEMA

-- EXPORT OBJECTS = ROGER

-- FILE TYPE = TXT

-- DUMP FILE = test.dmp

-- LOG FILE =

-- QUERY = ""

-- COMPRESS = N

-- CONSISTENT = N

-- CONTENT_MODE = ALL

-- SKIP_COMMENTS = N

-- FORCE = N

-- SKIP_ADD_DROP_TABLE = N

-- SKIP_TRIGGERS = N

-- QUOTE_NAMES = Y

-- TABLESPACE = N

-- COMMIT_BATCH = 1000

-- INSERT_BATCH = 1

-- FEEDBACK = 10000

-- PARALLEL = 2

-- CREATE_USER = N

-- ROLE = N

-- GRANT = N

-- WITH_CR_MODE = N

ALTER SESSION SET NLS_DATE_FORMAT = 'YYYY-MM-DD HH24:MI:SS';

ALTER SESSION SET NLS_TIMESTAMP_FORMAT = 'YYYY-MM-DD HH24:MI:SS.FF';

ALTER SESSION SET NLS_TIMESTAMP_TZ_FORMAT = 'YYYY-MM-DD HH24:MI:SS.FF TZH:TZM';

ALTER SESSION SET NLS_TIME_FORMAT = 'HH:MI:SS.FF AM';

ALTER SESSION SET NLS_TIME_TZ_FORMAT = 'HH:MI:SS.FF AM TZR';

ALTER SESSION SET CURRENT_SCHEMA = ROGER;

DROP TABLE IF EXISTS "TEST" CASCADE CONSTRAINTS;

CREATE TABLE "TEST"

 "A" NUMBER,

 "B" VARCHAR(20 BYTE)

TABLESPACE "USERS"

INITRANS 2

MAXTRANS 255

PCTFREE 8;

@@ data/_3F202DA1867E08580000.D

@@ data/_D6232DA186EE86A40100.D

CREATE INDEX "IDX_TEST_ID" ON "TEST"("A")

TABLESPACE "USERS"

INITRANS 2

PCTFREE 8;

-- end of exp: 2020-02-14 11:53:59.097


[roger@mysqldb GaussDB_100_1.0.1-TOOLS]$ cd data/

[roger@mysqldb data]$ ls -ltr

total 540

-rw------- 1 roger roger 275265 Feb 14 11:53 _3F202DA1867E08580000.D

-rw------- 1 roger roger 273831 Feb 14 11:53 _D6232DA186EE86A40100.D

[roger@mysqldb data]$ strings _3F202DA1867E08580000.D | more

INSERT INTO "TEST" ("A","B") values

 (1,'enmotech.com');

INSERT INTO "TEST" ("A","B") values

 (2,'killdb.com');

INSERT INTO "TEST" ("A","B") values

 (1,'killdb');

.....


这是异常情况:

SQL> exp users=roger CONTENT=ALL file="test_batch.dmp" PARALLEL=2 TABLESPACE=y ROLE=y GRANT=y;

Parsing export options ...

Verify options ...

 verify schema ...

Starting export ...

Preparing to export ...

-- EXPORT TYPE = SCHEMA

-- EXPORT OBJECTS = ROGER

-- FILE TYPE = TXT

-- DUMP FILE = test_batch.dmp

-- LOG FILE =

-- QUERY = ""

-- COMPRESS = N

-- CONSISTENT = N

-- CONTENT_MODE = ALL

-- SKIP_COMMENTS = N

-- FORCE = N

-- SKIP_ADD_DROP_TABLE = N

-- SKIP_TRIGGERS = N

-- QUOTE_NAMES = Y

-- TABLESPACE = Y

-- COMMIT_BATCH = 1000

-- INSERT_BATCH = 1

-- FEEDBACK = 10000

-- PARALLEL = 2

-- CREATE_USER = N

-- ROLE = Y

-- GRANT = Y

-- WITH_CR_MODE = N


Exporting roles  ...

Grant privilege to role ...

Exporting schema ROGER ...

Exporting grant role and privilege of schema ROGER ...

Grant privilege to schema ROGER ...

Grant role to schema ROGER ...

Exporting sequence of schema ROGER ...

Exporting tables of schema ROGER ...

Reading table objects of ROGER


The order of exporting table is:

TABLE NAME                                                       LEVEL    

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

TEST                                                             1        


Exporting tables (scripts or data) of ROGER

exporting table ROGER.TEST ...

 exporting DDL of ROGER.TEST ...

 exporting indexes on ROGER.TEST ...

 exporting constraints on ROGER.TEST ...


Exporting procedures/functions/triggers of schema ROGER ...

Exporting views of schema ROGER ...

End of export schema ROGER ...


Logical export succeeded.


SQL>

SQL> exit


[roger@mysqldb GaussDB_100_1.0.1-TOOLS]$ strings test_batch.dmp

--** The script is dumped by *ZSQL/EXP* tool, Zenith@Huawei Gauss Dept.

--** Dumped time: 2020-02-14 13:51:14.584

-- EXPORT TYPE = SCHEMA

-- EXPORT OBJECTS = ROGER

-- FILE TYPE = TXT

-- DUMP FILE = test_batch.dmp

-- LOG FILE =

-- QUERY = ""

-- COMPRESS = N

-- CONSISTENT = N

-- CONTENT_MODE = ALL

-- SKIP_COMMENTS = N

-- FORCE = N

-- SKIP_ADD_DROP_TABLE = N

-- SKIP_TRIGGERS = N

-- QUOTE_NAMES = Y

-- TABLESPACE = Y

-- COMMIT_BATCH = 1000

-- INSERT_BATCH = 1

-- FEEDBACK = 10000

-- PARALLEL = 2

-- CREATE_USER = N

-- ROLE = Y

-- GRANT = Y

-- WITH_CR_MODE = N

ALTER SESSION SET NLS_DATE_FORMAT = 'YYYY-MM-DD HH24:MI:SS';

ALTER SESSION SET NLS_TIMESTAMP_FORMAT = 'YYYY-MM-DD HH24:MI:SS.FF';

ALTER SESSION SET NLS_TIMESTAMP_TZ_FORMAT = 'YYYY-MM-DD HH24:MI:SS.FF TZH:TZM';

ALTER SESSION SET NLS_TIME_FORMAT = 'HH:MI:SS.FF AM';

ALTER SESSION SET NLS_TIME_TZ_FORMAT = 'HH:MI:SS.FF AM TZR';

GRANT CONNECT TO "ROGER";

GRANT DBA TO "ROGER";

GRANT RESOURCE TO "ROGER";

ALTER SESSION SET CURRENT_SCHEMA = ROGER;

DROP TABLE IF EXISTS "TEST" CASCADE CONSTRAINTS;

CREATE TABLE "TEST"

 "A" NUMBER,

 "B" VARCHAR(20 BYTE)

TABLESPACE "USERS"

INITRANS 2

MAXTRANS 255

PCTFREE 8;

CREATE INDEX "IDX_TEST_ID" ON "TEST"("A")

TABLESPACE "USERS"

INITRANS 2

PCTFREE 8;


我们可以看到,最后dmp中是没有实际数据的。 这是什么问题呢 ? 求解答。

举报
分享

分享文章到朋友圈

分享文章到微博

GaussDB粉e...

发帖: 44粉丝: 9

级别 : 版主

Rank: 7Rank: 7Rank: 7

发消息 + 关注

发表于2020-2-14 15:04:36 沙发 显示全部楼层

问题收到呦,我们会尽快答复您:)

点赞 评论 引用 举报

GaussDB粉e...

发帖: 44粉丝: 9

级别 : 版主

Rank: 7Rank: 7Rank: 7

发消息 + 关注

发表于2020-2-14 15:59:51 板凳 显示全部楼层

导出之前,请先使用 select count(1) from roger.test确认下roger.test中是否有记录。

点赞 评论 引用 举报

Roger的数...

发帖: 1粉丝: 0

级别 : 新手上路

Rank: 1

发消息 + 关注

发表于2020-2-14 16:50:59 地板 显示全部楼层

全部重新测了一些又ok了。。。。

SQL> truncate table test;


Succeed.


Elapsed: 0.001 sec

SQL> imp file="test_batch_1000.dmp" REMAP_SCHEMA=roger:enmo1 PARALLEL=2  LOG="test_batch_imp_1000.log";

Parsing import options ... 

Verify options ...

  verify remap schema ...

Starting import ...

Preparing to import ...

-- IMPORT TYPE = REMAP_SCHEMA

-- REMAP SCHEMA = ROGER:enmo1

-- DUMP FILE = test_batch_1000.dmp

-- LOG FILE = test_batch_imp_1000.log

-- FILE TYPE = TXT

-- SHOW = N

-- FEEDBACK = 10000

-- PARALLEL = 2

-- DDL_PARALLEL = 1

-- CONTENT_MODE = ALL

-- IGNORE = N

-- CREATE_USER = N

-- TIMING = OFF

-- BATCH_COUNT = 10000

-- DISABLE_TRIGGER = Y

-- NOLOGGING = N


data importing success, 1003 rows are loaded.

Logical import succeeded.


SQL> select count(1) from test;


COUNT(1)            

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

1000000             


1 rows fetched.


点赞 评论 引用 举报

游客

富文本
Markdown
您需要登录后才可以回帖 登录 | 立即注册