Oracle Technologies Blog

By ASKM

Archive for the ‘Linux’ Category

Prepare Query Predicate From Failed Commands In Import Logfile

Posted by Srikrishna Murthy Annam on May 12, 2011

This small script will be useful to prepare the list of objects that failed to create in a import process.

Usage :   prepare_list.sh   <import logfile>

Script:

echo "Entered File is $1"
echo ""
grep -i 'CREATE INDEX' $1 | awk -F " " '{print $3}' | awk -F "." '{print $2}' | sed 's/.\(.*\)/\1/' | sed 's/\(.*\)./\1/' | sed "s/^/\'/; s/$/\'/;" > askm
echo "Failed Objects Are:"
echo "==========================="
cat askm
#j="("
for i in `cat askm`
do
j=${j},$i
done
j=`echo $j | sed 's/.\(.*\)/\1/'`
j="("${j}")"
echo ""
echo "==================================================="
echo "Use The Following Predicate In Your Where Condition"
echo "==================================================="
echo $j
unset j

NOTE:  In the above script,i extracted failed index list, but you can change it to get your own object list.

Sample Output:

[oracle@b600e6tr askm]$ ./prepare_list.sh testdb_implog.log
Entered File is testdb_implog.log

Failed Objects Are:
===========================
'PV_ENTY_ATTR_TEXTS_U2'
'JTF_NOTES_TL_C1'
'HZ_CLASS_CODE_DENORM_T1'
'AMV_C_CHANNELS_DESC_CTX'
'AMV_C_CHANNELS_NAME_CTX'
'ENI_DEN_HRCHY_PAR_IM1'
'IBC_ATTRIBUTE_BUNDLES_CTX'
'JTF_TASKS_TL_IM'
'JTF_AMV_ITEMS_TEXT_CTX'
'JTF_AMV_ITEMS_URL_CTX'
'JTF_AMV_ITEMS_NAME_CTX'
'JTF_AMV_ITEMS_DESC_CTX'
'OKC_TERMS_TEMPLATES_CTX'
'OKC_ARTICLES_CTX'
'ICX_QUES_CTX'
'IRC_POSTING_CON_TL_CTX'
'PER_EMPDIR_PEOPLE_N1'
'IRC_DOCUMENTS_CTX'
'MVCN_PO_VND_NAME_CTX'
'MVCN_PO_VND_NAME_ALT_CTX'
'MVCN_PO_VND_VAT_CTX'
'MVCN_PO_VND_TIN_CTX'
'MVCN_PO_VST_CODE_CTX'
'MVCN_PO_VST_VAT_CTX'
'IDX_UP_SEARCH_DESCR'
'IDX_UP_SEARCH_COMM'
'IDX_UP_SEARCH_SUPP'

===================================================
Use The Following Predicate In Your Where Condition
===================================================
('PV_ENTY_ATTR_TEXTS_U2','JTF_NOTES_TL_C1','HZ_CLASS_CODE_DENORM_T1','AMV_C_CHANNELS_DESC_CTX','AMV_C_CHANNELS_NAME_CTX',
'ENI_DEN_HRCHY_PAR_IM1','IBC_ATTRIBUTE_BUNDLES_CTX','JTF_TASKS_TL_IM','JTF_AMV_ITEMS_TEXT_CTX','JTF_AMV_ITEMS_URL_CTX',
'JTF_AMV_ITEMS_NAME_CTX','JTF_AMV_ITEMS_DESC_CTX','OKC_TERMS_TEMPLATES_CTX','OKC_ARTICLES_CTX','ICX_QUES_CTX',
'IRC_POSTING_CON_TL_CTX','PER_EMPDIR_PEOPLE_N1','IRC_DOCUMENTS_CTX','MVCN_PO_VND_NAME_CTX','MVCN_PO_VND_NAME_ALT_CTX',
'MVCN_PO_VND_VAT_CTX','MVCN_PO_VND_TIN_CTX','MVCN_PO_VST_CODE_CTX','MVCN_PO_VST_VAT_CTX','IDX_UP_SEARCH_DESCR',
'IDX_UP_SEARCH_COMM','IDX_UP_SEARCH_SUPP')
[oracle@b600e6tr askm]$

Hope It Helps
SRI

Advertisements

Posted in Linux | Leave a Comment »

Prepare Linux virtual machine for 11gR2 installation on Linux 5.x

Posted by Srikrishna Murthy Annam on September 21, 2010

There are some OS preparation steps to be performed before installing database on linux.

Pls refer the Master Note ID : 851598.1 and complete all the steps specified in the note as per your OS.

In the present article, i am using the OEL 5.4 (32-bit) as OS and following the note id : 880936.1 to complete all the preparatory steps for 11gR2 database creation.

Create the required user and groups for the installation

  1. groupadd -g 1000 oinstall
  2. groupadd -g 1200 dba
  3. useradd -u 1100 -g oinstall -G dba oracle
  4. mkdir -p /u01/app/oracle
  5. chown -R oracle:oinstall /u01/app
  6. chmod -R 775 /u01/app

Required RPMs installation :

Make sure that the following RPMs are installed,

  1. binutils-2.17.50.0.6-2.el5
  2. compat-libstdc++-33-3.2.3-61
  3. elfutils-libelf-0.125-3.el5
  4. glibc-2.5-24
  5. glibc-common-2.5-12
  6. ksh-20060214-1.7
  7. libaio-0.3.106
  8. libgcc-4.1.2-42.el5
  9. libstdc++-4.1.2-42
  10. make-3.81-1.1
  1. elfutils-libelf-devel-0.125-3.el5.i386.rpm
  2. a.requires elfutils-libelf-devel-static-0.125-3.el5.i386.rpm as a prerequisite.
  3. b.elfutils-libelf-devel and elfutils-libelf-devel-static each depend upon the other. Therefore, they must be installed together, in one (1″rpm -ivh” command as follows:
  4. rpm -ivh elfutils-libelf-devel-0.125-3.el5.i386.rpm elfutils-libelf-devel-static-0.125-3.el5.i386.rpm
  5. kernel-headers-2.6.18-92.el5.i386.rpm
  6. glibc-headers-2.5-24.i386.rpm
  7. glibc-devel-2.5-24.i386.rpm
  8. libstdc++-devel-4.1.2-42.el5.i386.rpm
  9. libgomp-4.1.2-42.el5.i386.rpm
  10. gcc-4.1.2-42.el5.i386.rpm
  11. gcc-c++-4.1.2-42.el5.i386.rpm
  12. libaio-devel-0.3.106-3.2.i386.rpm
  13. sysstat-7.0.2-1.el5.i386.rpm
  14. unixODBC-2.2.11-7.1.i386.rpm
  15. unixODBC-devel-2.2.11-7.1.i386.rpm

NOTE :
rpm -qa | grep -i <rpm name>  ==> to check if the rpm is installed or not
rpm -ivh <rpm name>    ==> to install rpm
rpm -e <rpm name>  ==> to remove package from the OS

In my OS following four RPMs are not installed.

libaio-devel-0.3.106-3.2.i386.rpm
sysstat-7.0.2-1.el5.i386.rpm
unixODBC-2.2.11-7.1.i386.rpm
unixODBC-devel-2.2.11-7.1.i386.rpm

Session Log :

[root@localhost ~]# rpm -qa | grep -i  binutils-
binutils-2.17.50.0.6-12.el5
[root@localhost ~]# rpm -qa | grep -i  compat-libstdc
compat-libstdc++-296-2.96-138
compat-libstdc++-33-3.2.3-61
[root@localhost ~]# rpm -qa | grep -i  elfutils-libelf
elfutils-libelf-0.137-3.el5
elfutils-libelf-devel-static-0.137-3.el5
elfutils-libelf-devel-0.137-3.el5
[root@localhost ~]# rpm -qa | grep -i  glibc-
glibc-headers-2.5-42
glibc-common-2.5-42
glibc-devel-2.5-42
glibc-2.5-42
[root@localhost ~]# rpm -qa | grep -i  glibc-common-
glibc-common-2.5-42
[root@localhost ~]# rpm -qa | grep -i  ksh-
ksh-20080202-14.el5
[root@localhost ~]# rpm -qa | grep -i  libaio-
libaio-0.3.106-3.2
[root@localhost ~]# rpm -qa | grep -i  libgcc-
libgcc-4.1.2-46.el5
compat-libgcc-296-2.96-138
[root@localhost ~]# rpm -qa | grep -i  libstdc++
compat-libstdc++-296-2.96-138
libstdc++-4.1.2-46.el5
libstdc++-devel-4.1.2-46.el5
compat-libstdc++-33-3.2.3-61
[root@localhost ~]# rpm -qa | grep -i  make-
imake-1.0.2-3
make-3.81-3.el5
automake-1.9.6-2.1
[root@localhost ~]# rpm -qa | grep -i  elfutils-libelf-devel
elfutils-libelf-devel-static-0.137-3.el5
elfutils-libelf-devel-0.137-3.el5
[root@localhost ~]# rpm -qa | grep -i  kernel-headers-
kernel-headers-2.6.18-164.el5
[root@localhost ~]# rpm -qa | grep -i  glibc-headers-
glibc-headers-2.5-42
[root@localhost ~]# rpm -qa | grep -i  glibc-devel-
glibc-devel-2.5-42
[root@localhost ~]# rpm -qa | grep -i  libstdc++-devel-
libstdc++-devel-4.1.2-46.el5
[root@localhost ~]# rpm -qa | grep -i  libgomp-
libgomp-4.4.0-6.el5
[root@localhost ~]# rpm -qa | grep -i  gcc-
libgcc-4.1.2-46.el5
gcc-c++-4.1.2-46.el5
compat-libgcc-296-2.96-138
gcc-4.1.2-46.el5
gcc-gfortran-4.1.2-46.el5
[root@localhost ~]# rpm -qa | grep -i  libaio-devel
[root@localhost ~]# rpm -qa | grep -i  sysstat-
[root@localhost ~]# rpm -qa | grep -i  unixODBC
[root@localhost ~]#

[root@localhost Server]# rpm -ivh unixODBC-2.2.11-7.1.i386.rpm
warning: unixODBC-2.2.11-7.1.i386.rpm: Header V3 DSA signature: NOKEY, key ID 1e5e0159
Preparing…                ########################################### [100%]
1:unixODBC               ########################################### [100%]
[root@localhost Server]#

[root@localhost Server]# rpm -ivh libaio-devel-0.3.106-3.2.i386.rpm
warning: libaio-devel-0.3.106-3.2.i386.rpm: Header V3 DSA signature: NOKEY, key ID 1e5e0159
Preparing…                ########################################### [100%]
1:libaio-devel           ########################################### [100%]
[root@localhost Server]# rpm -ivh unixODBC-devel-2.2.11-7.1.i386.rpm
warning: unixODBC-devel-2.2.11-7.1.i386.rpm: Header V3 DSA signature: NOKEY, key ID 1e5e0159
Preparing…                ########################################### [100%]
1:unixODBC-devel         ########################################### [100%]
[root@localhost Server]# rpm -ivh sysstat-7.0.2-3.el5.i386.rpm
warning: sysstat-7.0.2-3.el5.i386.rpm: Header V3 DSA signature: NOKEY, key ID 1e5e0159
Preparing…                ########################################### [100%]
1:sysstat                ########################################### [100%]
[root@localhost Server]#

Following files should be modified as per the following session log:
/etc/security/limits.conf
/etc/pam.d/login
/etc/profile
/etc/sysctl.conf  ==> Can be modified while installing using OUI.

Session Log

[root@localhost ~]# diff /etc/security/limits.conf  /etc/security/limits.conf_bak
49,52c49
< oracle soft nproc 2047
< oracle hard nproc 16384
< oracle soft nofile 1024
< oracle hard nofile 65536

>
[root@localhost ~]#

[root@localhost ~]# diff /etc/pam.d/login /etc/pam.d/login_bak
15d14
< session required pam_limits.so
[root@localhost ~]#

[root@localhost ~]# diff /etc/profile /etc/profile_bak
57,65d56
< if [ $USER = “oracle” ]; then
<     if [ $SHELL = “/bin/ksh” ]; then
<        ulimit -u 16384
<        ulimit -n 65536
<     else
<        ulimit -u 16384 -n 65536
<     fi
< fi
<
[root@localhost ~]#

Make sure the following versions are verified.

[root@localhost ~]# gcc –version
gcc (GCC) 4.1.2 20080704 (Red Hat 4.1.2-46)
Copyright (C) 2006 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

[root@localhost ~]# g++ –version
g++ (GCC) 4.1.2 20080704 (Red Hat 4.1.2-46)
Copyright (C) 2006 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

[root@localhost ~]#

Finally add the following entries in the oracle user profile ( .bash_profile )

ORACLE_BASE=/u01/app/oracle
ORACLE_HOME=/u01/app/oracle/11.2.0/db_1
ORACLE_SID=TESTDB
PATH=$ORACLE_HOME/bin:$PATH
export ORACLE_BASE
export ORACLE_HOME
export ORACLE_SID
export PATH

Now the OS is ready for installing 11gR2 database.

Hope it helps
SRI

Posted in Database Articles, Linux | 2 Comments »

How to add more disk space to Linux Virtual Machine

Posted by Srikrishna Murthy Annam on September 15, 2010

The present demo shows how to add more disk space to linux virtual machine. If you are creating Linux virtual machines for testing purpose , obviously you will create with less disk space. If there is any requirement to add more disk space to linux virtual machine, just follow the steps in the demo and add more disk space to linux virtual machine.

[root@dhcppc1 ~]# fdisk -l

Disk /dev/sda: 8589 MB, 8589934592 bytes
255 heads, 63 sectors/track, 1044 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

Device Boot      Start         End      Blocks   Id  System
/dev/sda1   *           1          13      104391   83  Linux
/dev/sda2              14        1044     8281507+  8e  Linux LVM

Disk /dev/sdb: 8589 MB, 8589934592 bytes
255 heads, 63 sectors/track, 1044 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

Disk /dev/sdb doesn’t contain a valid partition table
[root@dhcppc1 ~]# fdisk /dev/sdb
Device contains neither a valid DOS partition table, nor Sun, SGI or OSF disklabel
Building a new DOS disklabel. Changes will remain in memory only,
until you decide to write them. After that, of course, the previous
content won’t be recoverable.

The number of cylinders for this disk is set to 1044.
There is nothing wrong with that, but this is larger than 1024,
and could in certain setups cause problems with:
1) software that runs at boot time (e.g., old versions of LILO)
2) booting and partitioning software from other OSs
(e.g., DOS FDISK, OS/2 FDISK)
Warning: invalid flag 0x0000 of partition table 4 will be corrected by w(rite)

Command (m for help): p

Disk /dev/sdb: 8589 MB, 8589934592 bytes
255 heads, 63 sectors/track, 1044 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

Device Boot      Start         End      Blocks   Id  System

Command (m for help): n
Command action
e   extended
p   primary partition (1-4)
p
Partition number (1-4): 1
First cylinder (1-1044, default 1):
Using default value 1
Last cylinder or +size or +sizeM or +sizeK (1-1044, default 1044):
Using default value 1044

Command (m for help): w
The partition table has been altered!

Calling ioctl() to re-read partition table.
Syncing disks.
[root@dhcppc1 ~]# fdisk -l

Disk /dev/sda: 8589 MB, 8589934592 bytes
255 heads, 63 sectors/track, 1044 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

Device Boot      Start         End      Blocks   Id  System
/dev/sda1   *           1          13      104391   83  Linux
/dev/sda2              14        1044     8281507+  8e  Linux LVM

Disk /dev/sdb: 8589 MB, 8589934592 bytes
255 heads, 63 sectors/track, 1044 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

Device Boot      Start         End      Blocks   Id  System
/dev/sdb1               1        1044     8385898+  83  Linux
[root@dhcppc1 ~]# mkfs -t ext3 /dev/sdb1
mke2fs 1.39 (29-May-2006)
Filesystem label=
OS type: Linux
Block size=4096 (log=2)
Fragment size=4096 (log=2)
1048576 inodes, 2096474 blocks
104823 blocks (5.00%) reserved for the super user
First data block=0
Maximum filesystem blocks=2147483648
64 block groups
32768 blocks per group, 32768 fragments per group
16384 inodes per group
Superblock backups stored on blocks:
32768, 98304, 163840, 229376, 294912, 819200, 884736, 1605632

Writing inode tables: done
Creating journal (32768 blocks):

done
Writing superblocks and filesystem accounting information: done

This filesystem will be automatically checked every 33 mounts or
180 days, whichever comes first.  Use tune2fs -c or -i to override.
[root@dhcppc1 ~]#
[root@dhcppc1 ~]#
[root@dhcppc1 ~]# mkdir /u01
[root@dhcppc1 ~]# chmod 777 /u01
[root@dhcppc1 ~]# df -h
Filesystem            Size  Used Avail Use% Mounted on
/dev/mapper/VolGroup00-LogVol00
3.9G  3.1G  657M  83% /
/dev/sda1              99M   20M   75M  21% /boot
tmpfs                 864M     0  864M   0% /dev/shm
none                  864M  104K  864M   1% /var/lib/xenstored
[root@dhcppc1 ~]# mount /dev/sdb1 /u01
[root@dhcppc1 ~]# df -h
Filesystem            Size  Used Avail Use% Mounted on
/dev/mapper/VolGroup00-LogVol00
3.9G  3.1G  657M  83% /
/dev/sda1              99M   20M   75M  21% /boot
tmpfs                 864M     0  864M   0% /dev/shm
none                  864M  104K  864M   1% /var/lib/xenstored
/dev/sdb1             7.9G  147M  7.4G   2% /u01
[root@dhcppc1 ~]# vi /etc/fstab
[root@dhcppc1 ~]# grep -i “/dev/sdb1” /etc/fstab
/dev/sdb1               /u01                    ext3    defaults        0  0
[root@dhcppc1 ~]#

Hope it helps

SRI

Posted in Linux, VMWARE | Tagged: , , , , , , , | Leave a Comment »

VMware Server – Linux installation

Posted by Srikrishna Murthy Annam on September 12, 2010

Linux installation on vmware server  Part 1

Linux installation on vmware server part 2

Posted in Linux, VMWARE | Tagged: , , , | 2 Comments »

 
%d bloggers like this: