View Materializada ou Snapshot

DBA Geral (instalação, configuração do banco, scripts do Sql*Plus, shell scripts, batch scripts, etc...)
Responder
Deathão
Rank: Programador Sênior
Rank: Programador Sênior
Mensagens: 57
Registrado em: Qui, 16 Jun 2005 11:31 am
Localização: Assis
Contato:
--
Júnior

Bom dia galera, estou com algumas dúvidas sobre View Materializadas ou Snapshots....

seguinte, ao tentar criar uma View Materializada ou um Snapshot utilizando uma query, só que existe um problema que ele não aceita quando uma query contém sub-queries dentro, alguém sabe o motivo deste ???

acho uma coisa meio que absurda não aceitar esse tipo de query..

se alguém já se deparou com isso, favor dê uma dica aqui...

Ps: para resolver o meu problema, tive que criar um procedimento PL/SQL que faz o mesmo que uma view materializada, eu criei uma tabela com os campos da minha view, e dei a carga nesta tabela, é meio "gambiarra" isso, se alguém tiver uma idéia melhor me avisem aí por favor, muito obrigado..
Avatar do usuário
dr_gori
Moderador
Moderador
Mensagens: 5024
Registrado em: Seg, 03 Mai 2004 3:08 pm
Localização: Portland, OR USA
Contato:
Thomas F. G

Você já respondeu a dúvida de alguém hoje?
https://glufke.net/oracle/search.php?search_id=unanswered

Pois é...
Existe uma série de restrições para o uso de views materializadas.
Esse link tem vários exemplos sobre isso (em ingles)
http://www.lc.leidenuniv.nl/awcourse/or ... .htm#28373

Vou citar alguns:

Selecionar tudo

Restrictions for Materialized Views with Subqueries

The defining query of a materialized view with a subquery is subject to several restrictions to preserve the materialized view's fast refresh capability.

The following are restrictions for fast refresh materialized views with subqueries:

    * Materialized views must be primary key materialized views.
    * The master's materialized view log must include certain columns referenced in the subquery. For information about which columns must be included, see "Logging Columns in the Materialized View Log".
    * If the subquery is many to many or one to many, join columns that are not part of a primary key must be included in the materialized view log of the master. This restriction does not apply to many to one subqueries.
    * The subquery must be a positive subquery. For example, you can use EXISTS, but not NOT EXISTS.
    * The subquery must use EXISTS to connect each nested level (IN is not allowed).
    * Each table can be in only one EXISTS expression.
    * The join expression must use exact match or equality comparisons (that is, equi-joins).
    * Each table can be joined only once within the subquery.
    * A primary key must exist for each table at each nested level.
    * Each nested level can only reference the table in the level above it.
    * Subqueries can include AND operators, but each OR operator may only reference columns contained within one row. Multiple OR operators within a subquery can be connected with an AND operator.
    * All tables referenced in a subquery must reside in the same master site or master materialized view site.
Responder
  • Informação
  • Quem está online

    Usuários navegando neste fórum: Nenhum usuário registrado e 4 visitantes