Advertisement
FolkeLarsson

check_params_in_ubuntu14_before_installing_oracle11g_xe.sh

Dec 4th, 2017
558
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 8.85 KB | None | 0 0
  1. #!/bin/bash
  2. # script for checking preferences, parameters, software etc in ubuntu 14.04 to 18.04 before installing the database oracle 11G XE
  3. # because this database is not licenced on ubuntu/debian some adjustments has to be done before installation
  4. # its not illegal, but oracle wont give any direct support.
  5. # changed since last version is check for /etc/sysconfig, lsb-functions, runlevels/graphical.target, environmrnt variables
  6. #  and packages openssh-server, libglapi-mesa:i386, libwim-dev and libzthread-2.3-2
  7. # for version 1.2: description, removed libmagic package, created check for rc.local used in Ubuntu 16.04 and above
  8. # version 1.2
  9.  
  10. # oracle need a connection to localhost somehow
  11. echo -e "-- ifconfig should show loopback interfaces like lo:0, lo:1 "
  12. ifconfig
  13. ip addr
  14.  
  15. echo -e "\n -- hosts, should contain localhost adress to oracle"
  16. cat /etc/hosts | grep oracle
  17.  
  18. echo -e "\n -- check if there is an alias for localhost called oracle"
  19. ping -c 1 oracle
  20.  
  21. echo -e "\n-------------------------------------------------"
  22.  
  23. # oracle need a lot of libs and programs not installed in default OS
  24. echo -e "\n -- check if all needed libraries and programs are installed: "
  25.  
  26. dpkg -l gcc-multilib g++-multilib libc6-dev libc6-i386 libc6-dev-i386 libstdc++6:i386 | grep ii
  27.  
  28. dpkg -l alien autoconf automake autotools-dev binutils build-essential bzip2 debhelper doxygen elfutils expat gawk | grep ii
  29.  
  30. dpkg -l gettext gsfonts-x11 html2text intltool-debian ksh less lsb lsb-core | grep ii
  31.  
  32. dpkg -l rlwrap sysstat unixodbc unixodbc-dev unzip zlibc | grep ii
  33.  
  34. 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
  35.  
  36. 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
  37.  
  38. dpkg -l libodbcinstq4-1:i386 libcheese-gtk25 libclutter-gtk-1.0-0 libcogl15 libglu1-mesa:i386 | grep ii
  39.  
  40. dpkg -l openssh-server libglapi-mesa:i386  | grep ii
  41.  
  42. dpkg -l cabextract wimtools wimlib-dev libwim-dev | grep ii
  43.  
  44. # oracle need at least oracles java 7
  45. echo -e "\n -- check java installed and with right version, should be oracle 8 "
  46. java -version
  47.  
  48. echo -e "\n -- check for existence of some libraries: "
  49.  ls -al /usr/lib/libpthread_nonshared.a
  50.  ls -al /usr/lib64/libc_nonshared.a
  51.  ls -al /usr/lib64/libpthread_nonshared.a
  52.  ls -al /usr/lib64/libstdc++.so.6
  53.  ls -al /lib64/libstdc++.so.6
  54.  ls -al /lib64/libgcc_s.so.1
  55.  
  56. echo -e "\n-------------------------------------------------"
  57.  
  58. # oracle demands at least 2 GB swap
  59. echo -e "\n -- check if enough real swap memory exists, should be at least 2 Gb "
  60. swapon -s
  61.  
  62. # oracle need a real mount point for memory, ubuntus symlink to /run/shm/
  63. echo -e "\n -- check if /dev/shm is a real directory(mount point) and not a symlink to /run/shm "
  64. ls -ald /dev/shm
  65. df -H /dev/shm
  66.  
  67. echo -e "\n-------------------------------------------------"
  68.  
  69.  
  70.  
  71. # because ubuntu has some programs in other dirs then oracles licenced ones
  72. echo -e "\n -- check for symlink to awk: "
  73. ls -ald /bin/awk
  74.  
  75. echo -e "\n -- check for symlink to rpm: "
  76. ls -ald /bin/rpm
  77.  
  78. echo -e "\n -- check for symlink to bash: "
  79. ls -ald /usr/bin/bash
  80.  
  81. echo -e "\n -- check for symlink to basename: "
  82. ls -ald /bin/basename
  83.  
  84.  
  85. # check for existence of some configuration files and libraries, listing config files
  86. echo -e "\n -- check for existence and listing the file listener and its dir: "
  87. ls -al /var/lock/subsys/listener
  88.  
  89. 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 ):  "
  90. ls -al /etc/rc2.d/S01shm_load
  91. cat /etc/rc2.d/S01shm_load
  92.  
  93. 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 ): "
  94. ls -al /etc/rc5.d/S01shm_load
  95. cat  /etc/rc5.d/S01shm_load
  96.  
  97. echo -e "\n -- in startup for Ubuntu 16.04 and above, creates file 'listener' using /etc/rc.local"
  98. ls -al /etc/rc.local
  99. cat /etc/rc.local
  100. systemctl status rc-local
  101.  
  102. echo -e "\n -- check for existence and listing the upstart replacement to 'chkconfig', /sbin/chkconfig: "
  103. ls -al /sbin/chkconfig
  104.  
  105. echo -e "\n -- check for existence of file /etc/sysconfig: "
  106. ls -al /etc/sysconfig
  107.  
  108. echo -e "\n -- check for existence of some libraries, : "
  109.  ls -al /usr/lib/libpthread_nonshared.a
  110.  ls -al /usr/lib64/libc_nonshared.a
  111.  ls -al /usr/lib64/libpthread_nonshared.a
  112.  ls -al /usr/lib64/libstdc++.so.6
  113.  ls -al /lib64/libstdc++.so.6
  114.  ls -al /lib64/libgcc_s.so.1
  115.  
  116. echo -e "\n -- check for existence of /etc/init.d/functions softlink to /lib/lsb/init-functions : "
  117. sudo ls -al /etc/init.d/functions
  118.  
  119. echo -e "\n -- show files in /etc/sudoers.d and listing contents in file 'oracle' that ahould give group 'oinstall' root access: "
  120. ls -al /etc/sudoers.d
  121. cat /etc/sudoers.d/oracle
  122.  
  123. echo -e "\n-------------------------------------------------"
  124.  
  125.  
  126. # some kernel parameters etc, that could need adjustments
  127. echo -e "\n -- check info about runlevel according to upstart, should be 5: "
  128. cat /etc/init/rc-sysinit.conf | grep DEFAULT_RUNLEVEL=
  129.  
  130. echo -e "\n -- check info about runlevel with runlevel command, should be 5: "
  131. runlevel
  132.  
  133. echo -e "\n -- check info about runlevel 5 counterpart in systemd, should be graphical.target: "
  134. systemctl get-default | grep graphical.target
  135.  
  136. echo -e "\n -- max file descriptors, fs.file-max, should be 6815744: "
  137. sudo sysctl -q fs.file-max
  138.  
  139. echo -e "\n -- alternative, file-max: "
  140. cat /proc/sys/fs/file-max
  141.  
  142. echo -e "\n -- max number of concurrent outstanding I/O requests, fs.aio-max-nrp, should be 1048576: "
  143. sudo sysctl -q fs.aio-max-nr
  144.  
  145. echo -e "\n -- core dump mode for setuids etc, fs.suid_dumpable, should be : 1"
  146. sudo sysctl -q fs.suid_dumpable
  147.  
  148. echo -e "\n -- largest SGA defined on database server, kernel.shmmax, should be 1073741824:"
  149. sudo sysctl -q kernel.shmmax
  150.  
  151. echo -e "\n -- alternative, shmmax: "
  152. cat /proc/sys/kernel/shmmax
  153.  
  154. echo -e "\n -- sum of all the shared memory segments on database server, kernel.shmall, should be 524288: "
  155. sudo sysctl -q kernel.shmall
  156.  
  157. echo -e "\n -- alternative, shmall: "
  158. cat /proc/sys/kernel/shmall
  159.  
  160. echo -e "\n -- max number of shared memory segments, kernel.shmmni, should be 4096: "
  161. sudo sysctl -q kernel.shmmni
  162.  
  163. echo -e "\n -- semafores for semmsl, semmns, semopm and semmni, kernel.sem, should be 250 32000 100 128: "
  164. sudo sysctl -q kernel.sem
  165.  
  166. echo -e "\n -- net.ipv4.ip_local_port_range, should be 9000 65500: "
  167. sudo sysctl -q net.ipv4.ip_local_port_range
  168.  
  169. echo -e "\n -- net.core.rmem_default, should be 262144: "
  170. sudo sysctl -q net.core.rmem_default
  171.  
  172. echo -e "\n -- net.core.rmem_max, should be 4194304: "
  173. sudo sysctl -q net.core.rmem_max
  174.  
  175. echo -e "\n -- net.core.wmem_default, should be 262144: "
  176. sudo sysctl -q net.core.wmem_default
  177.  
  178. echo -e "\n -- net.core.wmem_max, should be 1048576:  "
  179. sudo sysctl -q net.core.wmem_max
  180.  
  181. echo -e "\n -- hugetlb_shm_group, should be 1001: "
  182. sudo sysctl -q vm.hugetlb_shm_group
  183.  
  184. echo -e "\n-------------------------------------------------"
  185.  
  186.  
  187. # user specific settings
  188.  
  189. echo -e "\n -- check umask for current user, should be 022 for oracle: "
  190. umask
  191.  
  192.  
  193. # oracle need higher limits on open files, processes and stacksizes then in standard installation
  194. echo -e "\n -- maximum file open limit for current user: "
  195. ulimit -n
  196.  
  197. echo -e "\n -- maximum user processes for current user: "
  198. ulimit u
  199.  
  200. 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 "
  201. cat /etc/security/limits.d/oracle.conf
  202.  
  203. 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 "
  204. cat /etc/security/limits.conf | grep oracle
  205.  
  206. echo -e "\n -- check existence of session required for 'pam_limits.so' "
  207. cat /etc/pam.d/common-session | grep pam_limits.so
  208.  
  209. echo -e "\n -- check existence of session required for 'pam_limits.so' "
  210. cat /etc/pam.d/common-session-noninteractive | grep pam_limits.so
  211.  
  212. echo -e "\n-------------------------------------------------"
  213.  
  214.  
  215. # oracle of course needs an user and installation group as well as installation and home dirs .
  216. echo -e "\n -- check existence of installation dirs '/u01/app/oracle' and '/u02/oradata': "
  217. sudo ls -al /u01/app/oracle
  218. sudo ls -al /u02/oradata
  219.  
  220. echo -e "\n -- check existence of group 'oinstall': "
  221. cat /etc/group | grep oin
  222.  
  223. echo -e "\n -- check ownership for user 'oracle' : "
  224. cat /etc/passwd | grep ora
  225. id oracle
  226.  
  227.  
  228. # environment variables set after installation
  229. echo -e "\n -- check environment variables, like ORACLE_HOME, : "
  230. printenv | grep ORAC*
  231. printenv | grep NLS*
  232. printenv | grep SID*
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement