Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/bash
- # script for checking preferences, parameters, software etc in ubuntu 14.04 to 18.04 before installing the database oracle 11G XE
- # because this database is not licenced on ubuntu/debian some adjustments has to be done before installation
- # its not illegal, but oracle wont give any direct support.
- # changed since last version is check for /etc/sysconfig, lsb-functions, runlevels/graphical.target, environmrnt variables
- # and packages openssh-server, libglapi-mesa:i386, libwim-dev and libzthread-2.3-2
- # for version 1.2: description, removed libmagic package, created check for rc.local used in Ubuntu 16.04 and above
- # version 1.2
- # oracle need a connection to localhost somehow
- echo -e "-- ifconfig should show loopback interfaces like lo:0, lo:1 "
- ifconfig
- ip addr
- echo -e "\n -- hosts, should contain localhost adress to oracle"
- cat /etc/hosts | grep oracle
- echo -e "\n -- check if there is an alias for localhost called oracle"
- ping -c 1 oracle
- echo -e "\n-------------------------------------------------"
- # oracle need a lot of libs and programs not installed in default OS
- echo -e "\n -- check if all needed libraries and programs are installed: "
- dpkg -l gcc-multilib g++-multilib libc6-dev libc6-i386 libc6-dev-i386 libstdc++6:i386 | grep ii
- dpkg -l alien autoconf automake autotools-dev binutils build-essential bzip2 debhelper doxygen elfutils expat gawk | grep ii
- dpkg -l gettext gsfonts-x11 html2text intltool-debian ksh less lsb lsb-core | grep ii
- dpkg -l rlwrap sysstat unixodbc unixodbc-dev unzip zlibc | grep ii
- dpkg -l lib32z1 lib32z1-dev lib32ncurses5 libbz2-1.0:i386 libbz2-dev:i386 libaio1 libaio-dev libelf1 libelf-dev libbeecrypt7 libltdl-dev libmotif3 libmotif4 libodbcinstq4-1 | grep ii
- dpkg -l libpth-dev libpthread-stubs0-dev libpthread-workqueue0 libpthread-workqueue-dev libtiff5-dev libzthread-2.3-2 libzthread-dev libqt4-opengl:i386 | grep ii
- dpkg -l libodbcinstq4-1:i386 libcheese-gtk25 libclutter-gtk-1.0-0 libcogl15 libglu1-mesa:i386 | grep ii
- dpkg -l openssh-server libglapi-mesa:i386 | grep ii
- dpkg -l cabextract wimtools wimlib-dev libwim-dev | grep ii
- # oracle need at least oracles java 7
- echo -e "\n -- check java installed and with right version, should be oracle 8 "
- java -version
- echo -e "\n -- check for existence of some libraries: "
- ls -al /usr/lib/libpthread_nonshared.a
- ls -al /usr/lib64/libc_nonshared.a
- ls -al /usr/lib64/libpthread_nonshared.a
- ls -al /usr/lib64/libstdc++.so.6
- ls -al /lib64/libstdc++.so.6
- ls -al /lib64/libgcc_s.so.1
- echo -e "\n-------------------------------------------------"
- # oracle demands at least 2 GB swap
- echo -e "\n -- check if enough real swap memory exists, should be at least 2 Gb "
- swapon -s
- # oracle need a real mount point for memory, ubuntus symlink to /run/shm/
- echo -e "\n -- check if /dev/shm is a real directory(mount point) and not a symlink to /run/shm "
- ls -ald /dev/shm
- df -H /dev/shm
- echo -e "\n-------------------------------------------------"
- # because ubuntu has some programs in other dirs then oracles licenced ones
- echo -e "\n -- check for symlink to awk: "
- ls -ald /bin/awk
- echo -e "\n -- check for symlink to rpm: "
- ls -ald /bin/rpm
- echo -e "\n -- check for symlink to bash: "
- ls -ald /usr/bin/bash
- echo -e "\n -- check for symlink to basename: "
- ls -ald /bin/basename
- # check for existence of some configuration files and libraries, listing config files
- echo -e "\n -- check for existence and listing the file listener and its dir: "
- ls -al /var/lock/subsys/listener
- echo -e "\n -- in startup for Ubuntu 14.04, creates file 'listener' and its dir as well as a mount point for shared memory in rc2.d( runlevel 2 ): "
- ls -al /etc/rc2.d/S01shm_load
- cat /etc/rc2.d/S01shm_load
- echo -e "\n -- in startup for Ubuntu 14.04, creates file 'listener' and its dir as well as a mount point for shared memory in rc5.d( runlevel 5 ): "
- ls -al /etc/rc5.d/S01shm_load
- cat /etc/rc5.d/S01shm_load
- echo -e "\n -- in startup for Ubuntu 16.04 and above, creates file 'listener' using /etc/rc.local"
- ls -al /etc/rc.local
- cat /etc/rc.local
- systemctl status rc-local
- echo -e "\n -- check for existence and listing the upstart replacement to 'chkconfig', /sbin/chkconfig: "
- ls -al /sbin/chkconfig
- echo -e "\n -- check for existence of file /etc/sysconfig: "
- ls -al /etc/sysconfig
- echo -e "\n -- check for existence of some libraries, : "
- ls -al /usr/lib/libpthread_nonshared.a
- ls -al /usr/lib64/libc_nonshared.a
- ls -al /usr/lib64/libpthread_nonshared.a
- ls -al /usr/lib64/libstdc++.so.6
- ls -al /lib64/libstdc++.so.6
- ls -al /lib64/libgcc_s.so.1
- echo -e "\n -- check for existence of /etc/init.d/functions softlink to /lib/lsb/init-functions : "
- sudo ls -al /etc/init.d/functions
- echo -e "\n -- show files in /etc/sudoers.d and listing contents in file 'oracle' that ahould give group 'oinstall' root access: "
- ls -al /etc/sudoers.d
- cat /etc/sudoers.d/oracle
- echo -e "\n-------------------------------------------------"
- # some kernel parameters etc, that could need adjustments
- echo -e "\n -- check info about runlevel according to upstart, should be 5: "
- cat /etc/init/rc-sysinit.conf | grep DEFAULT_RUNLEVEL=
- echo -e "\n -- check info about runlevel with runlevel command, should be 5: "
- runlevel
- echo -e "\n -- check info about runlevel 5 counterpart in systemd, should be graphical.target: "
- systemctl get-default | grep graphical.target
- echo -e "\n -- max file descriptors, fs.file-max, should be 6815744: "
- sudo sysctl -q fs.file-max
- echo -e "\n -- alternative, file-max: "
- cat /proc/sys/fs/file-max
- echo -e "\n -- max number of concurrent outstanding I/O requests, fs.aio-max-nrp, should be 1048576: "
- sudo sysctl -q fs.aio-max-nr
- echo -e "\n -- core dump mode for setuids etc, fs.suid_dumpable, should be : 1"
- sudo sysctl -q fs.suid_dumpable
- echo -e "\n -- largest SGA defined on database server, kernel.shmmax, should be 1073741824:"
- sudo sysctl -q kernel.shmmax
- echo -e "\n -- alternative, shmmax: "
- cat /proc/sys/kernel/shmmax
- echo -e "\n -- sum of all the shared memory segments on database server, kernel.shmall, should be 524288: "
- sudo sysctl -q kernel.shmall
- echo -e "\n -- alternative, shmall: "
- cat /proc/sys/kernel/shmall
- echo -e "\n -- max number of shared memory segments, kernel.shmmni, should be 4096: "
- sudo sysctl -q kernel.shmmni
- echo -e "\n -- semafores for semmsl, semmns, semopm and semmni, kernel.sem, should be 250 32000 100 128: "
- sudo sysctl -q kernel.sem
- echo -e "\n -- net.ipv4.ip_local_port_range, should be 9000 65500: "
- sudo sysctl -q net.ipv4.ip_local_port_range
- echo -e "\n -- net.core.rmem_default, should be 262144: "
- sudo sysctl -q net.core.rmem_default
- echo -e "\n -- net.core.rmem_max, should be 4194304: "
- sudo sysctl -q net.core.rmem_max
- echo -e "\n -- net.core.wmem_default, should be 262144: "
- sudo sysctl -q net.core.wmem_default
- echo -e "\n -- net.core.wmem_max, should be 1048576: "
- sudo sysctl -q net.core.wmem_max
- echo -e "\n -- hugetlb_shm_group, should be 1001: "
- sudo sysctl -q vm.hugetlb_shm_group
- echo -e "\n-------------------------------------------------"
- # user specific settings
- echo -e "\n -- check umask for current user, should be 022 for oracle: "
- umask
- # oracle need higher limits on open files, processes and stacksizes then in standard installation
- echo -e "\n -- maximum file open limit for current user: "
- ulimit -n
- echo -e "\n -- maximum user processes for current user: "
- ulimit u
- echo -e "\n -- oracle limits for processes and open files as well as stacksize in /etc/security/limits.d/oracle.conf, should be 2047/16384, 1024/65535 and 10240 "
- cat /etc/security/limits.d/oracle.conf
- echo -e "\n -- oracle limits for processes and open files as well as stacksize in /etc/security/limits.conf, should be 2047/16384, 1024/65535 and 10240 "
- cat /etc/security/limits.conf | grep oracle
- echo -e "\n -- check existence of session required for 'pam_limits.so' "
- cat /etc/pam.d/common-session | grep pam_limits.so
- echo -e "\n -- check existence of session required for 'pam_limits.so' "
- cat /etc/pam.d/common-session-noninteractive | grep pam_limits.so
- echo -e "\n-------------------------------------------------"
- # oracle of course needs an user and installation group as well as installation and home dirs .
- echo -e "\n -- check existence of installation dirs '/u01/app/oracle' and '/u02/oradata': "
- sudo ls -al /u01/app/oracle
- sudo ls -al /u02/oradata
- echo -e "\n -- check existence of group 'oinstall': "
- cat /etc/group | grep oin
- echo -e "\n -- check ownership for user 'oracle' : "
- cat /etc/passwd | grep ora
- id oracle
- # environment variables set after installation
- echo -e "\n -- check environment variables, like ORACLE_HOME, : "
- printenv | grep ORAC*
- printenv | grep NLS*
- printenv | grep SID*
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement