Friday, March 26, 2010

Can I Get Tattooed If I Have Ringworm

Profile Report Historical Workload Base (Historical Load Profile)

Last week I was in a meeting to determine how to solve a problem in one of the foundations of a client. The problem was related to two materialized view refresh (I'll call the MV1 and MV2 for privacy) and what happened was that in the last days had not been able to refresh the view because the process was canceled for lack of space UNDO. The views are refreshed in every 1 hour COMPLETE way through a job on base and kept a detailed diary. In general never exceed 100,000 records, but now had more than 100 million since it was detected that a filter error in the view WHERE MV1 (VM2 uses a sentence that refers to MV1) detail was taken over 2 years instead of the day. team raised recreate database views, which is a valid solution and I agreed in the first instance, but has some disadvantages: 1) you have to run a drop and immediately create each view which can invalidations cause cascade and therefore must be done in a maintenance window and 2) until it is complete recreation of both views will be invalid dependent objects, and is somewhat difficult to estimate with certainty how long it will delay this process, thus risk out of the window.

As suggested workaround make a drink in the following way (it is important to note that this does not require any mv Drop):

sqlplus> exec dbms_refresh (list => 'MV1', atomic_refresh => FALSE) sqlplus> exec dbms_refresh (list => ' MV2 'atomic_refresh => FALSE)
A 10g partitr atomic_refresh default parameter is TRUE and know that means I will explain briefly how the process of soda from trying:

Each time you refresh a view mode FORCE running two steps:
1) The purge or delete all existing rows materialized view 2) new rows are inserted by running the query defined in the MV.
atomic_refresh parameter defines the method used to perform step 1. In 10g step 1 implies a DELETE of all rows, it is said that the process of soda 10g is atomic because the delete and insert are made in one transaction (atomic). Before 10g the default value of the parameter was FALSE implying that step 1 was done with a TRUNCATE, which is obviously faster than DELETE since it is not transactional. Just as it is not transactional UNDO does not consume space, recall that the DELETE is a DML operation that consumes far more than undo, since it must keep all the columns in each row in case you need a retreat.

As I said above, in the particular case of soda from the two MV's, both, for a errror filtering in the MV1, left with millions of rows instead of with a few tens of thousands as it should, since the base is 10g is taking the default parameter = TRUE atomic_refesh dictates perform a delete, in this case will be a delete of about 100M rows in both cases and therefore always canceled UNDO space, since it is not prepared to support and configures such a mass deletion. The suggestion to change the default parameter atomic_refresh = FALSE perform a TRUNCATE and then the cooling insert views in fast without having to recreate them.
is common once explained el nuevo funcionamiento en 10g, que alguien se pregunte porque no se sigue truncando en lugar de hacer delete. La explicación es que en el caso que al realizarse el truncate y luego fallar el insert, la MV quedará vacia lo cual podría afectar el negocio ya que quedaran vacias hasta que el refresco se pueda completar con exito. En otro caso que tiene sentido el delete es cuando no pueden quedar nunca vacias las MV's porque se consultan mucho y si se hace truncate no se retornaran filas hasta que finalice el refresco. Generalmente los errores de refresco se produce cuando los datos se obtienen accediendo las tablas fuente por un dblink desde otra base. En el caso de la base en cuestión, este problema no existe ya que las MV's se refrescan con datos de tablas que are in the same scheme. As last clarification, it is important to note that there is no risk in carrying out the soda suggested and may at any time of day without affecting overall performance. Once this cooled you can activate the jobs that shoot soft drinks normally.

I will now show an example for comparing times, generating a table T and a materialized view MV_T

rop @ DESA10G> alter table t add primary key (x); Table amended.

rop @ DESA10G> create Materialized view complete refresh mv_t

2 3 4 as select * from t; materialized view created.

rop @ DESA10G> set timing on
rop @ DESA10G> exec dbms_mview.refresh (list => 'MV_T' atomic_refresh => TRUE)
PL / SQL procedure successfully completed. After
: 00:02:39.75

rop @ DESA10G> exec dbms_mview.refresh (list => 'MV_T' atomic_refresh => FALSE)
PL / SQL procedure successfully completed. After

: 00:00:15.54


In sum, it is important to analyze the business requirements, whether these requirements support the short unavailability that not cause the refresh atomically (truncate) in addition to the possibility that the MV are empty, the result of an error or cancellation, until the next refresh, then it is possible to cool faster and with little consumption of Setting Up the parameter UNDO atomic_refresh FALSE.


Wednesday, March 10, 2010

Spiderbabe 1 Misty Mundae

photos from the past against the future conspire

Again, our country is experiencing a situation of many that dot our history, that a temporary combination of sectors that consider themselves "democratic" and "Republicans" interfere to prevent its mandate fully comply the government elected by the popular majority in free elections. That is, in a democracy. Destituyente machinery that is deployed in the legislative chambers, taking the form a "power struggle", far from disguising the amplified gestures. We saw it in those days. The carelessness, the lack modesty with which these heterogeneous allies proceeded to plunder of sites in the parliamentary committees, with no respect for proportionality emerging citizens' vote, with the avowed intention of locking any government initiative, going so far reject the tender commission Mercedes Marco del Pont, not in a timely manner to enable self-defense and for reasons other than what the Senate is called to consider: their intellectual quality and suitability for the position. Stripping and contempt of these procedures necessary to safeguard institutional governance.

From Carlos Saul Menem and Rodriguez Saa to Pino Solanas, all are responsible to impose on the parliamentary rules of the game such that any bill submitted by the Executive to succeed. Locking access to reserves for payment of debt and trying a gross manipulation of the Central Bank's conduct detrimental to the necessary coordination with all public policies are being developed, is to force the government to implement policies setting, in a context of international financial crisis whose effects are being moderated to local
undeniable effectiveness. Lower wages, low pensions, layoffs, curbs on public works, cutting subsidies: this is the scenario that is being pushed from the opposition. We regret that those who claim for themselves a place of social activists, and part of the left, are still functional at this return of the worst of our past. Photos of the week ending and a basic memory exercise should call a mature political thinking can enable more fruitful partnerships based on country projects that are in dispute rather than the conquest of an illusory and mean share of power .

As in the agricultural lock out started in March 2008, when he was at stake is whether extraordinary income affect faint towards distributive policies, there are, together again in the embrace, Reuteman, Latorre, Giustiniani. The three senators from the province of Santa Fe, as we said then in the final document of the First National Open Letter spaces in the city of Rosario, "from various folklore supporters, but identical interests defending conservatives, voted against the sliding tax , bouldering with whom they oppose any state intervention in the economic process and any initiative to restore a sense of the public. "
In line with these positions nationwide, our province, governed by Socialist Hermes Binner, is one of the few who could not give the normal school year and start living today a scene of conflict because it has been a minimal response to demand fair wage claims that teachers and state workers in endure both disproportionate increases in taxes, carrying responsibility for the nation.

artists, intellectuals and cultural workers gathered in Open Letter from Santa Fe Province express our solidarity with workers in conflict and reaffirm our support critical to the political process launched in Spain in 2003 and all measures aimed at deepening, by Argentina with more justice, and respectful mechanisms that sustain democracy. Open Letter

Province of Santa Fe

Monday, March 8, 2010

Ovulation Calcualtior March Of Dimes

As UNDO troubleshoot when

can we do to detect problems cpu oi / or without having to seek assistance from the Operating Systems group?, Sounds complicated, no?. Well ... 10g from an option, at least to be having a first scenario, is to see if something is happening with the case where our database consulting in the AWR repository. To externalize these metrics there is historical view: DBA_HIST_OSSTAT, which contains 10g as follows: -------------------------------------------

STAT_NAME
BUSY_TIME

AVG_IDLE_TIME
NUM_CPUS
AVG_BUSY_TIME
OS_CPU_WAIT_TIME
VM_IN_BYTES
AVG_USER_TIME
AVG_SYS_TIME
LOAD
SYS_TIME
RSRC_MGR_CPU_WAIT_TIME
 IDLE_TIME 
USER_TIME
PHYSICAL_MEMORY_BYTES
IOWAIT_TIME
AVG_IOWAIT_TIME
VM_OUT_BYTES <10000; i++)
11g R1
and adds the following:

TCP_SEND_SIZE_DEFAULT
TCP_RECEIVE_SIZE_DEFAULT TCP_RECEIVE_SIZE_MAX

NUM_CPU_SOCKETS
TCP_SEND_SIZE_MAX
NUM_CPU_CORES

Below, I copy a script I created to see some important metrics. The report takes as its only parameter the number of hours that I want to look backwards. September



line 120 pagesize
 September 9999 September 
verify off accept hours
prompt "Enter number of hours you wish to report backwards" snap
format a20 col

<10000; i++)
select unique to_char (snap, 'DD-MON- YYYY HH24 ') snap,
avg_idle_time-lead (avg_idle_time) over (partition by order by snap off st) avg_idle_time,
avg_user_time-lead (avg_user_time) over (partition by order by snap off st) avg_user_time,
avg_sys_time-lead (avg_sys_time ) over (partition by order by snap off st) avg_sys_time,
avg_iowait_time-lead (avg_iowait_time) over (partition by st order by snap desc) avg_iowait_time,
os_cpu_wait_time-lead(os_cpu_wait_time) over (partition by st order by snap desc) os_cpu_wait_time
from
(select s.end_interval_time snap,
s.startup_time st,
max(decode(stat_name,'AVG_IDLE_TIME',value,null)) AVG_IDLE_TIME,
max(decode(stat_name,'AVG_USER_TIME',value,null)) AVG_USER_TIME,
max(decode(stat_name,'AVG_SYS_TIME',value,null)) AVG_SYS_TIME,
max(decode(stat_name,'AVG_IOWAIT_TIME',value,null)) AVG_IOWAIT_TIME,
max(decode(stat_name,'OS_CPU_WAIT_TIME',value,null)) OS_CPU_WAIT_TIME
from dba_hist_osstat os,
dba_hist_snapshot s
 where s.snap_id = os.snap_id 
group by s.end_interval_time,s.startup_time)
where snap > sysdate-&horas/24
order by snap desc
/

<10000; i++)
SNAP AVG_IDLE_TIME AVG_USER_TIME AVG_SYS_TIME AVG_IOWAIT_TIME OS_CPU_WAIT_TIME
25-FEB-10 09 211854 108399 40156 99439 2087400
25-FEB-10 08 271995 61131 27296 97923 1199800
25-FEB-10 07 236760 85951 31938 84592 1489500
25-FEB-10 06 180172 130112 50168 90475 2281500
25-FEB-10 05 182995 123247 54623 105254 2274500
25-FEB-10 04 193166 116204 51902 127028 2197000
25-FEB-10 03 195871 119849
45241 130806 2126400 25-FEB-10 02 236610 85916 37782 160617 1574500


Obviously, to get an accurate diagnosis of OS resource usage ideally want the groups responsible for administering the OS, networking and storage reports historical details of activity, but if we have a first picture in fast to what is happening with only access the repository of the database, we can use the above query or any change (you can add columns to report virtual memory usage , network traffic, etc) for this to have a first impression.