Oracle Consulting Oracle Training Oracle Support Development
Home
Catalog
Oracle Books
SQL Server Books
IT Books
Job Interview Books
eBooks
Rampant Horse Books
911 Series
Pedagogue Books

Oracle Software
image
image
Write for Rampant
Publish with Rampant
Rampant News
Rampant Authors
Rampant Staff
  Phone
  252-431-0050
Oracle News
Oracle Forum
Oracle Tips
Articles by our Authors
Press Releases
SQL Server Books
image
image

Oracle 11g Books

Oracle tuning

Oracle training

Oracle support

Remote Oracle

STATSPACK Viewer

    Privacy Policy

 

 
 

Learn Oracle Step by Step

Article by author Kamran Agayev Agamehdi

Kamran Agayev Agamehdi  is an Oracle Certified Professional DBA (9i, 10g) with over 5 years experience with UNIX Systems and with Oracle Databases and author of Oracle Backup & Recovery by Rampant Tech Press.

In the following article I will point out my "Step by Step" guides which may help you understand basic Oracle concepts. 

Install VMware

As we know, if you want to setup Oracle Server – especially for testing purpose – it would be better to setup it on your “virtual PC”, not on PC directly. For this purpose, you can use software named “VMware” to achieve this aim. In this document, firstly we discuss how we can use VMware, how we can setup it, create a new “Virtual PC”. In the next section, we’ll discuss how to install OS (as an operating system, I’m using Centos) on this virtual machine. CentOS is a freely-available operating system that is based on Red Hat Enterprise Linux system. Then we’ll try to setup Oracle Server (10g Release 2) on this virtual machine

First off, let’s show how we can setup and create new VMware Virtual machine and prepare it for further OS installation:

1. First of all, enter to the official site of VMware and download VMware Workstation with a 30-day free evaluation from this address:
https://www.vmware.com/tryvmware/?p=workstation-w
Currently I’m using version 6.0.0 and all these examples are compatible and tested with this version
2. After downloading VMware workstation, install it on your PC
3. Setup will open Welcome Screen
Click on Next button and choose Typical option
4. By clicking “Next” buttons, to begin the installation, click on Install button at the end
5. This will install VMware Workstation software on your PC, After installation complete, click on Finish button. Then restart your PC. Then open this software
6. In this step we try to create new “virtual machine”. Enter to File menu, then New-> Virtual Machine
Click on Next button, then check Typical option as below
Then click Next button, and check your OS version. In this example, as we’re going to setup Oracle server on CentOS, we’ll check Linux option and from “version” option we’ll check Red Hat Enterprise Linux 4
By clicking Next button, we’ll give a name to our virtual machine, and give directory to create this new virtual machine
Then select Use bridged networking option and click Next.
Then you’ve to define size of hard disk by entering its size. I’ll give 15 GB hard disk space and please check Allocate all disk space now option.  Although it will take longer to create new hard disk, you’ll see high performance of your virtual machine when installing new applications and adding new files. If you uncheck this option, new hard disk will be created automatically, but when you install new applications, it will impact your performance, because it will allocate space each time new files added or applications installed
That’s all. Your virtual machine is ready to use.

Here, you can delete Sound Adapter, Floppy and USB Controller by entering “Edit virtual machine settings”. If you’re going to setup Oracle Server, please make sure you’ve increased your Memory (RAM) to 1GB

Installing CentOS on VMware

First of all, we’ve to download CentOS. CentOS is a freely-available operating system that is based on Red Hat Enterprise Linux system.  You can download the latest release (5) from its website. To download, please refer to download page of CentOS web site

http://isoredirect.centos.org/centos/5/isos/i386/

Select nearest location and begin downloading *.iso files.

After you finish downloading *.iso files, you have to mount it and let your VMware recognize it as a virtual “cd” or “dvd”. For this purpose, I prefer to download one DVD *.iso installation file. Please open VMware, double click on CD-ROM (IDE 1-0) item, select Use ISO image option and click Browse button to select your recently downloaded *.iso installation file of CentOS as shown below

Now you virtually inserted you installation DVD into DVD-ROM. And you’re ready to install your OS virtually.  

You should change your Memory to 1024 MB for your further Oracle installation. Double click on Memory item and set it to 1024
Then click Power button to start your virtual pc
When your virtual pc starts, you’ll see welcome screen of installation CentOS
If you’ll not be able to see this screen, then restart your virtual pc and click Esc button for Boot menu. And from this menu, select CD-ROM Drive
Click enter. The installation will tell you to begin testing of your installation cd or dvd. Select Skip button. It will skip testing your cd media and save your time
Then you’ll get another welcome screen, you only have to click next button the screen.
Select your language of installation and click Next
Then, select your keyboard configuration to use it for the system you’re installing and click Next.
Then, you’ll be warned to create new partitions by erasing ALL DATA on your newly created hard drive. As there’s no information in this drive, you’ll select Yes
In this step, just let it remain selected and click next
Then there’ll be warning “You have chosen to remove all Linux partitions (and ALL DATA on them) on the following drives: /dev/sda   Are you sure you want to do this?” Click Yes
Then, you’ll see Network Configurations screen, as it is your test virtual pc, don’t change anything and click next. You can change whatever you want after installation, for now, let it continue in this way and click Next.
From this screen, select your region and click Next.
Then, you’ll be prompted to enter password for root user, enter it and click Next.
To install packages, especially for working with Oracle Server, select all options except Clustering and Storage Clustering. Then select Customize now option and click Next.
Then, from Base System menu, select Legacy Software Support, System Tools and click Next.
Now, you’re ready for installation. Click next on the screen, and installation will begin.
You’ll see how all packages are installing. After a while, your OS will be ready for use.
After the installation is completed, click Reboot button to reboot your OS.
After reboot, you’ll face with another Welcome screen. There’re some steps need to be completed
Click Forward button on the screen.
Here, just disable your Firewall. This is only for test purposes, don’t disable your Firewall on real system! Then click forward button.
For testing purposes, it would be good to disable SELinux too.
Then keeping Kdump disabled, click Forward.
If you need, make your Date and Time configuration and click Forward.
If you want to create a new user, you can fill the blanks that appear. You can pass this step too by clicking Forward button.
Then Click Finish and the system will reboot.
After reboot, CentOS will be opened and you’ll be prompted to enter username (root) and password (root’s password).
Your Centos is ready to use! Congratulations.
In the next section, I’m going to show installation of Oracle 10g Release 2 on our Centos OS
Additionally, while using an operating system inside VMware, you recognize that every time you have to enter to its area and then press Ctrl+Alt buttons to leave this area and to return to your system.
To solve this issue, you should install VMware Tools.
As the VMware Tools will be installed from CD-Rom device, you should disconnect your connected CD-Rom device.
Next, Select VM menu on VMware application and select Install VMware Tools menu item.
Then click Install button on the message box to Install VMware Tools.
Then enter to My Computer and double click on CD-ROM Drive. You’ll see there two packages.
Now, double click on *.rpm file to setup   
After installation complete, copy another *.gz file to anywhere in hard drive. In our example we are copying it to tmp directory inside FileSystem, paste the file into this folder, right click on it and select Extract Here menu item.
Then enter to the folder vmware-tools-distrib and double click on vmware-install.pl file and click Run in Terminal button.
Then, whenever you’re asked to enter the value, just click enter.
But when you’re prompted to enter value for the display size of your X, be careful to enter default value. If you want your Virtual Machine to be little size, enter 2 (800-600).

That’s all! Your VMware Tools installed. Now you can enter to VMware’s area and exit it without clicking Ctrl+Alt .

Also, if you’ll face with “VMware hgfs: HGFS is disabled in the host” error, just reboot your system.

Installing Oracle Database 10g Release 2 on Linux (CentOS) and AUTOMATE the installation using Linux Shell Script

In order to use Oracle Database, first of all we need to setup Oracle Software. Installation of Oracle Database on Windows is very easy. By running setup.exe from installation CD of Oracle for Windows, we can invoke a setup and by clicking NEXT buttons we can install Oracle Software and Database without any problem. We don’t need any prerequisite actions before installation. But in Linux it’s different. If we want to install Oracle Database on Linux OS, we should follow some prerequisite actions.

Today, we’re going to install Oracle Database on CentOS. To do it, we use last version of CentOS (the latest release for now) – “CentOS-5.2” and mostly used release of Oracle Database – “Oracle Database 10g Release 2”. And we’re going to practice this whole project on VMware 6.0.0

Before starting, we need to install VMware. Then, we need to install CentOS on VMware. After that, we are going to install Oracle Database. You should refer to my previous posts in order to install VMware and Centos

But there’s one thing we should keep in mind. During installation of CentOS, on the “package lists” page, we should behave differently. It will be discussed in the next paragraphs.  

This project covers following steps:

  1. Checking minimum hardware requirements
  2. Installing rpm packages which are required for Oracle installation
  3. Configuring kernel parameters
  4. Creating groups and user for Oracle Installation
  5. Installing Oracle Software
  6. Creating an Oracle Database
  7. Connecting to Database with Enterprise Manager
  8. AUTOMATING all processes and steps of installation Oracle 10g R2 on Centos using Shell Script

As you see from the list above, in order to setup Oracle Database, we need to change some parameters in the system. Changing these parameters each time could lead to mistakes and waste of time. The main purpose of our article is to automate all these processes and save your time. For this purpose we’re going to use “Shell Script”

Now I’m going to explain above mentioned steps one by one

1. Checking minimum hardware requirements

At least, your system should meet the following requirements:  1GB RAM

Requirement for swap space in Oracle installation is as follows:

Available RAM  

Swap Space Required

Between 1 GB and 2 GB    

Between 2 GB and 8 GB         

More than 8 GB                    

1.5 times the size of RAM

Equal to the size of RAM

.75 times the size of RAM

-                      400MB free space in /tmp directory

-                      Depending on type of the installation, 1.5-3.5 GB free space for Oracle Software

-                      1.5GB free space if new Oracle Database is created

Getting familiar with requirements mentioned above, we need to get hardware information of our system. To check the size of RAM, Swap space and tmp directory, we run these commands:

-           To check the size of physical memory, execute grep MemTotal   /proc/meminfo

-           To check the size of swap space, execute   grep SwapTotal     /proc/meminfo

-           To check the space in  /tmp directory, execute df –h /tmp

2. Installing rpm packages which are required for Oracle installation

While installing CentOS, we have to install some rpm packages. During the installation, on the installation window you get list of packages. Here, we select “Customize” choice

On “Customized” window, we check required packages and uncheck packages that are not required for Oracle Installation.

In the packages list, check following packages. Uncheck all packages that are not in the list below.

Desktop Environments

                                                  GNOME Desktop Environment  

Applications

                                                  Graphical Internet

Development

                                                  Development Libraries

                                                  Development Tools

                                                  GNOME Software Development

                                                  Java Development

                                                  Legacy Software Development

                                                  X Software Development

Servers

                                                  Server Configuration Tools

                                                  Web Server

                                                  Windows File Server

Base System

                                                  Administration Tools

                                                  Base

                                                  Java

                                                  Legacy Software Support

                                                  System Tools

                                                  X Window System

Furthermore, after installation of CentOS, we have manually to install these four rpm packages. Surely, you can select them (except libaio-devel package) from the package list during setup, for many people who don’t want to find these packages in the package list, installing it manually after system installation is the best option. These are packages which should be installed before Oracle installation

-           compat-db-4.2.52-5.1.i386.rpm

-           sysstat-7.0.2-1.el5.i386.rpm

-           libaio-devel-0.3.106-3.2.i386.rpm

-           libXp-1.0.0-8.1.el5.i386.rpm

In order to install these packages, you can use rpm –Uvh command by changing directory to CentOS directory inside the CD (DVD) of CentOS installation as shown below

3. Changes to be made to Kernel parameters

After installing above mentioned packages, we need to change some Kernel parameters and make them match to Oracle requirements. Parameters which should be changed are shown below

shmmax

2147483648

shmmni

4096

shmall

2097152

shmmin

1

semmsl

250

semmns

32000

semopm

100

semmni

128

file-max

65536

ip_local_port_range

1024   65000

rmem_default

1048576

rmem_max

1048576

wmem_default

262144

wmem_max

262144

 We do all these changes in the /etc/sysctl.conf file by adding these lines to that file:

kernel.shmmax = 2147483648

kernel.shmall = 2097152

kernel.shmmni=4096

kernel.sem=250 32000 100 128

fs.file-max=65536

net.ipv4.ip_local_port_range=1024 65000

net.core.rmem_default=1048576

net.core.rmem_max=1048576

net.core.wmem_default=262144

net.core.wmem_max=262144

After appending those lines we save that file and run the following command to make these changes effective immediately in the running system

/sbin/sysctl –p

Setting Shell limits for the Oracle User - To improve the performance of the software on Linux systems, you must increase the following shell limits for the oracle user:

1. Add the following lines to /etc/security/limits.conf file

oracle              soft    nproc   2047

oracle              hard    nproc   16384

oracle              soft    nofile  1024

oracle              hard    nofile  65536

2. Add the following lines to /etc/pam.d/login file

session    required     /lib/security/pam_limits.so

session    required     pam_limits.so

3. In order to use Oracle Software, we need to make a change in “oracle” user’s buffer size and number of opened file descriptors. In order to do it, we add below lines to /etc/profile file

if [ $USER = "oracle" ]; then

        if [ $SHELL = "/bin/ksh" ]; then

              ulimit -p 16384

              ulimit -n 65536

        else

              ulimit -u 16384 -n 65536

        fi

fi

4. Changing redhat-release file

One of the first checks performed by the Oracle Universal Installer (OUI) is to determine if the host platform is supported. The OUI uses the file /etc/redhat-release to determine the platform. For the case of Red Hat Enterprise Linux, Oracle Database 10g Release 2 expects either RHEL 3 or RHEL/OEL 4.

The easiest way to get around this error is to modify the /etc/redhat-release file replacing the current release information (CentOS release 5 (Final)) with the following:

redhat-4

Before modifying /etc/redhat-release, make a backup copy of the file and ensure to replace the original one after the Oracle installation and patch process has been completed.

cp /etc/redhat-release /etc/redhat-release.original

echo “redhat-4″ > /etc/redhat-release

4. Create groups and user for Oracle Installation

In this step, we create “oinstall” and “dba” groups and “oracle” user to install Oracle Software, and create new Database  

groupadd  oinstall

groupadd  dba

useradd -m -g oinstall -G dba -d /home/oracle -s /bin/bash -c “Oracle Software Owner” oracle

passwd oracle

5. Installing Oracle Database 10g Release 2

First of all, we need to download Oracle Database 10g R2. To download it, use this link:

http://download.oracle.com/otn/linux/oracle10g/10201/10201_database_linux32.zip

After download finish, we need to copy this file to the Virtual Machine. To copy it, we have two choices:

  • Copy it using USB Flash Drive
  • Copy it using Samba service
  • Create an image file (.iso) from zipped installation and mount it to Virtual Machine

Here, we’re going to copy the zipped file using second technique. With any ISO creator program, create .iso file from zipped installation file of Oracle Database. And then mount it to the Virtual Machine.

Now switch to the desktop of CentOS, right click on DVD of CentOS installation on the desktop and click “Eject”.

Now enter to “Computer” and double click on “CD-ROM” icon.

Installation file of Oracle Database will be opened, then we create install folder on the /tmp directory,  change owner of this folder to “oracle”, copy this file into /tmp/install directory.

Then unzip this file and begin installation and after unzip completes, installation will begin automatically. 

Oracle Database 10g Installation

If you want to create new database after software installation, check “Create Starter Database” checkbox and enter database name and password, then click Next.

Specify Inventory directory (keep it as default) and click Next

Then we see that all Prerequisite Checks succeeded.

Click Install to begin installation.

Now, we’re installing Oracle 10g Software.

6.  Creating an Oracle Database

As we’ve checked “Create Starter Database” at the first page of the installation, new database will be created automatically after software installation.

After database created, you’ll get information about your database, Enterprise Manager and Spfile.

Click Ok. You’ll get location for two scripts which you should run as a root user to complete last configurations. Open new Terminal window and run those two scripts.

Installation of Oracle Database 10g completed successfully! Congratulations!

Now reboot your server and login as oracle user and start newly created database.  

If we want to login to our database, we run sqlplus. But before it, we need to set Environment Variables. We can do it automatically by adding them to .bashrc file in the /home/oracle directory as below:

export ORACLE_HOME=/home/oracle/oracle/product/10.2.0/db_1

export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$ORACLE_HOME/lib

export PATH=$ORACLE_HOME/bin:$PATH

alias database =’export ORACLE_SID=kamran;sqlplus “/ as sysdba”‘

Now, let’s open new terminal and try again.

As you see, after setting Environment Variables to their correct values, I was able to login to SQL*Plus using two ways.

7.   Connecting to Database with Enterprise Manager

Now, let’s start Oracle Enterprise Manager. In order to use EM, we should firstly start listener. In production environment, you need automate database, listener and EM startup.

Start the listener, then start Enterprise Manager.

Now, we can login to EM page to administer our database using above given address:

http://localhost.localdomain:1158/em/

Enter user sys and its password, then select “SYSDBA” as a role and click Login.

Using Enterprise Manager, you can administer your database in very easy steps.

That’s all. Our Database and EM is ready for use.

By following above mentioned steps we were able to install Oracle 10g R2 on CentOS 5. But if we carry out frequent tests and as a result of these tests each time we are to install Oracle Database, then we need to automate installation of Oracle Database. I would suggest two options to overcome this problem:

  1. To install CentOS+Oracle on VMware and copy image of VMware to elsewhere, then each time use this image to get fresh copy of Oracle Database
  2. To automate installation of Oracle Database by using Shell Script

Let’s explain each option in details: 

  1. Firstly, I usually create new Virtual Machine with 10GB size. Then, I install CentOS on it and create an Oracle Database with all its configurations. Then I shut down Virtual Machine and copy all the folders to another directory. Usually, I create two copies of the Virtual Machine. Then I do all my tests on the first Virtual Machine. When it becomes useless, I shut down and delete it as a whole folder, open second Virtual Machine which I’ve copied and continue my tests.
  2. Second way is the best method of approach to the problem. For this, I create a shell script and write all steps and do all configuration changes from this script. By running this script once, all configurations needed for Oracle Installation will be changed automatically and we will only be asked for new oracle user’s password and next we’ll see installation page open.

Automating installation of Oracle Database 10g Release 2 on Centos 5 using Shell Script

To automate this job, we wrote a Shell Script. Before running this script, we should follow some steps as shown below: 

1. First, you should know that before running this script we should create install directory in /tmp directory and copy zipped installation file of Oracle to this directory  with this installation script

2. Before running this script we must be sure that installation DVD of CentOS has been inserted or installation DVD image of CentOS mounted to the system. You can check it by running this code:

3. After installation completes, change the following Environment Variables and alias name into proper names which you’ve used during installation in the .bashrc file

  1. ORACLE_HOME  – If it is different folder, change it to correct value
  2. ORACLE_SID – If it is different SID, change it to correct SID  
  3. As an alias, you can assign whatever you want

If everything is OK as mentioned above, we change directory to /tmp/install folder and run install.sh file. By running this shell script, all configurations needed for installation will be automatically changed and only thing asked will be oracle user’s password. After that we’ll see Oracle Database installation page. By clicking Next buttons we’ll be able to install Oracle Software and Database very easily. 

Now, let’s install Oracle Database 10g using this Shell Script

First of all, we need to create install folder in the /tmp directory and copy zipped installation file of Oracle Database 10g to /tmp/install directory with install.sh script and check their existence. After that we need to mount Centos DVD once more, because we’re going to install some packages that were not installed with CentOS.

In the screen that appears once we start installation we see that:

  • We have zipped installation file of Oracle Database 10g in the /tmp/install directory
  • We mounted CentOS DVD

 Now, switch to /tmp/install folder and run install.sh script.

Here, enter oracle user’s password. Then click ok. After this step, zipped file will be unzipped.

After it finishes unzipping, we’ll get Installation Window.

That’s all! After getting this page, you should follow above mentioned installation steps in which we installed Oracle Database manually.

Using automatic install script we’ve avoided of all configuration settings and got Oracle 10gR2 installer page opened successfully

The automatic installation script for Oracle Database on Linux is as follows:

 

#########———— Installing Rpm files —–########

 

#Change directory to /tmp/install

cd /tmp/install

#Install all packages that are not installed during OS installation and that are required packages for Oracle Database 10gR2

echo “Installing rpm packages …”

 

rpm -Uvh “$(find /media/ -name compat-db*)”

rpm -Uvh “$(find /media/ -name sysstat*)”

rpm -Uvh “$(find /media/ -name libaio-devel*)”

rpm -Uvh “$(find /media/ -name libXp-1*)”

 

echo “Rpm packages installed

 

#Add lines to limits.conf file

echo “Changing limits.conf file”

cat >> /etc/security/limits.conf <<EOF

oracle soft nproc 2047

oracle hard nproc 16384

oracle soft nofile 1024

oracle hard nofile 65536

EOF

echo “limits.conf file changed successfully

 

#Add lines to profile to give maximum limit for Oracle user

echo “Changing /etc/profile file ….”

cat >> /etc/profile <<EOF

if [ \$USER = "oracle" ]; then

                                                  if [ \$SHELL = "bin/ksh" ]; then

                                                                ulimit -p 16384

                                                                ulimit -n 65536

                                                  else

                                                                ulimit -u 16384 -n 65536

                                                  fi

                                                  umask 022

fi

EOF

echo “/etc/profile file changed successfully

 

#Add line to /etc/pam.d/login file

echo “Changing /etc/pam.d/login file …”

cat >> /etc/pam.d/login <<EOF

session required /lib/security/pam_limits.so

EOF

echo “/etc/pam.d/login file changed successfuly

 

#Add some kernel parameters to /etc/sysctl.conf file

echo “Changing kernel parameters … “

 

cat >> /etc/sysctl.conf <<EOF

kernel.shmmax = 2147483648

kernel.shmall = 2097152

kernel.shmmni=4096

kernel.sem=250 32000 100 128

fs.file-max=65536

net.ipv4.ip_local_port_range=1024 65000

net.core.rmem_default=1048576

net.core.rmem_max=1048576

net.core.wmem_default=262144

net.core.wmem_max=262144

EOF

 

echo “Kernel parameters changed successfully

#Save all new kernel parameters

 

/sbin/sysctl -p

 

#Add “redhat-4″ line to /etc/redhat-release file

 

echo “Changing /etc/redhat-release file …”

cp /etc/redhat-release /etc/redhat-release.original

echo “redhat-4″ > /etc/redhat-release

echo “/etc/redhat-release file changed successfully

 

#Create new groups and “oracle” user and add this user to group

echo “Creating new groups and ‘oracle’ user …”

groupadd oinstall

groupadd dba

useradd -m -g oinstall -G dba -d /home/oracle -s /bin/bash -c “Oracle Software Owner” oracle

passwd oracle

echo “Groups and user created successfully

#Adding Environment Variables

#Adding Environment Variables

cat >> /home/oracle/.bashrc <<EOF

export ORACLE_HOME=/home/oracle/oracle/product/10.2.0/db_1

export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$ORACLE_HOME/lib

export PATH=$ORACLE_HOME/bin:$PATH

alias mydb=’export ORACLE_SID=mydb;sqlplus “/ as sysdba”‘

export ORACLE_SID=mydb

EOF

EOF

 

 

#Unzip setup of Oracle

echo “Unzipping setup of Oracle 10g Release 2…. “

unzip 10201_database_linux32.zip

echo “Setup file successfully unzipped

 

#Enter to installation directory and run the installation …

echo “Installation begins …”

cd /tmp/install/database

chmod 755 runInstaller

chmod 755 install/.oui

chmod 755 install/unzip

xhost +

sudo -u oracle /tmp/install/database/runInstaller

Create a Database Manually

In this section, I’ll show you how we can create a Database without Database Configuration Assistant (DBCA). We’re going to create the database manually, using CREATE DATABASE statement. Sometimes, we are not able to use GUI in order to create a database. For this, we should know syntax of database creation from SQL*Plus.

To create database manually, follow these steps:    

1. Firstly, export Environment Variables. To export EV automatically for every session, do below changes to /home/oracle/.bashrc file:
 export ORACLE_SID=kamran
export ORACLE_HOME=/home/oracle/oracle/product/10.2.0/db_1
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$ORACLE_HOME/lib
2. Create parameter file and modify it by setting minimum required parameters:
*.db_name=kamran
*.db_block_size=8192
*.sga_target=1677721600
*.undo_management=’AUTO’
*.control_files = (’/home/oracle/oracle/product/10.2.0/control01.ctl’)
*.user_dump_dest=’/home/oracle/oracle/product/10.2.0/udump’
*.background_dump_dest=’/home/oracle/oracle/product/10.2.0/bdump’
*.core_dump_dest=’/home/oracle/oracle/product/10.2.0/cdump’
After creation of this parameter file, create below folders in /home/oracle/oracle/product/10.2.0/ directory. Three of them are dump folders (needed for trace files and alert.log file). We’re going to keep Control Files and DataFiles in oradata folder.
-          oradata
-          udump
-          bdump
-          cdump
 3. Create Server parameter file (SPFILE) using this parameter file and STARTUP the instance in NOMOUNT mode.
CREATE SPFILE FROM PFILE=’/home/oracle/oracle/product/10.2.0/init.ora’;
STARTUP NOMOUNT
Now our instance started, SGA allocated and background processes started.
4. To create a new database, use the CREATE DATABASE statement. As a result, below files will be created:
-          Redo Log files
-          system.dbf and sysaux.dbf (files for SYSTEM tablespace)
-          undo01.dbf file (for UNDO tablespace)
-          temp_tbs.dbf file (for TEMPORARY tablespace)
-          users.dbf (for DEFAULT PERMANENT tablespace)
 
//######## Database Creation Code ####### 
CREATE DATABASE kamran
    USER SYS IDENTIFIED BY kamran
    USER SYSTEM IDENTIFIED BY kamran
LOGFILE GROUP 1 (’/home/oracle/oracle/product/10.2.0/oradata/redo01.log’) SIZE 50 m,
    GROUP 2 (’/home/oracle/oracle/product/10.2.0/oradata/redo02.log’) SIZE 50 m,
    GROUP 3 (’/home/oracle/oracle/product/10.2.0/oradata/redo03.log’) SIZE 50 m
    MAXLOGFILES 5
    MAXLOGMEMBERS 5
    MAXLOGHISTORY 1
   MAXDATAFILES 100
   MAXINSTANCES 1
   CHARACTER SET us7ascii
   NATIONAL CHARACTER SET al16utf16
   DATAFILE ‘/home/oracle/oracle/product/10.2.0/oradata/system01.dbf’ SIZE 325 m REUSE EXTENT MANAGEMENT LOCAL
   SYSAUX DATAFILE ‘/home/oracle/oracle/product/10.2.0/oradata/sysaux.dbf’ SIZE 400 m REUSE
    DEFAULT TABLESPACE tbs_1 DATAFILE ‘/home/oracle/oracle/product/10.2.0/oradata/users.dbf’ SIZE 200m REUSE AUTOEXTEND ON MAXSIZE UNLIMITED
    DEFAULT TEMPORARY TABLESPACE tempts1 TEMPFILE ‘/home/oracle/oracle/product/10.2.0/oradata/temp_tbs.dbf’ SIZE 20m REUSE
    undo TABLESPACE undotbs DATAFILE ‘/home/oracle/oracle/product/10.2.0/oradata/undo01.dbf’ SIZE 200m REUSE AUTOEXTEND ON MAXSIZE UNLIMITED
 5. Run the scripts necessary to build views, synonyms, and PL/SQL packages
CONNECT / AS SYSDBA
SQL>@$ORACLE_HOME/rdbms/admin/catalog.sql
SQL>@$ORACLE_HOME/rdbms/admin/catproc.sql
6. Shutdown the instance and startup the database. Your database is ready for use!

 

   

 Copyright © 1996 -2011 by Burleson Enterprises. All rights reserved.


Oracle® is the registered trademark of Oracle Corporation. SQL Server® is the registered trademark of Microsoft Corporation. 
Many of the designations used by computer vendors to distinguish their products are claimed as Trademarks