-   Linux - Newbie (
-   -   Configuring swapfile error (

congos 03-06-2012 06:54 AM

Configuring swapfile error
I installed oracle linux 6 on my desktop but I forgot to configure the swapfile, I want to install oracle 11gr2 on it and it requires 2gig or ram, if I type the following commands on the terminal I get these

[root@localhost ~]# grep MemTotal /proc/meminfo
MemTotal: 1789764 kB
You have new mail in /var/spool/mail/root
[root@localhost ~]# grep SwapTotal /proc/meminfo
SwapTotal: 0 kB
[root@localhost ~]# df -k /tmp
Filesystem 1K-blocks Used Available Use% Mounted on
/dev/sda4 100704696 5106508 90482644 6% /
[root@localhost ~]# df -k
Filesystem 1K-blocks Used Available Use% Mounted on
/dev/sda4 100704696 5106508 90482644 6% /
tmpfs 894880 100 894780 1% /dev/shm
[root@localhost ~]#

How do I set the swap file to the required ram for oracle installation which requires 2gig any ideas on how I can go about it?

zhjim 03-06-2012 07:00 AM

You need a free partition on your disk. Check with fdisk -l

After verifying or creating a free partition (I'd say 4G of space is sufficent) you create your swap partition with mkswap /dev/name_of_your_part

Edit /etc/fstab and add the swap partition (Here is one for reference)

[root@casnode1 ~]# cat /etc/fstab
/dev/VolGroup00/LogVol00 /                      ext3    defaults        1 1
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
/dev/VolGroup00/LogVol01 swap                    swap    defaults        0 0

Activate the swappartition with swapon -a or reboot

Or is there some special "swap" for oracle itself?

salasi 03-06-2012 09:23 AM


Originally Posted by zhjim (Post 4619785)
You need a free partition on your disk. Check with fdisk -l

Well, that isn't really correct. If you were going to use a partition for swap, you would need a partition, but the OP asks about a swap file, and you don't need a separate partition for that. Now
  • The use of a separate partition is more traditional in Linux and used to have significant performance advantages, but, some time ago, Andrew Morton claimed that the perf advantages no longer apply to any great extent. So, you might choose a swap file...but I don't know anyone who does, so I can't personally comment on any perf difference, or no. Just, there were some once, and the only people who use swap files are either Windows refugees who don't know better, or people who messed up partitioning and want a quick 'save' for the error.... :D
  • It isn't really clear why the OP is asking about a swap file rather than a partition; is it a case of following some tut that talks of a swap file, or is it 'hadn't thought about it'?


and it requires 2gig or ram
I am reading that as '2 Gigs of RAM', although that could be wrong.

Note that, if it really uses 2 Gigs on a continuous basis, and you think that adding a little swap will just make the issues go away, that is probably wrong.
  • Actively using swap would slow things down; maybe that's tolerable, maybe it isn't. Really nothing about what has been said so far would answer that question
  • Adding swap to barely reach the minimum requirement may be problematic if anything else on this machine also takes a chunk of memory

Of course, you could get away with this if either
  • the requirement for RAM is an installation requirement, that isn't met in day-to-day use (but maybe the day-to-day requirement is larger, depending on what you are doing, and if you are running a large database, or databases, it probably will be)
  • this is something like a trial install or dev machine, which won't see much traffic and for which a little slowness isn't too high a price to pay

All times are GMT -5. The time now is 12:15 AM.