Quick Reference for installation and deployment of Oracle 11G Single Instance + ASM storage on Linux

Source: Internet
Author: User

Quick Reference for installation and deployment of Oracle 11G Single Instance + ASM storage on Linux

Operating Environment: Apply for a Linux6.4 host (Template) in the Citrix virtualization environment)
Objective: to create a single-host 11 GB + ASM storage database

1. Host preparation

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

IP Address:

Host Name: JY-DB

Directory:/u01

Disk: one 50 GB hard disk is allocated from the local disk resources of the host, and three 10 Gb hard disks are allocated from the magnetic array resources.

1.1 check host name and IP address ing: hostname-I

Hostname

Vi/etc/sysconfig/network

Vi/etc/hosts

1.2 The Allocated/u01 directory is the Oracle software installation directory, lv_asm1, lv_asm2, and lv_asm3 are the ASM disks.

Format/dev/xvdb 50G and mount it to the/u01 directory.

/Dev/xvdc/dev/xvde/dev/xvdf each 10 Gb, no formatting required, used for ASM

 

Pvcreate/dev/xvdc/dev/xvde/dev/xvdf
Vgcreate ora_vg/dev/xvdc/dev/xvde/dev/xvdf
Lvcreate-L 10g-n lv_asm1 ora_vg
Lvcreate-L 10g-n lv_asm2 ora_vg
Vgdisplay ora_vg
Lvcreate-l 2557-n lv_asm3 ora_vg

 

After creating a grid user, you must change the disk permissions of the lv before creating the ASM.

Chown grid: asmadmin/dev/mapper/ora *

1.3 configure YUM and install the dependency package

Yum configuration reference:

Configure the epel yum Source

RedHat local yum source configuration

Description of yum configuration file

Install yum in RedHat 6.1)

YUM installation and cleaning

Build yum local source on CentOS 6.4

Yum install binutils compat-libstdc ++-33 elfutils-libelf-devel glibc-common glibc-devel gcc-c ++ libaio-devel libaliblibgcc libstdc ++ libstdc ++-devel make sysstat unixODBC-devel pdksh ksh compat-libcap1

If no image is installed on the system, you must install the graphic interface and xterm.

Yum groupinstall "X Window System"

Yum install xterm

1.4 disable system firewall startup

Service iptables stop

Chkconfig iptables off

2. Create ORACLE users and group members

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

Groupadd oinstall
Groupadd dba
Groupadd rule
Groupadd asmadmin
Groupadd asmdba
Groupadd asmoper

Useradd-g oinstall-G dba, asmdba, and oracle
Useradd-g oinstall-G dba, asmadmin, asmdba, asmoper grid

 

Specify the passwords of oracle and grid users respectively

Passwd oracle
Passwd grid

3. Create the following directory and grant corresponding Permissions

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

Mkdir-p/u01/app/11.2.0/grid
Mkdir-p/u01/app/grid
Mkdir-p/u01/app/oracle/product/11.2.0/db_1
Chown-R oracle: oinstall/u01/app
Chmod-R 775/u01/app

4. Set environment variables for oracle and grid users

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

4.1 oracle user login: vi ~ /. Bash_profile

Export ORACLE_BASE =/u01/app/oracle
Export ORACLE_HOME =/u01/app/oracle/product/11.2.0/db_1
Export LD_LIBRARY_PATH = $ ORACLE_HOME/lib :.
Export NLS_LANG = american_america.ZHS16GBK
Export ORACLE_SID = jyzhao
Export PATH = $ PATH: $ ORACLE_HOME/bin :.

4.2 log on to the grid user: vi ~ /. Bash_profile

Export ORACLE_BASE =/u01/app/grid
Export ORACLE_HOME =/u01/app/11.2.0/grid
Export LD_LIBRARY_PATH = $ ORACLE_HOME/lib :.
Export NLS_LANG = American_america.ZHS16GBK
Export PATH = $ PATH: $ ORACLE_HOME/bin :.
Export ORACLE_SID = + ASM

5. the root user changes the system parameters.

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

5.1 vi/etc/sysctl. conf

Fs. aio-max-nr = 1048576
Fs. file-max = 6815744
Kernel. shmall = 2097152
Kernel. shmmax = 4398046511104 // generally, the system memory is set to 75% bytes.
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

Make the settings take effect immediately:/sbin/sysctl-p

5.2 vi/etc/security/limits. conf

Oracle soft nproc 2047
Hard nproc 16384
Oracle soft nofile 1024
Oracle hard nofile 65536
Oracle soft stack 10240
Grid soft nproc 2047
Grid hard nproc 16384
Grid soft nofile 1024
Grid hard nofile 65536
Grid soft stack 1024

5.3 vi/etc/pam. d/login

# Oracle

Session required/lib64/security/pam_limits.so

Session required pam_limits.so

6. Upload the Oracle installation media to the/u01/tmp directory.

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

Mkdir-p/u01/tmp

P13390677_112040_Linux-x86-64_1of7.zip

P13390677_112040_Linux-x86-64_2of7.zip

P13390677_112040_Linux-x86-64_3of7.zip

7. Install the grid component

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

# Cd/u01/tmp/

# Unzip p10404530_112030_Linux-x86-64_3of7.zip

# Chown-R grid: oinstall grid

Xmanager software logon with grid user

$ Cd/u01/tmp/grid

$./RunInstaller

The GUI is installed. The root user executes two scripts. The screen output of the script is as follows:

 

#/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.

#/U01/app/11.2.0/grid/root. sh

Padding Ming root user operation for Oracle 11g

 

The following environment variables are set:

ORACLE_OWNER = grid

ORACLE_HOME =/u01/app/11.2.0/grid

 

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

Database Configuration Assistant when a database is created

Finished running generic part of root script.

Now product-specific root actions will be saved med.

 

To configure Grid Infrastructure for a Stand-Alone Server run the following command as the root user:

/U01/app/11.2.0/grid/perl/bin/perl-I/u01/app/11.2.0/grid/perl/lib-I/u01/app/11.2.0/grid/crs /install/u01/app/11.2.0/grid/crs/install/roothas. pl

To configure Grid Infrastructure for a Cluster execute the following command:

/U01/app/11.2.0/grid/crs/config. sh

This command launches the Grid Infrastructure Configuration Wizard. The wizard also supports silent operation, and the parameters can be passed through the response file that is available in the installation media.

8. According to the Script output prompt in the previous step, make sure that the root user needs to execute the following command on a single node.

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

/U01/app/11.2.0/grid/perl/bin/perl-I/u01/app/11.2.0/grid/perl/lib-I/u01/app/11.2.0/grid/crs /install/u01/app/11.2.0/grid/crs/install/roothas. pl

9. Use asmca to create an ASM disk group

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

Xmanager software logon with grid user

$ Asmca

10. Install oralce Software

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

# Cd/u01/tmp/

# Unzip p13390677_112040_Linux-x86-64_1of7.zip; unzip p13390677_112040_Linux-x86-64_2of7.zip

# Chown-R oracle: oinstall database

Xmanager software logon with oracle users

$ Cd/u01/tmp/database/

$./RunInstaller

Graphical interface installation, and the root user executes a script

#/U01/app/oracle/product/11.2.0/db_1/root. sh

11. Create a database

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

Xmanager software logon with oracle users

$ Dbca

The graphic interface is used to create a database, and the Storage Type is ASM and DATA1. The database character set is selected based on the actual situation.

12. Use the grid user to create a listener

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

Xmanager software logon with grid user

$ Netca

13. Test the database connection on the client

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

Ping IP Address

Tnsping IP Address

Sqlplus system/oracle @ IP Address/jyzhao

14. As the lv permission changes back to the root user after restart, you need to add a boot script.

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

Vi/etc/rc. d/rc. local

Chown grid: asmadmin/dev/mapper/ora *

Create a connection file for rc. local

Ln-sf/etc/rc. d/rc. local/etc/rc. d/rc1.d/S999rc. local &&

Ln-sf/etc/rc. d/rc. local/etc/rc. d/rc2.d/S999rc. local &&

Ln-sf/etc/rc. d/rc. local/etc/rc. d/rc3.d/S999rc. local &&

Ln-sf/etc/rc. d/rc. local/etc/rc. d/rc4.d/S999rc. local &&

Ln-sf/etc/rc. d/rc. local/etc/rc. d/rc5.d/S999rc. local &&

Ln-sf/etc/rc. d/rc. local/etc/rc. d/rc6.d/S999rc. local

15. Restart the test

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

15.1 shut down the database

# Su-oracle

$ Sqlplus/as sysdba

SQL * Plus: Release 11.2.0.4.0 Production ction on Thu Mar 12 14:14:38 2015

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

Connected:

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

With the Partitioning, Automatic Storage Management, OLAP, Data Mining

And Real Application Testing options

 

SQL> shutdown immediate

Database closed.

Database dismounted.

ORACLE instance shut down.

SQL>

15.2 disable has

$ Su-grid

Password:

$ Crsctl stop has

CRS-2791: Starting shutdown of Oracle High Availability Services-managed resources on 'jy-db'

CRS-2673: Attempting to stop 'ora. LISTENER. lsnr 'on 'jy-db'

CRS-2673: Attempting to stop 'ora. DATA1.dg 'on 'jy-db'

CRS-2677: Stop of 'ora. LISTENER. lsnr 'on 'jy-db' succeeded

CRS-2677: Stop of 'ora. DATA1.dg 'on 'jy-db' succeeded

CRS-2679: Attempting to clean 'ora. DATA1.dg 'on 'jy-db'

CRS-2681: Clean of 'ora. DATA1.dg 'on 'jy-db' succeeded

CRS-2673: Attempting to stop 'ora. asm 'on 'jy-db'

CRS-2677: Stop of 'ora. asm 'on 'jy-db' succeeded

CRS-2673: Attempting to stop 'ora.css d' on 'jy-db'

CRS-2677: Stop of 'ora.css d' on 'jy-db' succeeded

CRS-2673: Attempting to stop 'ora. evmd 'on 'jy-db'

CRS-2677: Stop of 'ora. evmd 'on 'jy-db' succeeded

CRS-2793: Shutdown of Oracle High Availability Services-managed resources on 'jy-db' has completed

CRS-4133: Oracle High Availability Services has been stopped.

15.3 restart the host

# Sync

# Sync

# Sync

# Shutdown-Fr now

 

Broadcast message from root @ JY-DB

(/Dev/pts/0)...

 

The system is going down for reboot NOW!

15.4 check the crs status after the host is started.

#/U01/app/11.2.0/grid/bin/crsctl stat res-t

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

Name target state server STATE_DETAILS

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

Local Resources

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

Ora. DATA1.dg

ONLINE jy-db

Ora. LISTENER. lsnr

ONLINE jy-db

Ora. asm

ONLINE jy-db Started

Ora. ons

OFFLINE jy-db

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

Cluster Resources

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

Ora.css d

1 ONLINE jy-db

Ora. diskmon

1 OFFLINE

Ora. evmd

1 ONLINE jy-db

Ora. jyzhao. db

1 OFFLINE Instance Shutdown

15.5 start the database

#/U01/app/11.2.0/grid/bin/srvctl start database-d jyzhao

#/U01/app/11.2.0/grid/bin/crsctl stat res-t

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

Name target state server STATE_DETAILS

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

Local Resources

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

Ora. DATA1.dg

ONLINE jy-db

Ora. LISTENER. lsnr

ONLINE jy-db

Ora. asm

ONLINE jy-db Started

Ora. ons

OFFLINE jy-db

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

Cluster Resources

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

Ora.css d

1 ONLINE jy-db

Ora. diskmon

1 OFFLINE

Ora. evmd

1 ONLINE jy-db

Ora. jyzhao. db

1 ONLINE jy-db Open

15.6 client Test

C: \ Users \ Alfred> sqlplus system/oracle @ IP Address/jyzhao

SQL * Plus: Release 11.2.0.1.0 Production on Thursday March 12 14:27:12 2015

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

Connect:

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

With the Partitioning, Automatic Storage Management, OLAP, Data Mining

And Real Application Testing options

SQL>

Now, the installation and deployment of oracle 11G Single Instance + ASM storage on the Linux platform are complete.

How Does Oracle ASM Add a new disk to a disk?

Oracle 10g manual creation of the ASM Database

Solutions to various problems after installing Oracle 11gR2 in Ubuntu 12.04 (amd64)

How to change the sys password of Oracle 10g ASM

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.