Saturday, September 5, 2015

steps to compare the database performance between two time stamps in oracle database?

1.generate the AWR manually and check the performance of the SQL's and TOP sql's
2.use OEM tool ,go to AWR  & compare awr for two time frames by snapshot  .

steps to check sql is hard/soft parse ,#execution,rows_processed in oracle database?

1.check from oem HISTORY FOR CURSOR AND HISOTRIC DATA
2.USE v$SQL,v$SQLAREA,DBA_HIST_SQLSTAT VIEWS TO GET THE INFORMATION

steps to check when the SQL executed on the oracle database?

1.go to OEM page ->performance->sql-->search sql from AWR if its history
2.select sql_id from dba_hist_sqlstat  where sql_text  like 'select * from emp%'; if its history
3. select sql_id from V$sql where sql_text like 'select ename%'; if its in cursor

monitoring tools for postgreSql database



1.OPM
2.PGWATCH















steps to generate explain pla for sql in oracle DB?

EXPLAIN PLAN command

select plan_table_output   from table(dbms_xplan.display('plan_table',null,'basic'));

V$SQL_PLAN --last slq staement on cursor

select plan_table_output  from table(dbms_xplan.display_cursor(null,null,'basic'));

Automatic Workload Repository (AWR) 

1.note down the specific time
2.generate the awr for the specific  time
2.genarete the awr and pick the sql_id and genrate the explain plan
or
use dba_hist_sqlstat and get the sql_id and genrate the explain plan

SQL Tuning Set (STS)

SQL Plan Baseline (SPM)

--get the sql_handle from the query and generate the plan

 select SQL_HANDLE, PLAN_NAME, ACCEPTED   from dba_sql_plan_baselines
  where sql_text like 'select * from empty%';


select t.* from
table(dbms_xplan.display_sql_plan_baseline('SYS_SQL_1899bb9331ed0999',format => 'basic')) ;

Tuesday, September 1, 2015

steps to flush a particular sql statements from the database

get the SQL_ID for the SQl statement

SQL> select ADDRESS, HASH_VALUE from V$SQLAREA where SQL_ID like '81d%';

ADDRESS HASH_VALUE
---------------- ----------
<address> <hash value>

SQL> exec DBMS_SHARED_POOL.PURGE ('address, hash value', 'C');

PL/SQL procedure successfully completed.

SQL> select ADDRESS, HASH_VALUE from V$SQLAREA where SQL_ID like '81d%';
no rows selected.

Monday, August 24, 2015

queries used to check SQL cluster view status

check about sql cluster
-------------------------------
select serverproperty('ComputerNamePhysicalNetBIOS');

SELECT * FROM fn_virtualservernodes();

SELECT * FROM sys.dm_os_cluster_nodes ;

script to check the DG sync status from primary Database

set time on
set echo off
set verify off
set feedback off
set pagesize 999 lines 200
col dest_name for a40
col destination for a40
col applied_seq# for 999999999
col archived_seq# for 999999999
select dest_name,status,destination,archived_seq#,applied_seq#
from v$archive_dest_status
where status='VALID';

Monday, August 10, 2015

steps to change the oracle DB SAp user password.

Please use the below SYNTAX.

brconnect -c -p initTEST.sap -l E -f chpass -o SYSTEM -password <PASSWORD>

steps to do table level re-org in SAP oracle database?

1.check the table size before re-org
2.here is the syntax:
brspace -u / -c force -f  tbreorg -m online -a reorg -t <Table_name> -degree 4 -initial 2
3.check the table size after re-org it will be reduced.