OracleDB: Unterschied zwischen den Versionen

Aus Info-Theke
Zur Navigation springen Zur Suche springen
Zeile 4: Zeile 4:
* Als root: /etc/init.d/oracle-xe configure
* Als root: /etc/init.d/oracle-xe configure
* service oracle-xe start
* service oracle-xe start
= Environment für Kommandos =
<pre>ORACLE_HOME=/u01/app/oracle/product/11.2.0/xe
ORACLE_SID=xe
ORA_BIN=/u01/app/oracle/product/11.2.0/xe/bin
</pre>


= User anlegen =
= User anlegen =

Version vom 14. Februar 2017, 21:15 Uhr

Installation Oracle XE 11g

  • Minimum: 2G Swap, Paket: bc muss existieren
  • Als root: /etc/init.d/oracle-xe configure
  • service oracle-xe start

Environment für Kommandos

ORACLE_HOME=/u01/app/oracle/product/11.2.0/xe
ORACLE_SID=xe
ORA_BIN=/u01/app/oracle/product/11.2.0/xe/bin

User anlegen

#! /bin/bash
if [ "$1" = "" ] ; then
  echo "usage create_user <user> [<password>]"
else
  CODE=$2
  test -z "$CODE" && CODE=$1
  test -d "$ORACLE_HOME" || export ORACLE_HOME=/u01/app/oracle/product/11.2.0/xe
  test -z "$ORACE_SID" || export ORACLE_SID=xe
  SCRIPT=/tmp/_create_user.inp
  test -f $SCRIPT && rm -rf $SCRIPT
  echo "CREATE USER $1 IDENTIFIED BY "$CODE" QUOTA 50M ON SYSTEM;" >>$SCRIPT
  echo "GRANT CREATE SESSION TO $1;" >>$SCRIPT
  echo "GRANT CREATE table TO $1;" >>$SCRIPT
  echo "quit" >>$SCRIPT
  sqlplus "SYS/SYS@xe AS SYSDBA" < $SCRIPT
  rm -rf $SCRIPT
fi