Centos 6 Oracle 11G 超详细安装
时间:2022-03-05 18:31
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 ~]# -y groupinstall "X Window System"
[root@dlp ~]# -y groupinstall "Desktop"
Input a command like below after finishing installation of new packages. |
[2] | Install some packages first. |
[3] | Edit Kernel parameters. |
[root@db01 ~]# /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 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 ~]# -g 200 oinstall
[root@db01 ~]# -u 440 -g oinstall -G dba -d /usr/oracle oracle [root@db01 ~]# oracle Changing password for user oracle. New password: Retype new password: passwd: all authentication tokens updated successfully. [root@db01 ~]# /etc/pam.d/login
# near line 14: add
|
db01 login:
Password:oracle
[oracle@db01 ~]$ 755 /usr/oracle
[oracle@db01 ~]$ /usr/oracle/app
[oracle@db01 ~]$ 775 /usr/oracle/app
[oracle@db01 ~]$ /usr/oracle/oradata
[oracle@db01 ~]$ 775 /usr/oracle/oradata
[oracle@db01 ~]$ ~/.bash_profile
# add follows to the end
umask 022
export ORACLE_BASE=/usr/oracle/app
export ORACLE_BASE=/usr/oracle/app
# create a temporary directory for installation
[oracle@db01 ~]$ tmp
Install Oracle Database 11g R2.
|
|
[1] | . |
[2] |
Download Oracle Databse 11g R2 for Linux and upload on your server.
|
[3] | After uploading Oracle files, move to a tmp directory and run an Installer like follows. |
[oracle@db01 ~]$ tmp
[oracle@db01 tmp]$ 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
|
[17] | Configure some settings for Oracle user. |
[oracle@db01 ~]$ ~/.bash_profile
# add follows to the end
export ORACLE_HOME=$ORACLE_BASE/product/11.2.0/dbhome_1
export PATH=$PATH:$ORACLE_HOME/bin
export PATH=$PATH:$ORACLE_HOME/bin
source ~/.bash_profile
[oracle@db01 ~]$ -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.
[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.
[oracle@db01 ~]$ /etc/oratab
# end line: change
db01:/usr/oracle/app/product/11.2.0/dbhome_1: Y
[oracle@db01 ~]$ ~/.bash_profile
# add follows to the end
export ORACLE_SID=db01
|
[2] | Create an init Script with the root user. |
[root@db01 ~]# /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
[root@db01 ~]# --add oracle
[root@db01 ~]# oracle on