Thursday 30 July 2009

Friday 24 July 2009

Windows Server 2003: Install DNS and Active Directory

http://www.petri.co.il/how_to_install_active_directory_on_windows_2003.htm



Wednesday 22 July 2009

OEM : Netapps custom reports

1. Grant additional perms
Need following perms on OEM repos as query is reliant on base tables not oem application views - could rework later perhaps
grant select on MGMT_METRICS_RAW to mgmt_view;
grant select on MGMT_METRICS to mgmt_view;
grant select on MGMT_TARGETS to mgmt_view;
2. Create first Report
2.1 Create Report
Navigate to Reports->Create
Title : NTAP001 - Netapps Raw IO-Rate
Category : Custom Reports (may have to add)
Subcategory : Development (may have to add)
Target : Target Type=Network Appliance Filer
Time Period : This reoport has a time period = ticked. Time Period = This Year, Allow the report viewer... = ticked

2.2 Create chart element
Navigate to tab Elements->Add
Select     Chart from SQL
Navigate to Set Parameters
Header : Io Rate
Statment :
    select
    mt.TARGET_NAME,
    mrw.COLLECTION_TIMESTAMP,
    --mm.column_label,
    mrw.VALUE
    /*-- DEBUG
    ,mm.COLUMN_LABEL_NLSID
    ,'MRW->'
    ,mrw.*
    ,',MT->'
    ,mt.*
    ,'MM->'
    ,mm.*
    */
    from
    MGMT_METRICS_RAW mrw,
    MGMT_METRICS mm,
    MGMT_TARGETS mt
    where 1=1
    and mrw.metric_guid    = mm.metric_guid
    and mrw.TARGET_GUID    = mt.TARGET_GUID
    and mt.TARGET_TYPE     = mm.TARGET_TYPE
    and mt.type_meta_ver   = mm.type_meta_ver
    and (mt.TARGET_TYPE = 'netapp_filer' )
    AND mrw.collection_timestamp >=      ??EMIP_BIND_START_DATE??
    and mrw.collection_timestamp <=       ??EMIP_BIND_END_DATE??
    and mt.TARGET_GUID          = ??EMIP_BIND_TARGET_GUID??
    and column_label_nlsid in (
     'netapp_filer_total_disk_io_rate'
    --,'netapp_filer_pct_busy'
    --,'netapp_filer_nfs_calls_rate'
    --,'netapp_filer_total_network_io_rate'
    )
    ORDER BY
    mt.TARGET_NAME,
    mrw.COLLECTION_TIMESTAMP,
    mm.column_label
Statement type : SQL
Legent Position : Right
Width : 1000
Height : 400

2.3 Create Table element
Navigate to tab Elements->Add
Select     Table from SQL
Repeat settings for Chart from SQL element above

3. Clone to create other reports
Repeat altering Sql in each case for
    NTAP001 - Netapps Raw IO-Rate = netapp_filer_total_disk_io_rate
    NTAP002 - Netapps Raw CPU %Busy = netapp_filer_pct_busy
    NTAP003 - Netapps Raw NFS Call Rate = netapp_filer_nfs_calls_rate
    NTAP004 - Netapps Raw Network IO Rate = netapp_filer_total_network_io_rate


OEM : Add ability to run queries on target dbs for OEM report elements

  • Login as sys on the Grid Repository and execute :
    insert into sysman.mgmt_ip_report_elem_def values('target_user_table_from_sql','database_target_type',
    'target_user_table_from_sql',
    'oracle.sysman.db.util.reports.TableTargetRenderController',0,NULL,'EM',NULL,
    '10.2.0.1.0');

    Insert into SYSMAN.MGMT_IP_ELEM_PARAM_CLASSES
    (ELEMENT_NAME_NLSID, ELEMENT_TYPE_NLSID, ELEMENT_PARAM_CLASS, DISPLAY_ORDER)
    Values ('target_user_table_from_sql', 'database_target_type','oracle.sysman.eml.ip.render.elem.HeaderParamController',
    1);

    Insert into SYSMAN.MGMT_IP_ELEM_PARAM_CLASSES
    (ELEMENT_NAME_NLSID, ELEMENT_TYPE_NLSID, ELEMENT_PARAM_CLASS, DISPLAY_ORDER)
    Values ('target_user_table_from_sql', 'database_target_type', 'oracle.sysman.eml.ip.render.elem.SQLStatementParamController', 2);
    Commit;
  • In GC there is now an element type on the Report page called "target_user_table_from_sql" which allows scripts to run against a Target database.


OEM : UDMs and Custom reports

1. Create user defined metric on LIVE1, ESTDB2 (has to be a db), DBQLIVE1
  • Navigate to Targets->Databases->Selected Database->User-Defined Metrics->Create
  • Metric Name    :    ODL_NEW_CLIENT_APPS_THISMONTH
  • Metric Type :    NUMBER       
  • SQL Query Output : Single Value
  • SQL Query :   
               select count(9) ct from
               (select program_name
                      ,min(least(nvl(first_allow_time,sysdate+1),nvl(first_deny_time,sysdate+1))) min_first_time 
                from odl_dbadmin_dbo.client_app_login
                where 1=1
                group by program_name
                order by 2 desc)
            where min_first_time >= sysdate-30
  • Db Credentials : User/Password
  • Comparison Operator : >
  • Warning : 0
  • Alert Message : ODL_NEW_CLIENT_APPS_THISMONTH: %value% new applications detected
  • Schedule
  • Enabled : On
  • Start : Immediately
  • Repeat every : 24 hours
2. Add custom report to show all UDMs
2.1  Create Report
  • Navigate to Reports->Create
  • Title : ODL010 - ODL User-defined Metric (UDM) Current Values
  • Category : Custom Reports (may have to add)
  • Subcategory : Development (may have to add)
  • Target : Use specified target = EMREP2.ODL (OEM repos)
  • Privileges : Run report usign target privs = ticked
  • Time Period : This reoport has a time period = ticked  Last 24 hours
2.2 Add query as a new element
  • Navigate to tab Elements->Add
  • Select     target_user_table_from_sql
  • Navigate to Set Parameters
  • Header : Latest UDM values
  • Statment :
           SELECT DISTINCT
            key_value "Metric Name", 
            UPPER(target_name) "Target Name",             
            TO_CHAR(collection_timestamp, 'MM-DD-YYYY HH24:MI') "Last Collected" 
            ,nvl(to_char(data_value_int),string_value) "Metric Value"
            --,M.*
            FROM sysman.em$current_metrics m 
            WHERE 1=1
            AND METRIC_NAME = 'SQLUDM'
            AND key_value like 'ODL%'
            ORDER BY 1, 2
  • Statement type : SQL
  • Rows to display : 100

2.3 Set a preferred credentials against the OEM repos target for the report running user
  • Navigate to Preferences->Preferred Credentials
  • Select Database Instance->Set Credentials
  • Fill in valid user/password for OEM Report


Friday 17 July 2009

Oracle : Tracing the session behind an ORA-54 resource busy message

select    oracle_username || ' (' || s.osuser || ')' username
,    s.sid || ',' || s.serial# sess_id
,    owner || '.' ||    object_name object
,    object_type
,    decode(    l.block
    ,    0, 'Not Blocking'
    ,    1, 'Blocking'
    ,    2, 'Global') status
,    decode(v.locked_mode
    ,    0, 'None'
    ,    1, 'Null'
    ,    2, 'Row-S (SS)'
    ,    3, 'Row-X (SX)'
    ,    4, 'Share'
    ,    5, 'S/Row-X (SSX)'
    ,    6, 'Exclusive', TO_CHAR(lmode)) mode_held
from    v$locked_object v
,    dba_objects d
,    v$lock l
,    v$session s
where     v.object_id = d.object_id
and     v.object_id = l.id1
and     v.session_id = s.sid
order by oracle_username
,    session_id

ALTER SYSTEM KILL SESSION '109,27585'; --sess_id

Saturday 11 July 2009

Firefox 3.5 startup speedup

Remove files from the following directories which are scanned for security:

C:\Documents and Settings\*user*\Local Settings\History
C:\Documents and Settings\*user*\Local Settings\Temporary Internet Files
C:\Documents and Settings\*user*\My Recent Documents
C:\Documents and Settings\*user*\Temp\