Tuesday, August 24, 2010

How To Congratbar Mitzvah

How to get the edition of the software installed from the inventory

For edition (Enterprise or Standard) of the Oracle software (engine) installed, if still not created a database (you can remove the issue from the catalog of the base) and if the person who installed it can not remember which option chosen, you can run the following command from Unix / Linux you are looking for in the inventory: $ grep-w $ s_serverInstallType ORACLE_HOME/inventory/Components21/oracle.server / * / context.xml of statistics and system objects. This new feature is very useful to analyze the impact of change as it allows to "play" with the environment and easily make comparison reports, regression testing, impact load, etc.
I will create a table with 1M records T and PCTFREE 90% to consume many blocks such that the difference between the performances that I compare it more noticeable. Then I'll create a PK for the id field. With RBO will do a FULL SCAN on the table T, which does not realize that has a PK and I could do a full index scan is faster. CBO obviously realizes this as being just PK has the same amount of records to the table and therefore serves to answer the question of how many records have the table T.


create table t (id int, val varchar2 (10)) PCTFREE 90;


insert into t select rownum as, dbms_random.string ('a', 10)
from dual connect by rownum

alter table t add primary key (id);


test carried out the sentence, use a hint to be more easily located in the dynamic view and get your sqlid:


select count (1) / * + * Test SPA / from t;


sql_id select from v $ sql WHERE
sql_text like '% SPA% Proof' and sql_text NOT LIKE '% sql_text%';

 5r2ufj2vqkk4p 

I have the sqlid
already, so I'm going to do is build a SQL Tuning Set (STS) using DBMS_SQLTUNE package (that has existed for 10g, so I could do in 10g and then migrate it to 11g, for example, to evaluate an upgrade between those versions)


begin
dbms_sqltune.create_sqlset (sqlset_name => 'Test', description => 'Test STS');
end;

The STS test you create is called, now has charge of the sentence from memory cursor: DECLARE


 l_cursor DBMS_SQLTUNE.sqlset_cursor ; 

BEGIN OPEN l_cursor <= 100000; 100000 filas suprimidas.
FOR SELECT VALUE (p) FROM TABLE
(
DBMS_SQLTUNE.select_cursor_cache (
 '5r2ufj2vqkk4p sql_id =''''', - basic_filter 
NULL, - object_filter
NULL, - NULL
ranking_measure1 - ranking_measure2
NULL, - NULL
ranking_measure3 - result_percentage
1) - result_limit ) p;
DBMS_SQLTUNE.load_sqlset (
sqlset_name => 'test',
populate_cursor => l_cursor)
END;
 

actually verified that the STS has been created and contains the sentence :

user_sqlset select * from WHERE name = 'Test';



----------------------------- NAME ID - ---------- ------------------------------------
 
DESCRIPTION CREATED
------------------------------------------------ STATEMENT_COUNT LAST_MODI

Test --------- --------- --------------- 10
Test STS 12-AUG-10 12-AUG-10 1

select sqlset_name, sql_id from user_sqlset_statements WHERE r2ufj2vqkk4p sql_id = '5 ';
 SQLSET_NAME 
SQL_ID
------------- Test ------------- -----------------
5r2ufj2vqkk4p



At this point, and having created the STS, which contains the but the sentence context information to evaluate it, we can begin to use the package DBMS_SQLPA (there from 11g R1) for comparison. For example DBMS_SQLTUNE and DBMS_SQLPA packages are complementary. With the first harmonized the workload (which may contain one or more sentences obtained from the AWR, from a cursor, from another STS or even from a trace file) and the second conducted comparative analysis (benchmarking). Then see how to perform this analysis: First

created a task analysis:

l_out declare char (50);

begin l_out: = dbms_sqlpa.create_analysis_task (
sqlset_name => 'test',
task_name => 'Prueba_TSK');
end;
Then, set up to simulate the environment "before." In our example, the idea is to compare a count with RBO and CBO, so setpoints at the meeting, the optimizer to use RBO and run the analysis with their environment:


alter session set optimizer_mode = RULE;


begin DBMS_SQLPA.EXECUTE_ANALYSIS_TASK (
task_name => 'Prueba_TSK'
execution_type => 'TEST EXECUTE',
execution_name = > 'Prueba_EXEC_antes');

I do the same to compare the "after" Setting Up the optimizer to its default value in 11g:


alter session set optimizer_mode = ALL_ROWS;
begin
DBMS_SQLPA.EXECUTE_ANALYSIS_TASK
(
task_name => 'Prueba_TSK'
execution_type => 'TEST EXECUTE ',
execution_name =>' Prueba_EXEC_despues');
end;
 
To compare, you can set focus on that metric, if not clarified anything, it is used as a metric of comparison: "elapsed_time." In this example I chose to use "buffer_gets", as this metric is one that most changes between the two cases to compare and therefore makes more compelling the final report. BEGIN



DBMS_SQLPA.set_analysis_task_parameter ('Prueba_TSK'
'comparison_metric' <= 1000000 ;
'buffer_gets');
END;

executed on the master for the sp Comparison: BEGIN


 DBMS_SQLPA.execute_analysis_task (
task_name => 'Prueba_TSK'
execution_type => 'compare performance',
execution_params => dbms_advisor.arglist (
'execution_name1'
'Prueba_EXEC_antes'
' execution_name2 '
' Prueba_EXEC_despues')
)
END;


Once we ran the analysis using a summary report of the differences:
 


SET LONG 1000000 SET PAGESIZE 0 SET LINESIZE 200
LONGCHUNKSIZE SET 200
SET TRIMSPOOL ON
 rop@DESA11G> SELECT DBMS_SQLPA.REPORT_ANALYSIS_TASK('Prueba_TSK', 'TEXT', 'TYPICAL', 'SUMMARY') from 
dual;
General Information
---------------------------------------------------------------------------------------------

Task Information: Workload Information:
--------------------------------------------- ---------------------------------------------
Task Name : Prueba_TSK SQL Tuning Set Name : Prueba
Task Owner : ROP SQL Tuning Set Owner : ROP
Description : Total SQL Statement Count : 1

Execution Information:
---------------------------------------------------------------------------------------------
Execution Name : EXEC_7692 Started : 08/12/2010 16:27:22
Execution Type : COMPARE PERFORMANCE Last Updated : 08/12/2010 16:27:22
Description : Global Time Limit : UNLIMITED
Scope : COMPREHENSIVE Per-SQL Time Limit : UNUSED
Status : COMPLETED Number of Errors : 0

Analysis Information:
---------------------------------------------------------------------------------------------
Comparison Metric: BUFFER_GETS
------------------
Workload Impact Threshold: 1%
--------------------------
  SQL Impact Threshold: 1% 
----------------------
Before Change Execution: After Change Execution:
--------------------------------------------- ---------------------------------------------
Execution Name : Prueba_EXEC_antes Execution Name : Prueba_EXEC_despues
Execution Type : TEST EXECUTE Execution Type : TEST EXECUTE
Scope : COMPREHENSIVE Scope : COMPREHENSIVE
Status : COMPLETED Status : COMPLETED
Started : 08/12/2010 16:26:29 Started : 08/12/2010 16:27:04
Last Updated : 08/12/2010 16:27:13 Last Updated : 08/12/2010 16:27:13
Global Time Limit : UNLIMITED Global Time Limit : UNLIMITED
Per-SQL Time Limit : UNUSED Per-SQL Time Limit : UNUSED
Number of Errors : 0 Number of Errors : 0

Report Summary
---------------------------------------------------------------------------------------------

Projected Workload Change Impact:
-------------------------------------------
Overall Impact : 92.05%
Improvement Impact : 92.05%
Regression Impact : 0%

SQL Statement Count
-------------------------------------------
SQL Category SQL Count Plan Change Count
  Overall               1                  1 
Improved 1 1

Top SQL Statements Sorted by their Absolute Value of Change Impact on the Workload
--------------------------------------------------------------------------------------
----------------------------------------------------------------------------------------------------

'TEXT', 'TYPICAL', 'FINDINGS') from dual;
General Information
---------------------------------------------------------------------------------------------

Task Information: Workload Information:
--------------------------------------------- ---------------------------------------------
   Task Name    : Prueba_TSK                      SQL Tuning Set Name        : Prueba 
Task Owner : ROP SQL Tuning Set Owner : ROP
Description : Total SQL Statement Count : 1

Execution Information:
---------------------------------------------------------------------------------------------
Execution Name : EXEC_7692 Started : 08/12/2010 16:27:22
Execution Type : COMPARE PERFORMANCE Last Updated : 08/12/2010 16:27:22
Description : Global Time Limit : UNLIMITED
Scope : COMPREHENSIVE Per-SQL Time Limit : UNUSED
Status : COMPLETED Number of Errors : 0

Analysis Information:
---------------------------------------------------------------------------------------------
  Comparison Metric: BUFFER_GETS 
------------------
Workload Impact Threshold: 1%
--------------------------
SQL Impact Threshold: 1%
----------------------
Before Change Execution: After Change Execution:
--------------------------------------------- ---------------------------------------------
Execution Name : Prueba_EXEC_antes Execution Name : Prueba_EXEC_despues
Execution Type : TEST EXECUTE Execution Type : TEST EXECUTE
Scope : COMPREHENSIVE Scope : COMPREHENSIVE
Status : COMPLETED Status : COMPLETED
Started : 08/12/2010 16:26:29 Started : 08/12/2010 16:27:04
   Last Updated        : 08/12/2010 16:27:13      Last Updated        : 08/12/2010  16:27:13 
Global Time Limit : UNLIMITED Global Time Limit : UNLIMITED
Per-SQL Time Limit : UNUSED Per-SQL Time Limit : UNUSED
Number of Errors : 0 Number of Errors : 0

Report Details: Statements Sorted by their Absolute Value of Change Impact on the Workload
---------------------------------------------------------------------------------------------

SQL Details:
-----------------------------
  Object ID            : 4 
Schema Name : ROP
SQL ID : 5r2ufj2vqkk4p
Execution Frequency : 1
SQL Text : select count(1) /*+ Prueba SPA */ from t

Execution Statistics:
-----------------------------
------------------------------------------------------------------------------------------------



Elapsed: 00:00:00.59


 The trivial example a comparison of the SPA procedure using sqlplus only (you could use MS to a more visual comparison), but serve to illustrate its usefulness. Using a similar procedure could make a pre-upgrade analysis to help ensure the stability of post-upgrade critical judgments on a 11g. To do so would have to perform the following steps before the analysis with SPA: 

1. Create the STS at the base to Upgrade

If the upgrade is based on 10g you can create the STS from AWR determining a representative range of the load. If the upgrade is based on 9i STS can be obtained from a previous trace 9i generated during a real load range.

then show an example, which is in the official documentation 10g to create a STS
from AWR, using a previously established baseline for a range with maximum load "peak baseline ', and filtered for the STS only include statements that are executed more than 10 times and a ratio between disk reads and buffer gets over 50%. It also specifies that TOP collect the 30 sentences ordered by disk_reads / buffer_gets: DECLARE



baseline_cursor DBMS_SQLTUNE.SQLSET_CURSOR;

BEGIN OPEN baseline_cursor
FOR SELECT VALUE (p) FROM TABLE
(DBMS_SQLTUNE.SELECT_WORKLOAD_REPOSITORY (
'peak baseline',
'Executions> = 10 AND disk_reads / buffer_gets> = 0.5', NULL
,
'disk_reads / buffer_gets'
NULL, NULL, NULL,
30)) p;

DBMS_SQLTUNE.LOAD_SQLSET (
sqlset_name => 'my_sql_tuning_set'
populate_cursor => baseline_cursor)
END;


If not I create a baseline, also can be configured using two AWR snapshosts id to specify the range to be processed.

2. STS migrate to the new base (11g)


- Create table to store the STS stage and then transferred to the new base

begin DBMS_SQLTUNE.create_stgtab_sqlset (table_name => 'TBL_STG_STS'
schema_name => user);
end;





- Record STS in the table begin
DBMS_SQLTUNE.pack_stgtab_sqlset
stage (sqlset_name => 'test',
staging_table_name => 'TBL_STG_STS');
end;


Once created and charged the stage table, subtract pass to the new base. Here you can use data pump or exp / imp conventional.



- Creates the STS generated in 10g from the stage table in 11g
begin
DBMS_SQLTUNE.unpack_stgtab_sqlset (sqlset_name => 'test',
staging_table_name => 'TBL_STG_STS'
replace => TRUE);
end;



In short, we may use this procedure for quickly assessing the impact of changes on the sentences, and therefore in the implementation plans, due to changes in the environment, for example, change of equipment, disks, cpu add, change database version changes in parameterization, etc.
can "play" with different settings and see how it sentences, perform benchmarking and analysis with different strategies and parameterizations, etc and so to infer the pre-change behavior and prevent instability of the applications when it is too late to turn back implies a high cost.


Monday, August 23, 2010

Where To Get Jockstrap Underwear In Bangalore

SOS interpersonal relationships


I teach language and not in vain I chose this topic for my blog.Si it is something I love, is both something that also worries me.
Is it possible that in the XXI century, where technology has shortened distances and messages can arrive early and quickly to any place, is the time when human beings feel more alone?.
This arises in the history of mankind to man's need to establish relationships and interact with each other and manifested in many ways, not only involve the use of a specific language, even the body,
a glance, a gesture, movement, color, image and much more.
On the other hand, if we speak of channels available to many of them to convey our messages, increasingly sophisticated.
So why modern man is increasingly isolated? my goal is to see and highlight the good and bad of the technological impact communication processes.
We must emphasize that we are informed, that information comes with an incredible speed and that distance is no longer a problem because I can make contact with someone across the globe. I can access a wealth of information without leaving my house, I can buy, study, chat and even working from home.
Now on how this affected human relationships? In much, it's easy to send an SMS to get to the house of a friend and congratulate him on his birthday. While we seem to be around people who are far away, turn away from those we are close. We isolated ourselves in front of a monitor are "not about us" but "who want to be." Consequently, vivmos immersed in virtual reality, which is sometimes far from real.
In conclusion, we must be aware and educated to know how to select the appropriate information, manage time to avoid falling into excesses against exposure to these media, especially Internet and letting us be ourselves " the wonderful encounter with the other. "

Friday, August 20, 2010

Low Platelets And Neutrophils Uk



" Language is the best and worst
a man has "

Thursday, August 12, 2010

Hanging Bob Opponent Bag

Performance Benchmarking of sentences using SQL Performance Analyzer (SPA)








Normal
 
0

21





false false false










MicrosoftInternetExplorer4














/ * Style Definitions * / table.MsoNormalTable {mso-style-name: "Table Normal" mso-tstyle-rowband-size: 0; mso-tstyle-colband-size: 0; mso-style-noshow: yes; mso-style-parent: "" mso-padding-alt: 0in 5.4pt 0in 5.4pt; mso-para-margin: 0in; mso-para-margin-bottom: .0001 pt; mso-pagination: widow-orphan; font -size: 10.0pt; font-family: "Times New Roman" mso-ansi-language: # 0400; mso-Fareast-language: # 0400; mso-bidi-language: # 0400;}


To update ( upgrade) a version of an Oracle based mainly four methods:



Use Chart Wizard (DBUA). Is the method suggested in the manuals.

Use scripting or manually (which I always tend to use)

Export / Import

CTAS (in my opinion the most complicated, create dblink, build scripts for the transfer of objects, etc)
This paper

I'll write a step by step procedure to update using the manual method (the 2 listed above):




Pre-Upgrade




1. If the upgrade is on the same team would have to install the software (the motor) 11g in a new home. You can use the same user oracle stream 10g installation and setup environment variables for 11g or you could use a new oracle user (eg Oracle11g).



2. After installing the software the user to connect to oracle 11g installation and copy the file
$ ORACLE_HOME/rdbms/admin/utlu112i.sql to a shared directory (ie / tmp).

3. Users connect to the 10g (eg Oracle) or if using the same user setear environment variables to use the 10g motor to run the script you copied in step 2. This script provides information prior to the upgrade to be used for preparing the current version there are no problems during the upgrade

4. Connect to sqlplus:



$ sqlplus / As sysdba



5. Setear the spool so there is no record of the script


sqlplus> spool upg_info.log


6. Run the script: sqlplus


> @ / tmp/utlu112i.sql;


7. Turn off the spool:


sqlplus> spool off





Example Output Report pre-upgrade information

Below is a typical output of the script on a database called utlu112i.sql ROP10g on a Solaris machine 10.



Oracle Database 11.2 Pre-Upgrade Information Tool 07-26-2010 15:14:36

**********************************************************************

Database:

**********************************************************************



--> name: ROP10G



--> version: 10.2.0.4.0


--> compatible: 10.2.0.1.0



--> blocksize: 8192



--> platform: Solaris[tm] OE (64-bit)



--> timezone file: V4



**********************************************************************

Tablespaces: [make adjustments in the current environment]
 

**********************************************************************



--> SYSTEM tablespace is adequate for the upgrade.



.... minimum required size: 313 MB



.... AUTOEXTEND additional space required: 83 MB



--> UNDO tablespace is adequate for the upgrade.



.... minimum required size: 121 MB



--> SYSAUX tablespace is adequate for the upgrade.



.... minimum required size: 73 MB



.... AUTOEXTEND additional space required: 23 MB


--> TEMP tablespace is adequate for the upgrade.



.... minimum required size: 61 MB



**********************************************************************
 

Update Parameters: [Update Oracle Database 11.2 init.ora or spfile]



**********************************************************************



WARNING: --> "sga_target" needs to be increased to at least 672 MB


**********************************************************************



Renamed Parameters: [Update Oracle Database 11.2 init.ora or spfile]
 

**********************************************************************



-- No renamed parameters found. No changes are required.



**********************************************************************


Obsolete/Deprecated Parameters: [Update Oracle Database 11.2 init.ora or spfile]



**********************************************************************


 --> "background_dump_dest" replaced by  "diagnostic_dest"



--> "user_dump_dest" replaced by "diagnostic_dest"



--> "core_dump_dest" replaced by "diagnostic_dest"



**********************************************************************


Components: [The following database components will be upgraded or installed]



**********************************************************************


--> Oracle Packages and Types [upgrade] VALID

**********************************************************************

Miscellaneous Warnings

.... USER SYS has 2 INVALID objects.
Controls are performed with the pre-upgrade tool
invalid objects.

Check if the configuration of SGA meets the minimum requirements in 11g.
  1. Check if database links with passwords (11g encrypts passwords).
  2. ensures that there are files that need recovery.
  3. ensures that there are files in backup mode.
  4. If the check is enabled RecycleBin if empty (if this completely purged).

Check if timezone files are of type 4 (the files are in $ ORACLE_HOME / oracore / zoneinfo).

Checks for Materialized Views drinks outstanding.

Checks for pending distributed transactions. Once corrected the warnings reported by the previous script can proceed with the upgrade


Upgrade


1. Connect with the owner (user oracle) 10g instance.

1.1 Check that all the processes with the same oracle instance name

$ ps-ef
sqlplus> shutdown transactional


5. If the database is on another computer 11g is to transfer the database files (datafiles, redologs, ControlFiles) to the new computer in the same directory with the same permissions (using unix command scp, ftp, copying any logical mechanism groups, etc). If you perform the upgrade on the same computer and on the same database files do not need to do anything at this point.
6. Connect to the 11g instance with SYSDBA

$ sqlplus / as sysdba

7. Lift 11g database upgrade mode


SQPLUS> STARTUP UPGRADE

8.
Setear spool SQLPLUS> spool upgrade11g.log



9. Run the script to get the pre-upgrade information

SQLPLUS> @? / Rdbms / admin / catupgrd.sql;



10. Disable spooling


SQLPLUS> spool off



11. Utlu112s.sql run the script to see the result of the upgrade.


SQLPLUS> @? / Rdbms/admin/utlu112s.sql



12. Run script to recompile stored procedures utlrp.sql and java classes.

i)
SQLPLUS> @? / Rdbms / admin / utlrp.sql


ii)
SQLPLUS> exec UTL_RECOMP.RECOMP_SERIAL ();



13. Check that all the packages and classes were compiled java


SQLPLUS> select count (1) from dba_invalid_objects.



14. Create spfile from pfile original.


SQLPLUS> create spfile from pfile;



15. Restart the instance normally.



Example Output Report post-upgrade information

Next shows a typical output of the script utlu112i.sql on a team called ROP10g on Solaris 10



SQL> @? / rdbms/admin/utlu112s.sql;

Oracle Database 11.2 Post-Upgrade Status Tool 07-26
14:32:12 -2010
Component Status Version HH: MM: SS Oracle Server


VALID 11.2.0.1.0 00:24:02 Gathering Statistics


.
00:01:32 Total Upgrade Time: 00:25:36

PL / SQL procedure successfully completed.







Post-Upgade




1. Analyze case-sensitive password


SQLPLUS> alter system set SEC_CASE_SENSITIVE_LOGON = false scope = both;


Ideally leave this parameter to true (default), as it strengthens security, but should analyze how some applications ( for example some versions of TOAD can not connect)

2. Setear the COMPATIBLE parameter to 11.2.0


SQLPLUS> alter system set compatible = '11 .2.0 'scope = spfile;


3. Enable thresholds for alerts on tablespaces.

4. Restart the instance

5. Check connection through the listener

6. Depending on the type of backup and use the tool that is sometimes necessary to change the internal identification of the base to be taken as a new base

How to Change the dbid:


SQLPLUS> shutdown Immediate


SQLPLUS> startup
mount

$ nid TARGET = SYS


SQLPLUS> startup mount


SQLPLUS> alter database open RESETLOGS Backup


6 full data base.