Monday, October 27, 2014

-- How to quickly change the AWR Interval and how to create one on demand --



Check the current defaults.


set linesize 100

col snap_interval format a20
col retention format a20
col topnsql format a20
select * from dba_hist_wr_control;

DBID SNAP_INTERVAL        RETENTION            TOPNSQL            
---------- -------------------- -------------------- --------------------
3610569430 0 0:60:0.0           7 0:0:0.0            DEFAULT              


Below we are changing the interval from 1 hour (Default) to 30 min.

execute dbms_workload_repository.modify_snapshot_settings ( interval => 30);

anonymous block completed

Check that the change was applied.

set linesize 100
col snap_interval format a20
col retention format a20
col topnsql format a20
select * from dba_hist_wr_control;

DBID SNAP_INTERVAL        RETENTION            TOPNSQL            
---------- -------------------- -------------------- --------------------
3610569430 0 0:30:0.0           7 0:0:0.0            DEFAULT    

Create AWR on demand

When debugging SQLs you may want to get an AWR snapshot before and after you run an specific SQL.

exec dbms_workload_repository.create_snapshot();

select * from xxxx /* Your query */


exec dbms_workload_repository.create_snapshot();


Wednesday, October 1, 2014

-- Oracle Openworld 2014 --

During my visit to the 2014 Oracle Openworld I had the opportunity to talk with some of Oracle's customers and with different vendors who are leaders in their industries.

This year there is a big focus on the cloud, which is not surprise. Companies are becoming more aggressive in adopting a hybrid between cloud and traditional information systems on premises. Oracle is trying to determine how to support 20 year old applications which are no longer supported by the original vendors, and how to avoid for those apps to age out placing customers on a bad spot in the future. A lot of companies are embracing the SaS schema, especially companies with global operations because that allows them standardization and also resolves the problem of keeping up with application upgrades.

The other emphasis is to provide real time data to the executives, including information from social media. The goal here is to enable executives to make decisions on the spot rather than weeks or months after obtaining the data when they finally get the results from their analytics. Companies believe that there is traditionally a big gap between the time they obtain the information and the time they react to it. By the time they shift gears in their business they missed some or all of the momentum. In order to achieve rapid response time, there are dedicated people constantly studying customer science and interpreting the volume and complexity of the data. This allows them to engage the customer digitally in real time before the analytics age out. 

Many companies find they are experiencing the same types of problems. Some common trends are: reducing the number of legacy applications; moving into a single CRM and ERP systems; achieving globalization and standardization by leveraging Cloud-like technologies; and simplification and modularization of infrastructure technology to enable the use of common computing power.

There has been a shift where companies are not longer organizing and following sales leads by territory and region, but by customers that are most likely to buy, with the implementation of digital technology, it is not longer that relevant to have a presence on a specific territory or  region, and companies can save in OPEX by making strategic use of their sales force. 

On the technical side Oracle is promoting the consolidation trend by recommending to implement multi tenant databases, this is specially good and true for environments such as development and test sharing the same hardware, but maintaining their inter-independence. On the analytics side once we get to Oracle 12c there is a paid feature called in memory database  which allows you non only to store tables in memory, but to organize them in a columnar fashion, which makes your analytics performance many times faster. 

Talking to some of the vendors they tell me nobody is doing money with Big Data, companies simple do not have interest on it yet, but they see a lot of potential and started to see tangible sales on SaS and other Cloud like technologies, the big concern here is still security and the big challenge is extracting your data if you decide to no longer be on a hosted Cloud service. 

Monday, February 10, 2014

-- Resetting a table or Index high water mark --

We recently got confronted in our Data Warehouse database with an issue where one of the database files was a "bigfile" tablespace and it was located on a drive that can't be expanded. Yes, I know that is the rule No.1 about using "bigfile" tablespaces, if you are going to have storage limitations do not use tablespaces. In my defense I inherited the environment, someone else designed it :) . 

Our application administrator told us that he deleted a humongous amount of space from the biggest table, however you will not see that space back in the tablespace as it is still being help as empty blocks on the table. Out grid control critical threshold of 97% was triggered.   

Although the application administrator told us not to worry about it, because the table will reuse the empty space and won't try to consume more space in the tablespace, I didn't feel well just knowing that the next time that we get an issue I won't get an alert, I will get a call from the application administrator telling me that the system in halt because of the space. Since this is a 1.7TB database, it will take long time for me to move that tablespace to somewhere else with more space.

So what I decided to do was to reset the high water mark of those tables and indexes so it returns the space to the tablespace and I get my Grid control alert clear again.

This is the way you accomplish that.

SQL> alter table enable row movement;
SQL > alter table shrink space;

If you want to reset the high water mark for all dependent objects yo do this:

SQL > alter table shrink space cascade;

If you just want to compact the table without resetting the high ware mark you do

SQL > alter table shrink space compact;

Please note that the operations above can be done online with minimum impact (row level locking for a brief moment). 

For indexed you do


SQL > alter index shrink space;

Enjoy. 



Monday, January 20, 2014

-- Challenges of Project Managing & Agile Methodologies --

Although these two subjects could be seen as two different topics (and they are),  they are intimate related and therefore I decided to cover both of them on the same paper. In my personal opinion Agile surges as a solution to the drastic increase of many Information System Development (ISD) projects failures.  However rather that analyzing the failures and correcting them, we decided to re-invent the wheel.

Let me explain, for a project to be successful there are few elements that are needed, you need the resources (people), they need to have the technical knowledge adequate to be able to develop the solution, you need a problem or requirements (what is needed, what is the problem that I am trying to solve), you need a solution or solutions (how I am going to resolve of mitigate the issue),  and you need a plan to get there.

 I learned earlier in my career that the most important elements on Developing information system are

1.- You need to have a clear understanding of what is that you are trying to solve.
2.- You need to understand how the proposed solution will solve the problem.
3.- You need to have a fix scope of what is that you are going to do, and make the business sign on it.

It is often that software engineers don't understand the problem (many times because the business do not understand it either, and provides very vague description and requirements). I find often that the issue here is the technological gap in communication. Depending who is the person from the business that you are getting the requirements from that person will be able to provide the exact requirements needed or will just give you a vague idea, which will likely translate in a poor design that does not meet the business requirements.

Many times business owners wants to set deadlines that are just not feasible, and developers need to compromise in the quality or their programs in order to meet the deadline, which end creating production issues. Another typical issue is that due to the constants business changes the scope of the project is changing all the time. So basically if you spend time understanding the requirements, you have solid knowledge of the technology that you will use for the development, you have a clear scope of the project,  your deadlines are feasible and you have a project manager supporting you, then you have a project that have a very high percentage of success rate.

Another challenge that was introduced in the last 10 years is that a big portion of the development projects are outsourced overseas, with this the communication issue that I explained above gets exponentially worse. The other problem that is difficult to solve is the constant changing requirements, and that is where Agile plays a role, the idea behind agile is to create a virtual team that will be able to address the constant changes on the fly, what Agile provides as well is a series of micro managing tools that ensure the project is on track before is too late.

Agile in theory looks good, however I have not seeing a lot of adoption on it, and the degree of success of Agile projects vs non-agile projects is still to be proven. At this point you may be asking yourself, if we do not use Agile how else can we close this gap, what other methodology can we use, to what I will answer that it depends of each business and organization needs, there is not a single solution that fixes all the problems.

Regarding to what would I propose for a project where the scope is constantly changing, my answer would be to have additional development groups that will start new development at the tail ending of the other, in that way you can take in production a complete project and you are already working on a new version.



Wednesday, January 8, 2014

-- The Future of Enterprise Applications --


Like any other technology "Enterprise Applications" surged from a need, initially companies were trying to resolve very specific problems.  Initially there were MRP. (Material Requirement Planning) systems (1970) that intended to aid in accomplish tasks such as schedule production. Later on that need evolved in good part because companies saw the capabilities of the technology and how it turned over time more efficient and more cost effective, the second wave of enterprise systems is constituted by what is call MRP. II  (Manufacturing Resource Planning) Systems (1980), these application not only focused exclusively in production data, but exploded the relationships with Marketing and Finance data between others. Later in 1990 these systems evolved once more into what is noways called ERP. or Enterprise Resource Planning.

As you can imagine by the word Enterprise the idea behind is to integrate in an orchestrated way all business functions with the goal of improving operations, some key features that characterize these applications are.
  • Global Scale.
  • Focus in Collaboration and Product Strategy.
  • Based on a particular business model.
  • Aims to adapt and correct based on the markets conditions.
  • Leverage business intelligence  and analytic techniques.
  • Integrated Information Exchange.

So what is next in the ERP arena?. Well to start with we are in the era of mobility (access your data any time any where from any device).  Mobility will not only add  convenience to Enterprise Systems but also will add a new level of real time data. But what do we need for that to happen, well there is an implicit cost in all these systems, so how do you manage this cost?.

The answer is to use SAS. (Software as a Service) which is usually stored in the cloud where you pay a fraction of the cost or (pay per use). So why this has not taken off?

Below are some of the few reasons:

  •    Hesitant due to security.     
  •    Technology not being totally there.       
  •    Scalability.      
  •     Interdependence, could  not exist without supporting range of other services.

What can you do to mitigate the risks

  •  You need to build fault tolerance infrastructure or hire a third party vendor that offers this.
  •  You need to plan for it instead of stay away from it..