next up previous contents
Next: Metadata 後設資料 Up: 其他 Previous: Clone Tables 複製資料表   Contents   DYWANG_HOME

查看複製的資料表

  1. 新的資料表的結構與原資料表完全一樣。
    mariadb root@localhost:dyw> show create table clone1_animals\G                  
    ***************************[ 1. row ]***************************
    Table        | clone1_animals
    Create Table | CREATE TABLE `clone1_animals` (
      `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
      `name` varchar(20) NOT NULL,
      `foot` tinyint(3) unsigned NOT NULL,
      PRIMARY KEY (`id`)
    ) ENGINE=InnoDB AUTO_INCREMENT=16 DEFAULT CHARSET=utf8
    
    1 row in set
    Time: 0.012s
    mariadb root@localhost:dyw> show create table clone_animals\G                   
    ***************************[ 1. row ]***************************
    Table        | clone_animals
    Create Table | CREATE TABLE `clone_animals` (
      `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
      `name` varchar(20) NOT NULL,
      `foot` tinyint(3) unsigned NOT NULL,
      PRIMARY KEY (`id`)
    ) ENGINE=InnoDB AUTO_INCREMENT=16 DEFAULT CHARSET=utf8
    
    1 row in set
    Time: 0.018s
    
  2. 新的資料表的紀錄與原資料表完全一樣。
    mariadb root@localhost:dyw> select * from animals;                              
    +----+---------+------+
    | id | name    | foot |
    +----+---------+------+
    | 1  | dog     | 4    |
    | 2  | cat     | 4    |
    | 3  | chicken | 2    |
    | 15 | bird    | 2    |
    +----+---------+------+
    
    4 rows in set
    Time: 0.027s
    mariadb root@localhost:dyw> select * from clone1_animals;                       
    +----+---------+------+
    | id | name    | foot |
    +----+---------+------+
    | 1  | dog     | 4    |
    | 2  | cat     | 4    |
    | 3  | chicken | 2    |
    | 15 | bird    | 2    |
    +----+---------+------+
    
    4 rows in set
    Time: 0.028s
    mariadb root@localhost:dyw> select * from clone_animals;                        
    +----+---------+------+
    | id | name    | foot |
    +----+---------+------+
    | 1  | dog     | 4    |
    | 2  | cat     | 4    |
    | 3  | chicken | 2    |
    | 15 | bird    | 2    |
    +----+---------+------+
    
    4 rows in set
    Time: 0.026s
    



De-Yu Wang 2020-06-16