Advertisement
FolkeLarsson

check_params_oracle18cxe_ubuntu18

Apr 16th, 2019
400
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 10.47 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 18c 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 bc net-tools autoconf automake autotools-dev alien binutils doxygen elfutils expat
  27.  
  28. dpkg -l gawk ksh pax perl-doc smartmontools sysstat keyutils lsb lsb-core
  29.  
  30. dpkg -l bind9utils libbind9-160 unixodbc unixodbc-dev x11-utils xauth zlibc
  31.  
  32. dpkg -l build-essential libpthread-stubs0-dev gcc gcc-8 g++ libstdc++5 libgfortran3
  33.  
  34. dpkg -l libaio-dev targetcli-fb unixodbc unixodbc-dev libfontconfig1-dev libelf-dev gssproxy nfs-kernel-server
  35.  
  36. dpkg -l libjpeg-turbo8 libjpeg62 libpcre16-3 libpng16-16 libtiff5 libmotif-common libmotif-dev pixz xz-utils
  37.  
  38. dpkg -l libcap2 libdmx1 libice6 libsm6 libverto-libevent1 librdmacm-dev libpath-utils1 libref-array1 libx11-dev
  39.  
  40. dpkg -l libxau6 libxext6 libxmu6 libxt6 libxi6 libxi-dev libxtst6 libxtst-dev libini-config5 libnfsidmap2
  41.  
  42. dpkg -l libtiff5 libtirpc1 libbasicobjects0 libcollection4 libini-config5 libnfsidmap2 libwrap0-dev libblkid-dev libtirpc1
  43.  
  44. dpkg -l libxinerama1 libxxf86vm1 libxxf86dga1 libxv1 libxrender1 libxrender-dev libxrandr2 libxcb1
  45.  
  46. dpkg -l libpthread-workqueue0 libpthread-workqueue-dev libzthread-dev libuil4
  47.  
  48. dpkg -l bsd-mailx quota rpcbind zlibc rpm rpm-common rpcbind rlwrap
  49.  
  50. dpkg -l lm-sensors pixz mksh targetcli-fb psmisc quota xz-utils
  51.  
  52. dpkg -l gcc-multilib g++-multilib lib32ncurses5 lib32z1 elfutils:i386 libelf-dev:i386 libaio-dev:i386 libcap2:i386 libx11-6:i386  libxau6:i386
  53.  
  54. 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
  55.  
  56. dpkg -l openssh-server libglapi-mesa:i386  | grep ii
  57.  
  58.  
  59. # oracle need at least oracles java 8, but java 11 is to prefer
  60. echo -e "\n -- check java installed and with right version, should be oracle 8 "
  61. java -version
  62.  
  63. echo -e "\n -- check for existence of some libraries: "
  64.  ls -al /usr/lib/libpthread_nonshared.a
  65.  ls -al /usr/lib64/libc_nonshared.a
  66.  ls -al /usr/lib64/libpthread_nonshared.a
  67.  ls -al /usr/lib64/libstdc++.so.6
  68.  ls -al /lib64/libstdc++.so.6
  69.  ls -al /lib64/libgcc_s.so.1
  70.  
  71. echo -e "\n-------------------------------------------------"
  72.  
  73. # oracle demands at least 2 GB swap
  74. echo -e "\n -- check if enough real swap memory exists, should be at least 2 Gb "
  75. swapon -s
  76.  
  77. # oracle 11G need a real mount point for memory, ubuntus symlink to /run/shm/, but not 18c, so this could be unneccesary
  78. echo -e "\n -- check if /dev/shm is a real directory(mount point) and not a symlink to /run/shm "
  79. ls -ald /dev/shm
  80. df -H /dev/shm
  81.  
  82. echo -e "\n-------------------------------------------------"
  83.  
  84.  
  85.  
  86. # because ubuntu has some programs in other dirs then oracles licenced ones
  87. echo -e "\n -- check for symlink to awk: "
  88. ls -ald /bin/awk
  89.  
  90. echo -e "\n -- check for symlink to rpm: "
  91. ls -ald /bin/rpm
  92.  
  93. echo -e "\n -- check for symlink to bash: "
  94. ls -ald /usr/bin/bash
  95.  
  96. echo -e "\n -- check for symlink to basename: "
  97. ls -ald /bin/basename
  98.  
  99.  
  100. # check for existence of some configuration files and libraries, listing config files
  101. echo -e "\n -- check for existence and listing the file listener and its dir: "
  102. ls -al /var/lock/subsys/listener
  103.  
  104. 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 ):  "
  105. ls -al /etc/rc2.d/S01shm_load
  106. cat /etc/rc2.d/S01shm_load
  107.  
  108. 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 ): "
  109. ls -al /etc/rc5.d/S01shm_load
  110. cat  /etc/rc5.d/S01shm_load
  111.  
  112. echo -e "\n -- in startup for Ubuntu 16.04 and above, creates file 'listener' using /etc/rc.local"
  113. ls -al /etc/rc.local
  114. cat /etc/rc.local
  115. systemctl status rc-local
  116.  
  117. echo -e "\n -- check for existence and listing the upstart replacement to 'chkconfig', /sbin/chkconfig: "
  118. ls -al /sbin/chkconfig
  119.  
  120. echo -e "\n -- check for existence of file /etc/sysconfig: "
  121. ls -al /etc/sysconfig
  122.  
  123. echo -e "\n -- check for existence of some libraries, : "
  124.  ls -al /usr/lib/libpthread_nonshared.a
  125.  ls -al /usr/lib64/libc_nonshared.a
  126.  ls -al /usr/lib64/libpthread_nonshared.a
  127.  ls -al /usr/lib64/libstdc++.so.6
  128.  ls -al /lib64/libstdc++.so.6
  129.  ls -al /lib64/libgcc_s.so.1
  130.  
  131. echo -e "\n -- check for existence of /etc/init.d/functions softlink to /lib/lsb/init-functions : "
  132. sudo ls -al /etc/init.d/functions
  133.  
  134. echo -e "\n -- show files in /etc/sudoers.d and listing contents in file 'oracle' that ahould give group 'oinstall' root access: "
  135. ls -al /etc/sudoers.d
  136. cat /etc/sudoers.d/oracle
  137.  
  138. echo -e "\n-------------------------------------------------"
  139.  
  140.  
  141. # some kernel parameters etc, that could need adjustments
  142. echo -e "\n -- check info about runlevel according to upstart, should be 5: "
  143. cat /etc/init/rc-sysinit.conf | grep DEFAULT_RUNLEVEL=
  144.  
  145. echo -e "\n -- check info about runlevel with runlevel command, should be 5: "
  146. runlevel
  147.  
  148. echo -e "\n -- check info about runlevel 5 counterpart in systemd, should be graphical.target: "
  149. systemctl get-default | grep graphical.target
  150.  
  151. echo -e "\n -- max file descriptors, fs.file-max, should be 6815744: "
  152. sudo sysctl -q fs.file-max
  153.  
  154. echo -e "\n -- alternative, file-max: "
  155. cat /proc/sys/fs/file-max
  156.  
  157. echo -e "\n -- max number of concurrent outstanding I/O requests, fs.aio-max-nrp, should be 1048576: "
  158. sudo sysctl -q fs.aio-max-nr
  159.  
  160. echo -e "\n -- core dump mode for setuids etc, fs.suid_dumpable, should be : 1"
  161. sudo sysctl -q fs.suid_dumpable
  162.  
  163. echo -e "\n -- largest SGA defined on database server, kernel.shmmax, should be 1073741824:"
  164. sudo sysctl -q kernel.shmmax
  165.  
  166. echo -e "\n -- alternative, shmmax: "
  167. cat /proc/sys/kernel/shmmax
  168.  
  169. echo -e "\n -- sum of all the shared memory segments on database server, kernel.shmall, should be 524288: "
  170. sudo sysctl -q kernel.shmall
  171.  
  172. echo -e "\n -- alternative, shmall: "
  173. cat /proc/sys/kernel/shmall
  174.  
  175. echo -e "\n -- max number of shared memory segments, kernel.shmmni, should be 4096: "
  176. sudo sysctl -q kernel.shmmni
  177.  
  178. echo -e "\n -- semafores for semmsl, semmns, semopm and semmni, kernel.sem, should be 250 32000 100 128: "
  179. sudo sysctl -q kernel.sem
  180.  
  181. echo -e "\n -- net.ipv4.ip_local_port_range, should be 9000 65500: "
  182. sudo sysctl -q net.ipv4.ip_local_port_range
  183.  
  184. echo -e "\n -- net.core.rmem_default, should be 262144: "
  185. sudo sysctl -q net.core.rmem_default
  186.  
  187. echo -e "\n -- net.core.rmem_max, should be 4194304: "
  188. sudo sysctl -q net.core.rmem_max
  189.  
  190. echo -e "\n -- net.core.wmem_default, should be 262144: "
  191. sudo sysctl -q net.core.wmem_default
  192.  
  193. echo -e "\n -- net.core.wmem_max, should be 1048576:  "
  194. sudo sysctl -q net.core.wmem_max
  195.  
  196.  
  197.  
  198.  
  199. echo -e "\n -- system swappiness that should not occur to often, should be 1: "
  200. sudo sysctl -q vm.swappiness
  201.  
  202. echo -e "\n -- percent 'dirty pages' in mem before flush, that has to be low, should be 3: "
  203. sudo sysctl -q vm.dirty_background_ratio
  204.  
  205. echo -e "\n -- max mem in cache before writing to disk, should be 80: "
  206. sudo sysctl -q vm.dirty_ratio
  207.  
  208. echo -e "\n -- how long 'dirty pages' can be in cache before written to disk, should be 500: "
  209. sudo sysctl -q vm.dirty_expire_centisecs
  210.  
  211. echo -e "\n -- how often checks if mem should be written to disk occurs, should be 100: "
  212. sudo sysctl -q vm.dirty_writeback_centisecs
  213.  
  214. echo -e "\n -- Reverse Path Forwarding, 'loose mode as defined in RFC 3704', should be 2: "
  215. sudo sysctl -q net.ipv4.conf.all.rp_filter
  216.  
  217. echo -e "\n -- Reverse Path Forwarding, 'loose mode as defined in RFC 3704', should be 2: "
  218. sudo sysctl -q net.ipv4.conf.default.rp_filter
  219.  
  220.  
  221.  
  222.  
  223.  
  224. echo -e "\n-------------------------------------------------"
  225.  
  226.  
  227. # user specific settings
  228.  
  229. echo -e "\n -- check umask for current user, should be 022 for oracle: "
  230. umask
  231.  
  232.  
  233. # oracle need higher limits on open files, processes and stacksizes then in standard installation
  234. echo -e "\n -- maximum file open limit for current user: "
  235. ulimit -n
  236.  
  237. echo -e "\n -- maximum user processes for current user: "
  238. ulimit u
  239.  
  240. 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 "
  241. cat /etc/security/limits.d/oracle.conf
  242.  
  243. 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 "
  244. cat /etc/security/limits.conf | grep oracle
  245.  
  246. echo -e "\n -- check existence of session required for 'pam_limits.so' "
  247. cat /etc/pam.d/common-session | grep pam_limits.so
  248.  
  249. echo -e "\n -- check existence of session required for 'pam_limits.so' "
  250. cat /etc/pam.d/common-session-noninteractive | grep pam_limits.so
  251.  
  252. echo -e "\n-------------------------------------------------"
  253.  
  254.  
  255. # oracle of course needs an user and installation group as well as installation and home dirs .
  256. echo -e "\n -- check existence of installation dirs '/opt/oracle' and '/opt/oradata/oradata': "
  257. sudo ls -al /opt/oracle
  258. sudo ls -al /opt/oracle/oradata
  259.  
  260. echo -e "\n -- check existence of group 'oinstall': "
  261. cat /etc/group | grep oin
  262.  
  263. echo -e "\n -- check ownership for user 'oracle' : "
  264. cat /etc/passwd | grep ora
  265. id oracle
  266.  
  267.  
  268. # environment variables set after installation
  269. echo -e "\n -- check environment variables, like ORACLE_HOME, : "
  270. printenv | grep ORAC*
  271. printenv | grep NLS*
  272. printenv | grep SID*
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement