Sun Microsystems, Inc.  Sun System Handbook - ISO 4.1 October 2012 Internal/Partner Edition
   Home | Current Systems | Former STK Products | EOL Systems | Components | General Info | Search | Feedback

Asset ID: 1-71-1457717.1
Update Date:2012-06-06
Keywords:

Solution Type  Technical Instruction Sure

Solution  1457717.1 :   Where to install your Application on the Oracle Database Appliance (ODA)  


Related Items
  • Oracle Database Appliance
  •  
  • Oracle Appliance Kit
  •  
Related Categories
  • PLA-Support>Database Technology>Engineered Systems>Oracle Database Appliance>DB: ODA_EST
  •  


Managing space for applications on Oracle Database Appliance. This note will provide a location where application should be installed on the Oracle Database Appliance

Applies to:

Oracle Database Appliance - Version Not Applicable to Not Applicable [Release N/A]
Oracle Appliance Kit - Version 2.1.0.1 and later
Linux x86-64
1. Applications should not be installed on the an ODA internal root file System.
2. All applications must be installed in a separate volume, mounted through a file system mount point /myapp1.
2a. The new volume name can be changed to suit your needs, by replacing /myapp1 with your selected name for the file system's mount point.

Goal

 To create a location on the Oracle Database Appliance where other application can be installed.

Fix

With the support of applications on ODA, there is a need to separate the application installation from the ODA installation. This note describes how to achieve this on existing ODA installations, by using some free space on the system disk.  A volume needs to be created which can then be formatted as an ext3 filesystem for the application installation.  Applications are to be installed in the /myapp1 directory, created using a new volume on volgroupsys in the Oracle Database Appliance.  

To create a new logical volume follow these 4 steps:

 

1.) Check space is available.

Note: If other applications are installed or the free space has been used for something else; DO NOT install your application if space is not available.

# pvscan

  PV /dev/md1   VG VolGroupSys   lvm2 [465.66 GB / 251.66 GB free]

  Total: 1 [465.66 GB] / in use: 1 [465.66 GB] / in no VG: 0 [0   ]

Note: On the Oracle Database Appliance (ODA) the volgroupsys volume has about 250 GB free.

 

2.) Use the vgdisplay command to display attributes of volume groups

# vgdisplay
--- Volume group ---
VG Name VolGroupSys
System ID
Format lvm2
Metadata Areas 1
Metadata Sequence No 7
VG Access read/write
VG Status resizable
MAX LV 0
Cur LV 4
Open LV 4
Max PV 0
Cur PV 1
Act PV 1
VG Size 465.66 GB
PE Size 32.00 MB
Total PE 14901
Alloc PE / Size 6848 / 214.00 GB
Free PE / Size 8053 / 251.66 GB
VG UUID rDSpEt-KJmb-XpPx-ADLg-GVw1-vjqG-yh9fpN

In the above output note 8053 is the free number of physical extents for the /dev/VolGroupSys/volgroupapp volume group.  This represents 251.66 GB of available space.  Each Physical Extent is 32 MB.

 

3.) Use the lvcreate command to Create a Logical Volume

# lvcreate -L 250G  -n volgroupapp VolGroupSys
Logical volume "volgroupapp" created

Note: The above command creates a logical volume, 250G in size.  Looking at the volume that was just created with the lvcreate command: (See Below)

# lvdisplay /dev/VolGroupSys/volgroupapp

--- Logical volume ---
LV Name /dev/VolGroupSys/volgroupapp
VG Name VolGroupSys
LV UUID A7brX5-SvQC-2n35-UURi-PwtO-6esg-1YeFqA
LV Write Access read/write
LV Status available
# open 0
LV Size 250 GB
Current LE 8000
Segments 1
Allocation inherit
Read ahead sectors auto
- currently set to 256
Block device 253:4

In the above output note that a logical volume size of 250 GB is created.

3.) Create a ext3 journaled filesystem on the logical volumes

# mkfs.ext3 /dev/VolGroupSys/volgroupapp

mke2fs 1.39 (29-May-2006)
Filesystem label=
OS type: Linux
Block size=4096 (log=2)
Fragment size=4096 (log=2)
32768000 inodes, 65536000 blocks
3276800 blocks (5.00%) reserved for the super user
First data block=0
Maximum filesystem blocks=4294967296
2000 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, 2654208,
4096000, 7962624, 11239424, 20480000, 23887872

Writing inode tables: done
Creating journal (32768 blocks): done
Writing superblocks and filesystem accounting information: done

This filesystem will be automatically checked every 21 mounts or
180 days, whichever comes first. Use tune2fs -c or -i to override.

Note: journaling file system is a file system that keeps track of the changes that will be made.


4.) Mount File Systems Automatically with /etc/fstab

Mount the new filesystem and add the entry to fstab to ensure reboots mount the filesystem automatically.

# mkdir /myapp1
# mount -t ext3 /dev/VolGroupSys/volgroupapp /myapp1

 

You must modify the /etc/fstab and add the following line to automacally mount the volume when the system is rebooted. 

/dev/VolGroupSys/volgroupapp    /myapp1    ext3    defaults    1 2 

After completing the above steps the logical volume is ready for use.

 

 

Addition Steps to Remove, Reduce, or Extend the storage  

Removing Storage Volume

The process of removing storage from a ODA Enterprise Linux system

  • Remove the following line from /etc/fstab

/dev/VolGroupSys/volgroupapp    /myapp1    ext3    defaults    1 2

  • Unmount the active partitions

# umount /myapp1

Note: A logical volume must be closed before it can be removed.  

If you see the following message a user is currently in or using the /myapp1 directory or a process still has a file open.  You can use the lsof command to identify the process(es).

umount: /myapp1: device is busy

  • Erase the contents of the disk drive

Use the UNIX rm command

  • Remove the logical volume

# lvremove /dev/VolGroupSys/volgroupapp
Do you really want to remove active logical volume volgroupapp? [y/n]: y
Logical volume "volgroupapp" successfully removed

 

To Reduce logical volume size

Logical volumes may be resized dynamically while preserving the data on the volume.  The process of reducing the size of the logical volume involves following 3 steps

  1. Unmount the logical volume (if it is mounted)
  2. Reduce the file system residing on the logical volume. And finally,
  3. Reduce the logical volume.
Warning: You should be careful when reducing a logical volume's size, because data in the reduced part is lost.  It is recommended to backup the file system prior to reducing the logical volume size.
  • Umount the file system. 

# umount /myapp1

Note: This may involve stopping processes, stopping logins or even switching to single-user mode.

  • Verify the file system is clean and not in use.

# e2fsck –f /dev/VolGroupSys/volgroupapp

e2fsck 1.39 (29-May-2006)
Pass 1: Checking inodes, blocks, and sizes
Pass 2: Checking directory structure
Pass 3: Checking directory connectivity
Pass 4: Checking reference counts
Pass 5: Checking group summary information
/dev/VolGroupSys/volgroupapp: 11/32768000 files (9.1% non-contiguous), 1076183/65536000 blocks

  • Reduce the size of the ext3 file system on the logical volume to the desired size

# resize2fs -p /dev/VolGroupSys/volgroupapp 150G

resize2fs 1.39 (29-May-2006)
Resizing the filesystem on /dev/VolGroupSys/volgroupapp to 26214400 (4k) blocks.
Begin pass 3 (max = 2000)
Scanning inode table XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
The filesystem on /dev/VolGroupSys/volgroupapp is now 26214400 blocks long.

  • Reduce the size of the logical volume and print out a percentage completion bars

# lvreduce -L 150G /dev/VolGroupSys/volgroupapp

WARNING: Reducing active logical volume to 150.00 GB
THIS MAY DESTROY YOUR DATA (filesystem etc.)
Do you really want to reduce volgroupapp? [y/n]: y
Reducing logical volume volgroupapp to 150.00 GB
Logical volume volgroupapp successfully resized
grow the file system again to occupy the whole logical volume

# lvdisplay /dev/VolGroupSys/volgroupapp

--- Logical volume ---
LV Name /dev/VolGroupSys/volgroupapp
VG Name VolGroupSys
LV UUID x4xCky-0Oo0-lLhG-2mMi-YtdJ-kZje-6QAeGU
LV Write Access read/write
LV Status available
# open 0
LV Size 150.00 GB
Current LE 4800
Segments 1
Allocation inherit
Read ahead sectors auto
- currently set to 256
Block device 253:4

In the above output note that a logical volume size has been reduced to 150 GB.

 

  • Re-mount the file system

# mount -t ext3 /dev/VolGroupSys/volgroupapp /myapp1

 

To Extend logical volume size

  • To extend the size of the logical volume, Use the lvextend command to specify how much you want to extend or resize the the logical volume.

# lvextend –L200G /dev/VolGroupSys/volgroupapp

This resizes the logical volume /dev/VolGroupSys/volgroupapp to 200 GB

# lvextend –L+50G /dev/VolGroupSys/volgroupapp

This will add 50GB to the current size of the logical volume /dev/VolGroupSys/volgroupapp 


Attachments
This solution has no attachment
  Copyright © 2012 Sun Microsystems, Inc.  All rights reserved.
 Feedback