解决sql脚本导入Oracle重复生成check约束问题
【网址】https://blog.csdn.net/yzf913214/article/details/53669071
查看用户HN_KW下的所有表的总记录数:
SELECT SUM(num_rows) FROM SYS.ALL_TABLES T WHERE T.OWNER = 'HN_KW';
查看用户HN_KW下的各表的总记录数:
SELECT t."OWNER",t.TABLE_NAME,t.NUM_ROWS FROM SYS.ALL_TABLES T WHERE T.OWNER = 'HN_KW' ORDER BY num_rows DESC;
查看用户HN_KW下所有表的字段总数:
SELECT * FROM SYS.dba_TAB_columns T WHERE T.OWNER = 'HN_KW';
Oracle查询数据库中所有表的记录数:
select t.table_name,t.num_rows from user_tables t;
/* Date: 2018-11-06 10:16:47 */ --表的sql脚本 -- ---------------------------- -- Table structure for BASIS_APP -- ---------------------------- DROP TABLE "HN_KW"."BASIS_APP"; CREATE TABLE "HN_KW"."BASIS_APP" ( "APPID" NUMBER NOT NULL , "APP_NO" VARCHAR2(64 BYTE) NOT NULL , "APP_MC" VARCHAR2(128 BYTE) NOT NULL , "APP_ORDER" NUMBER NULL , "APP_BZ" VARCHAR2(128 BYTE) NULL ) LOGGING NOCOMPRESS NOCACHE ; -- ---------------------------- -- Indexes structure for table BASIS_APP -- ---------------------------- CREATE UNIQUE INDEX "HN_KW"."IDX_BAS_APP_NO" ON "HN_KW"."BASIS_APP" ("APP_NO" ASC) LOGGING VISIBLE; -- ---------------------------- -- Checks structure for table BASIS_APP -- ---------------------------- ALTER TABLE "HN_KW"."BASIS_APP" ADD CHECK ("APPID" IS NOT NULL); ALTER TABLE "HN_KW"."BASIS_APP" ADD CHECK ("APP_NO" IS NOT NULL); ALTER TABLE "HN_KW"."BASIS_APP" ADD CHECK ("APP_MC" IS NOT NULL);-- ---------------------------- -- Primary Key structure for table BASIS_APP -- ---------------------------- ALTER TABLE "HN_KW"."BASIS_APP" ADD PRIMARY KEY ("APPID");