Using the blkid Command getting UUID information disks

When failure of "scsi_id" command during ASM installation with udev rules, you can use "blkid" command to get UUID information of disks.

~]# blkid
/dev/vda1: UUID="7fa9c421-0054-4555-b0ca-b470a97a3d84" TYPE="ext4"
/dev/vda2: UUID="7IvYzk-TnnK-oPjf-ipdD-cofz-DXaJ-gPdgBW" TYPE="LVM2_member"
/dev/mapper/vg_kvm-lv_root: UUID="a07b967c-71a0-4925-ab02-aebcad2ae824" TYPE="ext4"
/dev/mapper/vg_kvm-lv_swap: UUID="d7ef54ca-9c41-4de4-ac1b-4193b0c1ddb6" TYPE="swap"

For instance, to display information about /dev/vda1, type:
~]# blkid /dev/vda1
/dev/vda1: UUID="7fa9c421-0054-4555-b0ca-b470a97a3d84" TYPE="ext4"
You can also use the above command with the -p and -o udev command line options to obtain more detailed information. Note that root privileges are required to run this command:
blkid -po udev device_name
For example:
~]# blkid -po udev /dev/vda1
ID_FS_UUID=7fa9c421-0054-4555-b0ca-b470a97a3d84
ID_FS_UUID_ENC=7fa9c421-0054-4555-b0ca-b470a97a3d84
ID_FS_VERSION=1.0
ID_FS_TYPE=ext4
ID_FS_USAGE=filesystem

Can SCAN IP be used for ftp of files ?

SCAN IP's can be used for ftp ,sftp and also ssh connection during rac cluster service already running . Because when cluster services are running scan ip's nic bonding to public network interface for example ;


In RAC Node1
oracle@testdbrac1:/oracle:>ifconfig -a
eth0      Link encap:Ethernet  HWaddr 00:50:56:B8:40:B0 
          inet addr:PUBLIC IP  Bcast:xxx.x.x.xxx  Mask:255.255.255.0
          inet6 addr: fe80::250:56ff:feb8:40b0/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:1006522 errors:0 dropped:0 overruns:0 frame:0
          TX packets:92530 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:99913091 (95.2 MiB)  TX bytes:32001574 (30.5 MiB)

eth0:2    Link encap:Ethernet  HWaddr 00:50:56:B8:40:B0 
          inet addr:SCAN IP_1  Bcast:xxx.x.x.xxx  Mask:255.255.255.0
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1


In RAC Node 2
oracle@testdbrac2:/oracle:>ifconfig -a
eth0      Link encap:Ethernet  HWaddr 00:50:56:B8:40:B1 
          inet addr:PUBLIC IP  Bcast:xxx.x.x.xxx  Mask:255.255.255.0
          inet6 addr: fe80::250:56ff:feb8:40b1/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:1004162 errors:0 dropped:0 overruns:0 frame:0
          TX packets:69260 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:100817580 (96.1 MiB)  TX bytes:15328431 (14.6 MiB)


eth0:2    Link encap:Ethernet  HWaddr 00:50:56:B8:40:B1 
          inet addr:SCAN IP_2  Bcast:xxx.x.x.xxx  Mask:255.255.255.0
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1


eth0:3    Link encap:Ethernet  HWaddr 00:50:56:B8:40:B1 
          inet addr:SCAN IP_3  Bcast: xxx.x.x.xxx  Mask:255.255.255.0
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1

You can also check output command "ifconfig -a"  when rac services are not running. If you are planning for failover scenarios , it is reasonably.



Calculating optimal ulimit with RDA - Health Check

That's params from installation docs :

Open file descriptors
nofile
at least 1024
at least 65536
Number of processes available to a single user
nproc
at least 2047
at least 16384
Size of the stack segment of the process
stack
at least 10240 KB
at least 10240 KB, and at most 32768 KB


 We can confirm these parameters with RDA - Health Check utility. RDA - Health Check / Validation Engine Guide (Doc ID 250262.1)

ASM - Disk Operations

DROP DISKGROUP

SQL> column HEADER_STATUS format a20
SQL> set pages 100
SQL> col PATH format a25
SQL> SELECT name, header_status, path FROM V$ASM_DISK ;

NAME                           HEADER_STATUS        PATH
------------------------------ -------------------- -------------------------
                               CANDIDATE            /dev/asm-disk8
                               CANDIDATE            /dev/asm-disk6
                               CANDIDATE            /dev/asm-disk7
DATA_0000                      MEMBER               /dev/asm-disk1
DATA2_0000                     MEMBER               /dev/asm-disk4
DATA_0002                      MEMBER               /dev/asm-disk3
DATA2_0001                     MEMBER               /dev/asm-disk5
DATA_0001                      MEMBER               /dev/asm-disk2

DROP DISKGROUP DATA2 INCLUDING CONTENTS;
drop diskgroup DATA2 force including contents;

Rac-Node2

oracle@testdbrac2:/oracle:>grid_env
oracle@testdbrac2:/oracle:>sqlplus "/as sysasm"

SQL*Plus: Release 11.2.0.1.0 Production on Wed Aug 28 10:49:18 2013

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


Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - 64bit Production
With the Real Application Clusters and Automatic Storage Management options

SQL>  select GROUP_NUMBER, NAME, state from v$asm_diskgroup;

GROUP_NUMBER NAME                           STATE
------------ ------------------------------ -----------
           1 DATA                           MOUNTED
           2 DATA2                          MOUNTED

SQL> alter diskgroup DATA2 dismount;

Diskgroup altered.

SQL> select GROUP_NUMBER, NAME, state from v$asm_diskgroup;

GROUP_NUMBER NAME                           STATE
------------ ------------------------------ -----------
           1 DATA                           MOUNTED
           0 DATA2                          DISMOUNTED

Oracle 11g Grid Uninstall

You can uninstall oracle grid infrastructure via two way ;

Run the following commands with root user

Rac Node1
cd /oracle/app/11.2.0/grid/crs/install
 perl rootcrs.pl -deconfig -force

Rac Node2
cd /oracle/app/11.2.0/grid/crs/install
perl rootcrs.pl -deconfig -force -lastnode


Or (again need root user ) ;

Compressing Export Dump File On The Fly

If you don't have enough storage to keep export dump file on server , you can compress your dump file when export is running.

mkfifo pipe.dmp
gzip  < pipe.dmp > expdat.dmp.z &
exp user/passwd full=y file=pipe.dmp

Redolog File Block Corruption Database Recovery Without Any Backup


First Error with oracle database -

UDE-01034: operation generated ORACLE error 1034
ORA-01034: ORACLE not available
ORA-27101: shared memory realm does not exist
Solaris-AMD64 Error: 2: No such file or directory
UDE-00003: all allowable logon attempts failed

Related memory error in alert.log file
-------------------------------------

Starting ORACLE instance (normal)
WARNING: The system does not seem to be configured
optimally. Creating a segment of size 0x000000004c000000
failed. Please change the shm parameters so that
a segment can be created for this size. While this is
not a fatal issue, creating one segment may improve
performance


We check the memory because of kernel parameters not configured properly.

oracle@xxxx:/data/oracle:>prtconf | grep Mem
Memory size: 4096 Megabytes

oracle@xxxx:/data/oracle:>id -p
uid=610(oracle) gid=610(dba) projid=100(user.oracle)

Determine Endian Format When Migration Oracle Database Across OS Platform

When migrating Oracle Database to different platform , first of all you should check your endian format for both platforms (old and new ). You can determine via sqlplus with below command.


SQL> COLUMN PLATFORM_NAME FORMAT A32
SQL> SELECT * FROM V$TRANSPORTABLE_PLATFORM;

PLATFORM_ID PLATFORM_NAME                    ENDIAN_FORMAT
----------- -------------------------------- --------------
          1 Solaris[tm] OE (32-bit)          Big
          2 Solaris[tm] OE (64-bit)          Big
          7 Microsoft Windows IA (32-bit)    Little
         10 Linux IA (32-bit)                Little
          6 AIX-Based Systems (64-bit)       Big
          3 HP-UX (64-bit)                   Big
          5 HP Tru64 UNIX                    Little
          4 HP-UX IA (64-bit)                Big
         11 Linux IA (64-bit)                Little
         15 HP Open VMS                      Little
          8 Microsoft Windows IA (64-bit)    Little
          9 IBM zSeries Based Linux          Big
         13 Linux 64-bit for AMD             Little
         16 Apple Mac OS                     Big
         12 Microsoft Windows 64-bit for AMD Little
         17 Solaris Operating System (x86)   Little

If you are not sure ;
You can use this command on unix shell

echo I | tr -d [:space:] | od -to2 | head -n1 | awk '{print $2}' | cut -c6

IF return 0  ->  Big Endian
IF return 1  ->  Little Endian

After determination endian format , you can choose your methodology for migration operation.Check Oracle Support Note:Migration Of An Oracle Database Across OS Platforms (Generic Platform) (Doc ID 733205.1)

Oracle 10gR1 on Linux installation error

Due to  certified Oracle RDBMS 10gR1  on Linux 4 , installation process failed when trying to starting runInstaller.












Online Datafile Move : 12c Database New Feature



-rw-r-----. 1 oracle oinstall  52429312 Jul 16 09:49 redo03.log
-rw-r-----. 1 oracle oinstall  52429312 Jul 16 10:19 redo01.log
-rw-r-----. 1 oracle oinstall   5251072 Jul 16 10:24 users01.dbf
-rw-r-----. 1 oracle oinstall  92282880 Jul 16 10:45 temp01.dbf
-rw-r-----. 1 oracle oinstall 277880832 Jul 16 10:50 undotbs01.dbf
-rw-r-----. 1 oracle oinstall 828383232 Jul 16 10:51 system01.dbf
-rw-r-----. 1 oracle oinstall 859840512 Jul 16 10:51 sysaux01.dbf
-rw-r-----. 1 oracle oinstall  52429312 Jul 16 10:51 redo02.log
-rw-r-----. 1 oracle oinstall  17973248 Jul 16 10:52 control01.ctl
-rw-r-----. 1 oracle oinstall 828383232 Jul 16 10:52 system02.dbf



[oracle@cdb12c ~]$ sqlplus "/as sysdba"

SQL*Plus: Release 12.1.0.1.0 Production on Tue Jul 16 10:51:53 2013

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


Connected to:
Oracle Database 12c Enterprise Edition Release 12.1.0.1.0 - 64bit Production
With the Partitioning, OLAP, Advanced Analytics and Real Application Testing options

SQL> alter database move datafile '/u01/app/oracle/oradata/test12c/system01.dbf' to '/u01/app/oracle/oradata/test12c/system02.dbf';

Database altered.


Linux display Error while running firefox

While opening firefox " Xlib: extension "RANDR" missing on display message appeared  and failed to open display on my machine. I installed the gtk2-engines and passed this interesting error.

[root@mytest ~]# firefox
Xlib:  extension "RANDR" missing on display "xx.xx.xx.xx:0.0".
Error: cannot open display: xx.xx.xx.xx:0.0


Xlib:  extension "RANDR" missing on display ":0"


Oracle Database 12c Installation Step by Step on Oracle Linux 6.4

Newly announced Oracle Database 12c (12.1.0.1) comes with new features ; especially pluggable database , changings behaviour of CBO etc ... 

I downloaded latest Oracle Linux from http://edelivery.oracle.com and installed into Oracle Virtualbox .

Unzip files 
unzip linuxamd64_12c_database_1of2.zip
unzip linuxamd64_12c_database_2of2.zip 
  
Configure your /etc/hosts file

127.0.0.1   localhost localhost.localdomain 
xx.xxx.xx.xx cdb12c cdb12c.mytest

You can configure parameters for now or later. I skipped this step because of when installer checking prerequsite step it generates a bash script for correcting these parameters. 


Add or amend the following lines in the "/etc/sysctl.conf" file.


After installation VirtualBox 4.2.14 for Windows hosts from https://www.virtualbox.org/wiki/Downloads an error message appeared like below

Failed to create the VirtualBox COM object.
The application will now terminate.

Callee RC: CO_E_SERVER_EXEC_FAILURE (0x80080005)



A bit digging in Virtualbox logs (Document and Settings\.Virtualbox ,


VirtualBox COM Server 4.2.14 r86644 win.x86 (Jun 21 2013 16:12:11) release log
00:00:00.000000 main     Log opened 2013-06-26T09:55:00.622000300Z
00:00:00.000000 main     OS Product: Windows 7
00:00:00.000000 main     OS Release: 6.1.7601
00:00:00.000000 main     OS Service Pack: 1
00:00:00.015000 main     DMI Product Name: HP Compaq Pro 6300 SFF
00:00:00.031000 main     DMI Product Version: 
00:00:00.031000 main     Host RAM: 3476MB total, 1787MB available
00:00:00.031000 main     Executable: C:\Program Files\Oracle\VirtualBox\VBoxSVC.exe
00:00:00.031000 main     Process ID: 5960
00:00:00.031000 main     Package type: WINDOWS_32BITS_GENERIC
00:00:00.764000          VDInit finished

00:00:05.881000 Watcher  ERROR [COM]: aRC=E_ACCESSDENIED (0x80070005) aIID={3b2f08eb-b810-4715-bee0-bb06b9880ad2} aComponent={VirtualBox} aText={The object is not ready}, preserve=false

Just run program as administrator and problem solved.

Linux Cheat Sheet


CommandDescription
apropos whatisShow commands pertinent to string. See also threadsafe
man -t ascii | ps2pdf - > ascii.pdfmake a pdf of a manual page
which commandShow full path name of command
time commandSee how long a command takes
time catStart stopwatch. Ctrl-d to stop. See also sw
dir navigation
cd -Go to previous directory
cdGo to $HOME directory
(cd dir && command)Go to dir, execute command and return to current dir
pushd .Put current dir on stack so you can popd back to it

Linux/Unix Compare File or Folder Permissions

Last night , in exadata machine , file permissions accidentally changed recursively with "chmod -R 777  /u01"  command.Therefore oracle binaries ,especially "s" bit permission, didn't work.First of all , scan listener crashed with "TNS no listener" error  in cluster, after that cluster rebooted and instances didn't start.So we decided to compare oracle binaries with other exadata machine for fastest solution.

Original permissions oracle binary
--------------------------------
-rwsr-s--x 1 oracle dba 232399123 Jun 21 09:30 oracle


nmon performance: A free tool to analyze AIX and Linux performance


This free tool gives you a huge amount of information all on one screen. Even though IBM doesn't officially support the tool and you must use it at your
own risk, you can get a wealth of performance statistics. Why use five or six tools when one free tool can give you everything you need?

The nmon tool is designed for AIX and Linux performance specialists to use for monitoring and analyzing performance data, including:
  • CPU utilization
  • Memory use
  • Kernel statistics and run queue information
  • Disks I/O rates, transfers, and read/write ratios
  • Free space on file systems
  • Disk adapters
  • Network I/O rates, transfers, and read/write ratios
  • Paging space and paging rates
  • CPU and AIX specification
  • Top processors
  • IBM HTTP Web cache
  • User-defined disk groups
  • Machine details and resources
  • Asynchronous I/O -- AIX only
  • Workload Manager (WLM) -- AIX only
  • IBM TotalStorage® Enterprise Storage Server® (ESS) disks -- AIX only
  • Network File System (NFS)
  • Dynamic LPAR (DLPAR) changes -- only pSeries p5 and OpenPower for either AIX or Linux

A Tip for mostly used sql codes in Toad

In Toad do these steps ;

 View -> Toad Options -> Editor -> Behavior  choose Code Templates and add new code templates.



For Lazy DBA's

       Most of DBAs monitor alert.log for production databases.It sucks many times :) . Not only monitoring alert log in shell screen is so boring but also searching ORA- errors in lines. An idea came up my mind , during tailing log file , when founding ORA- error it displays popup dialog message into your screen.It is useful this command when surfing in web :)) .









Enterprise Manager Agent Configuration Issue

After upgrade 11.1.0.7 oracle rdbms to 11.2.0.3 , enterprise manager 11g has begun to work improperly.When running "emctl status console" command in unix shell , the message was that "running" , but when clicking the enterprise manager url the error message was database is down.After upgrading database ; ORACLE_HOME path , listener configuration ... etc. was changed and EM control needs to fix.

Trying different commands in order to configure EM was come to nothing.First I did ,