复制表结构及其数据 create table table_name_new as select * from table_name_old 只复制表结构 create table table_name_new as select * from table_name_old where 1=2 只复制表数据 insert into table_name_new select * from table_name_old 表结构不一样 insert into table_name_new(column…
create materialized view MV_XXXXrefresh fast on commitwith rowidenable query rewriteasselect * from SYS_USER where (USER_STATUS=0 AND USER_HR=1); oracle 有个机制,一旦条件与物化视图里的一样,那么会自动使用物化视图表 ORA-23413: 表 "xxx"."xx" 不带实体化视图日志 DROP materialize…
--删除物化表的日志表 DROP MATERIALIZED VIEW LOG ON 表名; --为将要创建物化视图的表添加带主键的日志表 CREATE MATERIALIZED VIEW LOG ON 表名 WITH PRIMARY KEY; --创建物化视图并每分钟刷新一次 CREATE MATERIALIZED VIEW 表名 NOLOGGING REFRESH FAST ON DEMAND WITH PRIMARY KEY START WITH SYSDATE NEXT SYSDATE +…
转:http://blog.sina.com.cn/s/blog_6b58d2fa0100rgvw.html 1.使用create or replace view命令创建视图 语法格式: create or replace view 视图名 as select 查询子句 例子: create or replace view tb_user_view1 as select count(username) shuliang,username from tb_user group by userna…