Links
Home
Oracle DBA Forum
Frequent Oracle Errors
TNS:could not resolve the connect identifier specified
Backtrace message unwound by exceptions
invalid identifier
PL/SQL compilation error
internal error
missing expression
table or view does not exist
end-of-file on communication channel
TNS:listener unknown in connect descriptor
insufficient privileges
PL/SQL: numeric or value error string
TNS:protocol adapter error
ORACLE not available
target host or object does not exist
invalid number
unable to allocate string bytes of shared memory
resource busy and acquire with NOWAIT specified
error occurred at recursive SQL level string
ORACLE initialization or shutdown in progress
archiver error. Connect internal only, until freed
snapshot too old
unable to extend temp segment by string in tablespace
Credential retrieval failed
missing or invalid option
invalid username/password; logon denied
unable to create INITIAL extent for segment
out of process memory when trying to allocate string bytes
shared memory realm does not exist
cannot insert NULL
TNS:unable to connect to destination
remote database not found'>ora-02019
exception encountered: core dump
inconsistent datatypes
no data found
TNS:operation timed out
PL/SQL: could not find program
existing state of packages has been discarded
maximum number of processes exceeded
error signaled in parallel query server
ORACLE instance terminated. Disconnection forced
TNS:packet writer failure
see ORA-12699
missing right parenthesis
name is already used by an existing object
cannot identify/lock data file
invalid file operation
quoted string not properly terminated
HELP!!! ---- MViews...

HELP!!! ---- MViews...

2004-07-14       - By Jonathan Lewis

Reply:     1     2     3     4  


1) I can promise you that on commit refresh would not be nice ;)

2) I think the problem is probably with the SYSDATE
that appears in WHERE clause. I would be very
very surprised if that were legal, as the materialized
would have to maintain itself every second without
any change taking place on the user data.

Regards

Jonathan Lewis

http://www.jlcomp.demon.co.uk

http://www.jlcomp.demon.co.uk/faq/ind_faq.html
The Co-operative Oracle Users ' FAQ

http://www.jlcomp.demon.co.uk/seminar.html
Optimising Oracle Seminar - schedule updated May 1st


-- -- Original Message -- --
From: "Freeman Robert - IL " <FREEMANR@(protected) >
To: <oracle-l@(protected) >
Sent: Wednesday, July 14, 2004 6:17 PM
Subject: HELP!!! ---- MViews...


Ok... I 'm trying to build an MView that will fast refresh (on commit would
be nice but it 's not required). Looking at the Oracle documentation, it
seems this should be ok, but I keep getting this error:

ORA-12015 (See ORA-12015.ora-code.com): cannot create a fast refresh materialized view from a complex
query

This is in 9.2.0.4

I have MView logs created on each table with ROWID and the non pk coumn
names listed as well as including new values as seen in this example:

create materialized view log on bag_tag_flt_leg with rowid, (
dep_rte_type_cd, scan_on_ind, flt_leg_actv_ind) including new values ;

It 's got a UNION ALL in it, but I beleive that this is supported (at least
the doc 's say so). I 've also added counts for each aggregate expression.
I 've run this through dbms_mview.explain_mview and I get no usable results.

Tis is the statement I 'm trying to get to fast refresh, anyone see anything
that seems out of place?


create materialized view mv_test_rf
build immediate
refresh fast
-- on commit
as
SELECT
BAG_TAG_FLT_LEG.flt_leg_lcl_dep_dt AS summ_dt,
BAG_TAG_FLT_LEG.orig_arpt_cd AS arpt_iata_cd,
BAG_TAG_FLT_LEG.carr_iata_cd,
'D ' AS ind,
BAG_TAG_FLT_LEG.dep_rte_type_cd AS rte_type_cd,
COUNT(*) AS bag_tag_tot_cnt,
SUM(BAG_TAG_FLT_LEG.scan_on_ind) AS bag_tag_scan_ind_cnt,
COUNT(BAG_TAG_FLT_LEG.scan_on_ind) as count_one
FROM
BAG_TAG_FLT_LEG,
OPS_FLT_LEG
WHERE
-- Join OPS_FLT_LEG and BAG_TAG_FLT_LEG tables
OPS_FLT_LEG.flt_nbr = BAG_TAG_FLT_LEG.flt_nbr AND
OPS_FLT_LEG.carr_iata_cd = BAG_TAG_FLT_LEG.carr_iata_cd AND
OPS_FLT_LEG.flt_lcl_orig_dt =
BAG_TAG_FLT_LEG.flt_lcl_orig_dt AND
OPS_FLT_LEG.orig_arpt_cd = BAG_TAG_FLT_LEG.orig_arpt_cd AND
-- Select active flight legs scheduled to depart yesterday and
today
-- and actually departing since 23:00 2 days ago
BAG_TAG_FLT_LEG.flt_leg_lcl_dep_dt BETWEEN TRUNC(SYSDATE - 1)
AND TRUNC(SYSDATE) AND
BAG_TAG_FLT_LEG.flt_leg_actv_ind = '1 ' AND
OPS_FLT_LEG.lcl_out_dtm >= TRUNC(SYSDATE - 1) - 1/24 AND
OPS_FLT_LEG.active_ind = 1
GROUP BY
BAG_TAG_FLT_LEG.flt_leg_lcl_dep_dt,
BAG_TAG_FLT_LEG.orig_arpt_cd,
BAG_TAG_FLT_LEG.carr_iata_cd,
'D ',
BAG_TAG_FLT_LEG.dep_rte_type_cd
UNION ALL
SELECT
TRUNC(SCHED_FLT_LEG.lcl_arr_dtm) AS summ_dt,
BAG_TAG_FLT_LEG.dest_arpt_cd AS arpt_iata_cd,
BAG_TAG_FLT_LEG.carr_iata_cd,
'A ' AS ind,
BAG_TAG_FLT_LEG.arr_rte_type_cd AS rte_type_cd,
COUNT(*) AS bag_tag_tot_cnt,
SUM(BAG_TAG_FLT_LEG.scan_off_ind) AS bag_tag_scan_ind_cnt,
COUNT(bag_tag_flt_leg.scan_off_ind) as count_two
FROM
SCHED_FLT_LEG,
BAG_TAG_FLT_LEG,
OPS_FLT_LEG
WHERE
-- Join SCHED_FLT_LEG and BAG_TAG_FLT_LEG tables
SCHED_FLT_LEG.flt_nbr = BAG_TAG_FLT_LEG.flt_nbr AND
SCHED_FLT_LEG.carr_iata_cd = BAG_TAG_FLT_LEG.carr_iata_cd AND
SCHED_FLT_LEG.flt_lcl_orig_dt = BAG_TAG_FLT_LEG.flt_lcl_orig_dt
AND
SCHED_FLT_LEG.orig_arpt_cd = BAG_TAG_FLT_LEG.orig_arpt_cd AND
SCHED_FLT_LEG.dest_arpt_cd = BAG_TAG_FLT_LEG.dest_arpt_cd AND
-- Join OPS_FLT_LEG and SCHED_FLT_LEG tables
OPS_FLT_LEG.flt_nbr = SCHED_FLT_LEG.flt_nbr AND
OPS_FLT_LEG.carr_iata_cd = SCHED_FLT_LEG.carr_iata_cd AND
OPS_FLT_LEG.flt_lcl_orig_dt = SCHED_FLT_LEG.flt_lcl_orig_dt AND
OPS_FLT_LEG.dest_arpt_cd = SCHED_FLT_LEG.dest_arpt_cd AND
-- Select active flight legs scheduled to arrive yesterday and
today
-- and actually arriving since 21:00 2 days ago
SCHED_FLT_LEG.lcl_arr_dtm BETWEEN TRUNC(SYSDATE - 1)
AND TRUNC(SYSDATE + 1) AND
BAG_TAG_FLT_LEG.flt_leg_actv_ind = '1 ' AND
OPS_FLT_LEG.lcl_in_dtm >= TRUNC(SYSDATE - 1) - 3/24 AND
OPS_FLT_LEG.active_ind = 1
GROUP BY
TRUNC(SCHED_FLT_LEG.lcl_arr_dtm),
BAG_TAG_FLT_LEG.dest_arpt_cd,
BAG_TAG_FLT_LEG.carr_iata_cd,
'A ',
BAG_TAG_FLT_LEG.arr_rte_type_cd

Robert


-- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ------
Please see the official ORACLE-L FAQ: http://www.orafaq.com
-- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ------
To unsubscribe send email to: oracle-l-request@(protected)
put 'unsubscribe ' in the subject line.
--
Archives are at http://www.freelists.org/archives/oracle-l/
FAQ is at http://www.freelists.org/help/fom-serve/cache/1.html
-- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- --