How to Automate Startup/Shutdown of Oracle Database on Linux

There are already good sample scripts for automating database startup and shutdown (i.e. check Tim Hall’s oracle-base.com or read MOS [ID 222813.1]), but I wanted to create a wizard to generate “dbora” script according to your inputs. So here it is:

http://apex.oracle.com/pls/apex/f?p=22258:1

This script uses dbstart/dbshut scripts of Oracle. If dbstart/dbshut scripts return the error: “Test: Argument Expected”, you should replace the value #!/bin/sh with the value #!/bin/bash in the first line of dbstart/dbshut files (MOS [ID 369923.1]).

I have also create a wizard to generate shell profile files:

http://apex.oracle.com/pls/apex/f?p=22258:2

I hope you find them useful. Feel free to post your feedback and suggestions here.

HugePages and Oracle Database 11g Automatic Memory Management

When you create a 11g database using Database Configuration Assistant (DBCA), Automatic Memory Management (AMM) is enabled by default. On a Linux system, if AMM is enabled, SGA memory will be allocated by creating files under /dev/shm so HugePages will not be used. Unfortunately AMM is absolutely incompatible with HugePages.

If you want to use HugePages, both MEMORY_TARGET / MEMORY_MAX_TARGET initialization parameters should be unset for the database instance.

How to Add Swap Space in Linux

If the swap space is not enough, you can add a new swap file to your server. Login as root user and then run the following commands to add 10GB of swap space:

You can verify if new swap space was added successfully:

If you want to remove the swap file, run the following commands:

If you want to add this swap space permanently, you need to include it in your /etc/fstab file. Edit the fstab file and add an entry that looks like this: