Home » SQL & PL/SQL » SQL & PL/SQL » Materialized View ORGANIZATION
Materialized View ORGANIZATION [message #228986] Wed, 04 April 2007 16:34 Go to next message
gall3n
Messages: 6
Registered: August 2006
Location: Edmonton
Junior Member
Hi. Does anyone have an example of using the ORGANIZATION key word in creating a materialized view? I'm using Oracle 10.2.

--George
Re: Materialized View ORGANIZATION [message #229002 is a reply to message #228986] Thu, 05 April 2007 00:07 Go to previous messageGo to next message
Frank Naude
Messages: 4502
Registered: April 1998
Senior Member
Here are some:

SQL> CONN scott/tiger
Connected.
SQL>
SQL> CREATE MATERIALIZED VIEW emp_heap_mv
  2          ORGANIZATION HEAP
  3          AS select * from emp;

Materialized view created.


SQL> CREATE MATERIALIZED VIEW emp_index_mv
  2          ORGANIZATION INDEX
  3          AS select * from emp;

Materialized view created.

Re: Materialized View ORGANIZATION [message #229156 is a reply to message #229002] Thu, 05 April 2007 10:11 Go to previous messageGo to next message
gall3n
Messages: 6
Registered: August 2006
Location: Edmonton
Junior Member
Thanks Frank!

That works if the source table has a primary key. Is there a way that I can create my own PK on the M View and use that?

--George
Re: Materialized View ORGANIZATION [message #229429 is a reply to message #229156] Sat, 07 April 2007 13:07 Go to previous messageGo to next message
Frank Naude
Messages: 4502
Registered: April 1998
Senior Member
MV on a table without a primary key:

SQL> CREATE TABLE no_primary_key (
  2          col1 NUMBER
  3  );

Table created.

SQL>
SQL> CREATE MATERIALIZED VIEW no_primary_key_mv
  2          ORGANIZATION HEAP
  3          REFRESH WITH ROWID
  4          AS select * from no_primary_key;

Materialized view created.
Re: Materialized View ORGANIZATION [message #230667 is a reply to message #229429] Thu, 12 April 2007 09:49 Go to previous message
gall3n
Messages: 6
Registered: August 2006
Location: Edmonton
Junior Member
Thank you.
Previous Topic: Session out after 30 min.
Next Topic: pl/sql views
Goto Forum:
  


Current Time: Tue Dec 06 06:26:59 CST 2016

Total time taken to generate the page: 0.24084 seconds