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 18c 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 bc net-tools autoconf automake autotools-dev alien binutils doxygen elfutils expat
- dpkg -l gawk ksh pax perl-doc smartmontools sysstat keyutils lsb lsb-core
- dpkg -l bind9utils libbind9-160 unixodbc unixodbc-dev x11-utils xauth zlibc
- dpkg -l build-essential libpthread-stubs0-dev gcc gcc-8 g++ libstdc++5 libgfortran3
- dpkg -l libaio-dev targetcli-fb unixodbc unixodbc-dev libfontconfig1-dev libelf-dev gssproxy nfs-kernel-server
- dpkg -l libjpeg-turbo8 libjpeg62 libpcre16-3 libpng16-16 libtiff5 libmotif-common libmotif-dev pixz xz-utils
- dpkg -l libcap2 libdmx1 libice6 libsm6 libverto-libevent1 librdmacm-dev libpath-utils1 libref-array1 libx11-dev
- dpkg -l libxau6 libxext6 libxmu6 libxt6 libxi6 libxi-dev libxtst6 libxtst-dev libini-config5 libnfsidmap2
- dpkg -l libtiff5 libtirpc1 libbasicobjects0 libcollection4 libini-config5 libnfsidmap2 libwrap0-dev libblkid-dev libtirpc1
- dpkg -l libxinerama1 libxxf86vm1 libxxf86dga1 libxv1 libxrender1 libxrender-dev libxrandr2 libxcb1
- dpkg -l libpthread-workqueue0 libpthread-workqueue-dev libzthread-dev libuil4
- dpkg -l bsd-mailx quota rpcbind zlibc rpm rpm-common rpcbind rlwrap
- dpkg -l lm-sensors pixz mksh targetcli-fb psmisc quota xz-utils
- dpkg -l gcc-multilib g++-multilib lib32ncurses5 lib32z1 elfutils:i386 libelf-dev:i386 libaio-dev:i386 libcap2:i386 libx11-6:i386 libxau6:i386
- dpkg -l libxtst6:i386 libxcb1:i386 libxi6:i386 libpcre32-3 libjpeg62:i386 libjpeg-turbo8 libjpeg62:i386 libjpeg62:i386 lib32z1-dev libglu1-mesa:i386 libbz2-dev:i386
- dpkg -l openssh-server libglapi-mesa:i386 | grep ii
- # oracle need at least oracles java 8, but java 11 is to prefer
- 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 11G need a real mount point for memory, ubuntus symlink to /run/shm/, but not 18c, so this could be unneccesary
- 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 -- system swappiness that should not occur to often, should be 1: "
- sudo sysctl -q vm.swappiness
- echo -e "\n -- percent 'dirty pages' in mem before flush, that has to be low, should be 3: "
- sudo sysctl -q vm.dirty_background_ratio
- echo -e "\n -- max mem in cache before writing to disk, should be 80: "
- sudo sysctl -q vm.dirty_ratio
- echo -e "\n -- how long 'dirty pages' can be in cache before written to disk, should be 500: "
- sudo sysctl -q vm.dirty_expire_centisecs
- echo -e "\n -- how often checks if mem should be written to disk occurs, should be 100: "
- sudo sysctl -q vm.dirty_writeback_centisecs
- echo -e "\n -- Reverse Path Forwarding, 'loose mode as defined in RFC 3704', should be 2: "
- sudo sysctl -q net.ipv4.conf.all.rp_filter
- echo -e "\n -- Reverse Path Forwarding, 'loose mode as defined in RFC 3704', should be 2: "
- sudo sysctl -q net.ipv4.conf.default.rp_filter
- 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, open files, stacksize, memlock and core in /etc/security/limits.d/oracle.conf, should be 24096/16384, 8192/65536, 10240/32768, 3145728/3145728, unlimited/unlimited "
- cat /etc/security/limits.d/oracle.conf
- echo -e "\n -- oracle limits for processes, open files, stacksize, memlock and core in /etc/security/limits.conf, should be 4096/16384, 8192/65536, 10240/32768, 3145728/3145728, unlimited/unlimited "
- 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 '/opt/oracle' and '/opt/oradata/oradata': "
- sudo ls -al /opt/oracle
- sudo ls -al /opt/oracle/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