Wednesday, 13 February 2013

How to completely uninstall oracle 11g from windows server 2008

In 11g to uninstall oracle software, U have to manually run deinstall.bat

Its not possible thru OUI.

1. Log in as the Administrator.
2. Run  ---> Services.msc --> Stop all Oracle related Services
3. Run ---> From a cmd window, run <<ORACLE_HOME>>\deinstall\deinstall.bat.

It would prompt you for database, and it would take time to complete.

4. Delete the ORACLE_HOME directory.

In Windows server 2003, In HKLM under software u will find one oracle folder, Removing that in enough in server 2003,

Here We have to remove the following things from registry entry,

Run---> regedit--->  

HKLM\System\CurrentControlSet\Services\EventLog\Application\Oracle Services for MTS
HKLM\System\CurrentControlSet\Services\EventLog\Application\OracleDBConsole<SID>
HKLM\System\CurrentControlSet\Services\EventLog\Application\Oracle.<SID>
HKLM\System\CurrentControlSet\Services\EventLog\Application\Oracle.VSSWriter.<SID>
HKLM\CurrentControlSet\Services\Oracle11

HKLM - HKEY_LOCAL_MACHINE

then reboot the server once.

You are done with uninstallation.

Thanks.

Monday, 24 December 2012

Steps To Enable Auditing on RAC Database

Auditing has two types, there are
  • standard - auditing based on statement, privilege and object-level
  • fine-grained - auditing, which is based on content
Standard auditng has 3 levels.

  • statement - audit all actions on any type of object
  • privilege - audit actions that stem from system privileges
  • object-level - specific audit actions like select, update, insert or delete

  • Auditing depends on which value we pass on audit_trail

    the values are..
    • none - disables auditing
    • os - records the information to a o/s file (uses parameter audit_file_dest for the file location)
    • db - records the information in the database, use the view dba_audit_trail ( view accesses table sys.aud$ ) to display audit information.
    • db, extended - as per the db value but also populates the sqlbind and sqltext clob columns
    • xml - audits to the o/s file but in xml format (uses parameter audit_file_dest for the file location)
    • xml,extended - as per xml option but also populates the sqlbind and sqltext clob columnstandard
    For all 3 levels of auditing you can choose to audit by access (audit every time you access) or by session (audit only once per access during the session).

    Steps to enable auditing ...   Ex  11gR2 2 Node RAC setup.

    We had to drop old audit (aud$) table, for that we need to keep our database in restricted mode.

    Steps:

    srvctl stop listener -n nodename1
    srvctl stop listener -n nodename2

    sqlplus>
    alter system set cluster_database=false scope=spfile

    alter system set audit_trail=db,extended scope=spfile

    $srvctl stop database -d dbname -o immediate

    >startup restrict
    >truncate table aud$
    >alter system set cluster_database=true scope=spfile
    >shu immediate;

    $srvctl start database -d dbname

    $srvctl start listener -n nodename1

    $srvctl start listener -n nodename2

    create users

    ----------------------------------------

    AUDIT ALL BY username BY ACCESS;

    AUDIT SELECT TABLE, UPDATE TABLE, INSERT TABLE, DELETE TABLE BY username BY ACCESS;

    AUDIT EXECUTE PROCEDURE BY username BY ACCESS;
     

    Monday, 17 December 2012

    opidcl aborting process unknown ospid (27181) as a result of ORA-2396

    If you face the above error,

    You can safely ignore.

    It was written in alertlog because of timed out sessions. If you dont want this in alertlog you may have to reset your idle time to unlimited which is not possible in huge environment. So it is better to ignore the above error message.

    Thanks.

    Experts comments welcome.

    Error 0 in kwqmnpartition-update_aqs_instance, aborting txn

    If you face above error in your alert log file,

                    It would be because of some sys invalid objects. It would end up with error when end users access something through application.

                    To rectify this first we have to run utlrp.sql script which is located in ORACLE_HOME/rdbms/admin path.

    If that doesn't work, we have to take downtime and disable all the triggers then run catproc.sql script which is also in the same location.

    Thanks. 

    Wednesday, 10 October 2012

    CRS is not coming up.. hitting a bug

    RAC - Windows server 2003 - CR Service is not coming up. - On 2 node RAC one node is down.

    When try start CR service on node 2 (which is down) Both nodes are down with Blue screen error(OS error)

    10.2.0.1

    When I check OCR logs..

    2012-10-09 21:54:46.058: [ CRSMAIN][632]32Initializing OCR
    2012-10-09 21:54:46.073: [ OCROSD][632]utgdv:11:could not read reg value ocrmirrorconfig_loc os error= The system could not find the environment option that was entered.

    2012-10-09 21:54:46.073: [ OCROSD][632]utgdv:11:could not read reg value ocrmirrorconfig_loc os error= The system could not find the environment option that was entered.
    2012-10-09 21:54:46.073: [ OCRRAW][632]proprioo: for disk 0 (E:\cdata\crs\data.ocr), id match (1), my id set (1830547516,1028247821) total id sets (1), 1st set (1830547516,1028247821), 2nd set (0,0) my votes (2), total votes (2)
    2012-10-09 21:54:46.089: [ OCRMAS][2872]th_master:12: I AM THE NEW OCR MASTER at incar 1. Node Number = 1
    2012-10-09 21:54:46.089: [ OCROSD][2872]utgdv:11:could not read reg value ocrmirrorconfig_loc os error= The system could not find the environment option that was entered.

    I had a doubt it would not able to access OCR.loc So get into ocr file on both nodes and check whether it is accessible or not.

    To find the locaton u can use ocrcheck command..

    or on windows ---> run ---->regedit ----> HKEY_LOCAL_MACHINE\SOFTWARE\Oracle\OCR

    Ocr.loc  In my enviroment  E:\cdata\crs\data.ocr in this format and it was accessible.

    To check votedisk location You can use..     crsctl query css votedisk

    Checked--- All ip's were pinging --- no network related issue.

    When checking css logs, We got to know that It was 10.2.0.1 bug. We were hitting a bug.

    Log for reference
    StartCMMon(): clssnmNMDetach failed - 2 10.2.0.1

    Bug 4714940: CLSSGMSTARTNMMON: TIMED OUT WAITING ON NESTED NM RECONFIG. SELF-SACRIFICING
    -> duplicate of
    Bug 4682525: STARTCMMON(): CLSSNMNMDETACH FAILED, IN CSS
    -> duplicate of
    Bug 4682514: CLSSGMSLAVECMSYNC: RECONFIG TIMEOUT, IN CSS
    -> fixed by 10202
    To fix this bug minimum required patchset is 10.2.0.2 we decided to go for 10.2.0.5 which is the latest.
    Patch # 4547817 10.2.0.2 PATCH SET FOR ORACLE DATABASE SERVER
    Patch # 7213942 ORACLE 10.2.0.2 PATCH 18 BUG FOR WINDOWS-64 AMD64 AND INTEL EM64T XP AND 2003 (latest minipatch over 10202)

    patch # 8202632 10.2.0.5.0 PATCH SET FOR ORACLE DATABASE SERVER
    patch # 14408636 ORACLE 10G 10.2.0.5 PATCH 18 BUG FOR WINDOWS (64-BIT AMD64 AND INTEL EM64) (latest minipatch over 10205)

    Thanks.....





     

    Tuesday, 11 September 2012

    ERROR : Connection was refused with error ORA-12519

    Please check MOS id:552765.1


    One of the most common reasons for the TNS-12516 and/or TNS-12519 errors being reported is the configured maximum number of PROCESSES and/or SESSIONS limitation being reached. When this occurs, the service handlers for the TNS listener become "Blocked" and no new connections can be made. Once the TNS Listener receives an update from the PMON process associated with the Database instance telling the TNS Listener the thresholds are below the configured limit, and the database is now accepting connections connectivity resumes.

    In this case please check v$resource_limt view to find maximum utilization and available utilization.

    For this,


    Select resource_name,current_utilization,max_utilization ,limit_value from v$resource_limit;

    If current utilization reaches the limit then increase the appropriate value, then if necessary bounce back the database.

    In my case it processes limit has been exceeded,  so i increase both nodes and restarted the RAC DB.

    Check lsnrctl status,

    It may show status is blocked.

    In my case;

    On both nodes ---
    SQL> alter system set sessions=800 scope=spfile;

    Sistema modificado.

    SQL> alter system set processes=1000 scope=spfile;


    shutdown immediate
    startup ------------  using svctl

    processes integer 1000
    sessions integer 1500
    Because sessions are derived from processes.. Keep in mind...

    ASM insufficient Privileges and while starting syntax error or unresolved network name 'LISTENER_+ASM'

    For the above error,

    as well as [oracle@racdr ~]$ sqlplus
    SQL*Plus: Release 11.2.0.1.0 Production on Sat Sep 8 13:00:14 2012
    Copyright (c) 1982, 2009, Oracle. All rights reserved.
    Enter user-name: sys as sysdba
    Enter password:
    Connected to an idle instance.
    SQL> startup mount pfile ='/u01/app/oracle/diag/asm/+asm/+ASM/trace/init+ASM.ora';
    ORA-01031: insufficient privileges
    SQL> conn sys as sysasm
    Enter password:
    ERROR:
    ORA-01031: insufficient privileges

    We  need to export all the home paths corectly

    For ex.. while starting ASM.(11g)

    ORACLE HOME should be grid home and also Grid home should be grid home..
    export ORACLE_SID as +ASM


    If you have any parameter like sqlnet.authentication_services inside your sqlnet.ora file comment that one. And also comment the LOCAL_LISTENER 'LISTENER_+ASM' (if exist ) in the pfile.

    Better U create a pfile using ASM alertlog File

    Following Steps has to be done.

     $export ORACLE_SID=+ASM
    $export ORACLE_HOME=<Your Grid Oracle Home>
    $export PATH=$PATH:$ORACLE_HOME/bin

    Create the pfile with below values under $ORACLE_HOME/dbs

    $cd $ORACLE_HOME/dbs
    $vi init+ASM.ora

    large_pool_size = 12M
    instance_type = "asm"
    remote_login_passwordfile= "EXCLUSIVE"
    asm_power_limit = 1
    diagnostic_dest = "/u01/app/oracle"
    asm_diskstring='/dev/oracleasm/disks/*'

    $sqlplus "/as sysasm"

    sql>startup pfile='?/dbs/init+ASM.ora';

    sql>alter diskgroup data mount; (Mention ur diskgroup name)


    To catch details of ur ASM

    You can use following commands for Linux.
    # rpm -qa |grep oracleasm
    # /etc/init.d/oracleasm status
    # lsmod |grep -i asm
    # cat /proc/filesystems |grep -i asm
    # ls -l /usr/sbin/oracleasm-discover
    # /etc/init.d/oracleasm listdisks
    $ /etc/init.d/oracleasm listdisks | xargs /etc/init.d/oracleasm querydisk -p
    # ls -l /dev/oracleasm/disks/*
    # cat /proc/partitions
    # cat /etc/sysconfig/oracleasm
    # ls -l /etc/sysconfig/oracleasm*
    Ur comments are welcome