Take the 2-minute tour ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

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?

share|improve this question

migrated from stackoverflow.com Mar 6 '12 at 15:20

This question came from our site for professional and enthusiast programmers.

2 Answers 2

up vote 0 down vote accepted

type the following commands on the terminal

swapoff -a
cd /
dd if=/dev/zero of=swapfile bs=2048 count=1048576 //this is 512x2048= 1048576 blocks
mkswapfile -v1 /swapfile
vi /etc/rc.local

then click insert and type

swapon /swapfile 

escape and press shift then wq

reboot

check

grep SwapToatal /proc/meminfo
share|improve this answer

The following examples shows how to create a 100-MB swap file called /files/swapfile.

# mkdir /files
# mkfile 100m /files/swapfile
# swap -a /files/swapfile
# vi /etc/vfstab
(An entry is added for the swap file):
/files/swapfile   -      -       swap     -     no     -
# swap -l
swapfile             dev  swaplo blocks   free
/dev/dsk/c0t0d0s1   136,1      16 1638608 1600528
/files/swapfile        -       16 204784  204784
share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.