An RPM consists of a .spec file, which contains the configuration details for the RPM. I
The rpm can be built with the following command:
cd ~/rpmbuild/$VERSION/
rpmbuild -ba --define "_topdir $PWD" --clean SPECS/epmvirt.spec
Building will generate a new RPM package such as:
epmvirt-11.1.2.4.0-4.x86_64.rpm
The spec file is split into a few basic sections. The top contains basic info on the version and prerequisites for the package.
The %pre section setups up the oracle user and dba group for the Oracle database installation.
The main purpose of the RPM is to lay out the automation scripts needed to build EPM. The %install section lays out the files onto the user's system. The %files section defines the files that are part of the rpm.
Finally, the post section kicks off the first automation script, which is desribed in more detail below.
The spec file contents look like this:
[root@localhost SPECS]# cat epmvirt.specSummary: Virtual EnvironmentName: epmvirtVersion: 11.1.2.4.0Release: 4License: GPLGroup: Oracle EPMURL: epm-errors.blogspot.comSource0: %{name}-%{version}.tar.gzBuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-rootRequires: unixODBC, openssl098e, numactl, zip, emacs, unzip, xauth, xdpyinfo, compat-libcap1, libstdc++-devel, sysstat, gcc, gcc-c++, ksh, libaio, libaio-devel, lsof, /usr/lib/libg.a, /lib/libgcc_s.so.1, /usr/lib/libnss_compat.so, /usr/lib/libstdc++.so.5, /usr/lib/libstdc++.so.6, /usr/lib64/libnsl.so, /usr/lib64/libstdc++.so.5%description%preprm -rf $RPM_BUILD_ROOT%setup -q%pregroupadd -f dbagroupadd -f oinstallid -u oracle &>/dev/null || useradd -G dba oracle%build%install# dirsinstall -m 0755 -d $RPM_BUILD_ROOT/u0install -m 0755 -d $RPM_BUILD_ROOT/u0/automationinstall -m 0755 -d $RPM_BUILD_ROOT/u0/installinstall -m 0755 -d $RPM_BUILD_ROOT/u0/install/downloadsinstall -m 0755 -d $RPM_BUILD_ROOT/u0/automation/rootinstall -m 0755 -d $RPM_BUILD_ROOT/u0/automation/epminstall -m 0755 -d $RPM_BUILD_ROOT/u0/automation/epm/boost_libsinstall -m 0755 -d $RPM_BUILD_ROOT/u0/automation/appsinstall -m 0755 -d $RPM_BUILD_ROOT/u0/automation/database# filesinstall -m 0755 u0/automation/startAll.sh $RPM_BUILD_ROOT/u0/automationinstall -m 0755 u0/automation/startDB.sh $RPM_BUILD_ROOT/u0/automationinstall -m 0755 u0/automation/startDB.sql $RPM_BUILD_ROOT/u0/automationinstall -m 0755 u0/automation/root/start.sh $RPM_BUILD_ROOT/u0/automation/rootinstall -m 0755 u0/automation/root/start_main.sh $RPM_BUILD_ROOT/u0/automation/rootinstall -m 0755 u0/automation/root/startOver.sh $RPM_BUILD_ROOT/u0/automation/rootinstall -m 0755 u0/automation/database/db.rsp $RPM_BUILD_ROOT/u0/automation/databaseinstall -m 0755 u0/automation/database/ENV.env $RPM_BUILD_ROOT/u0/automation/databaseinstall -m 0755 u0/automation/database/init.ora $RPM_BUILD_ROOT/u0/automation/databaseinstall -m 0755 u0/automation/database/installDB_1.sql $RPM_BUILD_ROOT/u0/automation/databaseinstall -m 0755 u0/automation/database/install_DB_create_db.sql $RPM_BUILD_ROOT/u0/automation/databaseinstall -m 0755 u0/automation/database/install_DB_create_objects.sql $RPM_BUILD_ROOT/u0/automation/databaseinstall -m 0755 u0/automation/database/listener.ora $RPM_BUILD_ROOT/u0/automation/databaseinstall -m 0755 u0/automation/database/sqlnet.ora $RPM_BUILD_ROOT/u0/automation/databaseinstall -m 0755 u0/automation/database/tnsnames.ora $RPM_BUILD_ROOT/u0/automation/databaseinstall -m 0755 u0/automation/database/installDB.sh $RPM_BUILD_ROOT/u0/automation/databaseinstall -m 0755 u0/automation/database/installDB_main.sh $RPM_BUILD_ROOT/u0/automation/databaseinstall -m 0755 u0/automation/database/dropAll.sql $RPM_BUILD_ROOT/u0/automation/databaseinstall -m 0755 u0/automation/database/recreateDB.sh $RPM_BUILD_ROOT/u0/automation/databaseinstall -m 0755 u0/automation/epm/EPMconfig_Essbase.xml $RPM_BUILD_ROOT/u0/automation/epminstall -m 0755 u0/automation/epm//EPMconfig_Disc.xml $RPM_BUILD_ROOT/u0/automation/epminstall -m 0755 u0/automation/epm/EPMconfig_CalcMgr.xml $RPM_BUILD_ROOT/u0/automation/epminstall -m 0755 u0/automation/epm/EPMconfig_ReconfigWeb.xml $RPM_BUILD_ROOT/u0/automation/epminstall -m 0755 u0/automation/epm/EPMconfig_RA.xml $RPM_BUILD_ROOT/u0/automation/epminstall -m 0755 u0/automation/epm/EPMconfig_Profit.xml $RPM_BUILD_ROOT/u0/automation/epminstall -m 0755 u0/automation/epm/EPMconfig_Plan.xml $RPM_BUILD_ROOT/u0/automation/epminstall -m 0755 u0/automation/epm/EPMconfig_HFM.xml $RPM_BUILD_ROOT/u0/automation/epminstall -m 0755 u0/automation/epm/EPMconfig_Foundation.xml $RPM_BUILD_ROOT/u0/automation/epminstall -m 0755 u0/automation/epm/EPMconfig_FDMEE.xml $RPM_BUILD_ROOT/u0/automation/epminstall -m 0755 u0/automation/epm/EPMconfig_EssbaseStudio.xml $RPM_BUILD_ROOT/u0/automation/epminstall -m 0755 u0/automation/epm/silentInstall.xml $RPM_BUILD_ROOT/u0/automation/epminstall -m 0755 u0/automation/epm/installAll.sh $RPM_BUILD_ROOT/u0/automation/epminstall -m 0755 u0/automation/epm/installAll_main.sh $RPM_BUILD_ROOT/u0/automation/epminstall -m 0755 u0/automation/epm/configAll.sh $RPM_BUILD_ROOT/u0/automation/epminstall -m 0755 u0/automation/epm/configAll_main.sh $RPM_BUILD_ROOT/u0/automation/epminstall -m 0755 u0/automation/epm/boost_libs/libboost_date_time.so.1.48.0 $RPM_BUILD_ROOT/u0/automation/epm/boost_libsinstall -m 0755 u0/automation/epm/boost_libs/libboost_filesystem.so.1.48.0 $RPM_BUILD_ROOT/u0/automation/epm/boost_libsinstall -m 0755 u0/automation/epm/boost_libs/libboost_locale.so.1.48.0 $RPM_BUILD_ROOT/u0/automation/epm/boost_libsinstall -m 0755 u0/automation/epm/boost_libs/libboost_regex.so.1.48.0 $RPM_BUILD_ROOT/u0/automation/epm/boost_libsinstall -m 0755 u0/automation/epm/boost_libs/libboost_system.so.1.48.0 $RPM_BUILD_ROOT/u0/automation/epm/boost_libsinstall -m 0755 u0/automation/epm/boost_libs/libboost_thread.so.1.48.0 $RPM_BUILD_ROOT/u0/automation/epm/boost_libsinstall -m 0755 u0/automation/epm/boost_libs/hfm_post_install_steps.sh $RPM_BUILD_ROOT/u0/automation/epm/boost_libsinstall -m 0755 u0/automation/epm/boost_libs/hfm_post_install_steps_helper.sh $RPM_BUILD_ROOT/u0/automation/epm/boost_libsinstall -m 0755 u0/automation/epm/boost_libs/odbc.ini $RPM_BUILD_ROOT/u0/automation/epm/boost_libsinstall -m 0755 u0/automation/apps/createApps.sh $RPM_BUILD_ROOT/u0/automation/appsinstall -m 0755 u0/automation/apps/insertPlanDS.sh $RPM_BUILD_ROOT/u0/automation/appsinstall -m 0755 u0/automation/apps/insertPlanDS.sql $RPM_BUILD_ROOT/u0/automation/appsinstall -m 0755 u0/automation/apps/loadPlanData.maxl $RPM_BUILD_ROOT/u0/automation/appsinstall -m 0755 u0/automation/apps/PLANDEMO.zip $RPM_BUILD_ROOT/u0/automation/appsinstall -m 0755 u0/automation/apps/RA.zip $RPM_BUILD_ROOT/u0/automation/appsinstall -m 0755 u0/automation/apps/pwgen.java $RPM_BUILD_ROOT/u0/automation/appsinstall -m 0755 u0/automation/apps/ImportHFM1.xml $RPM_BUILD_ROOT/u0/automation/appsinstall -m 0755 u0/automation/apps/HFM-COMMA4DIM.zip $RPM_BUILD_ROOT/u0/automation/appsinstall -m 0755 u0/automation/apps/HFMTuning.sh $RPM_BUILD_ROOT/u0/automation/appsinstall -m 0755 u0/automation/apps/HFMTuning.sql $RPM_BUILD_ROOT/u0/automation/appsinstall -m 0755 u0/automation/extractFiles.py $RPM_BUILD_ROOT/u0/automationinstall -m 0755 u0/automation/extractFiles.sh $RPM_BUILD_ROOT/u0/automationinstall -m 0755 u0/automation/buildEPMvirt.sh $RPM_BUILD_ROOT/u0/automationinstall -m 0755 u0/automation/buildEPMvirt.py $RPM_BUILD_ROOT/u0/automationinstall -m 0755 u0/automation/restartEPM.sh $RPM_BUILD_ROOT/u0/automation%clean%files%defattr(-,oracle,dba,-)%dir /u0%dir /u0/automation%dir /u0/install%dir /u0/install/downloads%dir /u0/automation/root%dir /u0/automation/database%dir /u0/automation/epm%dir /u0/automation/epm/boost_libs/u0/automation/startAll.sh/u0/automation/startDB.sh/u0/automation/startDB.sql/u0/automation/root/start.sh/u0/automation/root/start_main.sh/u0/automation/root/startOver.sh/u0/automation/database/db.rsp/u0/automation/database/ENV.env/u0/automation/database/init.ora/u0/automation/database/installDB_1.sql/u0/automation/database/install_DB_create_db.sql/u0/automation/database/install_DB_create_objects.sql/u0/automation/database/listener.ora/u0/automation/database/sqlnet.ora/u0/automation/database/tnsnames.ora/u0/automation/database/installDB.sh/u0/automation/database/installDB_main.sh/u0/automation/database/dropAll.sql/u0/automation/database/recreateDB.sh/u0/automation/epm/EPMconfig_Essbase.xml/u0/automation/epm/EPMconfig_Disc.xml/u0/automation/epm/EPMconfig_CalcMgr.xml/u0/automation/epm/EPMconfig_ReconfigWeb.xml/u0/automation/epm/EPMconfig_RA.xml/u0/automation/epm/EPMconfig_Profit.xml/u0/automation/epm/EPMconfig_Plan.xml/u0/automation/epm/EPMconfig_HFM.xml/u0/automation/epm/EPMconfig_Foundation.xml/u0/automation/epm/EPMconfig_FDMEE.xml/u0/automation/epm/EPMconfig_EssbaseStudio.xml/u0/automation/epm/silentInstall.xml/u0/automation/epm/installAll.sh/u0/automation/epm/installAll_main.sh/u0/automation/epm/configAll.sh/u0/automation/epm/configAll_main.sh/u0/automation/epm/boost_libs/libboost_date_time.so.1.48.0/u0/automation/epm/boost_libs/libboost_filesystem.so.1.48.0/u0/automation/epm/boost_libs/libboost_locale.so.1.48.0/u0/automation/epm/boost_libs/libboost_regex.so.1.48.0/u0/automation/epm/boost_libs/libboost_system.so.1.48.0/u0/automation/epm/boost_libs/libboost_thread.so.1.48.0/u0/automation/epm/boost_libs/hfm_post_install_steps.sh/u0/automation/epm/boost_libs/hfm_post_install_steps_helper.sh/u0/automation/epm/boost_libs/odbc.ini/u0/automation/apps/createApps.sh/u0/automation/apps/insertPlanDS.sh/u0/automation/apps/insertPlanDS.sql/u0/automation/apps/loadPlanData.maxl/u0/automation/apps/PLANDEMO.zip/u0/automation/apps/RA.zip/u0/automation/apps/pwgen.java/u0/automation/apps/ImportHFM1.xml/u0/automation/apps/HFM-COMMA4DIM.zip/u0/automation/apps/HFMTuning.sh/u0/automation/apps/HFMTuning.sql/u0/automation/extractFiles.py/u0/automation/extractFiles.sh/u0/automation/buildEPMvirt.sh/u0/automation/buildEPMvirt.py/u0/automation/restartEPM.sh%doc%postcd /u0/automation/root./start.sh%changelog* Thu Oct 23 2014 root <root@localhost.localdomain> -- Initial build.# Don't try fancy stuff like debuginfo, which is useless on binary-only# packages. Don't strip binary too# Be sure buildpolicy set to do nothing%define __spec_install_post %{nil}%define debug_package %{nil}%define __os_install_post %{_dbpath}/brp-compress
Finally,
cd /u0/automation/root
./start.shkicks off start_main.sh with the log going to /u0/automation/root/start.log
#!/bin/bash
echo oracle | passwd oracle --stdin
mkdir /u0
mkdir /u0/install
chown -R oracle:dba /u0
# add sudo ability for oracle root.sh scripts
chmod 700 /etc/sudoers
echo "oracle ALL=NOPASSWD: /u0/app/oracle/product/12.1.0/dbhome_1/root.sh" >> /etc/sudoers
echo "oracle ALL=NOPASSWD: /u0/app/oraInventory/orainstRoot.sh" >> /etc/sudoers
# allow non-tty sudo for startup of oracle services as root in rc.local
perl -p -i -e 's/Defaults\s+requiretty/\#Defaults requiretty/g' /etc/sudoers
chmod 440 /etc/sudoers
echo "oracle soft nproc 2047" >> /etc/security/limits.conf
echo "oracle hard nproc 16384" >> /etc/security/limits.conf
echo "oracle soft nofile 1024" >> /etc/security/limits.conf
echo "oracle hard nofile 65536" >> /etc/security/limits.conf
echo "session required pam_limits.so" >> /etc/pam.d/login
echo "fs.aio-max-nr = 1048576" >> /etc/sysctl.conf
echo "fs.file-max = 6815744" >> /etc/sysctl.conf
echo "kernel.shmall = 2097152" >> /etc/sysctl.conf
echo "kernel.shmmax = 2684329984" >> /etc/sysctl.conf
echo "kernel.shmmni = 4096" >> /etc/sysctl.conf
echo "kernel.sem = 250 32000 100 128" >> /etc/sysctl.conf
echo "net.ipv4.ip_local_port_range = 9000 65500" >> /etc/sysctl.conf
echo "net.core.rmem_default = 262144" >> /etc/sysctl.conf
echo "net.core.rmem_max = 4194304" >> /etc/sysctl.conf
echo "net.core.wmem_default = 262144" >> /etc/sysctl.conf
echo "net.core.wmem_max = 1048576" >> /etc/sysctl.conf
/sbin/sysctl -p
echo "oracle soft nproc 2047" >> /etc/security/limits.conf
echo "oracle hard nproc 16384" >> /etc/security/limits.conf
echo "oracle soft nofile 4096" >> /etc/security/limits.conf
echo "oracle hard nofile 65536" >> /etc/security/limits.conf
echo "oracle soft stack 10240" >> /etc/security/limits.conf
echo "source /home/oracle/*.env" >> /home/oracle/.bashrc
echo "ulimit -n 10000" >> /home/oracle/.bashrc
echo "nohup sudo -u oracle -i /u0/automation/startAll.sh &" >> /etc/rc.local
# needed for WL admin server.
echo "127.0.0.1 epmvirt" >> /etc/hosts
chkconfig iptables off
service iptables stop
ln -s /u0/install/downloads/ /home/oracle/downloads
ln -s /u0/automation/buildEPMvirt.sh /bin/buildEPMvirt
What's going on?
- Give oracle user the ability to do sudo for running "root.sh" during the Oracle installation
- Setup kernel parameters for Oracle and EPM
- Add startAll.sh to rc.local file to start EPM on boot
The other important thing the RPM does is setup the file system structure under /u0 and give rights to the oracle user. At this point, the root user has given all the necessary security and rights to the oracle user to perform the remaining installs. The rest of the installation is done as the oracle user.
Now that we understand how the OS was installed, and the EPMVirt RPM, the next thing to understand is the actual automation scripts. These scripts perform all of the actual installation and configuration tasks. Details will come in the next post...
This is something worth sharing. I am amazed to see how well you organized post on Create your own Oracle Hyperion Virtual Environment.
ReplyDelete