有的时候想想自己到底会有多懒,懒着写博客,已经不知道上一篇博客是什么时候写的。离12c 的发行版已经有段时间了。有着当时的热情给介质下了,却懒着整理,今天抽出来点时间,整理一篇,以便于学习。
具体参考http://docs.oracle.com/cd/E16655_01/install.121/e17720.pdf
oracle 12c 介质下载路径:http://www.oracle.com/technetwork/database/enterprise-edition/downloads/database12c-linux-download-1959253.html
对于oracle 12c 的安装,我一般总会第一时间的去通读一遍官方文档,万变不离其宗的观点,个人总的会认为主要有几块的思路:
1、采用yum源的配置
2、Install 之前的配置(以及检查系统信息、内存信息、创建用户、创建路径等)
3、install software (包含设置环境变量等)
4、netca(配置网络端口号以及客户端的连接方式)
5、dbca(软件安装完成后,已连接到空闲例程。需要DBCA去创建)
此文档没有采用asm
[root@oracle12c ~]# uname -a
Linux oracle12c 2.6.39-300.26.1.el5uek #1 SMP Thu Jan 3 18:31:38 PST 2013 x86_64 x86_64 x86_64 GNU/Linux
[root@oracle12c ~]#
[root@oracle12c ~]# mkdir /media/disk
[root@oracle12c ~]# touch /etc/yum.repos.d/public-yum-el5.repo
[root@oracle12c ~]# vi /etc/yum.repos.d/public-yum-el5.repo
[root@oracle12c ~]# more /etc/yum.repos.d/public-yum-el5.repo
[oel5]
name = Enterprise Linux 5.5 DVD
baseurl=file:///media/disk/Server/
gpgcheck=0
enabled=1
[root@oracle12c ~]# mount /dev/cdrom /media/disk
mount: block device /dev/cdrom is write-protected, mounting read-only
[root@oracle12c ~]# mount
/dev/sda2 on / type ext3 (rw)
proc on /proc type proc (rw)
sysfs on /sys type sysfs (rw)
devpts on /dev/pts type devpts (rw,gid=5,mode=620)
/dev/sda1 on /boot type ext3 (rw)
tmpfs on /dev/shm type tmpfs (rw)
none on /proc/sys/fs/binfmt_misc type binfmt_misc (rw)
sunrpc on /var/lib/nfs/rpc_pipefs type rpc_pipefs (rw)
/dev/sr0 on /media/disk type iso9660 (ro)
[root@oracle12c ~]# yum install clean
Loaded plugins: rhnplugin, security
oel5 | 1.1 kB 00:00
oel5/primary | 1.5 MB 00:00
oel5 3344/3344
Setting up Install Process
No package clean available.
Nothing to do
---oracle linux 5
[root@oracle12c ~]# yum install oracle-validated -y
--oracle linux 6
yum install oracle-rdbms-server-12cR1-preinstall
[root@oracle12c ~]# yum install oracle-validated -y
Loaded plugins: rhnplugin, security
This system is not registered with ULN.
You can use up2date --register to register.
ULN support will be disabled.
Setting up Install Process
Resolving Dependencies
--> Running transaction check
---> Package oracle-validated.x86_64 0:1.1.0-17.el5 set to be updated
oel5/filelists | 3.3 MB 00:00
--> Processing Dependency: sysstat for package: oracle-validated
--> Processing Dependency: /usr/lib/libaio.so for package: oracle-validated
--> Processing Dependency: unixODBC-devel for package: oracle-validated
--> Processing Dependency: /usr/lib64/libodbccr.so for package: oracle-validated
--> Processing Dependency: libaio-devel for package: oracle-validated
--> Processing Dependency: /usr/lib/libodbc.so.1 for package: oracle-validated
--> Processing Dependency: /usr/lib64/libaio.so for package: oracle-validated
--> Processing Dependency: /usr/lib/libodbccr.so for package: oracle-validated
--> Processing Dependency: libXp.so.6 for package: oracle-validated
--> Processing Dependency: libodbc.so.1()(64bit) for package: oracle-validated
--> Running transaction check
---> Package libXp.i386 0:1.0.0-8.1.el5 set to be updated
---> Package libaio-devel.i386 0:0.3.106-5 set to be updated
---> Package libaio-devel.x86_64 0:0.3.106-5 set to be updated
---> Package sysstat.x86_64 0:7.0.2-12.0.1.el5 set to be updated
---> Package unixODBC-devel.i386 0:2.2.11-10.el5 set to be updated
--> Processing Dependency: unixODBC = 2.2.11-10.el5 for package: unixODBC-devel
---> Package unixODBC-devel.x86_64 0:2.2.11-10.el5 set to be updated
---> Package unixODBC-libs.i386 0:2.2.11-10.el5 set to be updated
---> Package unixODBC-libs.x86_64 0:2.2.11-10.el5 set to be updated
--> Running transaction check
---> Package unixODBC.x86_64 0:2.2.11-10.el5 set to be updated
--> Finished Dependency Resolution
Dependencies Resolved
=======================================================================================================================================================================
Package Arch Version Repository Size
=======================================================================================================================================================================
Installing:
oracle-validated x86_64 1.1.0-17.el5 oel5 20 k
Installing for dependencies:
libXp i386 1.0.0-8.1.el5 oel5 22 k
libaio-devel i386 0.3.106-5 oel5 12 k
libaio-devel x86_64 0.3.106-5 oel5 11 k
sysstat x86_64 7.0.2-12.0.1.el5 oel5 188 k
unixODBC x86_64 2.2.11-10.el5 oel5 291 k
unixODBC-devel i386 2.2.11-10.el5 oel5 738 k
unixODBC-devel x86_64 2.2.11-10.el5 oel5 793 k
unixODBC-libs i386 2.2.11-10.el5 oel5 551 k
unixODBC-libs x86_64 2.2.11-10.el5 oel5 554 k
Transaction Summary
=======================================================================================================================================================================
Install 10 Package(s)
Upgrade 0 Package(s)
Total download size: 3.1 M
Downloading Packages:
-----------------------------------------------------------------------------------------------------------------------------------------------------------------------
Total 49 MB/s | 3.1 MB 00:00
Running rpm_check_debug
Running Transaction Test
Finished Transaction Test
Transaction Test Succeeded
Running Transaction
Installing : unixODBC-libs 1/10
Installing : unixODBC 2/10
Installing : sysstat 3/10
Installing : unixODBC-devel 4/10
Installing : libaio-devel 5/10
Installing : libaio-devel 6/10
Installing : unixODBC-libs 7/10
Installing : libXp 8/10
Installing : unixODBC-devel 9/10
Installing : oracle-validated 10/10
Installed:
oracle-validated.x86_64 0:1.1.0-17.el5
Dependency Installed:
libXp.i386 0:1.0.0-8.1.el5 libaio-devel.i386 0:0.3.106-5 libaio-devel.x86_64 0:0.3.106-5 sysstat.x86_64 0:7.0.2-12.0.1.el5
unixODBC.x86_64 0:2.2.11-10.el5 unixODBC-devel.i386 0:2.2.11-10.el5 unixODBC-devel.x86_64 0:2.2.11-10.el5 unixODBC-libs.i386 0:2.2.11-10.el5
unixODBC-libs.x86_64 0:2.2.11-10.el5
Complete!
[root@oracle12c ~]# grep MemTotal /proc/meminfo
MemTotal: 3089112 kB
[root@oracle12c ~]# grep SwapTotal /proc/meminfo
SwapTotal: 6289440 kB
[root@oracle12c ~]# df -h /tmp
Filesystem Size Used Avail Use% Mounted on
/dev/sda2 43G 3.2G 38G 8% /
[root@oracle12c ~]# df -h
Filesystem Size Used Avail Use% Mounted on
/dev/sda2 43G 3.2G 38G 8% /
/dev/sda1 99M 23M 72M 24% /boot
tmpfs 1.5G 0 1.5G 0% /dev/shm
/dev/sr0 3.8G 3.8G 0 100% /media/disk
[root@oracle12c ~]# free
total used free shared buffers cached
Mem: 3089112 1334680 1754432 0 99424 880344
-/+ buffers/cache: 354912 2734200
Swap: 6289440 0 6289440
[root@oracle12c ~]# uname -m
x86_64
[root@oracle12c ~]# more /etc/fstab |grep "tmpfs"
tmpfs /dev/shm tmpfs defaults 0 0
[oracle@oracle12c ~]$ cat /etc/hosts
# Do not remove the following line, or various programs
# that require network functionality will fail.
127.0.0.1 localhost.localdomain localhost
::1 localhost6.localdomain6 localhost6
192.168.3.200 oracle12c
[root@oracle12c ~]# groupadd oinstall
[root@oracle12c ~]# groupadd dba
[root@oracle12c ~]# useradd -g oinstall -G dba oracle
[root@oracle12c ~]# usermod -g oinstall -G dba oracle
[root@oracle12c ~]# id oracle
uid=500(oracle) gid=500(oinstall) groups=500(oinstall),501(dba)
[root@oracle12c ~]# passwd oracle
Changing password for user oracle.
New UNIX password:
BAD PASSWORD: it is based on a dictionary word
Retype new UNIX password:
passwd: all authentication tokens updated successfully.
[root@oracle12c ~]# vi /etc/sysctl.conf
fs.file-max = 6815744
fs.aio-max-nr = 1048576
kernel.shmall = 2097152
kernel.shmmax = 1073741824
kernel.shmmni = 4096
kernel.sem = 250 32000 100 128
net.ipv4.ip_local_port_range = 9000 65500
net.core.rmem_default = 4194304
net.core.rmem_max = 4194304
net.core.wmem_default = 262144
net.core.wmem_max = 1048576
[root@oracle12c ~]# sysctl -p
[root@oracle12c ~]# mkdir /u01
[root@oracle12c ~]# chmod -R 755 /u01
[root@oracle12c /]# chown -R oracle:oinstall u01
[root@oracle12c ~]# mkdir -p /u01/app/oracle
[root@oracle12c ~]# chown -R oracle:oinstall /u01/app/oracle
[root@oracle12c home]# su - oracle
[oracle@oracle12c ~]$ ls
[oracle@oracle12c ~]$ mkdir software
[oracle@oracle12c ~]$ ls
software
[oracle@oracle12c ~]$ cd software/
[oracle@oracle12c software]$ ls
Oracle Database 12c Release 1 (12.1.0.1.0) for Linux x86-64 (Part 1 of 2).zip Oracle Database 12c Release 1 (12.1.0.1.0) for Linux x86-64 (Part 2 of 2).zip
用xftp上传
Oracle Database 12c Release 1 (12.1.0.1.0) for Linux x86-64 (Part 1 of 2).zip
Oracle Database 12c Release 1 (12.1.0.1.0) for Linux x86-64 (Part 2 of 2).zip
这两个介质
并且解压
unzip Oracle Database 12c Release 1 (12.1.0.1.0) for Linux x86-64 (Part 1 of 2).zip unzip Oracle Database 12c Release 1 (12.1.0.1.0) for Linux x86-64 (Part 2 of 2).zip
[oracle@oracle12c database]$ export LANG=c
[oracle@oracle12c database]$ ./runInstaller
Starting Oracle Universal Installer...
Checking Temp space: must be greater than 500 MB. Actual 32199 MB Passed
Checking swap space: must be greater than 150 MB. Actual 6142 MB Passed
Checking monitor: must be configured to display at least 256 colors. Actual 16777216 Passed
Preparing to launch Oracle Universal Installer from /tmp/OraInstall2013-11-18_11-44-04AM. Please wait ...[oracle@oracle12c database]$ You can find the log of this install session at:
/u01/app/oraInventory/logs/installActions2013-11-18_11-44-04AM.log
出现图形界面













用root 用户跑这两个脚本:
[root@oracle12c ~]# /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@oracle12c ~]# /u01/app/oracle/product/12.1.0/dbhome_1/root.sh
Performing root user operation for Oracle 12c
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]:
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.
顺便.给环境变量给改了:
[oracle@oracle12c ~]$ cat .bash_profile
# .bash_profile
# Get the aliases and functions
if [ -f ~/.bashrc ]; then
. ~/.bashrc
fi
# User specific environment and startup programs
PATH=$PATH:$HOME/bin
export PATH
export ORACLE_BASE=/u01/app/oracle
export ORACLE_HOME=/u01/app/oracle/product/12.1.0/dbhome_1
export ORACLE_SID=ora12c
export PATH=$PATH:$ORACLE_HOME/bin
export NLS_LANG='simplified chinese_china.zhs16gbk'
[oracle@oracle12c ~]$ . .bash_profile
[oracle@oracle12c ~]$

























安装后的验证:
[oracle@oracle12c ~]$ sqlplus / as sysdba
SQL*Plus: Release 12.1.0.1.0 Production on 星期一 11月 18 14:01:13 2013
Copyright (c) 1982, 2013, Oracle. All rights reserved.
连接到:
Oracle Database 12c Enterprise Edition Release 12.1.0.1.0 - 64bit Production
With the Partitioning, OLAP, Advanced Analytics and Real Application Testing options
SQL> show user
USER 为 "SYS"
SQL> exit
SQL> create user testora identified by testora
2 ;
用户已创建。
SQL> grant dba to testora;
授权成功。
SQL> exit
从 Oracle Database 12c Enterprise Edition Release 12.1.0.1.0 - 64bit Production
With the Partitioning, OLAP, Advanced Analytics and Real Application Testing options 断开
[oracle@oracle12c ~]$ sqlplus testora/testora@192.168.3.200:1521/ora12c
SQL*Plus: Release 12.1.0.1.0 Production on 星期一 11月 18 14:06:16 2013
Copyright (c) 1982, 2013, Oracle. All rights reserved.
连接到:
Oracle Database 12c Enterprise Edition Release 12.1.0.1.0 - 64bit Production
With the Partitioning, OLAP, Advanced Analytics and Real Application Testing options
SQL> show user
USER 为 "TESTORA"