aboutsummaryrefslogtreecommitdiff
path: root/system/oracle-xe/doinst.sh
diff options
context:
space:
mode:
authorDhabyX <slack.dhabyx@gmail.com>2016-08-02 00:33:03 +0700
committerWilly Sudiarto Raharjo <willysr@slackbuilds.org>2016-08-03 07:29:30 +0700
commita06f065001ac20c01dc321623ad8bc0e4fa406da (patch)
treeb5e82e7a0a948514c4c782796d5a53b67ce62bdc /system/oracle-xe/doinst.sh
parent7f392e61526e595e55534725085b3d33679cf68c (diff)
system/oracle-xe: Added (Oracle Database Express Edition).
Signed-off-by: Willy Sudiarto Raharjo <willysr@slackbuilds.org>
Diffstat (limited to 'system/oracle-xe/doinst.sh')
-rw-r--r--system/oracle-xe/doinst.sh41
1 files changed, 41 insertions, 0 deletions
diff --git a/system/oracle-xe/doinst.sh b/system/oracle-xe/doinst.sh
new file mode 100644
index 0000000000000..563eeec10eeca
--- /dev/null
+++ b/system/oracle-xe/doinst.sh
@@ -0,0 +1,41 @@
+VERSION="11.2.0"
+
+config() {
+ NEW="$1"
+ OLD="$(dirname $NEW)/$(basename $NEW .new)"
+ if [ ! -r $OLD ]; then
+ mv $NEW $OLD
+ elif [ "$(cat $OLD | md5sum)" = "$(cat $NEW | md5sum)" ]; then
+ rm $NEW
+ fi
+}
+
+config etc/sysctl.d/10-oracle.xe.conf.new
+
+if [ -x /usr/bin/update-desktop-database ]; then
+ /usr/bin/update-desktop-database -q usr/share/applications >/dev/null 2>&1
+fi
+
+if ! grep /u01/app/oracle/product/${VERSION}/xe/lib etc/ld.so.conf 1> /dev/null 2> /dev/null ; then
+ echo "/u01/app/oracle/product/${VERSION}/xe/lib" >> etc/ld.so.conf
+fi
+
+if [ -x /sbin/ldconfig ]; then
+ /sbin/ldconfig 2> /dev/null
+fi
+
+
+# from rpm oracle scripts
+availphymem=`cat /proc/meminfo | grep '^MemTotal' | awk '{print $2}'`
+availphymem=`echo $availphymem / 1024 | bc`
+memory_target=`echo 0.40 \* $availphymem | bc | sed "s/\..*//"`
+
+if [ $memory_target -gt 1024 ];
+then
+ memory_target=`echo 1024 \* 1048576 | bc`
+else
+ memory_target=`echo $memory_target \* 1048576 | bc`
+fi
+
+sed -i "s/%memory_target%/$memory_target/g" u01/app/oracle/product/${VERSION}/xe/config/scripts/init.ora
+sed -i "s/%memory_target%/$memory_target/g" u01/app/oracle/product/${VERSION}/xe/config/scripts/initXETemp.ora