Home Database Mysql Tutorial Centos 6 Oracle 11G 超详细安装

Centos 6 Oracle 11G 超详细安装

Jun 07, 2016 pm 02:51 PM
centos oracle Install detailed

Desktop Environment is not neccessary for Server usage, though. But Sometimes installation or using an application requires Desktop Environment, then build Desktop Environment as follwos. [root@dlp ~]#yum -y groupinstall X Window System [r

Desktop Environment is not neccessary for Server usage, though. But Sometimes installation or using an application requires Desktop Environment, then build Desktop Environment as follwos.

[root@dlp ~]#yum -y groupinstall "X Window System"


[root@dlp ~]#yum -y groupinstall "Desktop"


[root@dlp ~]#yum -y groupinstall "General Purpose Desktop"


  Input a command like below after finishing installation of new packages.
[root@dlp ~]#startx


[2] Install some packages first.
[root@db01 ~]# yum -y install binutils compat-libstdc++-33 compat-libstdc++-33.i686 ksh elfutils-libelf elfutils-libelf-devel glibc glibc-common glibc-devel gcc gcc-c++ libaio libaio.i686 libaio-devel libaio-devel.i686 libgcc libstdc++ libstdc++.i686 libstdc++-devel libstdc++-devel.i686 make sysstat unixODBC unixODBC-devel
[3] Edit Kernel parameters.
[root@db01 ~]#vi /etc/sysctl.conf # comment out # net.bridge.bridge-nf-call-ip6tables = 0
# net.bridge.bridge-nf-call-iptables = 0
#
net.bridge.bridge-nf-call-arptables = 0
# add follows to the end
net.ipv4.ip_local_port_range = 9000 65500
fs.file-max = 6815744
kernel.shmall = 10523004
kernel.shmmax = 6465333657
kernel.shmmni = 4096
kernel.sem = 250 32000 100 128
net.core.rmem_default=262144
net.core.wmem_default=262144
net.core.rmem_max=4194304
net.core.wmem_max=1048576
fs.aio-max-nr = 1048576

[root@db01 ~]# sysctl -pnet.ipv4.ip_forward = 0
net.ipv4.conf.default.rp_filter = 1
net.ipv4.conf.default.accept_source_route = 0
kernel.sysrq = 0
kernel.core_uses_pid = 1
net.ipv4.tcp_syncookies = 1
net.ipv4.ip_local_port_range = 9000 65500
fs.file-max = 65536
kernel.shmall = 10523004
kernel.shmmax = 6465333657
kernel.shmmni = 4096
kernel.sem = 250 32000 100 128
net.core.rmem_default = 262144
net.core.wmem_default = 262144
net.core.rmem_max = 4194304
net.core.wmem_max = 1048576
fs.aio-max-nr = 1048576
[4] Create user and groups for Oracle Database.
[root@db01 ~]# groupadd -g 200 oinstall
[root@db01 ~]# groupadd -g 201 dba

[root@db01 ~]# useradd -u 440 -g oinstall -G dba -d /usr/oracle oracle

[root@db01 ~]# passwd oracle
Changing password for user oracle.
New password:
Retype new password:
passwd: all authentication tokens updated successfully.
[root@db01 ~]#vi /etc/pam.d/login # near line 14: add
session    required     pam_selinux.so open
session    required     pam_namespace.so
Copy after login
session    required     pam_limits.so
Copy after login
session    optional     pam_keyinit.so force revoke
session    include      system-auth
-session   optional     pam_ck_connector.so

Copy after login
[root@db01 ~]# vi /etc/security/limits.conf
# add follows to the end
oracle   soft   nproc   2047
oracle   hard   nproc   16384
oracle   soft   nofile   1024
oracle   hard   nofile   65536 [root@db01 ~]# vi /etc/profile
# add follows to the end
if [ $USER = "oracle" ]; then
      if [ $SHELL = "/bin/ksh" ]; then
           ulimit -p 16384
           ulimit -n 65536
      else
           ulimit -u 16384 -n 65536
      fi
fi
[5] Switch to a user "Oracle" and configure some settings.
db01 login: oracle Password:
[oracle@db01 ~]$ chmod 755 /usr/oracle

[oracle@db01 ~]$mkdir /usr/oracle/app
[oracle@db01 ~]$chmod 775 /usr/oracle/app
[oracle@db01 ~]$mkdir /usr/oracle/oradata
[oracle@db01 ~]$chmod 775 /usr/oracle/oradata
[oracle@db01 ~]$vi ~/.bash_profile # add follows to the end
umask 022
export ORACLE_BASE=/usr/oracle/app # create a temporary directory for installation
[oracle@db01 ~]$mkdir tmp

  Install Oracle Database 11g R2.
[1] Login and work with "oracle" user which you create in previous section.
[2] Download Oracle Databse 11g R2 for Linux and upload on your server.
http://www.oracle.com/technology/software/products/database/index.html
[3] After uploading Oracle files, move to a tmp directory and run an Installer like follows.
[oracle@db01 ~]$ cd tmp
[oracle@db01 tmp]$ unzip linux.x64_11gR2_database_1of2.zip

[oracle@db01 tmp]$ unzip linux.x64_11gR2_database_2of2.zip

[oracle@db01 tmp]$ ./database/runInstaller
[4] Oracle Installer starts like follows. First, Set your email address and password for receiving some infomation from Oracle like security issues and so on.
[5] On this example, Select "Install database software only".
[6] On this example, Select "Single Instance Database ***".
[7] Select your language.
[8] Select which edition you install.
[9] Specify the base directory and files for Oracle. On this example, keep default and proceed to next.
[10] Specify the installed directory. On this example, keep default and proceed to next.
[11] Specify the priviledged group. On this example, keep default and proceed to next.
[12] Checking settings runs automatically for requirements of installing Oracle. Generally, some packages requirements failed like follows, but it's noplobmen because most of them are higher version packages than requirements. Ignore them if the result is the same to the follows. (For only "pdksh", it's not a big ploblem if it is not installed. )
[13] The summary is shown for configuration. Click "Finish" if it's OK all.
[14] Installation starts.
[15] Following screen is shown, then open a terminal and execute follwong commands with the root user.
[root@db01 ~]# /usr/oracle/oraInventory/orainstRoot.sh
Changing permissions of /usr/oracle/oraInventory.
Adding read,write permissions for group.
Removing read,write,execute permissions for world.

Changing groupname of /usr/oracle/oraInventory to oinstall.
The execution of the script is complete.
[root@db01 ~]#
Copy after login
[root@db01 ~]# /usr/oracle/app/product/11.2.0/dbhome_1/root.sh

Running Oracle 11g root.sh script... The following environment variables are set as:
    ORACLE_OWNER= oracle
    ORACLE_HOME= /usr/oracle/app/product/11.2.0/dbhome_1 Enter the full pathname of the local bin directory: [/usr/local/bin]:    # Enter
    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 by
Database Configuration Assistant when a database is created
Finished running generic part of root.sh script.
Now product-specific root actions will be performed.
Finished product-specific root actions.
[16] Installation completed. Click "Close" button.
[17] Configure some settings for Oracle user.
[oracle@db01 ~]$vi ~/.bash_profile # add follows to the end
export ORACLE_HOME=$ORACLE_BASE/product/11.2.0/dbhome_1
export PATH=$PATH:$ORACLE_HOME/bin [oracle@db01 ~]$ source ~/.bash_profile
[oracle@db01 ~]$rm -rf tmp

Create Oracle Net Listener that is a network service on Oracle.
[1]Login with the "oracle" user and input a command "netca" like follows.  
[oracle@db01 ~]$ netca

[2] Check a box "Listener Configuration" and go next.
[3] Go next.
[4] Set Listner's name. Input any one you like.
[5] This example goes next with keeping default "TCP".
[6] Set a port. This example goes next with keeping default.
[7] If you'd like to create more Listeners, Answer "Yes". This example selects "No".
[8] Configuration completed.
[9] Click "Finish" to quit. After finishing, Confirm the status by "netstat" comand. Then you'll see "tnslsnr" listens 1521 port.

  Create a Database.
[1] Login with the "oracle" user and input a command "dbca" like follows.
[oracle@db01 ~]$ dbca

[2] Click "Next" to proceed.
[3] Select "Create Database" and go next.
[4] This example selects "General Purpose ***" and go next.
[5] Set Grobal Database name and SID like follows. Input any one you like.
[6] This example goes next with keeping default.
[7] Set passwords. Please set a password for a user for security.
[8] This example goes next with keeping default "File System".
[9] Configure recovery settings. If you'd like to change it, Set it.
[10] Configure sample schema and scripts. If you'd like to add them, Set them.
[11] Configure memory settings. After setting, go to next tab.
[12] Specify max processes.
[13] Set Character setting.
[14] Select a connection mode. If your server does not have many clients, Select Dedicated server mode. If your server has many clients, Select Shared server mode.
[15] Confirm parameters for Storage settings. If you'd like to change, set them.
[16] Configuration completed. Click "Finish" button to finish.
[17] Confirm settings and Click "OK" if all are OK.
[18] Database creation starts.
[19] After completing to create a database, Click "Exit" to finish.
[20] Access to the URL that is shown on finished screen above with web browser, then follwing screen is shown. Input a user name and password that you configured on the section [6].
[21] Just logined. It's possible to manage the database on here.

  Create an init Script to make Oracle start automatically on system booting.
[1] Set environment variables for "oracle" user like follows.
[oracle@db01 ~]$vi /etc/oratab # end line: change
db01:/usr/oracle/app/product/11.2.0/dbhome_1: Y [oracle@db01 ~]$vi ~/.bash_profile # add follows to the end
export ORACLE_SID=db01
[2] Create an init Script with the root user.
[root@db01 ~]#vi /etc/rc.d/init.d/oracle # it's an example, edit it you like.
#!/bin/bash

# oracle: Start/Stop Oracle Database 11g R2
#
# chkconfig: 345 90 10
# description: The Oracle Database is an Object-Relational Database Management System.
#
# processname: oracle

. /etc/rc.d/init.d/functions

LOCKFILE=/var/lock/subsys/oracle
ORACLE_HOME=/usr/oracle/app/product/11.2.0/dbhome_1
ORACLE_USER=oracle

case "$1" in
'start')
    if [ -f $LOCKFILE ]; then
        echo $0 already running.
        exit 1
    fi
    echo -n $"Starting Oracle Database:"
    su - $ORACLE_USER -c "$ORACLE_HOME/bin/lsnrctl start"
    su - $ORACLE_USER -c "$ORACLE_HOME/bin/dbstart $ORACLE_HOME"
    su - $ORACLE_USER -c "$ORACLE_HOME/bin/emctl start dbconsole"
    touch $LOCKFILE
    ;;
'stop')
    if [ ! -f $LOCKFILE ]; then
        echo $0 already stopping.
        exit 1
    fi
    echo -n $"Stopping Oracle Database:"
    su - $ORACLE_USER -c "$ORACLE_HOME/bin/lsnrctl stop"
    su - $ORACLE_USER -c "$ORACLE_HOME/bin/dbshut"
    su - $ORACLE_USER -c "$ORACLE_HOME/bin/emctl stop dbconsole"
    rm -f $LOCKFILE
    ;;
'restart')
    $0 stop
    $0 start
    ;;
'status')
    if [ -f $LOCKFILE ]; then
        echo $0 started.
    else
        echo $0 stopped.
    fi
    ;;
*)
    echo "Usage: $0 [start|stop|status]"
    exit 1
esac

exit 0

Copy after login
[root@db01 ~]#chmod 755 /etc/rc.d/init.d/oracle
[root@db01 ~]#chkconfig --add oracle
[root@db01 ~]#chkconfig oracle on


Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

AI Hentai Generator

AI Hentai Generator

Generate AI Hentai for free.

Hot Article

R.E.P.O. Energy Crystals Explained and What They Do (Yellow Crystal)
3 weeks ago By 尊渡假赌尊渡假赌尊渡假赌
R.E.P.O. Best Graphic Settings
3 weeks ago By 尊渡假赌尊渡假赌尊渡假赌
R.E.P.O. How to Fix Audio if You Can't Hear Anyone
3 weeks ago By 尊渡假赌尊渡假赌尊渡假赌

Hot Tools

Notepad++7.3.1

Notepad++7.3.1

Easy-to-use and free code editor

SublimeText3 Chinese version

SublimeText3 Chinese version

Chinese version, very easy to use

Zend Studio 13.0.1

Zend Studio 13.0.1

Powerful PHP integrated development environment

Dreamweaver CS6

Dreamweaver CS6

Visual web development tools

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)

How long will Oracle database logs be kept? How long will Oracle database logs be kept? May 10, 2024 am 03:27 AM

The retention period of Oracle database logs depends on the log type and configuration, including: Redo logs: determined by the maximum size configured with the "LOG_ARCHIVE_DEST" parameter. Archived redo logs: Determined by the maximum size configured by the "DB_RECOVERY_FILE_DEST_SIZE" parameter. Online redo logs: not archived, lost when the database is restarted, and the retention period is consistent with the instance running time. Audit log: Configured by the "AUDIT_TRAIL" parameter, retained for 30 days by default.

The order of the oracle database startup steps is The order of the oracle database startup steps is May 10, 2024 am 01:48 AM

The Oracle database startup sequence is: 1. Check the preconditions; 2. Start the listener; 3. Start the database instance; 4. Wait for the database to open; 5. Connect to the database; 6. Verify the database status; 7. Enable the service (if necessary ); 8. Test the connection.

How much memory does oracle require? How much memory does oracle require? May 10, 2024 am 04:12 AM

The amount of memory required by Oracle depends on database size, activity level, and required performance level: for storing data buffers, index buffers, executing SQL statements, and managing the data dictionary cache. The exact amount is affected by database size, activity level, and required performance level. Best practices include setting the appropriate SGA size, sizing SGA components, using AMM, and monitoring memory usage.

Oracle database server hardware configuration requirements Oracle database server hardware configuration requirements May 10, 2024 am 04:00 AM

Oracle database server hardware configuration requirements: Processor: multi-core, with a main frequency of at least 2.5 GHz. For large databases, 32 cores or more are recommended. Memory: At least 8GB for small databases, 16-64GB for medium sizes, up to 512GB or more for large databases or heavy workloads. Storage: SSD or NVMe disks, RAID arrays for redundancy and performance. Network: High-speed network (10GbE or higher), dedicated network card, low-latency network. Others: Stable power supply, redundant components, compatible operating system and software, heat dissipation and cooling system.

How much memory is needed to use oracle database How much memory is needed to use oracle database May 10, 2024 am 03:42 AM

The amount of memory required for an Oracle database depends on the database size, workload type, and number of concurrent users. General recommendations: Small databases: 16-32 GB, Medium databases: 32-64 GB, Large databases: 64 GB or more. Other factors to consider include database version, memory optimization options, virtualization, and best practices (monitor memory usage, adjust allocations).

Oracle scheduled tasks execute the creation step once a day Oracle scheduled tasks execute the creation step once a day May 10, 2024 am 03:03 AM

To create a scheduled task in Oracle that executes once a day, you need to perform the following three steps: Create a job. Add a subjob to the job and set its schedule expression to "INTERVAL 1 DAY". Enable the job.

How much memory does an oracle database require? How much memory does an oracle database require? May 10, 2024 am 02:09 AM

Oracle Database memory requirements depend on the following factors: database size, number of active users, concurrent queries, enabled features, and system hardware configuration. Steps in determining memory requirements include determining database size, estimating the number of active users, understanding concurrent queries, considering enabled features, and examining system hardware configuration.

When the oracle database is started in the nomount state, which file needs to be called? When the oracle database is started in the nomount state, which file needs to be called? May 10, 2024 am 01:51 AM

The file called to start the Oracle database into the NOMOUNT state is initsid.ora. Edit this file to modify the following parameters: DB_NAME (database name), DB_CREATE (prevent automatic creation), DB_RECOVERY_FILE_DEST (recovery log directory), DB_RECOVERY_FILE_DEST_SIZE (recovery log size), and then use the command "STARTUP NOMOUNT" to start the database.

See all articles