Build an Oracle10g Database Based on LVM bare devices on Oracle Linux 5.11

Source: Internet
Author: User

Build an Oracle10g Database Based on LVM bare devices on Oracle Linux 5.11

Software: VMware11

Operating System: Oracle Linux 5.11x64
Database: Oracle 10.2.0.5 x64
Host Name: odb. test. local
IP Address: 192.168.223.100 # the VM host network is used.
Instance: odb

Ubuntu 10.10 Oracle 10g Installation Guide

Ubuntu 10.10 Oracle 10g graphic tutorial
 
I. System Installation
During the installation process, select the GNOME Desktop environment and select "Development Libraries", "Development Tools", and "Legacy Software Development" as the installation method. you can install the GNOME Desktop by default, do not install JAVA or OFFICE.
Ii. Basic System Configuration
1. Configure the disc as the local yum installation Source
[Root @ odb ~] # Cd/etc/yum. repos. d/
[Root @ odb yum. repos. d] # cat local. repo
[Local]
Name = local
Baseurl = file: // media/cdrom/Server
Gpgcheck = 0
Enable = 1
 
2. Disable selinux and iptables services
[Root @ odb ~] # Sed-I's/= enforcing/= disabled/G'/etc/sysconfig/selinux
[Root @ odb ~] # Chkconfig iptables off
[Root @ odb ~] # Chkconfig ip6tables off
Disable other system services based on actual conditions
 
3. Install the oracle-validated package and configure the oracle preset Environment
[Root @ odb ~] # Yum-y install oracle-validated.x86_64
[Root @ odb ~] # Oracle-validated-verify
After executing this command, the Environment configuration required for oracle software installation will be automatically performed, such as installing the missing package, adding sysctl configuration, and ulimited related, such as oracle users, the dba group will be automatically created after the system is installed. It is more convenient to use CentOS than to use CentOS.
[Root @ odb ~] # Sed-I '1i \ RedHat 4'/etc/redhat-release
[Root @ odb ~] # Sed-I '$ a \ 192.168.223.100 odb. test. local odb'/etc/hosts
 
4. Install the rlwrap software (sqlplus and other functions such as turning pages up and down history can be added when the software is used)
[Root @ odb ~] # Tar-xf rlwrap-0.42.tar.gz-C/tmp/
[Root @ odb ~] # Rlwrap-0.42/cd/tmp/
[Root @ odb rlwrap-0.42] #./configure; make all; make install
 
5. Install vmware-tools
6. install and configure vncserver
[Oracle @ odb ~] # Yum-y install vncserver
[Oracle @ odb ~] # Cd/etc/sysconfig/
[Oracle @ odb sysconfig] # vim vncservers
VNCSERVERS = "1: root"
VNCSERVERARGS [1] = "-geometry 1024x768-depth 24"
After the configuration is saved,
[Root @ odb ~] # Vncserver # The first execution prompts you to enter the vnc password and automatically generate the initial configuration in the user directory.
[Root @ odb ~] # Cd. vnc
[Root @ odb. vnc] # vim xstartup
#! /Bin/sh
 
# Uncomment the following two lines for normal desktop:
Unset SESSION_MANAGER
Exec/etc/X11/xinit/xinitrc
 
[-X/etc/vnc/xstartup] & exec/etc/vnc/xstartup
[-R $ HOME/. Xresources] & xrdb $ HOME/. Xresources
Xsetroot-solid gray
Vncconfig-iconic &
Xterm-geometry 80x24 + 10 + 10-ls-title "$ VNCDESKTOP Desktop "&
# Twm &
Gnome-session &
It is easy to modify. Remove the notes from the last two lines in red and add the gnome-session.
 
7. Set the oracle installation directory and Basic Environment
[Root @ odb ~] # Mkdir-p/opt/oracle/
[Root @ odb ~] # Chown-R oracle: oinstall/opt/oracle/
[Root @ odb ~] # Chmod-R 775/opt/oracle/
Add oracle environment variables
[Oracle @ odb ~] $ Su-oracle
[Oracle @ odb ~] $ Vim. bash_profile # Add the following content
 
Export ORACLE_SID = odb
Export ORACLE_BASE =/opt/oracle
Export ORACLE_HOME = $ ORACLE_BASE/product/10.2.0/db_1
Export PATH = $ PATH: $ ORACLE_HOME/bin
Export ORACLE_TERM = xterm
Export LD_LIBRARY_PATH = $ LD_LIBRARY_PATH: $ ORACLE_HOME/lib
Export CLASSPATH = $ ORACLE_HOME/jre: $ ORACLE_HOME/jlib: $ ORACLE_HOME/rdbms/jlib
Alias sqlplus = 'maid sqlplus'
Alias rman = 'rlwrap rman'
 
Iii. Oracle database software installation
After completing the preliminary work, we are ready to officially install the oracle database. We can use the vnc client to connect to the server (how can we connect to this server? Please check your information). After connecting, open a new terminal
[Root @ odb ~] # Xhost +
Access control disabled, clients can connect from any host
[Root @ odb ~] # Export DISPLAY =: 1
[Root @ odb ~] # Su-oracle
 
[Oracle @ odb ~] $ Cpio-idmv </mnt/hgfs/Oracle/Oracle10g/linux. x64/10201_database_linux_x86_64.cpio
[Oracle @ odb ~] $ Cd database/
[Oracle @ odb database] $./runInstaller
The following figure shows the graphical installation process. If some of them fail to pass the Environment check, you can modify it as prompted. During installation, you can only install software.
Install patches after installation.
[Oracle @ odb ~] $ Unzip/mnt/hgfs/Oracle/Oracle10g/linux. x64/p8202632_10205_Linux-x86-64.zip-d.
[Oracle @ odb ~] $ Cd Disk1/
[Oracle @ odb Disk1] $./runInstaller
It is also a graphical interface, and the process is too boring to say
 
Iv. Configure bare device Environment
1. Add a scsi virtual hard disk online and use the following method to identify it when the system is not restarted
[Root @ odb ~] # Echo "---">/sys/class/scsi_host/host0/scan
2. Create a volume group and related logical volumes
[Root @ odb ~] # Fdisk/dev/sdb # create a separate partition.
[Root @ odb ~] # Pvcreate/dev/sdb1
[Root @ odb ~] # Vgcreate oradata/dev/sdb1
Then create the lvm logical volume required by the oracle database
Lvcreate-L 8 M-n lv_spfile oradata
Lvcreate-L 20 M-n lv_control01 oradata
Lvcreate-L 20 M-n lv_control02 oradata
Lvcreate-L 20 M-n lv_control03 oradata
Lvcreate-L 100 M-n lv_redo01 oradata
Lvcreate-L 100 M-n lv_redo02 oradata
Lvcreate-L 100 M-n lv_redo03 oradata
Lvcreate-L 1g-n lv_system01 oradata
Lvcreate-L 1g-n lv_sysaux01 oradata
Lvcreate-L 1g-n lv_users01 oradata
Lvcreate-L 1g-n lv_undo01 oradata
Lvcreate-L 1g-n lv_temp01 oradata
Use lvscan to view information after creation
[Root @ odb ~] # Lvscan
/Dev/hdc: open failed: No medium found
"ACTIVE"/dev/oradata/lv_spfile "[8.00 MB]" inherit"
ACTIVE '/dev/oradata/lv_control01' [20.00 MB] inherit
ACTIVE '/dev/oradata/lv_control02' [20.00 MB] inherit
ACTIVE '/dev/oradata/lv_control03' [20.00 MB] inherit
"ACTIVE"/dev/oradata/lv_redo01 "[100.00 MB] inherit
ACTIVE '/dev/oradata/lv_redo02' [100.00 MB] inherit
ACTIVE '/dev/oradata/lv_redo03' [100.00 MB] inherit
ACTIVE '/dev/oradata/lv_system01' [1.00 GB] inherit
ACTIVE '/dev/oradata/lv_sysaux01' [1.00 GB] inherit
ACTIVE '/dev/oradata/lv_users01' [1.00 GB] inherit
ACTIVE '/dev/oradata/lv_undo01' [1.00 GB] inherit
ACTIVE '/dev/oradata/lv_temp01' [1.00 GB] inherit
ACTIVE '/dev/VolGroup00/logvol00' [14.06 GB] inherit
ACTIVE '/dev/VolGroup00/logvol01' [5.81 GB] inherit
3. Bind the bare device and set automatic loading upon startup.
[Root @ odb ~] # Vim/etc/sysconfig/rawdevices
/Dev/raw/raw1/dev/oradata/lv_spfile
/Dev/raw/raw2/dev/oradata/lv_control01
/Dev/raw/raw3/dev/oradata/lv_control02
/Dev/raw/raw4/dev/oradata/lv_control03
/Dev/raw/raw5/dev/oradata/lv_redo01
/Dev/raw/raw6/dev/oradata/lv_redo02
/Dev/raw/raw7/dev/oradata/lv_redo03
/Dev/raw/raw8/dev/oradata/lv_sysaux01
/Dev/raw/raw9/dev/oradata/lv_system01
/Dev/raw/raw10/dev/oradata/lv_users01
/Dev/raw/raw11/dev/oradata/lv_undo01
/Dev/raw/raw12/dev/oradata/lv_temp01
[Root @ odb ~] # Chkconfig rawdevices on
[Root @ odb ~] #/Etc/init. d/rawdevices start

[Root @ odb ~] # Ll/dev/raw *
Total 0
Cr -- r ----- 1 root 162, 1 Jan 18 raw1
Cr -- r ----- 1 root 162, 10 Jan 18 raw10
Cr -- r ----- 1 root 162, 11 Jan 18 raw11
Cr -- r ----- 1 root 162, 12 Jan 18 21:52 raw12
Cr -- r ----- 1 root 162, 2 Jan 18 raw2
Cr -- r ----- 1 root 162, 3 Jan 18 raw3
Cr -- r ----- 1 root 162, 4 Jan 18 raw4
Cr -- r ----- 1 root 162, 5 Jan 18 raw5
Cr -- r ----- 1 root 162, 6 Jan 18 raw6
Cr -- r ----- 1 root 162, 7 Jan 18 raw7
Cr -- r ----- 1 root 162, 8 Jan 18 raw8
Cr -- r ----- 1 root 162, 9 Jan 18 raw9
 
4. Set bare device group and access permissions (direct modification is useless, and the root group will be automatically restored after restart)
[Root @ odb ~] # Vim/etc/udev/rules. d/60-raw.rules
ACTION = "add", KERNEL = "raw *", OWNER = "oracle", GROUP = "dba", MODE = "0660"
[Root @ odb ~] # Start_udev
Starting udev: [OK]
[Root @ odb ~] # Ll/dev/raw *
Crw-rw ---- 1 oracle dba 162, 0 Jan 18/dev/rawctl
 
/Dev/raw:
Total 0
Crw-rw ---- 1 oracle dba 162, 1 Jan 18 raw1
Crw-rw ---- 1 oracle dba 162, 10 Jan 18 raw10
Crw-rw ---- 1 oracle dba 162, 11 Jan 18 raw11
Crw-rw ---- 1 oracle dba 162, 12 Jan 18 raw12
Crw-rw ---- 1 oracle dba 162, 2 Jan 18 raw2
Crw-rw ---- 1 oracle dba 162, 3 Jan 18 raw3
Crw-rw ---- 1 oracle dba 162, 4 Jan 18 raw4
Crw-rw ---- 1 oracle dba 162, 5 Jan 18 raw5
Crw-rw ---- 1 oracle dba 162, 6 Jan 18 raw6
Crw-rw ---- 1 oracle dba 162, 7 Jan 18 raw7
Crw-rw ---- 1 oracle dba 162, 8 Jan 18 raw8
Crw-rw ---- 1 oracle dba 162, 9 Jan 18 raw9
 
5. Create a soft connection from the data file to the bare Device
[Root @ odb ~] # Mkdir-p/opt/oracle/oradata/odb
Ln-s/dev/raw/raw1/opt/oracle/oradata/odb/spfile
Ln-s/dev/raw/raw2/opt/oracle/oradata/odb/control01
Ln-s/dev/raw/raw3/opt/oracle/oradata/odb/control02
Ln-s/dev/raw/raw4/opt/oracle/oradata/odb/control03
Ln-s/dev/raw/raw5/opt/oracle/oradata/odb/redo01
Ln-s/dev/raw/raw6/opt/oracle/oradata/odb/redo02
Ln-s/dev/raw/raw7/opt/oracle/oradata/odb/redo03
Ln-s/dev/raw/raw8/opt/oracle/oradata/odb/sysaux01
Ln-s/dev/raw/raw9/opt/oracle/oradata/odb/system01
Ln-s/dev/raw/raw10/opt/oracle/oradata/odb/users01
Ln-s/dev/raw/raw11/opt/oracle/oradata/odb/undo01
Ln-s/dev/raw/raw12/opt/oracle/oradata/odb/temp01
After creating a soft connection, we recommend that you change the group and permissions of these linked files.
[Root @ odb ~] # Chown-R oracle: oinstall/opt/oracle/oradata/odb/
[Root @ odb ~] # Chmod-R 775/opt/oracle/oradata/odb/
 
6.create a bare-device ing file dbca_raw_config.txt
[Root @ odb ~] # Su-oracle
[Oracle @ odb ~] $ Vim DBCA_RAW_CONFIG.txt
Spfile =/opt/oracle/oradata/spfile
Control1 =/opt/oracle/oradata/odb/control01
Control2 =/opt/oracle/oradata/odb/control02
Control3 =/opt/oracle/oradata/odb/control03
Redo1_1 =/opt/oracle/oradata/odb/redo01
Redo2_1 =/opt/oracle/oradata/odb/redo02
Redo3_1 =/opt/oracle/oradata/odb/redo03
Sysaux =/opt/oracle/oradata/odb/sysaux01
System =/opt/oracle/oradata/odb/system01
Users =/opt/oracle/oradata/odb/users01
Undotbs1 =/opt/oracle/oradata/odb/undo01
Temp =/opt/oracle/oradata/odb/temp01
 
7. Run netca to create LISTENTER and TNSNAMES. The process is omitted.
8. Run DBCA to create a database
[Oracle @ odb ~] $ Export DBCA_RAW_CONFIG =/home/oracle/DBCA_RAW_CONFIG.txt
[Oracle @ odb ~] $ Dbca
The subsequent installation process is omitted. We recommend that you select Custom installation. If the raw device file does not arrive during installation, You can manually specify the soft link file location.
 
The above is how to install the ORACLE database on a bare Device Based on LVM.

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.