SQL*Plus: Release 10.2.0.4.0 - Production on 星期二 11月 26 10:16:39 2013
Copyright (c) 1982, 2007, Oracle. All Rights Reserved.
连接到:
Oracle Database 10g Enterprise Edition Release 10.2.0.4.0 - Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
SQL> conn scott/cat
已连接。
SQL> create materialized view mv_test as select * from dept1; --创建ON DEMAND 物化视图
实体化视图已创建。
SQL> select mv.REFRESH_MODE from user_mviews mv where mv.MVIEW_NAME = 'MV_TEST';
SQL> create view v_test as select * from dept1; --创建一个普通视图
视图已创建。
SQL> select * from v_test;
DEPTNO DNAME LOC
---------- -------------- -------------
10 ACCOUNTING NEW YORK
20 RESEARCH DALLAS
30 SALES CHICAGO
40 OPERATIONS BOSTON
50 wang gongzuo
60 zhuzhzu zhuzhuz
已选择6行。
SQL> insert into dept1(deptno,dname,loc) values (70,'test','test'); --插入一条测试数据
已创建 1 行。
SQL> select * from v_test; --普通视图数据已变化
DEPTNO DNAME LOC
---------- -------------- -------------
10 ACCOUNTING NEW YORK
20 RESEARCH DALLAS
30 SALES CHICAGO
40 OPERATIONS BOSTON
50 wang gongzuo
60 zhuzhzu zhuzhuz
70 test test