- 浏览: 245735 次
- 性别:
- 来自: 杭州
文章分类
最新评论
-
nodonkey:
貌似还是不行,再等等吧,amfphp要出2.0了
amfphp1.9与php5.3.X版本不兼容 -
live711:
请问amfphp与php5.3.X搭配能用了吗?
amfphp1.9与php5.3.X版本不兼容 -
zhousheng193:
非常感谢!
安装flash player debug版本遇到的一些问题 -
sp42:
谢谢提示,我遇到的也是不能加密,用MAC地址代替之。
DI-624+A路由器韧体升级解决经常掉线的问题(转) -
心似海:
不错,要挖去了,哈哈
深入sql之merge into
There are two kinds of views in an Oracle database, and they are very different in their implementation and use. One is stored as pure SQL, while the other creates a table that it maintains. We will start with the simple view.
Views
A view is simply the representation of a SQL statement that is stored in memory so that it can easily be re-used. You use a view in much the same way you use a database table. Note that this command does not result in anything being actually stored in the database at all except for a data dictionary entry that defines this view.This means that every time you query this view, Oracle has to go out and execute the view and query the database data. When you query from a view, the database takes the stored SQL statement and creates a table in memory. Because it is defined as a SQL statement, a view can join tables or limit the number of rows. There are two primary uses of views:
§ Reduce the complexity of a SQL statement
We can reduce the complexity of our queries by creating a view instead of using subqueries.
Visually, the database creates the view in memory and then selects from it. In reality, the view SQL is combined with your query, and the resulting query is executed. The complexity is reduced only for the user.
§ Restrict access to data.
The other use of a view is to limit a user’s access to some of the data.Views have long been used to hide the tables that actually contain the data you are querying. Also, views can be used to restrict the columns that a given user has access to. Using views for security on less complex databases is probably not a bad thing. As databases become more complex, this solution becomes harder to scale and other solutions will be needed.
A simple view can be inserted/updated/deleted because it directly relates to the table it is created on.
Example:
If you need to recreate a view, you can use the CREATE or REPLACE command, and all grants will be preserved.
SQL>
create or replace view sales_s109 as
2 select *
3 from sales
4 where store_key in ('S109','S108')
5 with read only;
View created.
Notice that with the CREATE or REPLACE command, we do not have to first drop the view.
Complex views contain table joins, functions or groups. Complex views do not map back to the underlying tables. If we group our sales by store, each row in my view is an aggregate of the rows in the underlying tables.
Complex views contain table joins, functions or groups. Complex views do not map back to the underlying tables. If we group our sales by store, each row in my view is an aggregate of the rows in the underlying tables.
create
view avg_store as
select
store_name,
avg(quantity) qty
from
store join sales using (store_key)
group by store_name;
The example above contains a GROUP BY clause and a multi- row function. This view is not updatable. A view is not updatable if:
§ Contains a multi row function
§ Contains a group by clause
§ Contains the distinct key word.
§ Uses the rownum key word.
If the view joins more than one table and does not violate the rules defined above, you can update one table’s data at a time.
Our view will only show us rows with a store key of S110. But, it will allow you to insert a row with another store key. To insure that this is not possible, you can create the view with the CHECK option, and all INSERT<!-- [if supportFields]> XE "INSERT" <![endif]--><!-- [if supportFields]><![endif]--> /UPDATE<!-- [if supportFields]> XE "UPDATE" <![endif]--><!-- [if supportFields]> <![endif]--> operations will be validated against the WHERE clause in the view.
SQL>
create or replace view sales_s110 as
2 select *
3 from sales
4 where store_key = 'S110'
5 with check option constraint s110_view_ck;
View created.
SQL>
insert into sales_s110
2 values ('B104','S106','O200',SYSDATE,300);
insert into sales_s110
*
ERROR at line 1:
ORA-01402: view WITH CHECK OPTION where-clause violation
The CHECK option creates a constraint on the view.
If we no longer need the view, we can delete it from the database by dropping it. SQL> drop view sales_s110;
发表评论
-
alter table move 与shrink space的区别
2012-03-06 13:51 2235转自:http://hi.baidu.co ... -
mysqlsla来分析MYSQL的性能及索引
2011-01-17 19:56 1313— Slow log: mysqlsla -lt slow ... -
六款常用mysql slow log分析工具的比较
2011-01-17 19:06 1274转自:http://www.iteye.com/topi ... -
MySQL的大小写敏感性
2011-01-12 14:05 1052转自: http://www.zeali.net/ent ... -
如何查看mysql的版本
2010-05-22 11:52 22028如果我们想要查看mysql数据库的版本有以下四种方法: ... -
MySQL 数据库的备份和恢复
2010-03-19 13:44 922转自 忧里修斯 http://tec ... -
mysql使用show命令以及replace函数批量修改数据
2010-03-19 13:37 2409一.mysql的show命令 a. show tables或 ... -
MySQL中的ROWNUM的实现
2010-01-26 13:43 2200本文转自 http://blog.csdn.net/ACMA ... -
一个MySQL死锁问题的分析及解决
2010-01-20 12:50 1254转自http://java-guru.iteye.com/bl ... -
MySQL 死锁分析
2010-01-20 12:42 33381.MySQL锁和死锁的理解: ... -
sql 按指定顺序排序
2010-01-19 10:53 21771、在ORACLE中使用Decode Decode实 ... -
MYSQL 事务管理
2009-10-26 19:48 1058mysql_query("BEGIN"); ... -
delete 符合条件的记录中的前几条或者重复记录
2009-09-03 20:04 2069今天写代码,遇到了这个问题,只能删除符合条件的记录中的某几条. ... -
sql update delete 中 使用 inner join
2009-08-24 11:38 7192SQL中使用update inner join和delet ... -
What is the difference between VARCHAR, VARCHAR2 ?
2009-06-01 09:43 928Both CHAR and VARCHAR2 types ar ... -
Oracle index
2009-05-15 10:50 0索引是一种可以提高查 ... -
IN and EXISTS, NOT IN AND NOT EXISTS
2009-04-10 14:28 1433Functionally, they are the same ... -
ORACLE 之 TRUNCATE TABLE
2009-03-30 16:49 1982TRUNCATE Caution: Y ... -
深入sql之merge into
2009-01-08 16:38 4777转自 逆水流沙 http://hi.baidu.com/wen ... -
Oracle日期函数操作(收集整理版)
2008-12-04 16:50 2789经常在平时的开发中要用到oracle的日期函数,每次都要上 ...
相关推荐
DATABASE AND INSTANCE PERFORMANCE/DATABASE AND INSTANCE CONFIGURATION/HIGH AVAILABILITY AND RECOVERABILITY/BACKUPS/ARCHIVES/RECOVERY 等是 Oracle 10g Database Views 中的一些视图,提供了数据库和实例的...
materialized_views ==================== 使用在 Postgres 中创建自动更新物化视图的方法扩展ActiveRecord::Migration 。 可以执行来检查物化视图是否与其非物化版本保持同步。 背景 以下是有关物化视图的一些...
Simulation for Generate Efficient Evaluation Plans With Materialized Views
为了进一步提高数据仓库的性能, 通过分析数据仓库中性能优化技术的特点, 提出了索引和物化视图耦合的性能优化技术。通过数据挖掘自动选择候选索引和物化视图, 减少查询的扫描范围; 然后研究在物化视图上建立索引的...
Create reusable components that bring Bootstrap and Angular together and effectively use materialized views for caching within Postgres. Get your front end working with Webpack, use Postgres' ...
See Creating and Managing Materialized Views. Note: Known Issues and Limitations describes a limitation of materialized view support in Greenplum 6.2.1. The gpinitsystem utility supports the --...
9 Advanced Materialized Views 10 Dimensions Part IV Managing the Data Warehouse Environment 11 Overview of Extraction, Transformation, and Loading 12 Extraction in Data Warehouses 13 Transportation ...
"materialized views.sql"可能进一步扩展了物化视图的使用,可能包含多个物化视图的创建、更新或维护。最后,"视图DML.sql"可能包含了对视图进行INSERT、UPDATE或DELETE操作的触发器定义,这些触发器在数据修改时会...
- Oracle的物化视图(Materialized View)提供了预计算和存储结果的功能,对于需要快速查询汇总数据的场景非常有用。 7. **索引视图**: - Oracle 10g引入了索引组织表(IOT)和索引-唯一-视图(IUV),这些特性...
在数据库管理领域,Materialized Views(物化视图)是一种非常实用的功能,它允许用户预先计算和存储复杂查询的结果,从而提高数据检索速度。在PostgreSQL数据库系统中,Materialized Views是常用的数据优化手段,...
Use secondary indexes and materialized views to avoid denormalization of data Effortlessly handle concurrent updates with collection columns Ensure data integrity with lightweight transactions and ...
介绍 这个存储库是一个示例 Magento 扩展,它使用企业版 1.13 中的新 Mview 组件。 它是作为博客文章的一部分构建的,位于 安装 要安装此扩展,只需将其复制到您的基本 Magento 安装目录中,因为它以 Magento 核心...
**Replication/Materialized Views** 1. **V$MVREFRESH**: 显示Materialized View刷新的信息。 2. **V$REPLPROP**: 显示复制属性的信息。 3. **V$REPLQUEUE**: 显示复制队列的信息。 **Direct Loader** 1. **V$...
除了Oracle Streams和materialized views之外,Oracle 11gR2还提供了一系列其他的分布式数据库功能,如: - **数据库链接**:允许从一个数据库访问另一个数据库中的数据。 - **数据守护程序**:用于实现高可用性和...
- Materialized Views:物化视图用于快速查询和数据刷新。 - RAC(Real Application Clusters):Oracle的集群技术,提供高可用性和负载均衡。 - Flashback技术:包括闪回查询、闪回表、闪回事务等,用于数据恢复...
page_type 语言 产品展示 描述 urlFragment 样品 尖锐的 天蓝色 显示如何使用无服务器方法通过Azure Functions,Cosmos DB和Cosmos DB Change Feed来近乎实时地更新实例化视图。 实时查看cosomos天蓝色功能 ...