cancel
Showing results for 
Search instead for 
Did you mean: 

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
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)
greenpiece
Advisor

Re: Upgrade of hard disk

hi Yogeeraj,

i was told to give a plan as to how to go about doing it, don't have the actual new disks yet. proposed plan is to use a new data disk.
hmm, i'm not sure whether i've answered your question, sorry!

thanks for your reply.
greenpiece
Advisor

Re: Upgrade of hard disk

Hi,
Just to confirm, if i want to keep the old data disk, can i just move all oracle files to the new data disk and mount both data disks without de-installing the database from old disk?

Thanks in advance!
Yogeeraj_1
Honored Contributor

Re: Upgrade of hard disk

hi,

post the output the following sql:
select substr(file_name,1,75) from dba_data_files;

You can modify your mount points according so that you can use both your new and old disks.

the output of the above query will simply your case.

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

Re: Upgrade of hard disk

Hi,
Use this link for oracle documentation to help you: http://tahiti.oracle.com
If you are going to keep the old disk will you be using it for something else or not? You might not even need to move the datafiles to the new disk. 2nd you'll want to try and evenly space the datafiles across the volumns. I don't know what type of setup you have but simply moving datafiles to another disk could cause poor performance in the future. You might even want to do an export and import to redistribute your data. But that's another topic, as far as moving the datafiles goes:
1. determine which datafiles you want to move by looking at dba_data_files tables. The name column will tell you the path and name of them.
2. either take a full export or an export of the tablespaces where the datafiles reside that you'll be moving.
3. Take the tablespaces offline where the datafiles reside in. ALTER TABLESPACE name OFFLINE NORMAL;
3. Perform an os 'cp old_name new_name' to move the datafiles. Important not to copy these datafiles when the tablespaces are online.
4. Rename datafiles on the oracle lvl.
alter tablespace name
rename datafile 'old_name1','old_name2' to
'new_name1','new_name2';
5. alter tablespace name online
This shouldn't take too long at all.
greenpiece
Advisor

Re: Upgrade of hard disk

hi, i would want to keep the old disk to house data files, and perhaps keep log files in the new disk.
I am actually trying to solve the problem of not enough disk space as the database "crashed" before bec the disk space was not enough for log file.
Therefore i was told to add new disk to the database.
Any better suggestion?
greenpiece
Advisor

Re: Upgrade of hard disk

Hi,

Thank you for your help.

Sorry for the late points assignment.