Oracle Lab Handbook

Source: Internet
Author: User
Tags iptables sqlplus yum repolist

Oracle Installation
    1. Install VirtualBox:

# yum Install gcc kernel-devel kernel-headers

# Yum Install virtualbox-5 ....

#/ETC/INIT.D/VBOXDRV Setup compiles kernel modules manually and completes automatically during installation

# usermod-g Vboxusers Root

    1. Install Linux:

To create a virtual machine:

Name: oracle11gr2_oel6.4_x64

Type: Linux 64bit

Memory: 2048MB

Hard disk Size: 100GB

Set up:

Number of two-way paste processors: 2 storage: Loading discs

Boot order: Hard disk, network

Network: Nic 1,host-only

Removing sound, USB devices

Installation: Desktop mode

Host Name: Node1.test.com,ip use Dhcp,swap 4GB, the rest to/

    1. To tune a Linux system:

To turn off the firewall:

# Service Iptables Stop

# Service Ip6tables Stop

# chkconfig Iptables off

# chkconfig Ip6tables off

Disabled firewall in Administrative Tools

To turn off SELinux:

# Vi/etc/selinux/config

Selinux=disabled

Configure Yum: (Configuration Repository)

# df-h (Find disc path)

# rm-f/etc/yum.repos.d/*

# Vi/etc/yum.repos.d/oel6.repo

[Server]

Name=server

baseurl=file:///media/"/media/ol6.4 x86_64 Disc 1 20130225"/server

Enabled=1

Gpgcheck=0

[[email protected] yum.repos.d]# Yum repolist All (see if the Repository is configured successfully)

Loaded Plugins:refresh-packagekit, security

Repo ID Repo name status

Installmedia Oracle Linux 6.4 disabled

Server server enabled:3,628

repolist:3,628

Install VB Enhancements:

# CD

# yum-y Install gcc Kernel-devel

# ln-s/usr/src/kernels/2.6.32-431.el6.x86_64//usr/src/linux

Device-to-install enhancements

Right-click Eject eject disc

    1. Confirm Root Identity:

# ID

    1. Hardware configuration:

# DF

-H

# grep Memtotal/proc/meminfo

# grep Swaptotal/proc/meminfo

# Vi/etc/fstab (permanently modified)

Tmpfs/dev/shm Tmpfs defaults,size=2g 0 0

# Mount-o REMOUNT/DEV/SHM

Temporary modification

# mount-t Tmpfs shmfs-o Size=2g/dev/shm

# uname-m

# df-h

Alternative 6 7 8 9 steps, (first put 7 best alone)

[Email protected] ~]# cd/media/ol6.4\ x86_64\ disc\ 1\ 20130225/packages/

[email protected] packages]# Yum install oracle-rdbms-server-11gr2-preinstall-1.0-7.el6.x86_64.rpm

    1. RPM Check and install:

# Cat/etc/redhat-release

# Uname-r

# Rpm-qa | grep glibc

# yum Install glibc

# yum Install glibc.i686

Binutils-2.20.51.0.2-5.11.el6 (x86_64)

Compat-libcap1-1.10-1 (x86_64)

Compat-libstdc++-33-3.2.3-69.el6 (x86_64)

compat-libstdc++-33-3.2.3-69.el6.i686

Gcc-4.4.4-13.el6 (x86_64)

Gcc-c++-4.4.4-13.el6 (x86_64)

Glibc-2.12-1.7.el6 (i686)

Glibc-2.12-1.7.el6 (x86_64)

Glibc-devel-2.12-1.7.el6 (x86_64)

glibc-devel-2.12-1.7.el6.i686

Ksh

Libgcc-4.4.4-13.el6 (i686)

Libgcc-4.4.4-13.el6 (x86_64)

Libstdc++-4.4.4-13.el6 (x86_64)

libstdc++-4.4.4-13.el6.i686

Libstdc++-devel-4.4.4-13.el6 (x86_64)

libstdc++-devel-4.4.4-13.el6.i686

Libaio-0.3.107-10.el6 (x86_64)

libaio-0.3.107-10.el6.i686

Libaio-devel-0.3.107-10.el6 (x86_64)

libaio-devel-0.3.107-10.el6.i686

Make-3.81-19.el6

Sysstat-9.0.4-11.el6 (x86_64)

    1. To create a user:

# groupadd-g Oinstall

# GROUPADD-G 1001 DBA

# GROUPADD-G 1002 Oper

# passwd Oracle

    1. To modify kernel parameters:

# vi/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 = 1048576

# sysctl-p

    1. To modify resource limits:

# vi/etc/security/limits.conf

Oracle Soft Nofile 1024

Oracle Hard Nofile 65536

Oracle Soft Nproc 2047

Oracle Hard Nproc 16384

Oracle Soft Stack 10240

Oracle Hard Stack 32768

    1. To create a directory:

# mkdir-p/u01/app/oracle

# Chown-r Oracle:oinstall/u01

# Chmod-r 775/u01

    1. To modify the profile:

# VI ~oracle/.bash_profile

Export ORACLE_SID=ORCL

Export Oracle_base=/u01/app/oracle

Export Oracle_home= $ORACLE _base/product/11.2.0/db_1

Export oracle_hostname=node1.test.com

Export ORACLE_UNQNAME=ORCL

Export path= $PATH: $ORACLE _home/bin

Export Ld_library_path= $ORACLE _home/lib:/lib:/usr/lib

Export classpath= $ORACLE _home/jre: $ORACLE _home/jlib: $ORACLE _home/rdbms/jlib

Export Nls_lang=american_america. Al32utf8

Export nls_date_format= ' Yyyy-mm-dd hh24:mi:ss '

Export Editor=vi

Export Lang=c

    1. To resolve the hostname using the Hosts file:

# hostname

Node1.test.com

# vi/etc/hosts

192.168.0.1 node1.test.com Node1

Virtual Machine Host

# ping Node1 Ping: Force echo Request data (used to detect network connections or test network connection speed)

# ping Node1.test.com

    1. Unzip the installation package:

# cd/installation

# unzip P10404530_112030_linux-x86-64_[12]of7.zip "unused"

Or:

The directory where the installation package resides is shared to the virtual machine after decompression. The command is as follows:

# mkdir/installation

# mount-t vboxsf installation/installation/

# cd/installation/

# ls

P10404530_112030_linux-x86-64_1of7.zip P10404530_112030_linux-x86-64_2of7.zip

#unzip P10404530_112030_linux-x86-64_1of7.zip

#unzip P10404530_112030_linux-x86-64_2of7.zip

[[email protected] installation]# ls

Database P10404530_112030_linux-x86-64_2of7.zip

P10404530_112030_linux-x86-64_1of7.zip

    1. Graphical Interface Installation:

# Xhost +

# su-oracle

$ cd/database/

$./runinstaller

Execute two scripts as root

To create a listener and database:

Create monitoring under the graphical interface, Oracle executes:

$ netca

$ LSNRCTL Status//View status

$ NETSTAT-TLNP | grep 1521

Graphical interface Creation Db,oracle execution:

$ dbca

General or transactional processing, ORCL/ORCL selected sample scheme, memory 1200

Char

Var

Sys Login

System user operator

DBSNMP Simple Network protocol

Sysman

    1. Test:

Sqlplus test:

$ sqlplus sys/[email protected] as Sysdba

$ sqlplus/as SYSDBA

Sql> Show User

Sql> Select COUNT (*) from hr.employees;

Sql> exit

Browser testing:

Https://192.168.0.1:1158/em

Sys/password SYSDBA

Install Rlwrap:

Root Installation

Copy the Rlwrap installation package to installation under Windows

Check Mount Directory

#cd/installation

# yum Install rlwrap-0.42-1.el6.x86_64.rpm

# VI ~ORACLE/.BASHRC

Alias sqlplus= ' Rlwrap sqlplus '

Alias rman= ' Rlwrap Rman '

# su-oracle

$ sqlplus/as SYSDBA

Sql> select * from Hr.employees;

Root Installation

# yum Install flash-plugin-11.2.202.508-release.x86_64.rpm

Sqldeveloper Test:

Root Installation

# yum Install jdk-8u51-linux-x64.rpm

# yum Install sqldeveloper-4.1.1.19.59-1.noarch.rpm

#/usr/local/bin/sqldeveloper

Enter the path to the JDK/usr/java/jdk1.8.0_51/

Click the upper left corner + sign to create a new connection:

Sys/password, Connection type: Basic, Role: SYSDBA

192.168.0.1 Port 1521 Sid:orcl

Test, save.

Garbled and changed to Chinese

    1. To add a startup script:

# Vi/etc/oratab Change N to Y

Orcl:/u01/app/oracle/product/11.2.0/db_1:y

# vi/etc/rc.d/init.d/oracle

#!/bin/bash

#chkconfig: 35 99 01

Case "$" in

Start

Echo-n "Starting Oracle Database & Listener:"

Su-oracle-c ' Dbstart $ORACLE _home ' >/dev/null

echo "[OK]"

Echo-n "Starting Oracle EM dbconsole:"

Su-oracle-c "emctl start Dbconsole" >/dev/null

echo "[OK]"

Touch/var/lock/subsys/oracle

;;

Stop

Echo-n "shutting down Oracle EM dbconsole:"

Su-oracle-c "Emctl Stop Dbconsole" >/dev/null

echo "[OK]"

Echo-n "shutting down Oracle Database & Listener:"

Su-oracle-c ' Dbshut $ORACLE _home ' >/dev/null

echo "[OK]"

Rm-f/var/lock/subsys/oracle

;;

*)

echo "Usage:oracle {start|stop}"

Exit 1

Esac

# chmod 755/etc/rc.d/init.d/oracle

# chkconfig--add Oracle

# chkconfig--list Oracle

    1. Delete Password validity period:

# su-oracle

$ sqlplus/as SYSDBA

sql> alter profile default limit Password_life_time unlimited;

Check:

Restart Direct Sqlplus/as SYSDBA

Enter select * from hr.employees; see results

Oracle Lab Handbook

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.