11g user here.
I would like to prevent an mview from ever using FAST_PCT as refresh method, I want FAST or COMPLETE only.
Is there a simple way? Like a hint of some kind? If not, have you ever successfully used a low intrusive workaround that prevents the FAST_PCT (but still allows for a FAST refresh) like an outer join to dual or the like?
Thank you!
Related
We're supposed to update some columns in a table 'tab1' with some values(which can be picked up from a different table 'tab2'). Now 'tab1' is getting new records inserted almost every few seconds(from MQ by a different system).
We want to design a solution that will update 'tab1' as soon as there is a new record added to 'tab1'. It doesn't have to be done in the same moment as the record is added, but the sooner its updated, the better. We were considering what can be the best way to do it:
1) First we thought of a 'before insert' trigger on tab1, so we can update the record - but that design was vetted out by our Architect, since the organization doesn't allow use of database triggers(don't know why, but that is a restriction, we have been asked to live with)
2) Second we thought, we will create a stored procedure which will perform the updates to records in 'tab1'. This stored procedure will be called within an long-running loop from a shell script. After every iteration there will be a pause of lets say 3 secs and then next loop will kick off, which will again call the stored proc. So this job will run 12 AM to 11:59 PM and then restarted every night.
My question is - is there a database only solution to this? Any other solutions are also welcome, but simplicity of design will be a huge plus. One colleague was wondering if there is a 'trigger-like' solution, which will perform the job within the database itself - so we don't have to write a shell script.
Any pointers will be appreciated!
Triggers The obvious solution.
DBMS_SCHEDULER Another obvious solution.
Continuous Query Notification This would be a "trigger-like" solution. It's meant to call an application when the results of a specific query would be different. But you can call PL/SQL instead of an application, and the query could be a simple select * from tab1; which would fire on any table changes. Normally I'd hope an architect would be to look at this solution and say, "a trigger would be a lot simpler".
DBMS_JOBS This is the old version of DBMS_SCHEDULER and is not as good. But it's different and maybe it won't be caught as an unauthorized feature.
Ignore the Architect The problem isn't that he disapproved of using triggers or jobs; there may be legitimate reasons to ban those technologies. The problem is that he rejected a sound idea without clearly articulating why it wasn't allowed. If he understood databases, or cared about your project, or acted like a professional, he would have said something like, "Oh, I'm sorry, I know that's the typical way to do this, but we don't allow it because of X, Y, Z."
To answer your questions:
Q: Is there a database only solution to this?
Unlikely, given all the limitations on your architecture.
Q: Any other solutions are also welcomed
It seems your likely solution is to have your application handle what would normally be handled by a trigger or stored procedure. Just do it all in one transaction.
I have a mappig to update certain columns in a table. Only 10% or less records should get updated. The remaining records should be rejected by the informatica.
The mapping works just fine if not for all the records getting logged into the session log file. Is there a way to prevent this other than using the filter transformation? I am aware this can be eliminated with a filter transforamtion. But just wanted to check if there is any simpler approach like selecting an option or something.
Change the tracing level to Terse - you can configure it for the update strategy transformation transformation or for the entire session (Config Object / Override tracing).
Well, by design, you should not let the reject the records and let them go to sink. Rather, control the logic for rejection, so that in future if there is a change to that rejection logic, you have control in ur hands.
Further, the rejected records are logged to session log by default, since its supposed to be abnormal behaviour on a mapping's part that some data is not handled properly through the flow.
To avoid getting all that data logged into session log, you can change the tracing level of the session to Terse. But remember, in that case, you wont get lot of other logging information in session, that is generally useful. This will achieve the end result, but is not the "ideal" way of achieving the same end result.
I would suggest looking again at your mapping design.
I understand that, in Oracle, you can check what rows or tables are locked and who is locking them, but is there a way to see how many pending requests are in queue trying to access that information at any given time?
I know that anything that would require an active verification of this is probably bad practice. I'm just trying to show something to someone and that would help me greatly get my point across.
Does DBA_WAITERS show what you're looking for? You can join to V$SESSION to see who is holding the lock and who is waiting for the resource, or other views to get other information. I'm not sure if that's quite what you're after though.
Is it possible to create a view in a database A of tables of another database B? If possible, can somebody please help me, I'm totally clueless.
Of course, just use a database link. So, your view would be:
create or replace view my_view as
select some_columns
from my_table#the_other_database
Beware though it's not always that efficient and you may have some problems with queries doing things you don't expect. If there's any volume to the data you're trying to select it might be worth using a materialized view instead to take data cross server. Then you can select data from the server you're on currently, which'll probably be a lot quicker.
i am new to oracle.Already there is a store procedure which fetches data from many tables.Due to performance issue,i need to modify it.So i want to know about materialised view (since,i already searched it in net,but i am not able to understand it).can anyone explain the features of it?
Also,i am using TOAD for oracle.Can someone suggest me any materials(book,websites etc.) to learn?
I'll take the Toad portion - you can get a ton of great help online for free at ToadWorld.com. I have a 35 page free tutorial there as well link text
Materialized View is covered in the documentation (eg here).
They don't make anything magically run faster. They move the performance hit (eg refresh the view at midnight and your procedure may run faster at 9am) but possibly at the expense of being 'up-to-date'. Or you could have REFRESH ON COMMIT MVs which can be more up to date, but maybe at the expense of concurrency and are also 'time shifting' work to when inserts/updates are done rather than queries.
MVs would be a long way down the list of things I'd consider for fixing a problem in a specific stored procedure.