Linux installation oracle11g

Source: Internet
Author: User
Tags dba administrator password file permissions sqlplus

Linux installation oracle11g0, download orcle11g

Http://www.cnblogs.com/mmzs/p/9030823.html

1. Upload files to the/install directory of the server or virtual machine

[Email protected] install]# rz–y

If the Rz–y command is not available, it can be resolved as follows:

Yum Install Lrzsz-y
2. Unzip the file to the current directory:

[Email protected] install]# Unzip Linux.x64_11gR2_database_1of2.zip

[Email protected] install]# Unzip Linux.x64_11gR2_database_2of2.zip

If the unzip command is not available, execute the following command in turn:

     Yum List | grep zip/unzip     yum install zip     yum Install unzip  

Move the extracted folder directly to the/software directory:

[Email protected] install]# MV database//software/

[Email protected] install]# Cd/software

[email protected] install]# LL

3. Turn off SELinux

[Email protected] software]# Vim/etc/selinux/config

Set selinux=disabled

[Email protected] software]# Setenforce 0

4. Turn off the firewall

To view the system version:

[Email protected] software]# cat/etc/redhat-release

CentOS Linux release 7.3.1611 (Core)

[Email protected] software]# getconf long_bit

64

If it is 6 and below:

[[Email protected] software]# service iptables stop

[[Email protected] software]# service iptables status

[Email protected] software]# chkconfig iptables off

If it is centenOS7:

[Email protected] software]# systemctl restart Firewalld.service

[Email protected] software]# Systemctl list-unit-files|grep firewalld.service

Firewalld.service disabled

[Email protected] software]# systemctl disable Firewalld.service

5. Install Oracle 11g Dependency Package

[email protected] software]# yum install gcc make binutils gcc-c++ compat-libstdc++-33elfutils-libelf-devel Elfutils-libelf-devel-static ksh libaio libaio-develnumactl-devel sysstat UnixODBC unixodbc-devel pcre-devel–y

6. Add installation users and user groups

[Email protected] software]# Groupadd Oinstall

[[email protected] software]# Groupadd DBA

[Email protected] software]# useradd-g oinstall-g dba Oracle

[Email protected] software]# passwd Oracle

Changing password for user Oracle.

New Password:

Bad Password:the PASSWORD is shorter than 8 characters

Retype new Password:

Passwd:all authentication tokens updated successfully.

[[email protected] software]# ID Oracle

UID=1001 (Oracle) gid=1001 (oinstall) groups=1001 (Oinstall), 1002 (DBA)

7. Modify kernel parameter configuration file

[Email protected] software]# vim/etc/sysctl.conf

Add the following at the end:

FS.AIO-MAX-NR = 1048576fs.file-max = 6815744= 2097152= 1073741824= 4096= 32000= 900065500 = 262144= 4194304=  262144 = 1048576

To see if it was successfully written into the/etc/sysctl.conf file:

[Email protected] software]# sysctl–p

where Kernel.shmmax = 1073741824 is the half of the native physical memory (2G), in bytes.

8, modify the user's limit file

To modify the/etc/security/limits.conf file:

[Email protected] software]# vim/etc/security/limits.conf

Add the following at the end:

Oracle           Soft    nproc           2047Oracle           hard    nproc           16384oracle           soft    Nofile           1024x768Oracle           hard    nofile         65536oracle           soft    stack            10240 

To modify the/etc/pam.d/login file:

[Email protected] software]# Vim/etc/pam.d/login

Add the following at the end:

Session Required  /lib64/security/pam_limits.sosession required   pam_limits.so  

To modify the/etc/profile file:

[Email protected] Myyun software]# vim/etc/profile

Add the following at the end:

#oracle配置 if [$USER = "Oracle" ];   Then if [$SHELL = "/bin/ksh" ];       Then -P      16384-n 65536  else      -u 16384-n 65536  

9. Create the installation directory and set file permissions

[Email protected] software]# mkdir-p/data/oracle/product/11.2.0

[Email protected] software]# Mkdir/data/oracle/oradata

[Email protected] software]# mkdir/data/oracle/inventory

[Email protected] software]# Mkdir/data/oracle/fast_recovery_area

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

[Email protected] software]# chmod-r 775/data/oracle

10. Setting Oracle User Environment variables

First switch to the Oracle User:

[Email protected] software]# su-l Oracle

[[email protected] ~]$ vim. Bash_profile

At the end, add the following:

Oracle_base=/data/oracle

Oracle_home= $ORACLE _base/product/11.2.0

oracle_sid=ORCL

Path= $PATH: $ORACLE _home/bin

Export Oracle_base oracle_home Oracle_sidpath

Note that the red place must be created with the database instance name is the same, or the database cannot be accessed after it is started. After the first configuration remember source a bit.

11. Edit the Silent installation response file

Copy the installation folder response to the current Oracle user's home directory:

[Email protected] ~]$ cp-r/software/database/response/.

[Email protected] ~]$ CD response/

[Email protected] response]$ vim DB_INSTALL.RSP

The options you need to set are as follows:

Oracle.install.option=install_db_swonly

Oracle_hostname=centos

Unix_group_name=oinstall

Inventory_location=/data/oracle/inventory

Selected_languages=en,zh_cn

oracle_home=/data/oracle/product/11.2.0

Oracle_base=/data/oracle

Oracle.install.db.installedition=ee

Oracle.install.db.dba_group=dba

Oracle.install.db.oper_group=dba

Decline_security_updates=true

12. Silent installation According to the response file oracle11g

[Email protected] response]$ cd/software/database/

[Email protected] database]$./runinstaller-silent-responsefile/home/oracle/response/db_install.rsp-ignoreprereq

If the execution of the above command error, you will be prompted to format the parameters, according to the prompt parameter format modification can be modified, generally because the font in Word, symbol format copied to the client command line after the inconsistency caused by the modification.

Landlord encountered the problem of insufficient exchange space:

The solution is as follows (executed under root user):

[[email protected]/]# free

[[email protected]/]# dd If=/dev/zero of=swapfile bs=1024 count=500000

500000+0 Records in

500000+0 Records out

512000000 bytes (MB) copied, 1.67013 s, 307 MB/s

[Email protected]/]# Mkswap swapfile

Setting up Swapspace version 1, size = 499996 KiB

No label, UUID=C5E355EB-E73E-4AA0-B882-CB6D1F88E6BC

[Email protected]/]# Swapon swapfile

Swapon:/swapfile:insecure permissions 0644, 0600 suggested.

[[email protected]/]# free

Begins a silent installation of Oracle in the background. During installation, if you are prompted [WARNING] to ignore it, the Setup program is still in the background, and if successfully setup software appears, Setup has stopped.

The log for this installation session can be found at the following location:/data/oracle/inventory/logs/installactions2018-05-13_02-14-55pm.log

You can toggle the terminal execution Top command to see that the background process is always installed, and the/data directory is growing,

When the following prompt appears, the installation succeeds:

Execute the script as required.

Open terminal, log out to root, execute script:

[[Email protected] database]$ exit

Logout

[Email protected] software]# sh/data/oracle/inventory/orainstroot.sh

changing permissions of/data/oracle/inventory.

Adding read,write permissions for group.

Removing Read,write,execute permissions for the world.

Changing groupname of/data/oracle/inventory to Oinstall.

The execution of the script is complete.

[Email protected] software]# sh/data/oracle/product/11.2.0/root.sh

Check/data/oracle/product/11.2.0/install/root_iz2f570bi1k56uz_2018-05-13_14-25-04.log for the output of root script

13. Configure the monitoring in silent mode

Re-use Oracle User login:

[Email protected] software]# su-l Oracle

Last Login:sun-14:09:10 CST 2018 on PTS/3

[Email protected] ~]$ NETCA/SILENT/RESPONSEFILE/HOME/ORACLE/RESPONSE/NETCA.RSP

Note here that you must use the/silent/responsefile format instead of the-silent-responsefile because it is a silent installation.

After running successfully, generate Listener.ora and Sqlnet.ora in/data/oracle/product/11.2.0/network/admin

With the netstat command, you can see that port 1521 is listening.

Yum installs Netstat software, and the package is in Net-tools.

[email protected]/]# Yum install Net-tools

[email protected]/]# Yum install Net-tools

14, to create a new library silently, but also to establish a corresponding example

[Email protected] ~]$ VIM/HOME/ORACLE/RESPONSE/DBCA.RSP

Modify the following parameters in the file:

[general]# Oracle version, cannot change responsefile_version= "11.2.0"# Description:type of Operationoperation_type= "CreateDatabase"[createdatabase]# Description:global database name of the database# global databases=sid+Host Domain Gdbname= "Orcl.test"# Description:system identifier (SID) of the database# corresponding instance name SID= "ORCL"# Description:name of the template# Library template file templatename= "General_purpose.dbc"# Description:password forSYS user# SYS administrator password Syspassword= "123456"# Description:password forSystem user# system Administrator password Systempassword= "123456"# Description:password forsysman user# sysman Administrator password Sysmanpassword= "123456"# Description:password fordbsnmp user# dbsnmp Administrator password Dbsnmppassword= "123456"# Description:location of the data file' s# Data File storage directory Datafiledestination=/data/oracle/oradata# description:location of the data file' s# Recover data storage directory Recoveryareadestination=/data/oracle/fast_recovery_area# Description:character Set of the database# character set, important!!!After you build the library, you can't change it, so make sure it's clear before you build it. # (CHARACTERSET= "Al32utf8" nationalcharacterset= "UTF8") CHARACTERSET= "ZHS16GBK"# Description:total Memory in MB to allocate to oracle# Oracle RAM 1638MB, physical memory 2G*80%totalmemory= "1638" 

To configure silently:

[Email protected] ~]$ DBCA-SILENT-RESPONSEFILE/HOME/ORACLE/RESPONSE/DBCA.RSP

Check the instance process after the database is built:

[Email protected] ~]$ Ps-ef | grep Ora_ | Grep-v grep

To view the listening status:

[Email protected] ~]$ lsnrctl status

Database creation is complete.

For more information, view the log files in the following location:/data/oracle/cfgtoollogs/dbca/orcl/orcl.log.

Database information:

Global database name: orcl.test

System identifier (SID): ORCL

Login to view instance status:

[Email protected] ~]$ Sqlplus/as SYSDBA

Sql> select status from V$instance;

If error: "Ora-12162:tns:net service name is incorrectly specified"

Error reason: "This error is due to the fact that the ORACLE_SID variable was not passed in." 】

Workaround:

1. View current Oracle_sid

[Email protected] ~]$ echo $ORACLE _sid

Orcl

2. Modify the same as in Oracle_sid and/HOME/ORACLE/RESPONSE/DBCA.RSP                                                                                                                                                                             

[Email protected] ~]$ export ORACLE_SID=ORCL

3. If you still cannot log in, try to modify the permissions of the Orcle folder

15, command-line mode silent Delete

1, first check the DBCA Help information

Dbca-help

Modify the following parameters in the/home/oracle/response/dbca.rsp file, the following three parameters are modified according to the actual situation of the database:

Operation_type = "DeleteDatabase"

Sourcedb = "ORCL"

Sysdbausername = "SYS"

Sysdbapassword = "123456"

Then run:

Dbca-silent-responsefile/home/oracle/response/dbca.rsp

Each parameter has the following meanings:

-silent means to silently delete

-responsefile indicates which response file to use, must use absolute path

Responsefile_version the version of the response file template, this parameter does not change

Operation_type installation type, do not change this parameter

Sourcedb database name, not the global database name, which does not contain db_domain

Very simple database uninstallation is complete, please note, only the database is uninstalled, the database software is still in.

2. Uninstalling the database using DBCA

Dbca-silent-delete Database-responsefile DBCA.RSP

A. option-silent means silent installation, no installation interaction, and most installation information is not output

B. Option-responsefile Specify an answer file that requires an absolute path

Reference article:

1. The solution of insufficient swap space when installing Oracle under Linux

2, Sqlplus/as sysdba can not log on the strange error

3, Oracle 11g based CentOS7 silent installation tutorial (no GUI, remote installation)

Linux installation oracle11g

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.