Powered By Blogger

Monday, October 31, 2011

Transaction Slot on a Block

Transaction Slot on a Oracle Block :
Your process does some DML that's going to update a table, so, Oracle reserves a slot in the transaction header of a rollback segment. This is specified by the rollback number, slot, and wrap. This is what's stored in the transaction slot of the data block that's to be modified. So, now that transaction slot in the data block points to that placeholder in the rollback segment header. When rows in the data block are updated, then in the data block's row directory, the lock byte for that row is set to point to that transaction slot. So, the row directory entry (lock byte) for an updated row points to a specific transaction slot in the data block's transaction header, which in turn points to the rollback transaction slot, which in turn points to where the before images are actually recorded in the rollback segment.

Reference :

Very good one...

http://www.proligence.com/itl_waits_demystified.html


Regards,
Navaneeth

Tuesday, October 18, 2011

Using 10g Logminer on 9.2.0.7 archive files


in 9i production server

SQL> execute   DBMS_LOGMNR_D.build ('dictionary.ora','C:\BCH\VER2.0\EXPORT\MONTHLY',OPTIONs => DBMS_LOGMNR_D.store_in_flat_file);

PL/SQL procedure successfully completed.

in 10g test server using 10g logminer to analyse 9.2.0.7 archive logfiles

execute DBMS_LOGMNR.ADD_LOGFILE('D:\je_rda\JE_logmining\LOG_1_31443.ARC',options => dbms_logmnr.new);


execute DBMS_LOGMNR.START_LOGMNR(dictfilename =>'D:\je_rda\JE_logmining\dictionary.ora');

select * from v$logmnr_logs
select * from v$logmnr_logfile
desc v$logmnr_stats

select SEG_OWNER,SEG_NAME,TABLE_NAME,SEG_TYPE,ROW_ID,SESSION#,SERIAL#,USERNAME,SESSION_INFO,SQL_REDO,SQL_UNDO,AUDIT_SESSIONID from v$logmnr_contents

Reference :
Oracle 10g New Features of LogMiner [ID 249001.1]
LogMiner - Frequently Asked Questions (FAQ) [ID 174504.1]
Oracle9i LogMiner New Features [ID 148616.1]
LogMiner Utility Release 8.1.x - 10g [ID 291686.1];


Regards,
Navaneeth

Thursday, October 13, 2011

Sharing folder from RHEL5 machine to Windows machine

Configuring Samba service on RHEL5 machine

Create a share folder in RHEL5 machine which u want to share with Windows machine.

Check Linux machine for the samba packages whether installed or not.

[root@nav1 ~]# rpm -qa *samba*
sblim-cmpi-samba-0.5.2-31.el5_2.1
sblim-cmpi-samba-test-1-31.el5_2.1
samba-3.0.33-3.7.el5
samba-client-3.0.33-3.7.el5
sblim-cmpi-samba-devel-1-31.el5_2.1
system-config-samba-1.2.41-3.el5
samba-common-3.0.33-3.7.el5
samba-swat-3.0.33-3.7.el5
You have new mail in /var/spool/mail/root

[root@nav1 ~]# service smb status
smbd (pid 3635 3068 3029) is running...
nmbd (pid 3032) is running...
[root@nav1 ~]#

[root@nav1 ~]# useradd samba -d /home/samba
[root@nav1 ~]# smbpasswd -a samba
New SMB password:
Retype new SMB password:
Added user samba.
[root@nav1 ~]# cat /etc/samba/smb
smb.conf  smbusers 
[root@nav1 ~]# cat /etc/samba/smb.conf

[windows]
        path = /u01/windows
        writeable = yes
;       browseable = yes
        valid users = az, nv, samba
[root@nav1 ~]#

After doing any changes to smb.conf file, please restart smb service to take effect of the changes as below.

[root@nav1 ~]# service smb restart
Shutting down SMB services:                                [  OK  ]
Shutting down NMB services:                                [  OK  ]
Starting SMB services:                                     [  OK  ]
Starting NMB services:                                     [  OK  ]
[root@nav1 ~]#

Now go to Windows machine and try to Map the network drive using the RHEL5 machine IP and share name and Samba username/password.
It should work fine.

Reference:
http://mars.netanya.ac.il/~unesco/cdrom/LDP/Samba/HTML_FORMAT/SMB-HOWTO.html#toc6


Regards,
Navaneeth

Sharing folder from Windows to RHEL5 machine

First share a folder in windows and give permission to everyone to access to that folder.

Go to linux machine and do the below steps

Prerequsties should be , all the packages for running SAMBA service should be installed on the Linux machine. And the SAMABA service should be running on the machine.

Please use below commands for checking about the SAMBA service.

[root@nav1 ~]# rpm -qa *samba*
sblim-cmpi-samba-0.5.2-31.el5_2.1
sblim-cmpi-samba-test-1-31.el5_2.1
samba-3.0.33-3.7.el5
samba-client-3.0.33-3.7.el5
sblim-cmpi-samba-devel-1-31.el5_2.1
system-config-samba-1.2.41-3.el5
samba-common-3.0.33-3.7.el5
samba-swat-3.0.33-3.7.el5
You have new mail in /var/spool/mail/root

[root@nav1 ~]# service smb status
smbd (pid 3635 3068 3029) is running...
nmbd (pid 3032) is running...
[root@nav1 ~]#
[root@nav1 ~]# smbclient -L WindowsIP -U APAC/WinUsrId
Password:

Domain=[APAC] OS=[Windows 5.1] Server=[Windows 2000 LAN Manager]

        Sharename       Type      Comment
        ---------       ----      -------
        IPC$            IPC       Remote IPC
        D$              Disk      Default share
        ADMIN$          Disk      Remote Admin
        C$              Disk      Default share
        linux_share     Disk     
Domain=[APAC] OS=[Windows 5.1] Server=[Windows 2000 LAN Manager]

        Server               Comment
        ---------            -------

        Workgroup            Master
        ---------            -------
[root@nav1 /]# smbclient \\\\WindowsIP\\linux_share -U APAC/WinUsrId
Password:

Domain=[APAC] OS=[Windows 5.1] Server=[Windows 2000 LAN Manager]
smb: \> ls
  .                                   D        0  Thu Oct 13 21:29:35 2011
  ..                                  D        0  Thu Oct 13 21:29:35 2011

                59616 blocks of size 2097152. 37993 blocks available
smb: \> ls
  .                                   D        0  Thu Oct 13 21:41:10 2011
  ..                                  D        0  Thu Oct 13 21:41:10 2011
  sfsdf                               A        0  Thu Oct 13 21:41:07 2011

                59616 blocks of size 2097152. 37993 blocks available
smb: \>

For Configuring through GUI use below option

go to places menu -> connect to server

it will open a connet to server configuration menu

1. select service type as "Windows Share"
2. Enter Windows Server name which u want to share in the server name option
3. Enter share folder name in the folder name option
4. Enter windows username in the username option
5. Enter windows Domain name in domain name option
6. Name to use for connection is optional and u can use whatever name u want

at last give connect it will ask for password for windows user id, give the passwd thats it !! 

it will be connected to the windows share folder and u will be able to do whatever u want.

Reference:

http://mars.netanya.ac.il/~unesco/cdrom/LDP/Samba/HTML_FORMAT/SMB-HOWTO-7.html

Regards,
Navaneeth

Adding Harddisk on RHEL5

[root@localhost ~]# fdisk -l

Disk /dev/sda: 10.7 GB, 10737418240 bytes
255 heads, 63 sectors/track, 1305 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1   *           1           6       48163+  83  Linux
/dev/sda2               7         515     4088542+  83  Linux
/dev/sda3             516         776     2096482+  82  Linux swap / Solaris
/dev/sda4             777        1305     4249192+   5  Extended
/dev/sda5             777        1305     4249161   83  Linux

Disk /dev/sdb: 7516 MB, 7516192768 bytes
255 heads, 63 sectors/track, 913 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

Disk /dev/sdb doesn't contain a valid partition table
[root@localhost ~]# 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.

Warning: invalid flag 0x0000 of partition table 4 will be corrected by w(rite)

Command (m for help): m
Command action
   a   toggle a bootable flag
   b   edit bsd disklabel
   c   toggle the dos compatibility flag
   d   delete a partition
   l   list known partition types
   m   print this menu
   n   add a new partition
   o   create a new empty DOS partition table
   p   print the partition table
   q   quit without saving changes
   s   create a new empty Sun disklabel
   t   change a partition's system id
   u   change display/entry units
   v   verify the partition table
   w   write table to disk and exit
   x   extra functionality (experts only)

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

Command (m for help): p

Disk /dev/sdb: 7516 MB, 7516192768 bytes
255 heads, 63 sectors/track, 913 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

   Device Boot      Start         End      Blocks   Id  System
/dev/sdb1               1         913     7333641   83  Linux

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

Calling ioctl() to re-read partition table.
Syncing disks.

[root@localhost ~]# mount -t ext3 /dev/sdb1 /u01

[root@nav1 ~]# df -h
Filesystem            Size  Used Avail Use% Mounted on
/dev/sda2             3.8G  1.9G  1.7G  53% /
/dev/sda5             4.0G  137M  3.6G   4% /home
/dev/sda1              46M   11M   33M  24% /boot
tmpfs                 506M     0  506M   0% /dev/shm
/dev/sdb1             6.9G  144M  6.4G   3% /u01

For mounting permanently add the entry in the fstab file in "/etc" location as below

[root@nav1 ~]# cat /etc/fstab
LABEL=/                 /                       ext3    defaults        1 1
LABEL=/home             /home                   ext3    defaults        1 2
LABEL=/boot             /boot                   ext3    defaults        1 2
tmpfs                   /dev/shm                tmpfs   defaults        0 0
devpts                  /dev/pts                devpts  gid=5,mode=620  0 0
sysfs                   /sys                    sysfs   defaults        0 0
proc                    /proc                   proc    defaults        0 0
LABEL=SWAP-sda3         swap                    swap    defaults        0 0
/dev/sdb1               /u01                    ext3    defaults        0 0

Regards,
Navaneeth

Wednesday, October 5, 2011

11gr1 Clean up failed cluster installation on linux RHEL5

Cleaned up a failed oracle 11gr1 crs installation on RHEL5

in node1

[root@rac1 ~]# cd /u01/app/oracle/product/11.1.0/crs/
[root@rac1 crs]# ls
bin css install JRE nls oui rdbms srvm
cdata cv install.platform ldap OPatch perl relnotes xdk
cfgtoollogs diagnostics inventory lib opmn plsql root.sh
clone evm jdk log oracore precomp slax
crs has jlib network oraInst.loc racg sqlplus

[root@rac1 crs]# cd install
[root@rac1 install]# ./rootdelete.sh

Getting local node name
NODE = rac1
PRKO-2006 : Invalid node name: rac1
Stopping resources.
This could take several minutes.
Error while stopping resources. Possible cause: CRSD is down.
Stopping Cluster Synchronization Services.
Unable to communicate with the Cluster Synchronization Services daemon.
Oracle CRS stack is not running.
Oracle CRS stack is down now.
Removing script for Oracle Cluster Ready services
Updating ocr file for downgrade
Cleaning up SCR settings in '/etc/oracle/scls_scr'
Cleaning up Network socket directories

[root@rac1 install]# ./rootdeinstall.sh
Verifying existence of ocr.loc file
Removing contents from OCR device
2560+0 records in
2560+0 records out
10485760 bytes (10 MB) copied, 0.145772 seconds, 71.9 MB/s
[root@rac1 install]#

in node2

[oracle@rac2 bin]$ su -
Password:
[root@rac2 ~]# cd /u01/app/oracle/product/11.1.0/crs/
[root@rac2 crs]# cd install
[root@rac2 install]# ./rootdelete.sh

Getting local node name
NODE = rac2.localdomain
PRKO-2006 : Invalid node name: rac2.localdomain
Oracle Cluster Registry initialization failed with invalid format: PROC-22: The OCR backend has an invalid format
Oracle CRS stack is not running.
Oracle CRS stack is down now.
Removing script for Oracle Cluster Ready services
Updating ocr file for downgrade
Cleaning up SCR settings in '/etc/oracle/scls_scr'
Cleaning up Network socket directories

[root@rac2 install]# ./rootdeinstall.sh
Verifying existence of ocr.loc file
Removing contents from OCR device
2560+0 records in
2560+0 records out
10485760 bytes (10 MB) copied, 0.126807 seconds, 82.7 MB/s
[root@rac2 install]#

in node1

[oracle@rac1 oui]$ cd bin
[oracle@rac1 bin]$ ./runInstaller
Starting Oracle Universal Installer...
Checking swap space: must be greater than 500 MB. Actual 2047 MB Passed
Checking monitor: must be configured to display at least 256 colors. Actual 16777216 Passed
Preparing to launch Oracle Universal Installer from /tmp/OraInstall2011-10-05_11-51-47AM. Please wait ...[oracle@rac1 bin]$ Oracle Universal Installer, Version 11.1.0.6.0 Production
Copyright (C) 1999, 2007, Oracle. All rights reserved.
/u01/app/oracle/product/11.1.0/crs/bin/crsctl.bin: error while loading shared libraries: /u01/app/oracle/product/11.1.0/crs/lib/libclntsh.so.11.1: file too short
-bash: /u01/app/oracle/product/11.1.0/crs/bin/crsctl: No such file or directory
-bash: /u01/app/oracle/product/11.1.0/crs/bin/crsctl: No such file or directory

You can check Metalink note How to Clean Up After a Failed 10g or 11.1 Oracle Clusterware Installation [ID 239998.1] for more info.

Regards,
Navaneeth

Sunday, October 2, 2011

Adding new hardisk in Solaris10

Adding new hardisk in Solaris10

# format

FORMAT MENU:

disk - select a disk
type - select (define) a disk type
partition - select (define) a partition table
current - describe the current disk
format - format and analyze the disk
fdisk - run the fdisk program
repair - repair a defective sector
label - write label to the disk
analyze - surface analysis
defect - defect list management
backup - search for backup labels
verify - read and display labels
save - save new disk/partition definitions
inquiry - show vendor, product and revision
volname - set 8-character volume name
! - execute , then return

quit

format>p

partition> p

Current partition table (unnamed):

Total disk cylinders available: 2044 + 2 (reserved cylinders)
Part Tag Flag Cylinders Size Blocks
0 unassigned wm 0 0 (0/0/0) 0
1 unassigned wm 0 0 (0/0/0) 0
2 backup wu 0 - 2043 3.99GB (2044/0/0) 8372224
3 unassigned wm 0 0 (0/0/0) 0
4 unassigned wm 0 0 (0/0/0) 0
5 unassigned wm 0 0 (0/0/0) 0
6 unassigned wm 0 0 (0/0/0) 0
7 unassigned wm 0 0 (0/0/0) 0
8 boot wu 0 - 0 2.00MB (1/0/0) 4096
9 unassigned wm 0 0 (0/0/0) 0

partition> 3

Part Tag Flag Cylinders Size Blocks

3 unassigned wm 0 0 (0/0/0) 0
Enter partition id tag[unassigned]:
Enter partition permission flags[wm]:
Enter new starting cyl[0]: 1
Enter partition size[0b, 0c, 1e, 0.00mb, 0.00gb]: 2043c

partition> p
 
Current partition table (unnamed):
Total disk cylinders available: 2044 + 2 (reserved cylinders)
Part Tag Flag Cylinders Size Blocks
0 unassigned wm 0 0 (0/0/0) 0
1 unassigned wm 0 0 (0/0/0) 0
2 backup wu 0 - 2043 3.99GB (2044/0/0) 8372224
3 unassigned wm 1 - 2043 3.99GB (2043/0/0) 8368128
4 unassigned wm 0 0 (0/0/0) 0
5 unassigned wm 0 0 (0/0/0) 0
6 unassigned wm 0 0 (0/0/0) 0
7 unassigned wm 0 0 (0/0/0) 0
8 boot wu 0 - 0 2.00MB (1/0/0) 4096
9 unassigned wm 0 0 (0/0/0) 0

partition> q

FORMAT MENU:

disk - select a disk
type - select (define) a disk type
partition - select (define) a partition table
current - describe the current disk
format - format and analyze the disk
fdisk - run the fdisk program
repair - repair a defective sector
label - write label to the disk
analyze - surface analysis
defect - defect list management
backup - search for backup labels
verify - read and display labels
save - save new disk/partition definitions
inquiry - show vendor, product and revision
volname - set 8-character volume name
! - execute , then return

quit

format> l

Ready to label disk, continue? y

format> q

# newfs /dev/rdsk/c1t1d0s3

newfs: construct a new file system /dev/rdsk/c1t1d0s3: (y/n)? y

/dev/rdsk/c1t1d0s3: 8368128 sectors in 2043 cylinders of 128 tracks, 32 sectors

4086.0MB in 79 cyl groups (26 c/g, 52.00MB/g, 6400 i/g)

super-block backups (for fsck -F ufs -o b=#) at:

32, 106560, 213088, 319616, 426144, 532672, 639200, 745728, 852256, 958784,

7350464, 7456992, 7563520, 7670048, 7776576, 7883104, 7989632, 8096160,

8202688, 8309216

# mkdir /u01

# mount -f ufs /dev/dsk/c1t1d0s3 /u01

# df -h

Filesystem size used avail capacity Mounted on

/dev/dsk/c1t0d0s0 9.3G 4.4G 4.8G 48% /

/devices 0K 0K 0K 0% /devices

ctfs 0K 0K 0K 0% /system/contract

proc 0K 0K 0K 0% /proc

mnttab 0K 0K 0K 0% /etc/mnttab

swap 938M 924K 937M 1% /etc/svc/volatile

objfs 0K 0K 0K 0% /system/object

sharefs 0K 0K 0K 0% /etc/dfs/sharetab

/usr/lib/libc/libc_hwcap1.so.1

9.3G 4.4G 4.8G 48% /lib/libc.so.1

fd 0K 0K 0K 0% /dev/fd

swap 937M 112K 937M 1% /tmp

swap 937M 36K 937M 1% /var/run

/hgfs 16G 4.0M 16G 1% /hgfs

/tmp/VMwareDnD 0K 0K 0K 0% /var/run/vmblock

/dev/dsk/c1t1d0s3 3.9G 4.0M 3.9G 1% /u01

#

# bash

bash-3.00# mount -p

/dev/dsk/c1t0d0s0 - / ufs - no rw,intr,largefiles,logging,xattr,onerror=panic

/devices - /devices devfs - no

ctfs - /system/contract ctfs - no

proc - /proc proc - no

mnttab - /etc/mnttab mntfs - no

swap - /etc/svc/volatile tmpfs - no xattr

objfs - /system/object objfs - no

sharefs - /etc/dfs/sharetab sharefs - no

/usr/lib/libc/libc_hwcap1.so.1 - /lib/libc.so.1 lofs - no

fd - /dev/fd fd - no rw

swap - /tmp tmpfs - no xattr

swap - /var/run tmpfs - no xattr

/hgfs - /hgfs vmhgfs - no

/tmp/VMwareDnD - /var/run/vmblock vmblock - no

/dev/dsk/c1t1d0s3 - /u01 ufs - no rw,intr,largefiles,logging,xattr,onerror=panic

bash-3.00# man fstype

Regards,
Navaneeth