• GBASE 8A v953报错集锦43--使用 gcdump 指定参数 ignore-table 不导出指定的 表或视图


    问题现象

    use testdb;

    create table t2(id int,name varchar(20),type int);

    create view v2 as select * from t2;

    create table t1(id int,name varchar(20),type int);

    create view v1 as select * from t1;

    alter table t1 drop column type;

    alter table t2 drop column type;

    create table t3(id int,name varchar(20),type int);

    gcdump导出报错

    # /opt/gcluster/server/bin/gcdump -B testdb

    DROP DATABASE IF EXISTS `testdb`;

    CREATE DATABASE IF NOT EXISTS `testdb` DEFAULT CHARACTER

    SET utf8;

    USE `testdb`;

    ...

    use testdb;

    DROP TABLE IF EXISTS `t3`;

    CREATE TABLE `t3` (

    `id` int(11) DEFAULT NULL,

    `name` varchar(20) DEFAULT NULL,

     `type` int(11) DEFAULT NULL

    ) ENGINE=EXPRESS DEFAULT CHARSET=utf8 TABLESPACE='sys_tables

    pace';

    2017-11-23 14:51:04.086 gcdump: Couldn't execute 'show create table `v1`':

    View 'testdb.v1' references invalid table(s) or column(s) or function(s) or def

    iner/invoker of view lack rights to use them (1356)

    解决方法

    如果需要忽略报错,不导出有问题的视图,可以加--ignore-table 参数。

    $$GCLUSTER_BASE/server/bin/gcdump -B testdb --ignore-table=testdb.v

    1 --ignore-table=testdb.v2

    DROP DATABASE IF EXISTS `testdb`;

    CREATE DATABASE IF NOT EXISTS `testdb` DEFAULT CHARACTER

    SET utf8;

    ...

    use testdb;

    DROP TABLE IF EXISTS `t3`;

    CREATE TABLE `t3` (

    `id` int(11) DEFAULT NULL,

    `name` varchar(20) DEFAULT NULL,

    `type` int(11) DEFAULT NULL

    ) ENGINE=EXPRESS DEFAULT CHARSET=utf8 TABLESPACE='sys_tables

    pace';

    前提是需要事先知道哪些表或视图不需要导出,并且一个--ignore-table 参数后面只

    能设置一个表.

  • 相关阅读:
    阿里云服务器上CentOS 7.6使用rpm包安装MySQL 8.0.31
    通用操作系统服务(一)、argparse模块
    第4章_freeRTOS入门与工程实践之开发板使用
    java进阶-Netty
    文娱行业搜索最佳实践
    战略合作 | 零数科技携手中智关爱通共建基于区块链的新人力服务网络
    openGauss通过VIP实现的故障转移
    Android学习笔记 31. Receiver组件
    while 与 for
    JSR303数据校验
  • 原文地址:https://blog.csdn.net/ls_hong/article/details/126570566