the work directory /tmp/ oracle,Centos 六 Oracle 12C 超详细安装

Centos 6 Oracle 12C 超详细安装

Install Oracle Database 12c.

Before Installing, Change some settings for requirements of installing Oracle database.

[1]

Install Desktop Environment, refer to here.

[2]

Install some packages first.

[root@dlp ~]#

yum -y install binutils compat-libcap1 compat-libstdc++-33 compat-libstdc++-33.i686 gcc gcc-c++ glibc glibc.i686 glibc-devel glibc-devel.i686

ksh libgcc libgcc.i686 libstdc++ libstdc++.i686 libstdc++-devel libstdc++-devel.i686 libaio libaio.i686 libaio-devel libaio-devel.i686 ibXext ibXext.i686 libX11 libX11.i686 libxcb libxcb.i686 libXi libXi.i686 make sysstat

[3]

Edit Kernel parameters.

[root@dlp ~]#

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

kernel.shmmni=4096

kernel.sem=250 32000 100 128

fs.file-max=6815744

fs.aio-max-nr=1048576

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

[root@dlp ~]#

sysctl -p

net.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

kernel.msgmnb = 65536

kernel.msgmax = 65536

kernel.shmmax = 68719476736

kernel.shmall = 4294967296

kernel.shmmni = 4096

kernel.sem = 250 32000 100 128

fs.file-max = 6815744

fs.aio-max-nr = 1048576

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

[4]

Create user and groups for Oracle Database.

[root@dlp ~]#

i=54321; for group in oinstall dba backupdba oper dgdba kmdba; do

groupadd -g $i $group; i=`expr $i + 1`

done

[root@dlp ~]#

useradd -u 1200 -g oinstall -G dba,oper,backupdba,dgdba,kmdba -d /home/oracle oracle

[root@dlp ~]#

passwd oracle

Changing password for user oracle.

New password:

Retype new password:

passwd: all authentication tokens updated successfully.

[root@dlp ~]#

mkdir -p /u01/app/oracle

[root@dlp ~]#

chown -R oracle:oinstall /u01/app

[root@dlp ~]#

chmod -R 775 /u01

[root@dlp ~]#

vi /etc/pam.d/login

# near line 14: add

session required pam_selinux.so open

session required pam_namespace.so

session required pam_limits.so

session optional pam_keyinit.so force revoke

session include system-auth

-session optional pam_ck_connector.so

[root@dlp ~]#

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

oracle soft stack 10240

oracle hard stack 32768

[5]

Switch to a user "Oracle" and configure some settings.

dlp login:

oracle

Password:

[oracle@dlp ~]$

vi ~/.bash_profile

# add follows to the end

umask 022

export ORACLE_BASE=/u01/app/oracle

# create a temporary directory for installation

[oracle@dlp ~]$

mkdir tmp

Install Oracle Database 12c.

[1]

Login and work with "oracle" user which you create in previous section.

1750382079.png

[2]

Download Oracle Databse 12c 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@dlp ~]$

cd tmp

[oracle@dlp tmp]$

unzip linuxamd64_12102_database_1of2.zip

[oracle@dlp tmp]$

unzip linuxamd64_12102_database_2of2.zip

[oracle@dlp 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.

1750382080.png

[5]

On this example, Select "Install database software only".

1750382081.png

[6]

On this example, Select "Single Instance Database ***".

1750382082.png

[7]

Select your language.

1750382083.png

[8]

Select which edition you install.

1750382084.png

[9]

Specify the base directory and files for Oracle. On this example, keep default and proceed to next.

1750382085.png

[10]

Specify the installed directory. On this example, keep default and proceed to next.

1750382086.png

[11]

Specify the priviledged group. On this example, keep default and proceed to next.

1750382087.png

[12]

The summary is shown for configuration. Click "Finish" if it's OK all.

1750382088.png

[13]

Installation starts.

1750382089.png

[14]

Following screen is shown, then open a terminal and execute follwong commands with the root user.

1750382090.png

[root@dlp ~]#

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

[root@dlp ~]#

[root@dlp ~]#

/u01/app/oracle/product/12.1.0/dbhome_1/root.sh

Performing root user operation.

The following environment variables are set as:

ORACLE_OWNER= oracle

ORACLE_HOME= /u01/app/oracle/product/12.1.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 script.

Now product-specific root actions will be performed.

[15]

Installation completed. Click "Close" button.

1750382091.png

[16]

Configure some settings for Oracle user.

[oracle@dlp ~]$

vi ~/.bash_profile

# add follows to the end

export ORACLE_HOME=/u01/app/oracle/product/12.1.0/dbhome_1

export PATH=$PATH:$ORACLE_HOME/bin

[oracle@dlp ~]$

source ~/.bash_profile

[oracle@dlp ~]$

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@dlp ~]$ netca

[2]

Check a box "Listener Configuration" and go next.

1750382092.png

[3]

Go next.

1750382093.png

[4]

Set Listner's name. Input any one you like.

1750382094.png

[5]

This example goes next with keeping default "TCP".

1750382095.png

[6]

Set a port. This example goes next with keeping default.

1750382096.png

[7]

If you'd like to create more Listeners, Answer "Yes". This example selects "No".

1750382097.png

[8]

Configuration completed.

1750382098.png

[9]

Click "Finish" to quit. After finishing, Confirm the status by "netstat" comand. Then you'll see "tnslsnr" listens 1521 port.

1750382099.png

Create a Database.

[1]

Login with the "oracle" user and input a command "dbca" like follows.

[oracle@dlp ~]$ dbca

[2]

Select "Create Database" and go next.

1750382100.png

[3]

On this example, select "Advanced Mode" and go next.

1750382101.png

[4]

This example selects "General Purpose ***" and go next.

1750382102.png

[5]

Set Grobal Database name and SID like follows. Input any one you like.

1750382103.png

[6]

This example goes next with keeping default.

1750382104.png

[7]

Set passwords. Please set a password for a user for security.

1750382105.png

[8]

Configure Listener. On this example, keep default and go next.

1750382106.png

[9]

Configure Storage settings. On this example, keep default and go next.

1750382107.png

[10]

Configure sample schema and scripts. If you'd like to add them, Set them.

1750382108.png

[11]

Configure memory settings. After setting, go to next tab.

1750382109.png

[12]

Specify max processes.

1750382110.png

[13]

Set Character setting.

1750382111.png

[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.

1750382112.png

[15]

Go next.

1750382113.png

[16]

Configuration completed. Click "Finish" button to finish.

1750382114.png

[17]

Database creation starts.

1750382115.png

[18]

After completing to create a database, Click "Close" to finish.

1750382116.png

[19]

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 [7].

1750382117.png

[20]

Just logined. It's possible to manage the database on here.

1750382118.png

Create an init Script to make Oracle start automatically on system booting.

[1]

Set environment variables for "oracle" user like follows.

[oracle@dlp ~]$

vi /etc/oratab

# end line: change

dlp:/u01/app/oracle/product/12.1.0/dbhome_1:

Y

[oracle@dlp ~]$

vi ~/.bash_profile

# add follows to the end

export ORACLE_SID=dlp

[2]

Create an init Script with the root user.

[root@dlp ~]#

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

# it's an example, edit it you like.

#!/bin/bash

# oracle: Start/Stop Oracle Database 12c R1

#

# 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=/u01/app/oracle/product/12.1.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"

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"

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@dlp ~]#

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

[root@dlp ~]#

chkconfig --add oracle

[root@dlp ~]#

chkconfig oracle on

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值