星期二, 3月 28, 2017

Oracle Linux 7 Install Oracle Database 11.2.0.4 方法

ref:

https://docs.oracle.com/database/122/CWLIN/disabling-transparent-hugepages.htm

 

Transparent HugePages memory is disabled by default in UEK2 and later UEK kernels.

--------------------------------------------------------------------------------------------------------

Quick Reference to Patch Numbers for Database/GI PSU, SPU(CPU), Bundle Patches and Patchsets (Doc ID 1454618.1)

 

Patch 13390677: 11.2.0.4.0 PATCH SET FOR ORACLE DATABASE SERVER

Currently, the Oracle Database 11.2.0.4 files are not available to download from the usual Oracle Technology Network (OTN) area, instead you have to log into My Oracle Support (MOS) and search for patch number '13390677'.  It's probably worth mentioning at this point, that the 'patch' is a full install, despite the reference – so you don't need to download Oracle Database 11.2.0.2 files in addition here 😉

 

Once you've searched for the 'patch', select the link appropriate to your platform, in this case 'Linux x86-64'.  When you click download, there will be a total of 7 zip files available.  For a standard installation, you only need zip parts 1 and 2…

 

p13390677_112040_platform_1of7.zip (Oracle Database, including Oracle RAC components)

p13390677_112040_platform_2of7.zip (Oracle Database, including Oracle RAC components)

p13390677_112040_platform_3of7.zip (Oracle Grid Infrastructure, includes: Oracle ASM, Oracle Clusterware, Oracle Restart)

p13390677_112040_platform_4of7.zip (Oracle Database Client)

p13390677_112040_platform_5of7.zip (Oracle Gateways)

p13390677_112040_platform_6of7.zip (Oracle Examples)

p13390677_112040_platform_7of7.zip (Deinstall)

 

--------------------------------------------------------------------------------------------------------

 

 

[root@testdb11g source]#

#Hyper-V mount iso 好像怪怪的 所以直接把OEL 7.2 iso copy/source去進行掛載

 

mount -t iso9660 -o loop /source/V100082-01.iso /media/rhel7

 

ref: https://access.redhat.com/solutions/23016

cd /media/rhel7/Packages

 

[root@testdb11g Packages]# yum install createrepo

Loaded plugins: langpacks, ulninfo

Resolving Dependencies

--> Running transaction check

---> Package createrepo.noarch 0:0.9.9-23.el7 will be updated

---> Package createrepo.noarch 0:0.9.9-26.el7 will be an update

--> Finished Dependency Resolution

 

Dependencies Resolved

 

=====================================================================================================

Package                 Arch                Version                   Repository               Size

=====================================================================================================

Updating:

createrepo              noarch              0.9.9-26.el7              ol7_latest               92 k

 

Transaction Summary

=====================================================================================================

Upgrade  1 Package

 

Total size: 92 k

Is this ok [y/d/N]: y

Downloading packages:

warning: /var/cache/yum/x86_64/7Server/ol7_latest/packages/createrepo-0.9.9-26.el7.noarch.rpm: Header

V3 RSA/SHA256 Signature, key ID ec551f03: NOKEY

Retrieving key from file:///etc/pki/rpm-gpg/RPM-GPG-KEY-oracle

Importing GPG key 0xEC551F03:

Userid     : "Oracle OSS group (Open Source Software group) <build@oss.oracle.com>"

Fingerprint: 4214 4123 fecf c55b 9086 313d 72f9 7b74 ec55 1f03

Package    : 7:oraclelinux-release-7.2-1.0.5.el7.x86_64 (@anaconda/7.2)

From       : /etc/pki/rpm-gpg/RPM-GPG-KEY-oracle

Is this ok [y/N]: y

Running transaction check

Running transaction test

Transaction test succeeded

Running transaction

  Updating   : createrepo-0.9.9-26.el7.noarch                                                    1/2

  Cleanup    : createrepo-0.9.9-23.el7.noarch                                                    2/2

  Verifying  : createrepo-0.9.9-26.el7.noarch                                                    1/2

  Verifying  : createrepo-0.9.9-23.el7.noarch                                                    2/2

 

Updated:

  createrepo.noarch 0:0.9.9-26.el7                                                                   

 

Complete!

 

cd  /etc/yum.repos.d

mv public-yum-ol7.repo public-yum-ol7.orig

vi local.repo

 

[local]

name=local

gpgcheck=0

baseurl=file:///media/rhel7

 

yum list

 

yum install compat-libstdc++* -y

yum install binutils -y

yum install compat-libcap* -y

yum install gcc-4.8.5 -y

yum install glibc -y

yum install glibc-devel -y

yum install ksh -y

yum install libaio -y

yum install libaio-devel -y

yum install libgcc -y

yum install libstdc++ -y

yum install libstdc++-devel -y

yum install libXi -y

yum install libXtst -y

yum install make -y

yum install sysstat -y

yum install elfutils -y

yum install elfutils-libelf-devel -y

yum install xorg-x11-apps -y

 

[root@testdb11g source]# yum install oracle-rdbms-server-12cR1-preinstall.x86_64   or yum install oracle-rdbms-server-11gR2-preinstall.x86_64

Loaded plugins: langpacks, ulninfo

Resolving Dependencies

--> Running transaction check

---> Package oracle-rdbms-server-12cR1-preinstall.x86_64 0:1.0-4.el7 will be installed

--> Processing Dependency: gcc-c++ for package: oracle-rdbms-server-12cR1-preinstall-1.0-4.el7.x86_64

--> Running transaction check

---> Package gcc-c++.x86_64 0:4.8.5-4.el7 will be installed

--> Finished Dependency Resolution

 

Dependencies Resolved

 

===============================================================================================================================================================================================

Package                                                            Arch                                 Version                                     Repository                           Size

===============================================================================================================================================================================================

Installing:

oracle-rdbms-server-12cR1-preinstall                               x86_64                               1.0-4.el7                                   local                                18 k

Installing for dependencies:

gcc-c++                                                            x86_64                               4.8.5-4.el7                                 local                               7.2 M

 

Transaction Summary

===============================================================================================================================================================================================

Install  1 Package (+1 Dependent package)

 

Total download size: 7.2 M

Installed size: 16 M

Is this ok [y/d/N]: y

Downloading packages:

-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

Total                                                                                                                                                          107 MB/s | 7.2 MB  00:00:00    

Running transaction check

Running transaction test

Transaction test succeeded

Running transaction

  Installing : gcc-c++-4.8.5-4.el7.x86_64                                                                                                                                                  1/2

  Installing : oracle-rdbms-server-12cR1-preinstall-1.0-4.el7.x86_64                                                                                                                       2/2

  Verifying  : oracle-rdbms-server-12cR1-preinstall-1.0-4.el7.x86_64                                                                                                                       1/2

  Verifying  : gcc-c++-4.8.5-4.el7.x86_64                                                                                                                                                  2/2

 

Installed:

  oracle-rdbms-server-12cR1-preinstall.x86_64 0:1.0-4.el7                                                                                                                                     

 

Dependency Installed:

  gcc-c++.x86_64 0:4.8.5-4.el7                                                                                                                                                                 

 

Complete!

 

-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

if OS is Redhat Enterprise Linux 6/ Redhat Enterprise Linux 7 :

Ref https://blacksaildivision.com/how-to-disable-transparent-huge-pages-on-centos

 

How to disable THP manually?

 

Append followings in /etc/rc.local:

 

if test -f /sys/kernel/mm/transparent_hugepage/enabled; then

    echo never > /sys/kernel/mm/transparent_hugepage/enabled

fi

-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

 

https://oracle-base.com/articles/11g/oracle-db-11gr2-installation-on-oracle-linux-6

 

Add or amend the following lines in the "/etc/sysctl.conf" file.

 

fs.suid_dumpable = 1

fs.aio-max-nr = 1048576

fs.file-max = 6815744

kernel.shmall = 2097152

kernel.shmmax = 536870912

kernel.shmmni = 4096

# semaphores: semmsl, semmns, semopm, semmni

kernel.sem = 250 32000 100 128

net.ipv4.ip_local_port_range = 9000 65500

net.core.rmem_default=262144

net.core.rmem_max=4194304

net.core.wmem_default=262144

net.core.wmem_max=1048586

 

Create the new groups and users.

 

groupadd -g 501 oinstall

groupadd -g 502 dba

#groupadd -g 503 oper

#groupadd -g 504 asmadmin

#groupadd -g 506 asmdba

#groupadd -g 505 asmoper

 

#useradd -u 502 -g oinstall -G dba,asmdba,oper oracle

#useradd -u 502 -g oinstall -G dba oracle

[root@testdb11g kernel]# passwd oracle

Changing password for user oracle.

New password: welcome1

BAD PASSWORD: The password fails the dictionary check - it is based on a dictionary word

Retype new password: welcome1

passwd: all authentication tokens updated successfully.

[root@testdb11g kernel]#

 

vi /etc/security/limits.d/20-nproc.conf

# Default limit for number of user's processes to prevent

# accidental fork bombs.

# See rhbz #432903 for reasoning.

 

*          soft    nproc     4096 ->16384

root       soft    nproc     unlimited

 

Set secure Linux to permissive by editing the "/etc/selinux/config" file, making sure the SELINUX flag is set as follows.

 

SELINUX=permissive

 

 

mkdir -p /u01/app/oracle/product/11.2.0/db_1

chown -R oracle:oinstall /u01

chmod -R 775 /u01

 

Login as the oracle user and add the following lines at the end of the ".bash_profile" file.

 

# Oracle Settings

TMP=/tmp; export TMP

TMPDIR=$TMP; export TMPDIR

 

ORACLE_HOSTNAME=ol6-112.localdomain; export ORACLE_HOSTNAME

ORACLE_UNQNAME=DB11G; export ORACLE_UNQNAME

ORACLE_BASE=/u01/app/oracle; export ORACLE_BASE

ORACLE_HOME=$ORACLE_BASE/product/11.2.0/db_1; export ORACLE_HOME

ORACLE_SID=DB11G; export ORACLE_SID

 

PATH=/usr/sbin:$PATH; export PATH

PATH=$ORACLE_HOME/bin:$PATH; export PATH

 

LD_LIBRARY_PATH=$ORACLE_HOME/lib:/lib:/usr/lib; export LD_LIBRARY_PATH

CLASSPATH=$ORACLE_HOME/jlib:$ORACLE_HOME/rdbms/jlib; export CLASSPATH

 

 

chown -R oracle:oinstall /source

 

Log in as oracle user "

/source/database/runInstaller

 

 

#ref https://oracle-base.com/articles/11g/oracle-db-11gr2-installation-on-oracle-linux-7

During the link phase you will encounter an error invoking the "ins_emagent.mk" file. To fix this, edit the "$ORACLE_HOME/sysman/lib/ins_emagent.mk", doing a search and replace for the line shown below.

 

FROM:

$(MK_EMAGENT_NMECTL)

TO  :

$(MK_EMAGENT_NMECTL) -lnnz11

 

Click the "Retry" button.

 

 

[root@testdb11g ~]# /u01/app/oraInventory/orainstRoot.sh

Changing permissions of /u01/app/oraInventory.

Adding read,write permissions for group.

Removing read,write,execute permissions for world.

 

Changing groupname of /u01/app/oraInventory to oinstall.

The execution of the script is complete.

[root@testdb11g ~]# /u01/app/oracle/product/11.2.0/db_1/root.sh

Running Oracle 11g root script...

 

The following environment variables are set as:

    ORACLE_OWNER= oracle

    ORACLE_HOME=  /u01/app/oracle/product/11.2.0/db_1

 

Enter the full pathname of the local bin directory: [/usr/local/bin]:

   Copying dbhome to /usr/local/bin ...

   Copying oraenv to /usr/local/bin ...

   Copying coraenv to /usr/local/bin ...

 

 

Creating /etc/oratab file...

Entries will be added to the /etc/oratab file as needed by

Database Configuration Assistant when a database is created

Finished running generic part of root script.

Now product-specific root actions will be performed.

Finished product-specific root actions.

[root@testdb11g ~]#

 

 

沒有留言:

LinkWithin-相關文件

Related Posts Plugin for WordPress, Blogger...