Hit All Views One After Other In Database?

Aug 26, 2003

I am writing a checker that should hit all the views one after other in database and report if there is an SQL error ( Page: Data cannot be retrived from the view XYZ).

The query I am running is
"select * from $view fetch first 1 rows only".

better query which runs faster as I have to query all the views in db in the script ( script runs every 10 mins on cron).

View 5 Replies


ADVERTISEMENT

Server Administration :: Graphical Analysis Of Dynamic Performance Views (V$ Views)?

Nov 5, 2012

is there some open source or free tool which can graphical display V$ Views. Can TOAD do that in a good maner?

in UNIX there is the "sar" command, but a Java tool "ksar" for displaying the statistics in user friendly fashion.

View 2 Replies View Related

Refresh Materialized Views Based On Remote Views?

Aug 4, 2011

I have a created a materialized view which is based on a view on remote database. Now how do I refresh the view.

Materialized view is created by

CREATE MATERIALIZED VIEW mv_employee_name
AS SELECT EMPLID, EMPL_NAME
FROM VEMPDATA@REMOTEDB
WHERE REGION = 'US';

I am wondering how the refersh happens or how do I specify the refresh clause.REFRESH FAST option is looking for VIEW LOG on the master table but in this case its a remote view, so I cannot create any object on remote db.

View 1 Replies View Related

PL/SQL :: Get List Of Materialized Views / Views Using Column Of Table

Oct 17, 2013

I am removing sal column from table tab_emp; i want to check whether any materialized view or view using this column by  querying using data dictionary :- if i use like condition against query column of all_mviews it is throwing error sicne it is long data type. is there a way to search it without creating any function and use it in a query.

View 3 Replies View Related

SQL & PL/SQL :: Create Materialized Views On A Database

Jan 5, 2011

I'm trying to create a materialized view on a database on my local laptop, and when I execute the create it fails with the following error: ORA-06550: line 1, column 60:

PLS-00103: Encountered the symbol ".16" when expecting one of the following: . ( @ ; with the table name highlighted.

CREATE MATERIALIZED VIEW Schema.MV (col1,
col2,)
BUILD IMMEDIATE
REFRESH Complete ON DEMAND
WITH PRIMARY KEY
AS
select EXTRACTVALUE (rawxml, '/Test.class/@ID') AS col1,
EXTRACTVALUE (rawxml, '/test.class/test.attribute.name') AS col2,
from RAWXML
where Type = 'test.classvalue';

The query on its own though executes fine.

select EXTRACTVALUE (rawxml, '/Test.class/@ID') AS col1,
EXTRACTVALUE (rawxml, '/test.class/test.attribute.name') AS col2,
from RAWXML
where Type = 'test.classvalue';

Is there something wrong with the table setup? I have tried creating a public synonym and still the error comes up.

View 11 Replies View Related

Replication :: Materialized Views On 3 Database?

Apr 8, 2012

There is a database db1 which has user U1 in in it contains T1 as table.

Likely,

There is also another database db2 which also has a user named U2 containing table T2 in it.

Now

I want to use the concept of JOINS and Join Table T1 of database named DB1 and Table T2 of database named DB2 and access from database named DB3 using Materialized View Concept.

what shall i do to access tables of DB1 and DB2 from database DB3 using Materialized View.

View 7 Replies View Related

Security :: Virtual Private Database Update Policy On Complex Views

Aug 21, 2013

1)I have created a complex view, and created an instead of trigger on this view

example:

create or replace trigger tr_x instead of before update on test_view_name for each row
-------
2) I have created an update policy on this view

DBMS_RLS.ADD_POLICY (
object_schema := schema_name,
object_name := name of the view,
policy_name := ploicy name,
function_schema := func schema name,
policy_function := pkg_test.fn_get_where,
statement_types := 'UPDATE',
update_check := TRUE,
policy_type := dbms_rls.dynamic);

3) function pkg_test.fn_get_where, which is used in the policy function always return 1 = 2, so that update should fail.

4) Now I will issue an update statement on the view test_view_name

update test_view_name set test_col = 1;

but still it updates the records, though update policy returns the where cluse 1 = 2

same where clause for select policy works perfectly fine.

View 4 Replies View Related

Server Utilities :: Export Procedure Views Function And Packages In Database

Sep 29, 2010

How to export the procedure,views,function and packages in a database, by using Export commmand.

View 2 Replies View Related

Convert Some Existing Materialized Views (fast Refresh) To Partition Materialized Views

Jul 7, 2010

I have to convert some existing materialized views (fast refresh) to partition materialized views.

Database version is oracle 10.1.0.4. I have decided to use on prebuilt table option to do the partitioning as it minimizes the time to transfer from the master site.

1) stop replication
1) create interim tables with similar structure as the materialized views
2) transfer all data from the materialized views to the interim tables
4) script out the materialized views structure and add in on prebuilt table option in the scripts
5) drop the materialized views
6) rename the interim tables with the same name as the materialized views
7) run the scripts to create the materialized views with on prebuilt table option
8) refresh the newly created materialized views -> it should take a short time since I am using on prebuilt table option

But I am facing one major issue. That is if I drop the materialized views, the materialized view logs of the master tables are purged. When the materialized views are refreshed fast, there are some data missing. the data that are purged out when the materialized view are dropped.

Do you happen to know other ways that existing materialized views can be converted to partitioned materialized views? Do you have any workaround to prevent the materialized view logs from being purged?

View 3 Replies View Related

Why To Need Materialized Views

Aug 26, 2010

Why do we need materialized views when the normal views also serve the same purpose?

View 2 Replies View Related

Materialized Views Not Getting Refreshed?

Dec 29, 2010

I have a problem Mat view refresh...I have to take a snapshot of the table before nsert or update to the table....below is the code written to achieve this..

create materialized view my_view refresh complete as select * from t2;
create or replace trigger TRG_T2
before insert or update on T2
declare
X number;

[code]....

However this is not getting refreshed... Also i noticed that it works for the very first time (after first insert or update) and then for successive ones it doesnt.. ..

View 1 Replies View Related

How To Refresh Materialized Views

Aug 4, 2011

I have a created a materialized view which is based on a view on remote database. Now how do I refresh the view.

Materialized view is created by

CREATE MATERIALIZED VIEW mv_employee_name
AS SELECT EMPLID, EMPL_NAME
FROM VEMPDATA@REMOTEDB
WHERE REGION = 'US';

how the refersh happens or how do I specify the refresh clause.

REFRESH FAST option is looking for VIEW LOG on the master table but in this case its a remote view, so I cannot create any object on remote db.

View 1 Replies View Related

Select All Views From Schema

Apr 27, 2010

I want to list out all the views in a schema. What table can I query?

View 2 Replies View Related

Creating Trigger For Views

Sep 21, 2008

I have a table tblcustomer and a view called vworder. I need to create a trigger such that any data being added into vworder first checks if the field customerid has the data in customerid of tblcustomer.. all it has to do is spit out a error "Customer ID not found"

So I created a view such as

Quote: create or replace TRIGGER trig_order
BEFORE INSERT OR UPDATE ON vworder
FOR EACH ROW
DECLARE
cust_id VARCHAR2(20);
BEGIN
SELECT customerid INTO cust_id FROM tblcustomer WHERE customerid = :new.customerid;
EXCEPTION
WHEN NO_DATA_FOUND THEN
Raise_application_error(-20000, 'Customer ID Does Not Exist');
END;

But it comes with error

Quote: ORA-25001: cannot create this trigger type on this type of view 25001. 00000 - "cannot create this trigger type on views" *Cause: Only INSTEAD OF triggers can be created on a view. *Action: Change the trigger type to INSTEAD OF.

I am not an expert at all and I need to finish this today itself.

View 7 Replies View Related

SQL & PL/SQL :: Usage Of Hints In The Views

Oct 11, 2011

I have a table "tl" which is partitioned--say 30 partition and for each partition there is a seperate view like as follows

create view view_t130 as select * from tl partition (p30);
create view view_t129 as select * from t1 partition (p29);
.
.
.
create view view_t101 as select * from t1 partition (p01);

my question is how to use hints on this table if your are using view to access the data from internal table.

Normal structure is if i don't wrong:-

index( <<view name|view alia name>> <<table name|table alias name>> name of index)

Consider my case

select * from view_t130 where <index_column> --not picking up index

i want to give expicit index hint.so i used the same structure that i specified above but it didn't work.

select /*+ index( view_t130 t1 <index_name) */ * from view_t130 where <index_name>

how to give explicit index hint..but one constraint is i cannot give any alias names for internal tables because those(view structure) are generated by predefined scripts..so it's not possible to change it.

View 1 Replies View Related

SQL & PL/SQL :: Refresh Views And Function?

Aug 17, 2010

Is there any function to refresh all views and functions in oracle.

View 4 Replies View Related

SQL & PL/SQL :: Refresh All Materialized Views?

Nov 28, 2011

I have n number of materialized views in my schema ..I want to refresh all M_views at once by using cursor

View 3 Replies View Related

SQL & PL/SQL :: How To Create Dynamic Views

Jun 26, 2010

How to create dynamic views? I need literature on dynamic views.

View 5 Replies View Related

SQL & PL/SQL :: Bind Variable In Views?

Dec 27, 2010

how to avoid the bind variable in view.

The query is correct but it contains bind variable Based on this query, View has to be created for report

like example select * from emp where deptno = :deptno

How to get the correct result by avoiding bind variable because view does not accept bind variable.

View 2 Replies View Related

Replication :: Views Or Streaming

Oct 13, 2008

I need to know that what is best approach for replication. Materialized View or Streaming. We have to replicate a subset of database at different nodes.

View 3 Replies View Related

Replication :: Materialized Views?

Oct 25, 2011

for following two questions.

1. I have created a materialized view with following syntax in 11g R1 database.

CREATE MATERIALIZED VIEW fr_emp_bonus_record_vw
BUILD IMMEDIATE
REFRESH COMPLETE
START WITH SYSDATE NEXT SYSDATE+1/48
ENABLE QUERY REWRITE AS
SELECT person_id, <columns>

This MV will have around 300K records and this MV will be used in other queries based on person_id. So I have created an index on mv.person_id with following syntax. I have chosen REFRESH COMPLETE, I am assuming that, Oracle truncates this table and recreates it. When it recreates this MV, does it analyze automatically or do I need to do it manually.

CREATE UNIQUE INDEX mv_u1 ON mv(person_id);

2. It takes around 2 minutes to populate 300K. While it is populating the data, if somebody accessing this view or query where this view is being used, are they going to get any error?

View 1 Replies View Related

Possible To Limit Sessions In These Views

Jan 17, 2013

I'm using Toad 11.6, I can see about 156 sessions for the database in the session browser but when I do a select from v$session, only 40 sessions are showing up. I was able to look at all the sessions until yesterday. I tried several views like v$session, v$open_cursor etc, but only 60 sessions show up. I'm connected to the database using same user login yesterday and this morning.. May be this user had some privileges revoked last night??If so is it possible to limit sessions in these views (v$session etc) but it's strange that I can see them in the session browser in Toad. 'm very confident that there are 156 sessions in the database but it's just that I'm not able to see them in the v$session etc views. I need to troubleshoot a session but it is not showing up in any views.

View 9 Replies View Related

Partitions On Materialized Views?

Nov 29, 2012

Can we add partitions for materialized views like tables ? ALTER TABLE owner.tablename ADD PARTITION p1 VALUES LESS THAN (2012,12);

Like is there any syntax for mview ALTER TABLE mv.mviewname ADD PARTITION ..... ?

View 2 Replies View Related

One Materialized Views In Two Refresh Groups

Sep 11, 2013

I have 5 MViews that I want to refresh in two occasions, every Sundays and at the 1st of the month. I created a Refresh Group for the weekly and that work fine. But when I tried to created the second Refresh Group for the monthly I get a "materialized view is already in a refresh group".

You can only have a materialized view in one refresh group? What options to I have to refresh it in different intervals?

View 1 Replies View Related

Save Frozen Views In SQL Developer

May 13, 2009

I work with several tables at a time in SQL Developer and I find myself having to reopen and freeze every table everytime I start the application. Is there a way to save all those frozen views for next time?

View 4 Replies View Related

Materialized Views Not Used With UNION ALL In Query

Oct 13, 2010

I am an Oracle newbie.

We have 2 fact tables and one lookup table in this structure:

FACTTABLE1 (C1_ID, C2, SALE)
FACTTABLE2 (C1_ID, C3, SALE)
LOOKUPTABLE (C1_ID, C1_NAME)

The DBAs have built 2 Materialized Views, which aggregates data in the fact tables at column C1 level

MAT_VIEW1 :SELECT C1_ID, SUM(SALE) SALES from FACTTABLE1 join LOOKUPTABLE on C1_ID
MAT_VIEW2: SELECT C1_ID, SUM(SALE) SALE from FACTTABLE2 join LOOKUPTABLE on C1_ID

We are using an old BI tool that can ONLY generate Inline Views in these formats.

CASE1:
select
INL_VIEW.C1_ID
,LOOKUPTABLE.C1_NAME
,sum(SALE) SALE
from
(select C1_ID, C2_ID, null C3_ID, SALE from FACTTABLE1)INL_VIEW
join LOOKUPTABLE
on INL_VIEW.C1_ID = LOOKUPTABLE.C1_ID
group by INL_VIEW.C1_ID, LOOKUPTABLE.C1_NAME

CASE2:
select
INL_VIEW.C1_ID
,LOOKUPTABLE.C1_NAME
,sum(SALE) SALE
from
(select C1_ID, null C2_ID, C3_ID, SALE from FACTTABLE2)INL_VIEW
join LOOKUPTABLE
on INL_VIEW.C1_ID = LOOKUPTABLE.C1_ID
group by INL_VIEW.C1_ID, LOOKUPTABLE.C1_NAME

CASE3:
select
INL_VIEW.C1_ID
,LOOKUPTABLE.C1_NAME
,sum(SALE) SALE
from
(
select C1_ID, C2_ID, null C3_ID, SALE from FACTTABLE1
union all
select C1_ID, C2_ID, null C3_ID, SALE from FACTTABLE2
)INL_VIEW
join LOOKUPTABLE
on INL_VIEW.C1_ID = LOOKUPTABLE.C1_ID
group by INL_VIEW.C1_ID, LOOKUPTABLE.C1_NAME

Oracle 11g rewrites Case 1 and Case 2 to use the correct materialized views. But for case 3, it goes to the base fact tables 1 and 2. Is there a way to make oracle use the MVs even if there is a UNION ALL in the inline view? There is a 1:M Foreign Key relationship between LOOKUPTABLE.C1_ID and the 2 fact tables.

View 2 Replies View Related

Materialized Views Vs Refresh Groups?

Sep 29, 2010

We recently migrated a database from 9i to 10g (overdue we know!!) and discovered that dbms_mview.refresh default behavior was turned upside down - meaning that 10g didn't first truncate the MV to refresh it. We're trying to unwind a lot of legacy issues, but it also turns out that we also have 100 REFRESH GROUPs and 100 MATERIALIZED VIEWs. That means a 1 to 1 relationship between RGs vs MVs. There is one MV defined to each RG.

These are my questions:

1) Does a 1 to 1 relationship between RGs and MVs make sense to anybody? The original implementors are gone and we can't fathom the reason for this.

2) Is there any reason why I shouldn't convert these 100 groups to plain and simple 100 MVs? I don't want the delete/insert refresh behavior of dbms_refresh.refresh and I do want the truncate behavior of dbms_mview.refresh ATOMIC=FALSE for refreshing a standard MVIEW

View 1 Replies View Related

Replication :: How To Use Materialize Views In Streams

Mar 21, 2011

Can we use Materialized views in Streams like how we use tables... ?

View 11 Replies View Related

SQL & PL/SQL :: Advantages Of Writable Materialized Views

Aug 22, 2012

What are the advantages of writable materialized views.

View 6 Replies View Related

SQL & PL/SQL :: Row Count In Selected Materialized Views

Nov 26, 2010

I have two problems.

1.I have the following query--

select name from user_snapshots where type = 'COMPLETE';

I can't do anything except running 'select' statement. NO PL/SQL as well.

how to wrote a query that counts the number of rows in individual materialized views selected by the above query.

2. How to store the result of a select statement into a variable using SQL (not PL/SQL)

select count(*) from tab;

now I want to store count of tables into a variable. Is it possible?

View 4 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved