About Us

RSInfoMinds, a web based IT Training and Consultancy firm. It is established with high dreams in training people in IT Infrastructure Field. We provide Online and Class Room training in various fields of IT Infrastructure Management.

Join Us: http://www.facebook.com/RSInfoMinds
Mail Us: rsinfominds@gmail.com
Twitter: @RSInfoMinds

We are specialized in the below courses:

Redhat Linux Admin Redhat Linux Cluster
Redhat Virutualization IBM AIX Admin
IBM AIX Virtualization IBM AIX Cluster
HP Unix Admin HP Unix Cluster
HP Unix Virtualization Shell Scripting
Veritas Volume Manager Veritas Cluster
Oracle Core DBA VMWare


We provide training in such a way, So that you get in depth knowledge on the Courses you look for.

And we ensure you are very confident from each and every Techincal aspect that the IT Industry needs and expects from you.

We also conduct Workshops on the latest technology and the real time faculties sharing their work experiences to make you the best.

Saturday, 21 June 2014

Delete a Oracle DB using DBCA In Silent Mode

Make Sure You Stop The DB "ORCL" Using > shutdown command.


How To Manually Reboot The HMC

Below are the pictures that would show how to reboot the HMC Manually.




How To Find The Users With Empty Password

/etc/shadow is the file which we look for password information.

/etc/shadow content:
===============

scott:!!:16236:0:99999:7:::
peter:!!:16236:0:99999:7:::
kevin:!!:16236:0:99999:7:::

This is actual content for a default user/new user.

[root@node1 /]# passwd -d scott
Removing password for user scott.
passwd: Success
[root@node1 /]# passwd -d peter
Removing password for user peter.
passwd: Success
[root@node1 /]# passwd -d kevin
Removing password for user kevin.
passwd: Success

scott::16236:0:99999:7:::
peter::16236:0:99999:7:::
kevin::16236:0:99999:7:::

The above is the content after remving the password for the user using the command # passwd -d

[root@node1 /]# cat /etc/shadow | awk -F: '($2==""){print $1}'
scott
peter
kevin
[root@node1 /]#


Now the above script will give the list of users with EMPTY PASSWORD.


pam_tally2 - The login counter (tallying) module

I have set up PAM Authentication to lock a user accoount after 3 attempts of incorrect password.

PAM Module: pam_tally2.so

password-auth-ac:
=============

auth        required      pam_tally2.so deny=3 file=/var/log/tallylog

account     required      pam_tally2.so

[root@node1 /]# pam_tally2 --user test
Login           Failures Latest failure     From
test                0
[root@node1 /]# 

login as: test
test@192.168.183.148's password:
Access denied
test@192.168.183.148's password:
Access denied
test@192.168.183.148's password:
Access denied
test@192.168.183.148's password:
Access denied
test@192.168.183.148's password:
Account locked due to 4 failed logins
Account locked due to 5 failed logins
Account locked due to 6 failed logins
Account locked due to 7 failed logins
Last login: Sun Jun 15 00:14:30 2014 from 192.168.183.1
[test@node1 ~]$


[root@node1 /]# pam_tally2 --user=test
Login           Failures Latest failure     From
test                6    06/15/14 00:23:20  192.168.183.1
[root@node1 /]# pam_tally2 --user=test --reset
Login           Failures Latest failure     From
test                6    06/15/14 00:23:20  192.168.183.1
[root@node1 /]# pam_tally2 --user=test
Login           Failures Latest failure     From
test                0
[root@node1 /]#

login as: test
test@192.168.183.148's password:
Last login: Sun Jun 15 00:20:07 2014 from 192.168.183.1
[test@node1 ~]$ whoami
test
[test@node1 ~]$


Friday, 20 June 2014

Locate Memory Slots In AIX

Using the below commands we can find out the memory slots in AIX.

                     #lscfg -vp |grep -p DIMM

Output:

#lscfg -vp |grep -p DIMM

Memory DIMM:
  Record Name.................VINI
  Flag Field..................XXMS
  Hardware Location Code......U787B.001.DNWG069-P1-C9-C1
  Customer Card ID Number.....312D
  Serial Number...............YH10MM53M07F
  Part Number.................15R7170
  FRU Number.................. 15R7170
  Size........................2048
  Version.....................RS6K
Physical Location: U787B.001.DNWG069-P1-C9-C1

Memory DIMM:
  Record Name.................VINI
  Flag Field..................XXMS
  Hardware Location Code......U787B.001.DNWG069-P1-C9-C3
  Customer Card ID Number.....312D
  Serial Number...............YH10MM5CH07D
  Part Number.................15R7170
  FRU Number.................. 15R7170
  Size........................2048
  Version.....................RS6K
Physical Location: U787B.001.DNWG069-P1-C9-C3

Unix Password-less Login

On source server side:

First generate public key using rsa

#ssh-keygen -t rsa    

( here it will ask some questions, please give all default options, especially we have to press enter (leave as empty) in the passphrase option)

Copying the .pub files content from source server to target server.
 scp ~/.ssh/id_rsa.pub username@destination:~/.ssh/authorized_keys

                                                         (OR)

Better we can follow the below steps
 cp ~/.ssh/id_rsa.pub ~/.ssh/authorize_keys

 next copy this authorize_keys file to client /root/.ssh/
  scp ~/.ssh/authorize_keys username@destination:~/.ssh/.

Now client will be able to login without password.

Thursday, 19 June 2014

Linux Buffer Cache Clean Up

Every 1.0s: free -m                                                                                                                                                                   total       used       free     shared    buffers     cached
Mem:          1998        631       1367          0          2        423
-/+ buffers/cache:        205       1792
Swap:         3999          0       3999

echo 3 > /proc/sys/vm/drop_caches --> Command to clear buffer cache.

Every 1.0s: free -m      

         total       used       free     shared    buffers     cached
Mem:          1998        629       1369          0          0        422
-/+ buffers/cache:        206       1792
Swap:         3999          0       3999

Mem:   2046792k total,   652248k used,  1394544k free,     1536k buffers
Swap:  4095992k total,        0k used,  4095992k free,   438744k cached

echo 3 > /proc/sys/vm/drop_caches

Mem:   2046792k total,   648288k used,  1398504k free,      348k buffers
Swap:  4095992k total,        0k used,  4095992k free,   432796k cached

ORA-01078: failure in processing system parameters

This happens very rarely, when you are not able startup the DB.

SQL> startup;
ORA-01078: failure in processing system parameters
LRM-00109: could not open parameter file '/u01/app/oracle/product/11.2.0/db_1/dbs/initTest.ora'
SQL>

The issue is the Oracle could not fine the Pfile or SPfile to startup the DB.

So, if both the files are deleted then restore the file backup and start the DBA.

I just restored,

SQL> startup;
ORACLE instance started.

Total System Global Area  730714112 bytes
Fixed Size                  2216944 bytes
Variable Size             478153744 bytes
Database Buffers          247463936 bytes
Redo Buffers                2879488 bytes
Database mounted.
Database opened.
SQL> select name from v$database;

NAME
---------
TEST

SQL>


SQL> show parameter spfile;

NAME                                 TYPE        VALUE
------------------------------------ ----------- ------------------------------
spfile                               string      /u01/app/oracle/product/11.2.0
                                                 /db_1/dbs/spfileTest.ora
SQL>


And it just got up from SPfile.


What happens when your SPFILE is missing while starting the DB ?

I have a database called "Test".

The Test DB has its Pfile and SPfile.

Pfile is configured with the Memory of 600MB.
SPfile is configured with the Memory of 700MB.

I have renamed my SPfile.

[oracle@node1 dbs]$ mv spfileTest.ora spfileTest.ora_ORIG
[oracle@node1 dbs]$ ls -l spfileTest.ora*
-rw-r----- 1 oracle oinstall 2560 Jun 14 20:46 spfileTest.ora_ORIG
[oracle@node1 dbs]$


Shutting down and starting the DB:

SQL> shutdown immediate;
Database closed.
Database dismounted.
ORACLE instance shut down.
SQL> startup
ORACLE instance started.

Total System Global Area  626327552 bytes
Fixed Size                  2215944 bytes
Variable Size             373297144 bytes
Database Buffers          247463936 bytes
Redo Buffers                3350528 bytes
Database mounted.
Database opened.
SQL> show parameter spfile;

NAME                                 TYPE        VALUE
------------------------------------ ----------- ------------------------------
spfile                               string
SQL>

SQL> select name from v$database;

NAME
---------
TEST

SQL> sho parameter sga_max_size;

NAME                                 TYPE        VALUE
------------------------------------ ----------- ------------------------------
sga_max_size                         big integer 600M
SQL>

Oracle DBA Startup Time

SQL> select INSTANCE_NAME,DATABASE_STATUS,STARTUP_TIME,STATUS from v$instance;

INSTANCE_NAME  DATABASE_STATU STARTUP_TIME   STATUS
-------------- -------------- -------------- --------------
Test           ACTIVE         14-JUN-14      OPEN

SQL>


ORA-32001: write to SPFILE requested but no SPFILE is in use

The possible issue could be the DB Started from the PFile or the SPFILE is missing.

SQL> show parameter spfile;

NAME                                 TYPE        VALUE
------------------------------------ ----------- ------------------------------
spfile                               string      /u01/app/oracle/product/11.2.0
                                                 /db_1/dbs/spfileTest.ora
SQL>

Command to verify whether the DB started from Pfile or SPFile.


ORA-00845: MEMORY_TARGET not supported on this system

When you get the message ORA-00845: MEMORY_TARGET not supported on this system while starting the DB.

It means you are running short of memory for that instance.

1) Increase RAM on your machine.

2) Else rework on the memory assigned for your database.

3) Else stop other database and start the needed one.

Here I get a error while starting a DB called "ORCL"

SQL> startup;
ORA-00845: MEMORY_TARGET not supported on this system
SQL>

Since I already have a DB called "TEST". I am stopping it and starting the "ORCL".

SQL> select name from v$database;

NAME
---------
TEST

SQL> shutdown immediate;
Database closed.
Database dismounted.
ORACLE instance shut down.
SQL>


SQL> startup;
ORACLE instance started.

Total System Global Area  835104768 bytes
Fixed Size                  2217952 bytes
Variable Size             536872992 bytes
Database Buffers          293601280 bytes
Redo Buffers                2412544 bytes
Database mounted.
Database opened.
SQL> select name from v$database;

NAME
---------
ORCL

SQL>



Saturday, 14 June 2014

Oracle Listener TNS-12541: TNS:no listener

[oracle@node1 ~]$ lsnrctl status

LSNRCTL for Linux: Version 11.2.0.1.0 - Production on 14-JUN-2014 08:29:55

Copyright (c) 1991, 2009, Oracle.  All rights reserved.

Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=IPC)(KEY=EXTPROC1521)))
TNS-12541: TNS:no listener
 TNS-12560: TNS:protocol adapter error
  TNS-00511: No listener
   Linux Error: 111: Connection refused
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=node1.oracle.com)(PORT=1521)))
TNS-12541: TNS:no listener
 TNS-12560: TNS:protocol adapter error
  TNS-00511: No listener
   Linux Error: 111: Connection refused
[oracle@node1 ~]$

Solution :

Start the listener.

[oracle@node1 ~]$ lsnrctl start

LSNRCTL for Linux: Version 11.2.0.1.0 - Production on 14-JUN-2014 08:30:12

Copyright (c) 1991, 2009, Oracle.  All rights reserved.

Starting /u01/app/oracle/product/11.2.0/db_1/bin/tnslsnr: please wait...

TNSLSNR for Linux: Version 11.2.0.1.0 - Production
System parameter file is /u01/app/oracle/product/11.2.0/db_1/network/admin/listener.ora
Log messages written to /u01/app/oracle/diag/tnslsnr/node1/listener/alert/log.xml
Listening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC1521)))
Listening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=node1.oracle.com)(PORT=1521)))

Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=IPC)(KEY=EXTPROC1521)))
STATUS of the LISTENER
------------------------
Alias                     LISTENER
Version                   TNSLSNR for Linux: Version 11.2.0.1.0 - Production
Start Date                14-JUN-2014 08:30:14
Uptime                    0 days 0 hr. 0 min. 0 sec
Trace Level               off
Security                  ON: Local OS Authentication
SNMP                      OFF
Listener Parameter File   /u01/app/oracle/product/11.2.0/db_1/network/admin/listener.ora
Listener Log File         /u01/app/oracle/diag/tnslsnr/node1/listener/alert/log.xml
Listening Endpoints Summary...
  (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC1521)))
  (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=node1.oracle.com)(PORT=1521)))
The listener supports no services
The command completed successfully
[oracle@node1 ~]$ 

Friday, 13 June 2014

Linux CPU Usage

ps -eo pcpu,pid,user,args | sort -k 1 -r | head -10

ps -eo pcpu,pid,user,args | sort -r -k1 | less

Linux Memory Usage

ps -eo rss,vsz,pid,cputime,cmd --width 100 --sort rss,vsz | tail --lines 10

ps aux --sort -rss | head

ps axo %mem,pid,euser,cmd | sort -nr | head -n 10

ps aux | sort -nk +4 | tail

ps -e -orss=,args= | sort -b -k1,1n | pr -TW$COLUMNS

HPUX Kernel Configuration

1) Go to /stand/build

2) system_prep -v -s system

The system_prep script creates the system file /stand/build/system in your current directory.

3) Edit the /stand/build/system file to perform your task.

4) mk_kernel -s system : Build the kernel.

The mk_kernel command creates /stand/build/vmunix_test, a kernel ready for testing.

If you get this message when executing mk_kernel,
ERROR: Kernel is too large to boot.
Actual: 15605892 bytes
Limit: 13580288 bytes

eliminate optional subsystems or drivers and decrease the tunable parameters.

Move the old system file and kernel so if anything goes wrong, you still have a bootable kernel.

mv /stand/system /stand/system.prev
mv /stand/vmunix /stand/vmunix.prev

5) Move the new system file and new kernel into place, ready to be used when you reboot the system.

mv /stand/build/system /stand/system
mv /stand/build/vmunix_test /stand/vmunix

6) Reboot the server.

Wednesday, 11 June 2014

Create a UDEV In Linux

1. Add the "options=-g" line to the /etc/scsi_id.config file as the root user.

2. Obtain the SCSI ID for your disks as the root user:

/sbin/scsi_id -g -s /block/{sd_device}

3. Create a udev rules file in /etc/udev/rules.d directory as the root user with entries similar to the below:

vi /etc/udev/rules.d/99-udev-oracle.rules
# ####################################################
# FILE: 99-udev-oracle.rules
# DESC: UDEV rules file for Oracle ASM functionality.
#       Should be placed under /etc/udev/rules.d
# ####################################################
# DATA disks
KERNEL=="sd*",BUS=="scsi",ENV{ID_SERIAL}=="{scsi_id}", NAME="asm1", OWNER="oracle", GROUP="oinstall", MODE="660"
# FRA disks
KERNEL=="sd*",BUS=="scsi",ENV{ID_SERIAL}=="{scsi_id}", NAME="asm2", OWNER="oracle", GROUP="oinstall", MODE="660"

4. Stop and start udev as the root user:

/etc/init.d/boot.udev stop
/etc/init.d/boot.udev start

Tuesday, 10 June 2014

How To Connect To Oracle11g Running on Linux VM using Toad : Part II

TNSNames ?????

This tnsnames.ora file is a configuration file that contains net service names mapped to connect descriptors for the local naming method, or net service names mapped to listener protocol addresses.

ORCL =
  (DESCRIPTION =
    (ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.183.148)(PORT = 1521))
    (CONNECT_DATA =
      (SERVER = DEDICATED)
      (SERVICE_NAME = orcl.cluster.com)
    )

  )

Host could be your server running 11g name or the IP. 

Make sure the port is opened on the server.

Now Open Toad and connect  with the user ID:


How To Connect To Oracle11g Running on Linux VM using Toad : Part I

1) First we need to install oracle11g Client.

During the installation make sure you select "Run Installer".



















Proceed with the installation.

2) Download Toad for Windows and do the installation.

Now login to the oracle11g server and copy the contents of “tnsnames.ora” to the below location on the windows where the oracle11g Client is installed.

/u01/app/oracle/product/11.2.0/db_1/network/admin/tnsnames.ora






Create A Boot Partition In Linux

We need to use fdisk utility to create a boot partition.
























Using the flag "a" we can toogle between "Boot Flag" Enable and Disable.

Oracle Listener Stop/Start/Status

[oracle@node1 ~]$ lsnrctl start

LSNRCTL for Linux: Version 11.2.0.1.0 - Production on 10-JUN-2014 10:12:57

Copyright (c) 1991, 2009, Oracle.  All rights reserved.

Starting /u01/app/oracle/product/11.2.0/db_1/bin/tnslsnr: please wait...

TNSLSNR for Linux: Version 11.2.0.1.0 - Production
System parameter file is /u01/app/oracle/product/11.2.0/db_1/network/admin/listener.ora
Log messages written to /u01/app/oracle/diag/tnslsnr/node1/listener/alert/log.xml
Listening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC1521)))
Listening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=node1.oracle.com)(PORT=1521)))

Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=IPC)(KEY=EXTPROC1521)))
STATUS of the LISTENER
------------------------
Alias                     LISTENER
Version                   TNSLSNR for Linux: Version 11.2.0.1.0 - Production
Start Date                10-JUN-2014 10:12:57
Uptime                    0 days 0 hr. 0 min. 0 sec
Trace Level               off
Security                  ON: Local OS Authentication
SNMP                      OFF
Listener Parameter File   /u01/app/oracle/product/11.2.0/db_1/network/admin/listener.ora
Listener Log File         /u01/app/oracle/diag/tnslsnr/node1/listener/alert/log.xml
Listening Endpoints Summary...
  (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC1521)))
  (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=node1.oracle.com)(PORT=1521)))
The listener supports no services
The command completed successfully
[oracle@node1 ~]$

Command to start the Listener.

[oracle@node1 ~]$ lsnrctl stop

LSNRCTL for Linux: Version 11.2.0.1.0 - Production on 10-JUN-2014 10:12:27

Copyright (c) 1991, 2009, Oracle.  All rights reserved.

Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=IPC)(KEY=EXTPROC1521)))
The command completed successfully
[oracle@node1 ~]$


Connect To Oracle11g

[oracle@node1 ~]$ sqlplus

SQL*Plus: Release 11.2.0.1.0 Production on Tue Jun 10 10:11:06 2014

Copyright (c) 1982, 2009, Oracle.  All rights reserved.

Enter user-name: sys as sysdba
Enter password:

Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options

SQL>

sqlplus is the wizard to connect to ORACLE DBA.

Every DBA will have a base table.

SQL> select name from v$database;

NAME
---------
ORCL

SQL>


ORCL is the name of the Base Table.