Install Oracle database under Linux

Source: Internet
Author: User
Tags dba

Original source http://www.linuxidc.com/Linux/2015-02/113222.html

Need to install Oracle DataGuard, so first install a single oracle11g, below is the detailed installation process of Linux under a single oracle11g.

1, installation Environment

Hardware environment: 2 Linux virtual machines, CentOS6.4, 4G, 4 cores, disk 50G


Oracle software version:

Linux.x64_11gR2_database_1of2.zip

Linux.x64_11gR2_database_2of2.zip

is: Http://pan.baidu.com/s/1bappO

Rlwrap Software Installation Reference: http://www.linuxidc.com/Linux/2013-01/77198.htm

Oracle 11gR2 RAC Real-time application cluster http://www.linuxidc.com/Linux/2015-01/111298.htm

Install Oracle 11gR2 (x64) http://www.linuxidc.com/Linux/2014-02/97374.htm under CentOS 6.4

Oracle 11gR2 installation steps in VMware virtual machines http://www.linuxidc.com/Linux/2013-09/89579p2.htm

Install Oracle 11g XE R2 http://www.linuxidc.com/Linux/2014-03/98881.htm under Debian

Oracle Linux 6.5 installs Oracle 11.2.0.4 x64 http://www.linuxidc.com/Linux/2014-11/109903.htm

2. Unzip

Unzip Linux.x64_11gR2_database_1of2.zip

Unzip Linux.x64_11gR2_database_2of2.zip

A database directory will appear below this directory, about 2.3g in size.

3, OS version and patch matrix

The following RPM packages need to be installed (the 32-bit version of the package is annotated with the 32bit bracket, and the 64-bit version of the package is the one with the same name.) On the 64-bit version of the platform, both versions are installed):

binutils-2.17.50.0.6
compat-libstdc++-33-3.2.3
compat-libstdc++-33-3.2.3 (+ bit)
elfutils-libelf-0.125
elfutils-libelf-devel-0.125
gcc-4.1.2
gcc-c++-4.1.2
Glibc-2.5-24
Glibc-2.5-24 (+ bit)
glibc-common-2.5
glibc-devel-2.5
glibc-devel-2.5 (+ bit)
glibc-headers-2.5
ksh-20060214
libaio-0.3.106
libaio-0.3.106 (+ bit)
libaio-devel-0.3.106
libaio-devel-0.3.106 (+ bit)
libgcc-4.1.2
libgcc-4.1.2 (+ bit)
libstdc++-4.1.2
libstdc++-4.1.2 (+ bit)
Libstdc++-devel 4.1.2
make-3.81
sysstat-7.0.2

Install with Yum, as follows:
Yum Install-y binutils*
Yum Install-y compat-libstdc*
Yum Install-y elfutils-libelf*
Yum Install-y gcc*
Yum Install-y glibc*
Yum Install-y ksh*
Yum Install-y libaio*
Yum Install-y libgcc*
Yum Install-y libstdc*
Yum Install-y make*
Yum Install-y sysstat*
Yum Install libxp*-y
Yum Install-y glibc-kernheaders

Check that the LIB is fully installed:

[[email protected] ~]# rpm-q--queryformat%-{name}-%{version}-%{release}-%{arch} "\ n" \ Compat-libstdc++-33 Glibc-kernheaders glibc-headers Libaio LIBGCC glibc-devel xorg-x11-deprecated-libs

If it is missing, continue to install the missing component package.

4, network, system parameter adjustment and description

In the production environment, it is required to use 2 gigabit NICs as much as possible to prevent a single point of failure caused by network cards, network cables, ports, and individual networks.

4.1, adjust the kernel parameters and user restrictions

All of the following actions need to be performed by the root user and restart the operating system to be fully effective.

(1) Edit the/etc/sysctl.conf file and set the system default values for the relevant parameters. If the parameter is already set in the file, make sure that the parameter value is not less than the corresponding value below, and if there is no setting for the relevant parameter, add the corresponding parameter setting line in the following format.

Vim/etc/sysctl.conf

FS.AIO-MAX-NR = 1048576
Fs.file-max = 6815744
Kernel.shmall = 2097152
Kernel.shmmax = 536870912
Kernel.shmmni = 4096
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

(2) Edit the/etc/security/limits.conf file to modify the operating system restrictions on Oracle user resources. Add the following line to the file.

Vim/etc/security/limits.conf

Oracle Soft Nproc 2047

Oracle Hard Nproc 16384

Oracle Soft Nofile 1024

Oracle Hard Nofile 65536

Oracle Hard Stack 10240

4.2. Open OS Asynchronous IO (AIO)

The 2nd package that needs to be installed in the previous section already contains libaio-0.3.106, which turns on asynchronous I/O by default.

Check that the AIO is running in the operating system, run the command and display the results similar to the following:

$ cat/proc/slabinfo | grep Kio

Kioctx 1:tunables 8:slabdata 10 10 0

KIOCB-1:tunables 8:slabdata 2 2 0

Note: If the database is using a file system and you want to use asynchronous IO, you need to modify the initialization parameters of the database

A. Set the Disk_asynch_io parameter value to True (default value)

B. Set the Filesystemio_options parameter value to Asynch

5: Directory Structure and spatial planning

5.1 Storage Settings

The database storage for PC server typically does not use high-end storage (the VG physical partition is recommended as 32M), so the VG physical partition (PE size) is the default 32M for operating system installation, or 256M (the recommended value for the VG physical partition in the low-end storage) is available.


5.2 Temp Directory

/tmp: At least 1GB space, 5GB recommended for storing logs generated by Oracle Software installation.


5.3 Exchange Requirements

Swap: According to the operating system recommended configuration, according to the memory size, for the physical memory of 1-1.5 times times. Recommendation: Create 2 swap spaces of the same size and distributed on different disks (PV).


5.4, database Software installation directory

The Oracle Software installation directory is recommended to be set to a separate file system, the mounted directory name is/tpsys, the actual installed home directory is/tpsys/app/oracle, the size is generally configured to 20GB, the directory owner requirements for Oracle:oinstall.


5.5, Database Space planning

Oracle database space is represented by a tablespace (tablespace), such as the default: Sysaux, SYSTEM, TEMP, UNDOTBS1, users, and so on, and the table space is comprised of a data file (datafile). We define file system-based files to create Oracle data files and define a single data file size of 10G for rollback table space, temporary tablespace, and data table space.
The file directory used by the database and the corresponding purpose and corresponding file system size plan as follows (assuming the database name is test, in the actual operation, the italic test needs to be replaced with the actual defined database name):
/data/oracle/data: System and data table space corresponding data file storage path;/oracle/app/oracle
/data/oracle/redolog/: Redo Redo log file storage path;
/data/oracle/archive/: Archive log file storage path;
/data/oracle/tempfile/: Tempfile file storage path (n is the last number in the order).

/data/oracle/backup/data: Backup Directory

......
Note: The above file system is mounted on the level two directory, that is, the mounted directory is:/data/oracle/data,/data/oracle/redolog/,/data/oracle/archive/,/data/oracle/tempfile /ET

In addition, depending on the actual use, there may also be a file directory for the flashback zone and a corresponding file system:
/data/oracle/flashback: Flash back area catalogue, recommended 100GB
If you need to back up the database to a hard disk, create a file directory and file system to hold the database backup:
/data/oracle/backup: Backup directory, based on future data volume size, is recommended to be larger than the data table space capacity
Note: The above file system is mounted on a level two directory
The owner requirement for all of the above directories is Oracle:oinstall.

6, installation of database software and configuration of database creation

6.1, creation of database installation users and groups

Using the root user, do the following:
Create a Oinstall Group
# groupadd-g Oinstall
Create a DBA Group
# GROUPADD-G 501 DBA
Create an Oracle User
#useradd-G oinstall-g dba Oracle


6.2, setting the profile of the database installation user

First determine the database name and the database instance name, for a single instance (non-RAC) environment, the two are generally consistent.

Assuming the database (instance) is named Powerdes, use Oracle user, edit/home/oracle/.bash_profile, add the following


#added by Timman for Oracle

Export Oracle_base=/oracle/app/oracle

Export Oracle_home=/oracle/app/oracle/product/11.2.0/dbhome_1

Export Oracle_sid=powerdes

Export path= $ORACLE _home/bin: $PATH

Export Oracle_term=xterm

Export tns_admin= $ORACLE _home/network/admin

Export ld_library_path= $LD _library_path: $ORACLE _home/oracm/lib: $ORACLE _home/lib

Export classpath= $CLASSPATH: $ORACLE _home/rdbms/jlib: $ORACLE _home/jlib: $ORACLE _home/network/lib

Export LANG=EN_US.GBK

Export Nls_lang=american_america. Zhs16gbk

Export Editor=vi


6.3 Create the appropriate file system (or installation directory) and change the appropriate permissions

[Email protected] oracle]# mkdir-p/oracle/app/oracle

[Email protected] oracle]# chown-r oracle:oinstall/oracle/app/oracle

[Email protected] oracle]# chmod-r 775/oracle/app/oracle

[Email protected] oracle]#

6.4. Prepare VNC remote connection to Linux desktop
Reference: Linux installation set up VNC Remote Desktop Connection to install Oracle 11g http://www.linuxidc.com/Linux/2015-01/112326p2.htm

6.6, ready under Linux

Used by Oracle users. Installation is required in the graphical interface (in the console or with the X-window tool software). Open a terminal window and execute the following command to install:

Export display=10.7.32.145:0.0

Input Xclock test, if you can see the clock proof graphically available


Yum Install Tigervnc Tigervnc-server


In Xshell's Linux system, execute the following command:

[Email protected] rlwrap-0.37]# Xhost +
Access control disabled, clients can connect from any host
[Email protected] rlwrap-0.37]#
Indicates that the Windows environment under Linux and ready for OK can be installed by Oracle.


7, start the installation
Connect the Linux system remotely with VNC, as shown below:

7.1, ready to start the startup command on Linux system

[[email protected] ~]$ Su-oracle[[email protected] ~]# export Display=192.168.121.217:0.0[[email protected] ~]# Xhost + Access control disabled, clients can connect from any Host[[email protected]/]#

[Email protected] ~]$ cd/home/oracle_64/database/

[Email protected] database]$./runinstaller

Starting Oracle Universal Installer ...

Checking Temp space:must be greater than MB. Actual 21658 MB Passed

Checking swap space:must be greater than MB. Actual 2047 MB Passed

Checking Monitor:must is configured to display at least-colors. Actual 16777216 Passed

Preparing to launch Oracle Universal Installer from/tmp/orainstall2015-01-23_12-18-01pm. Please wait ... [Email protected] database]$

[Email protected] database]#

As shown in the following:

7.2 Remove the I wish to receive security updates via My Oracle surrport option, click Next.

7.3, select Install database software only, click Next.

7.4, select Single Instance database installation, click Next.

7.5, in Available languages select Chinese, Simplified Chinese, Traditional Chinese, click on the middle of two boxes, add the selected language to the right of the selected Languages, then click Next.

7.6, according to the actual situation, select the enterprise version, such as

7.7. Complete the Oracle software path and basic path, such as:

7.8. Select the installation log directory as shown in:

7.9, select DBA Group

7.10. Continue to the next installation operation

7.11, can be ignored, because the CentOS version is higher, so 11g check when the high version of the LIB package is not recognized

7.12. Continue installation

7.13, in the installation, this time is relatively long

Need to wait, about 20 minutes or so

Click OK to continue

7.14, and then click Close to End

8, create a database

The database is created using the Oracle user (assuming the database name is Powerdes, in the actual operation, the italic powerdes needs to be replaced by the actual defined database name), and the following steps create the database.

8.1. The installation needs to be in the graphical interface (in the console or with the X-window tool software). Open a terminal window and execute the following command: DBCA, as shown in:

8.2,database Configuration Assistant graphical interface started. The title also indicates the number of steps and the name of the step. In the Welcome window of step name welcome, click Next directly.

8.3, wait for next step

8.4, select Custom Database

8.5,global Database Name box: Enter the previously determined DB name SID box: automatically appear with the same database name as the database instance name, no changes in the case of single instance

8.6, continue to default

8.7,database Credentials

The password and Confirm password columns of the Use Different Administrative passwords table are the User Name column sys, SYSTEM, Dbsnmp and Sysman Users enter the password and repeat the input (if the password settings are too simple, a pop-up prompt confirms acceptance of the security risk before the next step) the SYS and system password settings can be modified after the database is established.

Password is sys1624

8.8,database file locationsstorage Locations: Select Use Common location for all Database filesdatabase file location box: Enter/oracl E/data_ora

8.9,recovery configurationspecify Fast Recovery area If automatic backup is selected in the previous management options step, keep the check box and below: Fast Recovery Area box: Modify the directory name for the quick Recovery Zone fast Recovery area Size box: Adjust the size of the quick recovery zone

8.10,enable archiving determines whether the actual demand for archived logs is selected (important production systems must be open for archiving, test systems generally shut down Archives save server space) Click Next to edit Archive Mode Parameters ..., In the pop-up window: Automatic Archiving: Leave the default tick archive log File format box: Modify to%t_%s_%r.arcarchive Log Destinations table: Enter/oracle/in the first row Data_ora/archive Click OK to return to the main window database Contentdatabase Components page

8.11,initialization Parameters, memory allocation 20% (test library so smaller, production library can allocate larger such as 40%60%, etc.), character set selection compatible UTF8 options

8.12, click File Location Variables, you can see some basic parameter information, return, and then directly next, as shown in:

8.13, select Generate Database Creation Scripts, the default is/oracle/app/oracle/admin/powerdes/scripts, such as:

8.14, click the Finish button as shown in:

Click on the OK button, there is an error saying that/etc/oratab read errors, an error as shown

So go build this directory.

[Email protected] rpms]# Mkdir/etc/oratab

[Email protected] rpms]#

[Email protected] rpms]# chown-r Oracle.oinstall/etc/oratab

[Email protected] rpms]#

8.15, then click the OK button to start creating the database as shown in:

After waiting 35 minutes, the database is created and then clicked, as follows:

9, simple inspection

[Email protected] ~]$ sqlplus "/As SYSDBA"


Sql*plus:release 11.2.0.1.0 Production on Sat Jan 24 14:51:10 2015


Copyright (c) 1982, Oracle. All rights reserved.

Connected to:

Oracle Database 11g Enterprise Edition Release 11.2.0.1.0-64bit Production

With the partitioning, OLAP, Data Mining and Real application testing options


Sql> CREATE TABLE z_test (ID number,name varchar (20));


Table created.


sql> INSERT INTO Z_test Select 1, ' a ' from dual;


1 row created.


Sql> select * from Z_test;


ID NAME

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

2 B


Sql> commit;


Commit complete.


Sql> exit

Disconnected from Oracle Database 11g Enterprise Edition Release 11.2.0.1.0-64bit Production

With the partitioning, OLAP, Data Mining and Real application testing options

[Email protected] ~]$

10, error message record

(1) Error

>>> ignoring required pre-requisite failures. Continuing ...

Preparing to launch Oracle Universal Installer from/tmp/orainstall2015-01-21_06-07-35pm. Please wait ... [[email protected] database]$ Exception in thread "main" Java.lang.UnsatisfiedLinkError:/tmp/orainstall2015-01-21_ 06-07-35pm/jdk/jre/lib/i386/xawt/libmawt.so:libxext.so.6:cannot open Shared object file:no such file or directory

At Java.lang.classloader$nativelibrary.load (Native Method)

At Java.lang.ClassLoader.loadLibrary0 (classloader.java:1751)

At Java.lang.ClassLoader.loadLibrary (classloader.java:1647)

At Java.lang.Runtime.load0 (runtime.java:769)

At Java.lang.System.load (system.java:968)

At Java.lang.classloader$nativelibrary.load (Native Method)

At Java.lang.ClassLoader.loadLibrary0 (classloader.java:1751)

At Java.lang.ClassLoader.loadLibrary (classloader.java:1668)

At Java.lang.Runtime.loadLibrary0 (runtime.java:822)

At Java.lang.System.loadLibrary (system.java:993)

At Sun.security.action.LoadLibraryAction.run (loadlibraryaction.java:50)

At java.security.AccessController.doPrivileged (Native Method)

At Java.awt.Toolkit.loadLibraries (toolkit.java:1509)

At Java.awt.toolkit.<clinit> (toolkit.java:1530)

At Com.jgoodies.looks.LookUtils.isLowResolution (Unknown Source)

At com.jgoodies.looks.lookutils.<clinit> (Unknown Source)

At Com.jgoodies.looks.plastic.plasticlookandfeel.<clinit> (plasticlookandfeel.java:122)

At JAVA.LANG.CLASS.FORNAME0 (Native Method)

At Java.lang.Class.forName (class.java:242)

At Javax.swing.SwingUtilities.loadSystemClass (swingutilities.java:1783)

At Javax.swing.UIManager.setLookAndFeel (uimanager.java:480)

At Oracle.install.commons.util.Application.startup (application.java:758)

At Oracle.install.commons.flow.FlowApplication.startup (flowapplication.java:164)

At Oracle.install.commons.flow.FlowApplication.startup (flowapplication.java:181)

At Oracle.install.commons.base.driver.common.Installer.startup (installer.java:265)

At Oracle.install.ivw.db.driver.DBInstaller.startup (dbinstaller.java:114)

At Oracle.install.ivw.db.driver.DBInstaller.main (dbinstaller.java:132)

^c


(1) need to install Yum install libxext*-y

(2) Chown-r oracle:oinstall/usr/*

Yum Install Libxext.i686-y

In the 64-bit CentOS installation of 64-bit Oracle, there are sometimes "Libxext.so.6:cannot open Shared Object file:" Errors.

This is mainly due to the fact that Oracle installs some 32-bit LIB, which is similar to the DLL under Windows.

This problem can be solved by the following solutions:

#yum install libxext.i686.


(2) Error

[Email protected] database]$./runinstaller

Starting Oracle Universal Installer ...


Checking Temp space:must be greater than MB. Actual 38250 MB Passed

Checking swap space:must be greater than MB. Actual 2047 MB Passed

Checking Monitor:must is configured to display at least colors

>>> Could not execute auto Check for display colors using Command/usr/bin/xdpyinfo.    Check If the DISPLAY variable is set. Failed <<<<


Some requirement checks failed. You must fulfill these requirements before


Continuing with the installation,


Continue? (y/n) [N] Y

>>> ignoring required pre-requisite failures. Continuing ...

Preparing to launch Oracle Universal Installer from/tmp/orainstall2015-01-21_07-15-20pm. Please wait ... [[email protected] database]$ Exception in thread "main" Java.lang.NoClassDefFoundError

At JAVA.LANG.CLASS.FORNAME0 (Native Method)

At Java.lang.Class.forName (class.java:164)

At Java.awt.toolkit$2.run (toolkit.java:821)

At java.security.AccessController.doPrivileged (Native Method)

At Java.awt.Toolkit.getDefaultToolkit (toolkit.java:804)

At Com.jgoodies.looks.LookUtils.isLowResolution (Unknown Source)

At com.jgoodies.looks.lookutils.<clinit> (Unknown Source)

At Com.jgoodies.looks.plastic.plasticlookandfeel.<clinit> (plasticlookandfeel.java:122)

At JAVA.LANG.CLASS.FORNAME0 (Native Method)

At Java.lang.Class.forName (class.java:242)

At Javax.swing.SwingUtilities.loadSystemClass (swingutilities.java:1783)

At Javax.swing.UIManager.setLookAndFeel (uimanager.java:480)

At Oracle.install.commons.util.Application.startup (application.java:758)

At Oracle.install.commons.flow.FlowApplication.startup (flowapplication.java:164)

At Oracle.install.commons.flow.FlowApplication.startup (flowapplication.java:181)

At Oracle.install.commons.base.driver.common.Installer.startup (installer.java:265)

At Oracle.install.ivw.db.driver.DBInstaller.startup (dbinstaller.java:114)

At Oracle.install.ivw.db.driver.DBInstaller.main (dbinstaller.java:132)

^c

[Email protected] database]$

Need to install graphical interface server program on Linux x Window

Yum groupinstall "X window System" #安装X window

[email protected] database]# yum groupinstall "X window System" "Desktop Platform" desktop

Yum Install VNC

[Email protected] database]# export display=192.168.121.217:0.0

[Email protected] database]# Xhost +

Access control disabled, clients can connect from any host

[Email protected] database]#

See Oracle Feature page for more information on Oracle HTTP://WWW.LINUXIDC.COM/TOPICNEWS.ASPX?TID=12

This article permanently updates the link address : http://www.linuxidc.com/Linux/2015-02/113222.htm

Install Oracle database under Linux

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.