Saturday, 26 November 2016

(ASH) performed an emergency flush


Alert :- Active Session History (ASH) performed an emergency flush. This may mean that ASH i
             undersized. If emergency flushes are a recurring issue, you may consider increasing ASH  
             size  by setting the value of _ASH_SIZE to a sufficiently large value.
             Currently, ASH size is 50331648 bytes.

 
 Cause :-  Suddenly increased load on the database , and more active sessions are established   
                because  of this oracle unable to maintain active sessions information in ASH buffer
                hence oracle perform ASH emergency flush for the time being fixing the issue internally.
                During internal process oracle will not allowing to make SQLPLUS    
                connection (SQLPLUS connection may get hanged)

Solution :- If you are frequently gettting the same alert in alert log then consider the increasing the  
                   size of ASH buffer using hidden parameter "_ASH_SIZE" reference MOS doc 1385872.1
                   I would suggest please concern with oracle support before going to change the values of  
                  "_ASH_SIZE" hidden parameter
           
Query to check ASH size and total number of emergency flushes happened :

  SQL> select total_size/1024/1024 as MB ,awr_flush_emergency_count from v$ash_info;


 Hope this article help you.

===================      Thank you                   ============================

Monday, 1 August 2016

find block corruption object/segment

Query to display corrupted block object/segment name
--------------------------------------------------------------------

set pages 1000 lines 180
COLUMN segment_name FORMAT A30
 
SELECT DISTINCT owner, segment_name
FROM   v$database_block_corruption dbc
JOIN dba_extents e ON dbc.file# = e.file_id AND dbc.block#
BETWEEN e.block_id and e.block_id+e.blocks-1
ORDER BY 1,2;

 
O/P

OWNER                          SEGMENT_NAME

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

SYS                            SMON_SCN_TIME_SCN_IDX

 

ORA-00972: identifier is too long

Scenario :-

SQL> SELECT dbms_metadata.get_ddl('INDEX',’SMON_SCN_TIME_SCN_IDX’,'SYS') from dual;
SELECT dbms_metadata.get_ddl('INDEX',’SMON_SCN_TIME_SCN_IDX’,'SYS') from dual
                                     *
ERROR at line 1:
ORA-00972: identifier is too long

Cause: An object identifier was specified with more than 30 characters.
   
Action: Specify at most 30 characters.
                Make sure that Oracle object names are shorter than thirty characters.

we may experience this issue many times when we trying to access database column, alias, or table names which are too long which having large length. it can be cause ORA-00972.



------------------------           Thank you                -----------------------------------------

Wednesday, 2 March 2016

Scripts --: Listing database users with granted privileges.

Method 1


SQL> select distinct grantee as "USER",PRIVILEGE  from dba_tab_privs where grantee not in ( select role from dba_roles)
union all
select grantee,PRIVILEGE from dba_sys_privs where grantee not in ( select role from dba_roles)
union all
select grantee,granted_role from dba_role_privs where grantee not in ( select role from dba_roles) order by 1 ;




WSDB_USER                      SELECT
WSI_USER                       SELECT
WSI_USER                       CREATE SESSION
WSI_USER                       EXECUTE
WSOMBW                         RIMS_LOGON_CORP
WSOMBW                         FLOODREPORTUSER
WSOMBW                         IEDITION
WWTS                           IEDITION
WWTS                           FLOODREPORTUSER
WWTS                           RIMS_LOGON_CORP
WW_USER                        SELECT
WW_USER                        CREATE SESSION
XDB                            EXECUTE
XDB                            JAVAUSERPRIV
XDB                            QUERY REWRITE
XDB                            CREATE INDEXTYPE
XDB                            CREATE PUBLIC SYNONYM
XDB                            UNLIMITED TABLESPACE
XDB                            CREATE LIBRARY
XDB                            CREATE OPERATOR
XDB                            DROP PUBLIC SYNONYM
XDB                            CREATE VIEW
XDB                            CREATE SESSION




Method 2


set heading off
set pages 0
set long 9999999
select dbms_metadata.get_granted_ddl('ROLE_GRANT', user) 
from dual;
select dbms_metadata.get_granted_ddl('SYSTEM_GRANT', user) 
from dual;
select dbms_metadata.get_granted_ddl('OBJECT_GRANT', user) 
from dual;




  GRANT ALTER TABLESPACE TO "SYS"
  GRANT CREATE TABLESPACE TO "SYS"
  GRANT RESTRICTED SESSION TO "SYS"
  GRANT ALTER SESSION TO "SYS"
  GRANT CREATE SESSION TO "SYS"
  GRANT AUDIT SYSTEM TO "SYS"
  GRANT ALTER SYSTEM TO "SYS"

SQL>   2
  GRANT SELECT ON "OUTLN"."OL$" TO "SYS" WITH GRANT OPTION
  GRANT SELECT ON "OUTLN"."OL$HINTS" TO "SYS" WITH GRANT OPTION
  GRANT SELECT ON "OUTLN"."OL$NODES" TO "SYS" WITH GRANT OPTION
  GRANT SELECT ON "SYSTEM"."DEF$_ERROR" TO "SYS" WITH GRANT OPTION
  GRANT SELECT ON "SYSTEM"."DEF$_DESTINATION" TO "SYS" WITH GRANT OPTION
  GRANT SELECT ON "SYSTEM"."DEF$_CALLDEST" TO "SYS" WITH GRANT OPTION
  GRANT SELECT ON "SYSTEM"."REPCAT$_REPSCHEMA" TO "SYS" WITH GRANT OPTIO

Method 3


  /* USER SYSTEM GRANTS */
SELECT a.grantee "USER", a.privilege, a.admin_option
FROM DBA_SYS_PRIVS a
INNER JOIN DBA_USERS c on c.USERNAME = a.GRANTEE
ORDER BY a.grantee, a.privilege;


/* USER OBJECT GRANTS */
SELECT a.table_name "OBJECT_NAME", b.object_type, a.privilege, a.grantee, a.grantor, c.username
FROM dba_tab_privs a
INNER JOIN dba_objects b on b.OBJECT_NAME = a.TABLE_NAME AND a.OWNER = b.OWNER
INNER JOIN DBA_USERS c on c.USERNAME = a.GRANTEE
ORDER by table_name;


/* ROLE SYSTEM GRANTS */
SELECT a.grantee "ROLE", a.privilege, a.admin_option
FROM DBA_SYS_PRIVS a
INNER JOIN DBA_ROLES c on c.ROLE = a.GRANTEE
ORDER BY a.grantee, a.privilege;


/* ROLE OBJECT GRANTS */
SELECT a.table_name "OBJECT_NAME", b.object_type, a.privilege, a.grantee, a.grantor
FROM dba_tab_privs a
INNER JOIN dba_objects b on b.OBJECT_NAME = a.TABLE_NAME AND a.OWNER = b.OWNER
INNER JOIN DBA_ROLES c on c.ROLE = a.GRANTEE
ORDER by table_name;


/* Use DBA_ROLE_PRIVS to find who is a member of each role */
SELECT *
FROM DBA_ROLE_PRIVS
ORDER BY GRANTEE, GRANTED_ROLE;

Scripts --: Listing database users with granted privileges.

Method 1


SQL> select distinct grantee as "USER",PRIVILEGE  from dba_tab_privs where grantee not in ( select role from dba_roles)
union all
select grantee,PRIVILEGE from dba_sys_privs where grantee not in ( select role from dba_roles)
union all
select grantee,granted_role from dba_role_privs where grantee not in ( select role from dba_roles) order by 1 ;




WSDB_USER                      SELECT
WSI_USER                       SELECT
WSI_USER                       CREATE SESSION
WSI_USER                       EXECUTE
WSOMBW                         RIMS_LOGON_CORP
WSOMBW                         FLOODREPORTUSER
WSOMBW                         IEDITION
WWTS                           IEDITION
WWTS                           FLOODREPORTUSER
WWTS                           RIMS_LOGON_CORP
WW_USER                        SELECT
WW_USER                        CREATE SESSION
XDB                            EXECUTE
XDB                            JAVAUSERPRIV
XDB                            QUERY REWRITE
XDB                            CREATE INDEXTYPE
XDB                            CREATE PUBLIC SYNONYM
XDB                            UNLIMITED TABLESPACE
XDB                            CREATE LIBRARY
XDB                            CREATE OPERATOR
XDB                            DROP PUBLIC SYNONYM
XDB                            CREATE VIEW
XDB                            CREATE SESSION




Method 2


set heading off
set pages 0
set long 9999999
select dbms_metadata.get_granted_ddl('ROLE_GRANT', user) 
from dual;
select dbms_metadata.get_granted_ddl('SYSTEM_GRANT', user) 
from dual;
select dbms_metadata.get_granted_ddl('OBJECT_GRANT', user) 
from dual;




  GRANT ALTER TABLESPACE TO "SYS"
  GRANT CREATE TABLESPACE TO "SYS"
  GRANT RESTRICTED SESSION TO "SYS"
  GRANT ALTER SESSION TO "SYS"
  GRANT CREATE SESSION TO "SYS"
  GRANT AUDIT SYSTEM TO "SYS"
  GRANT ALTER SYSTEM TO "SYS"

SQL>   2
  GRANT SELECT ON "OUTLN"."OL$" TO "SYS" WITH GRANT OPTION
  GRANT SELECT ON "OUTLN"."OL$HINTS" TO "SYS" WITH GRANT OPTION
  GRANT SELECT ON "OUTLN"."OL$NODES" TO "SYS" WITH GRANT OPTION
  GRANT SELECT ON "SYSTEM"."DEF$_ERROR" TO "SYS" WITH GRANT OPTION
  GRANT SELECT ON "SYSTEM"."DEF$_DESTINATION" TO "SYS" WITH GRANT OPTION
  GRANT SELECT ON "SYSTEM"."DEF$_CALLDEST" TO "SYS" WITH GRANT OPTION
  GRANT SELECT ON "SYSTEM"."REPCAT$_REPSCHEMA" TO "SYS" WITH GRANT OPTIO

Method 3


  /* USER SYSTEM GRANTS */
SELECT a.grantee "USER", a.privilege, a.admin_option
FROM DBA_SYS_PRIVS a
INNER JOIN DBA_USERS c on c.USERNAME = a.GRANTEE
ORDER BY a.grantee, a.privilege;


/* USER OBJECT GRANTS */
SELECT a.table_name "OBJECT_NAME", b.object_type, a.privilege, a.grantee, a.grantor, c.username
FROM dba_tab_privs a
INNER JOIN dba_objects b on b.OBJECT_NAME = a.TABLE_NAME AND a.OWNER = b.OWNER
INNER JOIN DBA_USERS c on c.USERNAME = a.GRANTEE
ORDER by table_name;


/* ROLE SYSTEM GRANTS */
SELECT a.grantee "ROLE", a.privilege, a.admin_option
FROM DBA_SYS_PRIVS a
INNER JOIN DBA_ROLES c on c.ROLE = a.GRANTEE
ORDER BY a.grantee, a.privilege;


/* ROLE OBJECT GRANTS */
SELECT a.table_name "OBJECT_NAME", b.object_type, a.privilege, a.grantee, a.grantor
FROM dba_tab_privs a
INNER JOIN dba_objects b on b.OBJECT_NAME = a.TABLE_NAME AND a.OWNER = b.OWNER
INNER JOIN DBA_ROLES c on c.ROLE = a.GRANTEE
ORDER by table_name;


/* Use DBA_ROLE_PRIVS to find who is a member of each role */
SELECT *
FROM DBA_ROLE_PRIVS
ORDER BY GRANTEE, GRANTED_ROLE;

Saturday, 20 February 2016

ORA-48913 Writing into trace file failed


Alert :   Non critical error ORA-48913 caught while writing to trace file "/opt/oracle/XXXXX
             /diag/rdbms/nptmp/XXXXX/incident/incdir_288464/XXXXX_ora_23179_i288464.trc"
              Error message: ORA-48913: Writing into trace file failed, file size limit [5242880] reached.

Cause :

                show parameter        max_dump_file_size
                ---------------------------------
                max_dump_file_size        10240

                We are getting this alert in alert.log because when oracle reaches the limit of max 
                dump/trace file size, and its resized to write all content in trace/dump file.
                supported values of this parameter in byes, and special string "UNLIMITED" there is no    
                upper limit of trace file size

Solution : Simply increase the values of max_dump_file_size parameters as per your enviornment  
                 and storage availability.

                SQL> alter system set max_dump_file_size=18240 ;   ( fixed the issued in my case)

                or

                SQL> alter system set max_dump_file_size=UNLIMITED ;
                         ( write dump/trace file as per OS max size limit).


                Hope this article will help you for solving the issue.


=========== Use knowledge to help others not to defect    ============================

ORA-02266: unique/primary keys in table referenced by enabled foreign keys and ORA-02297: cannot disable constraint (MIS_OWNER.USR_PK) - dependencies exist

Alert/error :- When I tried to truncate the table/clear the table data, Oracle not allowed me to 
                      cleared the table data, because whenever we creates primary/unique key constraint, 
                      oracle internally linked column data with ROWID, hence oracle not allow to  
                     remove  table data. however if we disable link between column data and ROWID, then
                    it will allow us to truncate the table.




Workaround :-



SQL> >> truncate table MIS_OWNER.MIS_USERS;
truncate table MIS_OWNER.MIS_USERS
                        *
ERROR at line 1:
ORA-02266: unique/primary keys in table referenced by enabled foreign keys


SQL> select CONSTRAINT_NAME,CONSTRAINT_TYPE,status ,TABLE_NAME from dba_constraints where TABLE_NAME='MIS_USERS' and owner='MIS_OWNER';

CONSTRAINT_NAME                C STATUS   TABLE_NAME
------------------------------ - -------- ------------------------------
SYS_C0024627                   C ENABLED  MIS_USERS
SYS_C0024626                   C ENABLED  MIS_USERS
SYS_C0024625                   C ENABLED  MIS_USERS
SYS_C0024624                   C ENABLED  MIS_USERS
SYS_C0024623                   C ENABLED  MIS_USERS
SYS_C0024622                   C ENABLED  MIS_USERS
SYS_C0024621                   C ENABLED  MIS_USERS
SYS_C0024620                   C ENABLED  MIS_USERS
AVCON_MIS_E_NEW_F_000          C ENABLED  MIS_USERS
USR_UK                         U ENABLED  MIS_USERS
USR_PK                         P ENABLED  MIS_USERS

11 rows selected.

SQL> select ' alter table ' ||owner||'.'||TABLE_NAME|| ' disable constraint '||CONSTRAINT_NAME || ';' from dba_constraints where TABLE_NAME='MIS_USERS' and owner='MIS_OWNER';

'ALTERTABLE'||OWNER||'.'||TABLE_NAME||'DISABLECONSTRAINT'||CONSTRAINT_NAME||';'
--------------------------------------------------------------------------------
 alter table MIS_OWNER.MIS_USERS disable constraint SYS_C0024627;
 alter table MIS_OWNER.MIS_USERS disable constraint SYS_C0024626;
 alter table MIS_OWNER.MIS_USERS disable constraint SYS_C0024625;
 alter table MIS_OWNER.MIS_USERS disable constraint SYS_C0024624;
 alter table MIS_OWNER.MIS_USERS disable constraint SYS_C0024623;
 alter table MIS_OWNER.MIS_USERS disable constraint SYS_C0024622;
 alter table MIS_OWNER.MIS_USERS disable constraint SYS_C0024621;
 alter table MIS_OWNER.MIS_USERS disable constraint SYS_C0024620;
 alter table MIS_OWNER.MIS_USERS disable constraint AVCON_MIS_E_NEW_F_000;
 alter table MIS_OWNER.MIS_USERS disable constraint USR_UK;
 alter table MIS_OWNER.MIS_USERS disable constraint USR_PK;

11 rows selected.


 SQL> alter table MIS_OWNER.MIS_USERS disable constraint SYS_C0024627;
 SQL> alter table MIS_OWNER.MIS_USERS disable constraint SYS_C0024626;
 SQL> alter table MIS_OWNER.MIS_USERS disable constraint SYS_C0024625;
 SQL> alter table MIS_OWNER.MIS_USERS disable constraint SYS_C0024624;
 SQL> alter table MIS_OWNER.MIS_USERS disable constraint SYS_C0024623;
 SQL> alter table MIS_OWNER.MIS_USERS disable constraint SYS_C0024622;
 SQL> alter table MIS_OWNER.MIS_USERS disable constraint SYS_C0024621;
 SQL> alter table MIS_OWNER.MIS_USERS disable constraint SYS_C0024620;
 SQL> alter table MIS_OWNER.MIS_USERS disable constraint AVCON_MIS_E_NEW_F_000;
 SQL> alter table MIS_OWNER.MIS_USERS disable constraint USR_UK;

 SQL>  alter table MIS_OWNER.MIS_USERS disable constraint USR_PK
*
ERROR at line 1:
ORA-02297: cannot disable constraint (MIS_OWNER.USR_PK) - dependencies exist

SQL> select CONSTRAINT_NAME,CONSTRAINT_TYPE,status ,TABLE_NAME from dba_constraints where TABLE_NAME='MIS_USERS' and owner='MIS_OWNER';

CONSTRAINT_NAME                C STATUS   TABLE_NAME
------------------------------ - -------- ------------------------------
SYS_C0024627                   C DISABLED MIS_USERS
SYS_C0024626                   C DISABLED MIS_USERS
SYS_C0024625                   C DISABLED MIS_USERS
SYS_C0024624                   C DISABLED MIS_USERS
SYS_C0024623                   C DISABLED MIS_USERS
SYS_C0024622                   C DISABLED MIS_USERS
SYS_C0024621                   C DISABLED MIS_USERS
SYS_C0024620                   C DISABLED MIS_USERS
AVCON_MIS_E_NEW_F_000          C DISABLED MIS_USERS
USR_UK                         U DISABLED MIS_USERS
USR_PK                         P ENABLED  MIS_USERS

11 rows selected.

SQL> truncate table MIS_OWNER.MIS_USERS;
truncate table MIS_OWNER.MIS_USERS
                        *
ERROR at line 1:
ORA-02266: unique/primary keys in table referenced by enabled foreign keys

SQL> alter table MIS_OWNER.MIS_USERS disable constraint USR_PK cascade;

Table altered.


SQL> select CONSTRAINT_NAME,CONSTRAINT_TYPE,status ,TABLE_NAME from dba_constraints where TABLE_NAME='MIS_USERS' and owner='MIS_OWNER';

CONSTRAINT_NAME                C STATUS   TABLE_NAME
------------------------------ - -------- ------------------------------
SYS_C0024627                   C DISABLED MIS_USERS
SYS_C0024626                   C DISABLED MIS_USERS
SYS_C0024625                   C DISABLED MIS_USERS
SYS_C0024624                   C DISABLED MIS_USERS
SYS_C0024623                   C DISABLED MIS_USERS
SYS_C0024622                   C DISABLED MIS_USERS
SYS_C0024621                   C DISABLED MIS_USERS
SYS_C0024620                   C DISABLED MIS_USERS
AVCON_MIS_E_NEW_F_000          C DISABLED MIS_USERS
USR_UK                         U DISABLED MIS_USERS
USR_PK                         P DISABLED MIS_USERS

11 rows selected.

SQL> truncate table MIS_OWNER.MIS_USERS;

Table truncated.

========================= THANK YOU  ===================================

Thursday, 4 February 2016

Listing user Granted Privileges



I had written blogs, when i received request from user and he wanted to know all granted rights/privileges to DB user.
For this purpose there are few DBA views ( DBA_TAB_PRIVS,DBA_ROLE_PRIVS ,DBA_SYS_PRIVS) from which we can query and get desire outputs.
supporting view explanation :-
-----------------------
DBA_USERS      ----------->    List info about all the users in the database.
DBA_TAB_PRIVS  ----------->    Lists the object privileges granted to users.
DBA_ROLE_PRIVS ----------->    Lists roles that are granted/assigned to a either another role or a user.
DBA_SYS_PRIVS  ----------->    Lists system privileges that are granted/assigned to a either another role or a user.


For the instance  :-  

Way 1 :-
select dbms_metadata.get_ddl( 'USER', 'DB_ADMIN' ) || '/' from dual
UNION ALL
select dbms_metadata.get_granted_ddl( 'SYSTEM_GRANT', 'DB_ADMIN' ) || '/' from dual
UNION ALL
select dbms_metadata.get_granted_ddl( 'OBJECT_GRANT', 'DB_ADMIN' ) || '/' from dual
UNION ALL
select dbms_metadata.get_granted_ddl( 'ROLE_GRANT', 'DB_ADMIN' ) || '/' from dual

Way 2 :-


Granted objects privs
----------------------
SQL> select GRANTEE,PRIVILEGE, TABLE_NAME from dba_tab_privs where grantee='LABUSER';

GRANTEE                        PRIVILEGE                                TABLE_NAME
====================================================================================
LBACSYS                        QUERY REWRITE                            EXPDEPACT$
LBACSYS                        DEBUG                                    EXPDEPACT$
LBACSYS                        FLASHBACK                                EXPDEPACT$
LBACSYS                        INDEX                                    EXPDEPACT$
LBACSYS                        DELETE                                   EXPPKGACT$
LBACSYS                        INDEX                                    EXPPKGACT$
LBACSYS                        INSERT                                   EXPPKGACT$
LBACSYS                        SELECT                                   EXPPKGACT$
LBACSYS                        UPDATE                                   EXPPKGACT$
LBACSYS                        FLASHBACK                                EXPPKGACT$
LBACSYS                        ALTER                                    EXPPKGACT$
LBACSYS                        REFERENCES                               EXPPKGACT$
LBACSYS                        ON COMMIT REFRESH                        EXPPKGACT$
LBACSYS                        QUERY REWRITE                            EXPPKGACT$
LBACSYS                        DEBUG                                    EXPPKGACT$


Granted roles
----------------
SQL> select grantee, granted_role from dba_role_privs where grantee='LABUSER';

GRANTEE                        GRANTED_ROLE
===================================================
DB_ADMIN                       SELECT_CATALOG_ROLE
DB_ADMIN                       CONNECT
DB_ADMIN                       DBA
DB_ADMIN                       DBA
DB_ADMIN                       CONNECT

System Privs
==================
SQL> select grantee, PRIVILEGE from dba_sys_privs where grantee='LABUSER';
GRANTEE         PRIVILEGE
=============================
DB_ADMIN     CREATE SESSION
DB_ADMIN     SELECT ANY DICTIONARY
DB_ADMIN     SELECT ANY TABLE
DMSYS         ALTER SESSION
DMSYS         ALTER SYSTEM
DMSYS         CREATE JOB
DMSYS         CREATE LIBRARY




====================== THANK YOU =====================================

Thursday, 14 January 2016

ORA-00600: internal error code, arguments: [kzdlk_zt2 err], [1844674407370955160



Facing :  ORA-00600: internal error code, arguments: [kzdlk_zt2 err], [1844674407370955160
==============================================================================================

Situation
============

SQL>create public database link Pub_DB_user
  connect to Pub_DB_user identified by values '1A1BB86FA3C47631'
  using 'PROD_DB';



SQL> set pages 1000 lines 180
column DB_LINK format a30
column HOST format a50
select * from dba_db_links;

OWNER                          DB_LINK                        USERNAME                       HOST                                               CREATED
------------------------------ ------------------------------ ------------------------------ -------------------------------------- ---------
PUBLIC                         Pub_DB_user                  Pub_DB_user                  PROD_DB                                             15-JAN-16



SQL> select count(*) from dual@Pub_DB_user;
select count(*) from dual@Pub_DB_user
                          *
ERROR at line 1:
ORA-00600: internal error code, arguments: [kzdlk_zt2 err], [1844674407370955160


Solution :- (Recreate the database link using valid syntax. )
================================================================


SQL > Drop public database link "Pub_DB_user";

SQL > create public database link Pub_DB_user
      connect to Pub_DB_user identified by allow123
      using 'PROD_DB';


     
Note :-

There is MOS note related to this error: [ID 1309705.1]


 The error suggests that when the database link was created, using the syntax IDENTIFIED BY VALUES.
 this clause IDENTIFIED BY VALUES is reserved for internal Oracle use only.
 While earlier Oracle releases allowed the use of IDENTIFIED BY VALUES, this is not documented as being valid syntax.
 From Oracle release 10gR2, database links must be created using the documented syntax.

Although you could create database link using this syntax but it's not have documented as being valid syntax. So use valid when we would be create DBLINK.

  

Step–by-Step 12c oracle database installation on Linux platform (RHEL 6)


Steps 1 Pre-Installation Checks:-

Minimum Space:
Enterprise Edition: 6.4 GB
RAM: 1 GB
Swap: 2GB

Check Memory:-
   [root@12Cmachine] grep MemTotal /proc/meminfo

Check Swap space:-
       [root@12Cmachine] grep SwapTotal /proc/meminfo

Check server bit:-
      [root@12Cmachine] uname -m

Check Linux version:-
      [root@12Cmachine] cat /etc/redhat-release

Check free memory:-
     [root@12Cmachine] free –m

Check Current kernel version:-
    [root@12Cmachine] uname -a
   Linux 2.6.18-238.el5 #1 SMP Sun Dec 19 14:22:44 EST 2010 x86_64x86_64 x86_6 4 GNU/Linux

Download 12c database software:-

Minimum kernel version:-
·Red Hat Enterprise Linux 5 Update 6: 2.6.18-238.0.0.0.1.el5 or later
·Red Hat Enterprise Linux 5 Update 6 with the Unbreakable Enterprise Kernel: 2.6.32-100.0.19 or later

Steps 2 Hostname entry:-
[root@12Cmachine]# Cat /etc/hosts
# Do not remove the following line, or various programs
# that require network functionality will fail.
127.0.0.1 localhost.localdomain localhost
::1 localhost6.localdomain6 localhost6
192.168.0.31 12Cmachine.localdomain 12Cmachine

Kernel Parameters:-
[root@12Cmachine]# cat /etc/sysctl.conf
fs.aio-max-nr = 1048576
fs.file-max = 6815744
kernel.shmall = 2097152
kernel.shmmax= 4294967295
kernel.shmmni = 4096
kernel.sem = 250 32000 100 128
net.ipv4.ip_local_port_range = 9000 65500
net.core.rmem_default = 262144
net.core.rmem_max = 4194304
net.core.wmem_default = 262144
net.core.wmem_max = 1048576
[root@12Cmachine]# /sbin/sysctl – p

Security limit parameters:-
[root@12Cmachine]# cat /etc/security/limits.conf
#Oracle user limit
oracle soft nproc  16384
oracle hard nproc  16384
oracle soft nofile 1024
oracle hard nofile 65536
oracle soft stack  10240
oracle hard stack  32768

Packages
Note: -Install all below listed packages, which are recommend by Oracle support for oracle 12c(mandate)

[root@12Cmachine]#cd /media/RHEL_6.4 x86_64 Disc 1/Packages
[root@12Cmachine]# rpm –Uvh packges_name  ( upgrade package) or
[root@12Cmachine]# rpm –ivh packages_name  ( Install fresh package)
binutils-2.20.51.0.2-5.11.el6 (x86_64)
compat-libcap1-1.10-1 (x86_64)
compat-libstdc++-33-3.2.3-69.el6 (x86_64)
compat-libstdc++-33-3.2.3-69.el6 (i686)
gcc-4.4.4-13.el6 (x86_64)
gcc-c++-4.4.4-13.el6 (x86_64)
glibc-2.12-1.7.el6 (i686)
glibc-2.12-1.7.el6 (x86_64)
glibc-devel-2.12-1.7.el6 (x86_64)
glibc-devel-2.12-1.7.el6 (i686)
ksh
libgcc-4.4.4-13.el6 (i686)
libgcc-4.4.4-13.el6 (x86_64)
libstdc++-4.4.4-13.el6 (x86_64)
libstdc++-4.4.4-13.el6 (i686)
libstdc++-devel-4.4.4-13.el6 (x86_64)
libstdc++-devel-4.4.4-13.el6 (i686)
libaio-0.3.107-10.el6 (x86_64)
libaio-0.3.107-10.el6 (i686)
libaio-devel-0.3.107-10.el6 (x86_64)
libaio-devel-0.3.107-10.el6 (i686)
libXext-1.1 (x86_64)
libXext-1.1 (i686)
libXtst-1.0.99.2 (x86_64)
libXtst-1.0.99.2 (i686)
libX11-1.3 (x86_64)
libX11-1.3 (i686)
libXau-1.0.5 (x86_64)
libXau-1.0.5 (i686)
libxcb-1.5 (x86_64)
libxcb-1.5 (i686)
libXi-1.3 (x86_64)
libXi-1.3 (i686)
make-3.81-19.el6
sysstat-9.0.4-11.el6 (x86_64)

Selinux
 [root@12Cmachine]# cat /etc/selinux/config
SELINUX= enforcing  ( default)
[root@12Cmachine]# setenforce Permissive
setenforce: SELinux is disabled
 [root@12Cmachine]# cat /etc/selinux/config
# This file controls the state of SELinux on the system.
# SELINUX= can take one of these three values:
#     enforcing - SELinux security policy is enforced.
#     permissive - SELinux prints warnings instead of enforcing.
#     disabled - No SELinux policy is loaded.
SELINUX=permissive
# SELINUXTYPE= can take one of these two values:
#     targeted - Targeted processes are protected,
#     mls - Multi Level Security protection.
SELINUXTYPE=targeted

Create user and group:-
[root@12Cmachine]# groupadd –g 501 orainstall
[root@12Cmachine]# groupadd –g 601 dba
[root@12Cmachine]# useradd –g orainstall –G dba oracle
[root@12Cmachine]# egroup ‘orainstall|dba’   /etc/group
orainstall:x:501:
dba:x:601:oracle
[root@12Cmachine]# id oracle
uid=500(oracle) gid=501(orainstall) groups=501(orainstall),502(dba)
Change file system ownership:-
Note: - here we have given File System (/u002) ownership to ORACLE user.
[root@12Cmachine]# chown –R oracle:oinstall oracle
Create directory structure and login profile:-
[root@12Cmachine]# su - oracle
Password: ----password------
Directory:-
[oracle@12Cmachine]# mkdir –p /u002/app/oracle
[oracle@12Cmachine]# mkdir –p /u002/app/oraInventory

Profile:-
[oracle@12Cmachine]# vi .bash_profile
# Oracle env Settings
TMP=/tmp; export TMP
TMPDIR=$TMP; export TMPDIR
ORACLE_HOSTNAME=12Cmachine.localdomain; export ORACLE_HOSTNAME
ORACLE_UNQNAME=db12c; export ORACLE_UNQNAME
ORACLE_BASE=/u002/app/oracle; export ORACLE_BASE
ORACLE_HOME=/u002/app/oracle/product/12.1.0/dbhome_1; export ORACLE_HOME
ORACLE_SID=db12c; export ORACLE_SID
PATH=/usr/sbin:$PATH; export PATH
PATH=$ORACLE_HOME/bin:$PATH; export PATH
LD_LIBRARY_PATH=$ORACLE_HOME/lib:/lib:/usr/lib; export LD_LIBRARY_PATH
CLASSPATH=$ORACLE_HOME/jlib:$ORACLE_HOME/rdbms/jlib; export CLASSPATH
[oracle@12Cmachine]#. .bash_profile
[oracle@12Cmachine]# echo $ORACLE_SID
db12c

Unzipping oracle software patches:-
[oracle@12Cmachine]# cd /media
-rwxrwxrwx. 1 oracle orainstall 1673544724 Nov 5 22:39 linuxamd64_12102_database_1of2.zip
-rwxrwxrwx. 1 oracle orainstall 1014530602 Nov 5 23:02 linuxamd64_12102_database_2of2.zip
[oracle@12Cmachine]# unzip linuxamd64_12102_database_1of2.zip –d /u002
[oracle@12Cmachine]# unzip linuxamd64_12102_database_2of2.zip -d /u002



Steps 3 Install oracle 12.1.0.2:-
[oracle@12Cmachine]# /u002/database
[oracle@12Cmachine]# ./runIntaller


























=========================      Thank You    =================================



Wednesday, 6 January 2016

Steps to change hostname




                            Step- by-step to change host name
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@

Command line method
=====================
1.#hostname
localhost.localdomain

2. login to root user

#su - root

3.#hostname  rac_node_1

4. Modify the host file /etc/hosts file

#vi /etc/hosts
127.0.0.1 rac_node_1 localhost.localdomain localhost4 localhost4.localdomain4

5. Modify the /etc/sysconfig/network file

# vi /etc/sysconfig/network
NETWORKING=yes
HOSTNAME=rac_node_1
GATEWAY=192.168.1.254

6. Restart network service.

# Service network restart

Own interface eth0:  Device state: 3 (disconnected)   [OK]
Shutting down interface eth1:  Device state: 3 (disconnected) [OK]
Shutting down loopback interface:                          [  OK  ]
Bringing up loopback interface:                            [  OK  ]
Bringing up interface eth0:                                [  OK  ]
Bringing up interface eth1:  Active connection state: activated
Active connection path: /org/freedesktop/NetworkManager/ActiveConnection/2 [  OK  ]
[root@rac_node_1 Packages]# service  network status
Configured devices:
lo eth0 eth1
Currently active devices:
lo eth0 eth1


6. [root@rac_node_1 tmp]# hostname
 rac_node_1









GUI   method
================

1. Login root user
 #su – root

2. Launch GUI interface

#system-config-network

i)



ii)

iii)


4. Restart service network

 #Service network restart

Own interface eth0:  Device state: 3 (disconnected)   [OK]
Shutting down interface eth1:  Device state: 3 (disconnected) [OK]
Shutting down loopback interface:                          [  OK  ]
Bringing up loopback interface:                            [  OK  ]
Bringing up interface eth0:                                [  OK  ]
Bringing up interface eth1:  Active connection state: activated
Active connection path: /org/freedesktop/NetworkManager/ActiveConnection/2 [  OK  ]
[root@rac_node_1 Packages]# service  network status
Configured devices:
lo eth0 eth1
Currently active devices:
lo eth0 eth1


5. [root@rac_node_1 tmp]# hostname
 rac_node_1