1748282 Members
4021 Online
108761 Solutions
New Discussion юеВ

Re: Upgrade of hard disk

 
greenpiece
Advisor

Upgrade of hard disk

Hi,
i'm working on a hp-ux machine and was told to upgrade hard disk to a bigger size because of space is running out. oracle server used is 7.something.

which is a better way, to create a new database in the new hard disk and migrate data from old to new database? or to add hard disk and move certain files, maybe data files, to new hard disk?

sorry for the vague versions of hp-ux and oracle software used bec i've no access to it at the moment.

thanks in advance!
15 REPLIES 15
Steven E. Protter
Exalted Contributor

Re: Upgrade of hard disk

If you have room in your drive cage/enclose for another drive:

install the drive.

ioscan -fnC disk
ioscan
insf -e

pvcreate -b /dev/rdsk/c#t#d# #make the numbers real

vgextend /dev/vg01 /dev/dsk/c#t#d#
lvcreate -C y /dev/vg01 #pick a real vg
# the name will be displayed
lvextend -L /dev/vg01/name_that_was_displayed
newfs -F vxfs -0 largefiles /dev/vg01/rname_that_was_displayed

mount the filestem
shut down the databaes
mv or copy the databse to the new fileystem


unmount both filesystems
change /etc/fstab so the mount of the old filesystem name is pointing to the newly created logical volume

You are done.

Back up with the database down before you start.

SEP
Steven E Protter
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
T G Manikandan
Honored Contributor

Re: Upgrade of hard disk

create a new file system in the new drive.

shutdown all oracle services

copy all oracle files to the new file system created on the new drive.

umount the old drive file system.

Re-mount the new file system created on the new drive with the old mount point.

THanks
Sridhar Bhaskarla
Honored Contributor

Re: Upgrade of hard disk

Hi,

One problem is that you may not be able to add this bigger harddisk to an existing volume group (unless you have a disk of same or bigger size).

You can simply create another volume group with filesystems and add|move the datafiles over to them.

ioscan -f
insf
ioscan -fnC disk (identify the disk say c2t5d0

#mkdir /dev/vg02
#mknod /dev/vg02/group c 64 0x0?0000 (replace vg02 with your choice and ? should be a uniq number can be picked up using ll /dev/*/group)
#pvcreate /dev/rdsk/c2t5d0
#vgcreate -s 16 -p 128 -l 255 vg02 /dev/dsk/c2t5d0
#lvcreate -n db201 -L 1000 vg02
#newfs -F vxfs /dev/vg02/rdb201
#mkdir /db201
#mount /dev/vg02/db201 /db201

Update your /etc/fstab to add this filesystem.

Repeat the above process for your choice of filesystems and their sizes.

If you do have a bigger disk in the existing volume group (say vg01), then you can add this disk to it and extend the filesystems.

#pvcreate /dev/rdsk/c0t5d0
#vgextend vg01 /dev/dsk/c0t5d0
#umount /dev/vg01/lvol1 (make sure no processes access this logical volume
#lvextend -L new_size_in_mb /dev/vg01/lvol1
#extendfs /dev/vg01/lvol1
#mount /dev/vg01/lvol1

Now the filesystem that has lvol1 mounted will have more space.

-Sri
You may be disappointed if you fail, but you are doomed if you don't try
Steven E. Protter
Exalted Contributor

Re: Upgrade of hard disk

As usual, Sri is correct.

If the volume group can't accomodate the larger disk, you'll have to build a new volume group for the new disk, logical volume and fileystem.

You'll need to be prepared to build a new volume group if you run out of extents in the volume group the database is in.


SYNOPSIS
/usr/sbin/vgcreate [-f] [-A autobackup] [-x extensibility] [-e max_pe]
[-l max_lv] [-p max_pv] [-s pe_size] [-g pvg_name] vg_name
pv_path ...



-p max_pe and -s pe_size bumped up to 16 allows for more disk to be accomodated in a volume group.

SEP

Steven E Protter
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
greenpiece
Advisor

Re: Upgrade of hard disk

hi,
thanks to all who have helped.

do u all mean i don't have to create database in the new disk? and moving/copying database means moving of cold backups eg data files etc? and most solutions mean i don't use the old data disk anymore?

thanks in advance, sorry for asking probably qns with obvious ans, i've little knowledge in this.
T G Manikandan
Honored Contributor

Re: Upgrade of hard disk

Yes,you are right.Not only cold backup(movement) but also you can move all oracle related installation files,database files by making the oracle services down.

everything will work fine if done this way by mounting the new file system on hte old mount point.

Also make sure about the good point made above.
The max_pe on the VG will be based on the largest disk during the VG creation.

If you are upgrading the disk you can create a new vg which will use the MAX_PE based on teh new disk.
greenpiece
Advisor

Re: Upgrade of hard disk

hi,
1 more question, do i have to backup controlfile to trace? or just do an os copy of it?

if i don't have to, does that mean i do not need administrator password to upgrade my hard disk (assuming application can startup and shutdown database).

thanks in advance for any replies!
T G Manikandan
Honored Contributor

Re: Upgrade of hard disk

backup controlfile to trace' command is used to backup the controlfile and will be used to re-create the controlfile when the file is lost/corrupted.

Any structural changes of the database,you should keep a backup of the controlfile.

There is no need for you now to re-create the controlfile as you are stopping/shutting down all oracle services are moving the files to another disk.

But before you do anything,it would be great to have a full backup of the database.
and also the backup of the current controlfile
Yogeeraj_1
Honored Contributor

Re: Upgrade of hard disk

Hi,

TG is right.

You can just move around files and unmount/remounting of the file systems can do the trick. No need to reinstall....

Again, make sure you have done a full backup of your system.

are you using raw device?

regards
Yogeeraj
No person was ever honoured for what he received. Honour has been the reward for what he gave (clavin coolidge)