Showing posts with label Installation. Show all posts
Showing posts with label Installation. Show all posts

0 Insatalling oracle database

This is a post which shows how to install oracle software on linux machine

Logon to linux machine with root user and follow the below step
     
               # fdisk -l  ------>to see partations
     
create a directory path as follows(Oracle software location)

                #mkdir -p /oradb/app/oracle/product/11.2.0

create two groups

              #<groupadd> -g 1100 oinstall
        
              #groupadd -g 1101 dba
create user assign primary group as oinstall and secondary as dba
         
              #useradd -u 1002 -g 1100 -G 1101 -d /home/oracle -m oracle
Change the permissions of the group

               #chown -R oracle:oinstall  /oradb
               #chown -R oracle:dba      /diska /diskb

  Now switch to oracle user and do the following
                 # su - oracle
                 $DISPLAY=localhost:0.0 export DISPLAY----------------->to set display variable
                $SELINUX=DISABLE-------->to disable security enhance linux
                $xclock-------------->to check weather graphics properties are enable or not if enable clock will appear
 
Go to .bash_profile directory and set some environmental variables in that directory as follows
      $vi  .bash_profile
     export ORACLE_HOME=  <path where software is located>
     export  ORACLE_SID    =  <sid name>
     export    PATH                 =$ORACLE_HOME/bin:$PATH:.
   
         :wq!-------------save file

$ . .bash_profile------->to execute the file
$cd  /opt/linux/oracle11g/database------------>go to database  location directory in DVD

$ ls----------->here you can find runinstaller
$ . run installer--------------->execute this file

Now oracle window appears

Step 1

      Select stand alone server(2nd Option)

Step 2

     Database Software Only-------->next

Step 3

        Single Instance Database Installation

Step 4

       Language----------->English

Step 5

           Enterprise Edition

Step 6

             Oracle base: /oradb/app/oracle/product

              Software location :  /oradb/app/oracle/product/11.2.0/db

Step 7

     No change------------>next

Step 8  in this we will see one script file which is to be executed in another terminal.copy the file and paste in other terminal and press enter

          Now press check ignoreall option  and press next
Step 9   Click save response file after some time we will get two scrtips  which is to executed.

              Copy those  two files and execute in another terminal and installation will be done

Go to Install window and click

Step 10

       Finish

$ sqlplus / as sysdba--------------->to login to database
$ select instance,status from v$instance-------->to check weather database is installed
   

           

0 Installing RHEl5.3

Insert the linux bootable cd and restart ou personal computer.

Generally Installation go with two methods

1   Boot: Text
2   For GUI mode boot: Press enter

Step 1               Welcome to red hat linux server

                               press ok
Step 2                what language we want to work

                               English
Step 3               Which model keyboard we are using

                               US
Step 4               If already linux exists in our pc then it ask as
                                   Reinstall system
                                   Red hat linux es 4
 Step 5              Disk Partitioning setup(do as below)

       Mount point                  /                            6000mb
       Mount point                   /boot                    2500mb
       Mount point               /opt                         12000mb
       Mount point                  /usr                       7000mb
       Mount point                 /var                        6000mb
       Mount point                 /tmp                       3500
       Mount point               /disk1                      12000mb
       Mount point              /disk2                       8000mb
       Mount point               /disk3                       8000mb
       Mount point             swap                           twice of ram

Step 6       Which boot loader could you like to use

               (*)  Use grub boot loader
Step 7    Boot loader configuration

            No need to change anything(for kernels)

Step 8  Boot loader configuration

                   /dev/sda       (MBA)Master boot record

Step 9 Firewall
     
         No firewall
Step 10  Security enhanced linux
             Active
 Step 11   Language support
       
            English[USA]
Step 12  Time zone selection
     system clock user UTC

Step 13  root pasword

Step 14  package default

    Customize software selection-----------(select all packages)
 Step 15  Install to begin----->

Installation process will take some time
 



0 Database creation on linux


Database creation

Database can created in three different ways in oracle
1)DBCA(GUI interface creation)
2)OMF(Oracle Managed Files)
3)Manual Creation

Oracle supports some tools to create a database.But, here we are manually creating the database.
 Generally the home directory for oracle software is ORACLE_HOME.Different oracle versions are stored in this oracle_home directory

Manual Database creation:

Steps to create database manually

Step 1:  Set the environmental variables

  • environmental variables are nothing but a executable file
  • go to .bash_profile directory and set some environmental variables in that directory as follows
     export ORACLE_HOME=  <path where software is located>
     export  ORACLE_SID    =  <sid name>
     export    PATH                 =$ORACLE_HOME/bin:$PATH:.
   
         :wq!-------------save file
  • set the above environmental variables in .bash_profile directory and execute the file as follows
    $ . .bash_profile---------->to execute .bash_profile
    $echo $ORACLE_HOME------>to display contents in ORACLE_HOME

Step 2: Creating pfile(parameter file)  

$ cd ORACLE_HOME/dbs----->move to dbs directory where it is located in ORACLE_HOME
$ ls------>list all file in that directory
$ cp init.ora  init$ORACLE_SID.ora-------->copy init.ora file to init<SID NAME>.ora
$vi init<SID NAME>.ora--------------->open copied file and make changes as follows

  db_name=<SID NAME>

  control_file=/disk1/oradata/test_database/control.ctl------->create this directory path before editing this file
 diagnostic_dest=/disk1/oradata/test_database------->create directory path before editing this file

:wq!-------- >save file

Step 3: Script for creating database
  • Make a folder with name createdatabse.sql in /home location
  • Now enter into that folder and write script as follows
     create database <SID NAME>
    datafile '/disk1/oradata/test_database/system.dbf ' size 170m autoextended on
    sysaux datafile '/disk1/oradata/test_database/sysaux.dbf ' size 70m autoextended on
    undo tablespace  <Tablespace name>
   datafile  '/disk1/oradata/test_database/<tablespace name>.dbf ' size 30m
   default tablespace <Tablespace name>
   datafile  '/disk1/oradata/test_database/<tablespace name>.dbf ' size 40m
   default temporary tablespace<Tablespace name>
   tempfile '/disk1/oradata/test_database/<tablespace name>.dbf ' size 30m
   logfile
   group 1( '/disk1/oradata/test_database/redo1.log') size 4m,
   group 2( '/disk1/oradata/test_database/redo2.log') size 4m
   controlfile reuse;

:wq!------------->save the file

Step 4 : Script creating for base tables
 
  • Make a folder with name basetables.sql in /home location
  • Now enter into that folder and write script as follows
@$<path where oracle software is located>/rdbms/admin/catalog.sql----->(this is to create base tables upon that basetables it will create views upon the view it will create sysnonyms and grant some privilages for the user)
@$<path where oracle software is located>ORACLE_HOME/rdbms/admin/catproc.sql------>(this is to create packages and PL/SQL procedures)
conn system/manager------>to connect as admin user
@$<path where oracle software is located>ORACLE_HOME/sqlplus/admin/pupbld.sql ------->(to start sql*plus to all users)

Step 5 : connect to oracle database as follows
$ sqlplus / as sysdba-----> to connect to oracle database
sys> startup nomount  ---- - > to connect database in nomount state
sys> @createdatabase.sql ------ > run the script to create database
sys> @createbasetables.sql ------> run the script to create base tables
sys> select instance_name,status from v$instance;------>check the status after creating the databse


 

Oracle DBA Tutorial Copyright © 2011 - |- Template created by O Pregador - |- Powered by Blogger Templates