Il y a 389 articles et 19 utilisateurs inscrits (ce bandeau est défini dans MediaWiki:Sitenotice)

« Oracle » : différence entre les versions

De AJLSM
Aller à la navigation Aller à la recherche
Ctate (discussion | contributions)
Aucun résumé des modifications
Ctate (discussion | contributions)
 
Ligne 93 : Ligne 93 :
if [ -z "$AWK" ]; then AWK=awk; fi
if [ -z "$AWK" ]; then AWK=awk; fi
if [ -z "$SU" ];then SU=su; fi
if [ -z "$SU" ];then SU=su; fi
</syntaxhighlight>
Aussi, commenter le "exit 1" dans le fonction configure() :
<syntaxhighlight lang="bash">
configure()
{
        if test -f "$CONFIGURATION"
        then
                echo "Oracle Database 11g Express Edition is already configured"
#      exit 1
        fi
</syntaxhighlight>
</syntaxhighlight>



Dernière version du 5 novembre 2013 à 12:23

Installer Oracle sur Ubuntu

[modifier | modifier le wikicode]

Il faut créer un fichier /sbin/chkconfig qui contient :

#!/bin/bash
# Oracle 11gR2 XE installer chkconfig hack for Debian by Dude
file=/etc/init.d/oracle-xe
if [[ ! `tail -n1 $file | grep INIT` ]]; then
   echo >> $file
   echo '### BEGIN INIT INFO' >> $file
   echo '# Provides:             OracleXE' >> $file
   echo '# Required-Start:       $remote_fs $syslog' >> $file
   echo '# Required-Stop:        $remote_fs $syslog' >> $file
   echo '# Default-Start:        2 3 4 5' >> $file
   echo '# Default-Stop:         0 1 6' >> $file
   echo '# Short-Description:    Oracle 11g Express Edition' >> $file
   echo '### END INIT INFO' >> $file
fi
update-rc.d oracle-xe defaults 80 01

Il faut créer un fichier /etc/init.d/oracle-shm qui contient :

#! /bin/sh 
# /etc/init.d/oracle-shm 
# 
# 
case "$1" in
  start) 
    echo "Starting script /etc/init.d/oracle-shm"
    # Run only once at system startup 
    if [ -e /dev/shm/.oracle-shm ]; then
      echo "/dev/shm is already mounted, nothing to do"
    else
      rm -f /dev/shm
      mkdir /dev/shm
      mount --move /run/shm /dev/shm
      mount -B /dev/shm /run/shm
      touch /dev/shm/.oracle-shm 
    fi
    ;; 
  stop) 
    echo "Stopping script /etc/init.d/oracle-shm"
    echo "Nothing to do"
    ;; 
  *) 
    echo "Usage: /etc/init.d/oracle-shm {start|stop}"
    exit 1 
    ;; 
esac 
# 
### BEGIN INIT INFO 
# Provides:          oracle-shm 
# Required-Start:    $remote_fs $syslog 
# Required-Stop:     $remote_fs $syslog 
# Default-Start:     2 3 4 5 
# Default-Stop:      0 1 6 
# Short-Description: Bind /run/shm to /dev/shm at system startup. 
# Description:       Fix to allow Oracle 11g use AMM. 
### END INIT INFO
sudo chmod 755 /sbin/chkconfig
sudo chmod 755 /etc/init.d/oracle-shm
unzip oracle-xe-11.2.0-1.0.x86_64.rpm.zip
cd Disk1/
sudo alien --scripts oracle-xe-11.2.0-1.0.x86_64.rpm
# sudo alien -i oracle-xe-11.2.0-1.0.x86_64.rpm
dpkg --install ./oracle-xe_11.2.0-2_amd64.deb
sudo chown -R ctate /u01/app/oracle
sudo chgrp -R ctate /u01/app/oracle
chmod u+x /u01/app/oracle/product/11.2.0/xe/config/scripts/*.sh
sudo addgroup dba
sudo usermod -a -G dba ctate
sudo chmod u+x /etc/init.d/oracle-xe
sudo mkdir /var/lock/subsys
mkdir /u01/app/oracle/product/11.2.0/xe/network/log

Il faut modifier le fichier sudo vi /etc/init.d/oracle-xe

if [ -z "$CHOWN" ]; then CHOWN=chown; fi
if [ -z "$CHMOD" ]; then CHMOD=chmod; fi
if [ -z "$HOSTNAME" ]; then HOSTNAME=hostname; fi
if [ -z "$NSLOOKUP" ]; then NSLOOKUP=nslookup; fi
if [ -z "$GREP" ]; then GREP=grep; fi
if [ ! -f "$GREP" ]; then GREP=grep; fi
if [ -z "$SED" ]; then SED=sed; fi
if [ -z "$AWK" ]; then AWK=awk; fi
if [ -z "$SU" ];then SU=su; fi

Aussi, commenter le "exit 1" dans le fonction configure() :

configure()
{
        if test -f "$CONFIGURATION"
        then
                echo "Oracle Database 11g Express Edition is already configured"
#       exit 1
        fi

Ajouter ces choses dans ~/.profile

export ORACLE_SID=XE
export ORACLE_HOME=/u01/app/oracle/product/11.2.0/xe
export PATH=.:$PATH:$ORACLE_HOME/bin:$ORACLE_HOME/config/scripts
sudo /etc/init.d/oracle-xe configure
  • Specify the HTTP port that will be used for Oracle Application Express [8080]:20180
  • Specify a port that will be used for the database listener [1521]:20121
  • Enter password:
  • Confirm the password:
  • Do you want Oracle Database 11g Express Edition to be started on boot (y/n) [y]:n

Pour démarrer la base de données Oracle :

startdb.sh
lsnrctl start

Pour connecter avec sqlplus vers Oracle :