在 oracle数据库中,要想获取表的定义信息,必须使用 dbms_metadata.get_ddl方式来取,不方便,还是 mysql方便,直接使用 show create table xxx方式搞定,比如我们想查看 orders_range表的创建语句,使用下面语句搞定:
mysql> show create table orders_range \G *************************** 1. row *************************** Table: orders_range Create Table: CREATE TABLE `orders_range` ( `id` int(11) NOT NULL AUTO_INCREMENT, `customer_surname` varchar(30) DEFAULT NULL, `store_id` int(11) DEFAULT NULL, `saleperson_id` int(11) DEFAULT NULL, `order_date` date DEFAULT NULL, `note` varchar(500) DEFAULT NULL, PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (id) (PARTITION p0 VALUES LESS THAN (10000) ENGINE = InnoDB, PARTITION p1 VALUES LESS THAN (20000) ENGINE = InnoDB, PARTITION p2 VALUES LESS THAN (30000) ENGINE = InnoDB, PARTITION p3 VALUES LESS THAN (40000) ENGINE = InnoDB, PARTITION p4 VALUES LESS THAN (50000) ENGINE = InnoDB) */ 1 row in set (0.00 sec)
mysql> |