Oracle database 12c:Installation on OEL5
本文参考Oracle官方文档:
Database Installation Guide for Linux:
http://docs.oracle.com/database/121/LADBI/toc.htm
在安装开始前,最好把需要做的事情整理出一张清单列表(Check List)
Oracle官方推荐的这张列表如下:
Server Hardware Checklist:
服务器厂商:
服务器型号:
服务器架构:
(Q)是否支持HBA(Host Bus Adaptor):
(Q)服务器是否联网:
内网 / 外网:
(Q)是否有显示器:
(Q)是否有DVD光驱:
操作系统的运行级别(Run Level):【等级3:无图形化界面;等级5:图形化支持】
显卡的分辨率:【最少需要提供:1028 x 768】
是否有足够的磁盘空间提供给Oracle系列软件?具体准备了多少?:【企业版:6.4G;标准版:6.1G】
SWAP多大?:【最少需要1GB,最好给到4G或者更大】
临时空间(/tmp)多大?:【最少分配1GB】
——————————————
一、操作系统支持(for Oracle Database Installation)
操作系统的发行版:
具体的版本请参阅:
http://docs.oracle.com/database/121/LADBI/pre_install.htm#LADBI7533
或者有MOS(My Oracle Support)的朋友可以去上面的“认证”功能下搜索是否支持你当前使用的Linux发行版。
如果有的Linux发行版不被官方支持,很可能死活都装不上去。
操作系统的软件(RPM)支持:
对于不同的版本的Linux来说,需要安装的RPM包也是不同的。
官方对于RPM支持的说明具体如下:
http://docs.oracle.com/database/121/LADBI/olinrpm.htm#LADBI7477
官方使用的方式大部分是基于你要操作的服务器可以联网,并且可以注册到Oracle的ULN技术支持网络(这是需要付费的)。
如果你满足了上面的两点,你可以很简单的安装:oracle-rdbms-server-12cR1-preinstall(针对OEL6版本)或者oracle-validated(针对OEL5版本)来完成Oracle软件安装前的全部操作系统的Preinstall过程。
OEL 6:
yum install oracle-rdbms-server-12cR1-preinstall
OEL 5:
yum install oracle-validated
如果你的服务器不能连到外网,并且你也没有购买ULN支持。
你可以选择从DVD介质来安装RPM。
配置YUM:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 |
[root@oracledb12c yum.repos.d]# df -h Filesystem Size Used Avail Use% Mounted on /dev/mapper/VolGroup00-LogVol00 14G 3.1G 9.9G 24% / /dev/sda1 99M 25M 70M 26% /boot tmpfs 2.0G 0 2.0G 0% /dev/shm /dev/sr0 4.0G 4.0G 0 100% /iso [root@oracledb12c yum.repos.d]# [root@oracledb12c yum.repos.d]# ls iso.repo [root@oracledb12c yum.repos.d]# [root@oracledb12c yum.repos.d]# cat iso.repo [Server] name=Server baseurl=file:///iso/Server gpgcheck=0 [VT] name=VT baseurl=file:///iso/VT gpgcheck=0 [Cluster] name=Cluster baseurl=file:///iso/Cluster gpgcheck=0 [ClusterStorage] name=ClusterStorage baseurl=file:///iso/ClusterStorage gpgcheck=0 [root@oracledb12c yum.repos.d]# [root@oracledb12c yum.repos.d]# yum repolist Loaded plugins: rhnplugin, security This system is not registered with ULN. You can use up2date --register to register. ULN support will be disabled. repo id repo name status Cluster Cluster 9 ClusterStorage ClusterStorage 16 Server Server 3,370 VT VT 35 repolist: 3,430 [root@oracledb12c yum.repos.d]# |
需要的软件包如下:
针对OEL5的发行版:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 |
binutils-2.17.50.0.6 compat-libstdc++-33.3.2.3 (32/64) elfutils-libelf-0.125 elfutils-libelf-devel-0.125 gcc-4.1.2 gcc-c++-4.1.2 glibc-2.5-58 (32/64) glibc-common-2.5 glibc-devel-2.5 (32/64) glibc-headers-2.5 ksh-20060214 libaio-0.3.106 (32/64) libaio-devel-0.3.106 (32/64) libgcc-4.1.2 (32/64) libstdc++-4.1.2 (32/64) libstdc++-devel-4.1.2 make-3.8.1 sysstat-7.0.2 unixODBC-2.2.14 (64) unixODBC-devel-2.2.14 (64) |
Yum软件包的安装:
1 2 3 4 5 6 7 8 |
第一: yum install -y binutils.x86_64 compat-libcap1.x86_64 compat-libstdc++-33.i686 compat-libstdc++-33.x86_64 gcc.x86_64 gcc-c++.x86_64 glibc.x86_64 glibc.i686 glibc-devel.x86_64 glibc-devel.i686 ksh.x86_64 libgcc.x86_64 libgcc.i686 libstdc++.i686 libstdc++.x86_64 libstdc++-devel.i686 libstdc++-devel.x86_64 libaio.x86_64 libaio.i686 libaio-devel.i686 libaio-devel.x86_64 libXext.x86_64 libXext.i686 libXtst.x86_64 libXtst.i686 libX11.x86_64 libX11.i686 libXau.x86_64 libXau.i686 libxcb.x86_64 libxcb.i686 libXi.x86_64 libXi.i686 make.x86_64 sysstat.x86_64 第二: yum install -y compat-libcap1* compat-libstdc++-* glibc-devel* libgcc* libstdc++-devel* libaio* libXext* libX11* libXau* libxcb* libxi* 第三: yum install -y compat-libcap* libXcb* libXi* |
Linux内核参数:
关于各个内核参数的说明具体如下:
http://docs.oracle.com/database/121/LADBI/app_manual.htm#LADBI7867
配置过程:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 |
编辑文件:/etc/sysctl.conf vi /etc/sysctl.conf [root@oracledb12c yum.repos.d]# vi /etc/sysctl.conf [root@oracledb12c yum.repos.d]# cat /etc/sysctl.conf # Kernel sysctl configuration file for Oracle Enterprise Linux # # For binary values, 0 is disabled, 1 is enabled. See sysctl(8) and # sysctl.conf(5) for more details. # Controls IP packet forwarding net.ipv4.ip_forward = 0 # Controls source route verification # See /usr/share/doc/kernel-doc-*/Documentation/networking/ip-sysctl.txt net.ipv4.conf.default.rp_filter = 2 # Do not accept source routing net.ipv4.conf.default.accept_source_route = 0 # Controls the System Request debugging functionality of the kernel kernel.sysrq = 0 # Controls whether core dumps will append the PID to the core filename # Useful for debugging multi-threaded applications kernel.core_uses_pid = 1 # Controls the use of TCP syncookies net.ipv4.tcp_syncookies = 1 # Controls the default maxmimum size of a mesage queue kernel.msgmnb = 65536 # Controls the maximum size of a message, in bytes kernel.msgmax = 65536 # Controls the maximum shared segment size, in bytes kernel.shmmax = 68719476736 # Controls the maximum number of shared memory segments, in pages kernel.shmall = 4294967296 # For Oracle Database 12c fs.aio-max-nr = 1048576 fs.file-max = 6815744 kernel.shmall = 2097152 kernel.shmmax = 4294967295 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 kernel.msgmnb=65536 kernel.msgmax=65536 [root@oracledb12c yum.repos.d]# 让对内核参数的修改立即生效: sysctl -p [root@oracledb12c yum.repos.d]# sysctl -p net.ipv4.ip_forward = 0 net.ipv4.conf.default.rp_filter = 2 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 fs.aio-max-nr = 1048576 fs.file-max = 6815744 kernel.shmall = 2097152 kernel.shmmax = 4294967295 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 kernel.msgmnb = 65536 kernel.msgmax = 65536 [root@oracledb12c yum.repos.d]# |
User Environment Configuration for Oracle Database:
创建需要的组和用户:
创建Oracle Inventory组:
1 2 3 4 5 6 7 8 |
Eg:groupadd -g 54321 oinstall [root@oracledb12c yum.repos.d]# grep oinstall /etc/group [root@oracledb12c yum.repos.d]# [root@oracledb12c yum.repos.d]# groupadd oinstall [root@oracledb12c yum.repos.d]# grep oinstall /etc/group oinstall:x:500: [root@oracledb12c yum.repos.d]# |
接下来创建Oracle Database组:
标准的Oracle Database组是按照不同的工作角色来区分的,具体如下:
OSDBA组 – dba
OSOPER组 – oper
OSBACKUPDBA组 – backupdba
OSDGDBA组 – dgdba
OSKMDBA组 – kmdba 【用于Encyption Key的管理】
OSDBA组(FOR Oracle ASM) – asmdba
Oracle Grid Infrastructure software owner – grid(该组是创建该用户的时候自动创建的同名组)
OSASM组(For Oracle ASM) – asmadmin
OSOPER组(For Oracle ASM) – asmoper
在我的当前环境中只需要启用OSDBA和OSOPER两个工作角色对应的系统组即可,并且我也没有用到Oracle ASM:
1 2 3 4 5 6 7 8 9 10 11 |
groupadd dba groupadd oper [root@oracledb12c yum.repos.d]# groupadd dba [root@oracledb12c yum.repos.d]# groupadd oper [root@oracledb12c yum.repos.d]# [root@oracledb12c yum.repos.d]# grep dba /etc/group dba:x:501: [root@oracledb12c yum.repos.d]# grep oper /etc/group oper:x:502: [root@oracledb12c yum.repos.d]# |
创建用户:
这里的用户是为Oracle系列软件的所有者,具体的创建如下:
1 2 3 4 5 6 7 8 9 10 |
[root@oracledb12c yum.repos.d]# useradd -g oinstall -G dba,oper -c "Oracle Database 12C - owner" oracle [root@oracledb12c yum.repos.d]# id oracle uid=500(oracle) gid=500(oinstall) groups=500(oinstall),501(dba),502(oper) [root@oracledb12c yum.repos.d]# 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@oracledb12c yum.repos.d]# |
设置用户环境变量:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 |
[root@oracledb12c ~]# cat /home/oracle/.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 # for Oracle database 12c export TMP=/tmp export TMPDIR=$TMP export ORACLE_HOSTNAME=oracledb12c export ORACLE_UNQNAME=yayu export ORACLE_BASE=/u01/app/oracle export ORACLE_HOME=$ORACLE_BASE/product/12/db_1 export ORACLE_SID=yayu1 export PATH=/usr/sbin:$PATH export PATH=$ORACLE_HOME/bin:$PATH export LD_LIBRARY_PATH=$ORACLE_HOME/lib:/lib:/usr/lib export CLASSPATH=$ORACLE_HOME/JRE:$ORACLE_HOME/jlib:$ORACLE_HOME/rdbms/jlib [root@oracledb12c ~]# |
为Oracle系列软件的拥有者(系统用户:oracle)添加资源限定:
修改:/etc/security/limits.conf文件。
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 |
[root@oracledb12c ~]# cat /etc/security/limits.conf # /etc/security/limits.conf # #Each line describes a limit for a user in the form: # #<domain> <type> <item> <value> # #Where: #<domain> can be: # - an user name # - a group name, with @group syntax # - the wildcard *, for default entry # - the wildcard %, can be also used with %group syntax, # for maxlogin limit # #<type> can have the two values: # - "soft" for enforcing the soft limits # - "hard" for enforcing hard limits # #<item> can be one of the following: # - core - limits the core file size (KB) # - data - max data size (KB) # - fsize - maximum filesize (KB) # - memlock - max locked-in-memory address space (KB) # - nofile - max number of open files # - rss - max resident set size (KB) # - stack - max stack size (KB) # - cpu - max CPU time (MIN) # - nproc - max number of processes # - as - address space limit # - maxlogins - max number of logins for this user # - maxsyslogins - max number of logins on the system # - priority - the priority to run user process with # - locks - max number of file locks the user can hold # - sigpending - max number of pending signals # - msgqueue - max memory used by POSIX message queues (bytes) # - nice - max nice priority allowed to raise to # - rtprio - max realtime priority # #<domain> <type> <item> <value> # #* soft core 0 #* hard rss 10000 #@student hard nproc 20 #@faculty soft nproc 20 #@faculty hard nproc 50 #ftp hard nproc 0 #@student - maxlogins 4 # End of file # Oracle database 12c oracle soft nproc 2047 oracle hard nproc 16384 oracle soft nofile 1024 oracle hard nofile 65536 oracle hard memlock 3145728 [root@oracledb12c ~]# |
Display X11:
如果你是远程控制台或者模拟终端连接的服务器,需要GUI界面,你需要设置X11的Display环境变量。
在我的环境中:
远端服务器:
192.168.65.129
本机:
192.168.65.1
所以,我的设置是这样的:
1 2 3 4 5 |
[root@oracledb12c ~]# env | grep DISPLAY [root@oracledb12c ~]# export DISPLAY=192.168.65.1:0.0 [root@oracledb12c ~]# env | grep DISPLAY DISPLAY=192.168.65.1:0.0 [root@oracledb12c ~]# |
要让上面的DISPLAY的设定真正生效前,需要在本机启动PASSIVE:
让DISPLAY真正生效:
1 2 3 |
[root@oracledb12c ~]# xhost + access control disabled, clients can connect from any host [root@oracledb12c ~]# |
创建Oracle系列软件需要的目录结构:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 |
[root@oracledb12c ~]# mkdir /u01/ [root@oracledb12c ~]# ll -d /u01 drwxr-xr-x 2 root root 4096 Aug 31 18:00 /u01 [root@oracledb12c ~]# chown -R oracle.oinstall /u01 [root@oracledb12c ~]# su - oracle [oracle@oracledb12c ~]$ mkdir -p $ORACLE_HOME [oracle@oracledb12c ~]$ [oracle@oracledb12c ~]$ ll -d /u01 drwxr-xr-x 3 oracle oinstall 4096 Aug 31 18:00 /u01 [oracle@oracledb12c ~]$ [oracle@oracledb12c ~]$ tree /u01/ /u01/ `-- app `-- oracle `-- product `-- 12 `-- db_1 5 directories, 0 files [oracle@oracledb12c ~]$ |
网络配置:
需要修改网络配置的NoZeroConf为真。
1 2 3 4 5 6 |
[root@oracledb12c ~]# cat /etc/sysconfig/network NETWORKING=yes NETWORKING_IPV6=yes HOSTNAME=oracledb12c NOZEROCONF=yes [root@oracledb12c ~]# |
PAM认证:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 |
[root@oracledb12c ~]# cat /etc/pam.d/login #%PAM-1.0 auth [user_unknown=ignore success=ok ignore=ignore default=bad] pam_securetty.so auth include system-auth account required pam_nologin.so account include system-auth password include system-auth # pam_selinux.so close should be the first session rule session required pam_selinux.so close session optional pam_keyinit.so force revoke session required pam_loginuid.so session include system-auth session optional pam_console.so # pam_selinux.so open should only be followed by sessions to be executed in the user context session required pam_selinux.so open # Oracle database 12c session required pam_limits.so [root@oracledb12c ~]# |
系统:确认防火墙与SELINUX关闭与禁用:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 |
[root@oracledb12c ~]# sestatus SELinux status: disabled [root@oracledb12c ~]# service iptables status Firewall is stopped. [root@oracledb12c ~]# [root@oracledb12c ~]# cat /etc/selinux/config # This file controls the state of SELinux on the system. # SELINUX= can take one of these three values: # enforcing - SELinux security policy is enforced. # permissive - SELinux prints warnings instead of enforcing. # disabled - SELinux is fully disabled. SELINUX=disabled # SELINUXTYPE= type of policy in use. Possible values are: # targeted - Only targeted network daemons are protected. # strict - Full SELinux protection. SELINUXTYPE=targeted [root@oracledb12c ~]# [root@oracledb12c ~]# chkconfig --list iptables iptables 0:off 1:off 2:off 3:off 4:off 5:off 6:off [root@oracledb12c ~]# |
开始解压:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 |
[root@oracledb12c ~]# cd /software/ [root@oracledb12c software]# ls [root@oracledb12c software]# ls V46095-01_1of2.zip V46095-01_2of2.zip [root@oracledb12c software]# df -h Filesystem Size Used Avail Use% Mounted on /dev/mapper/VolGroup00-LogVol00 14G 5.6G 7.5G 43% / /dev/sda1 99M 25M 70M 26% /boot tmpfs 2.0G 0 2.0G 0% /dev/shm /dev/sr0 4.0G 4.0G 0 100% /iso [root@oracledb12c software]# [root@oracledb12c software]# unzip V46095-01_1of2.zip ;rm -rf V46095-01_1of2.zip ;unzip V46095-01_2of2.zip ;rm -rf V46095-01_2of2.zip (... etc。) inflating: database/stage/Components/oracle.rdbms/12.1.0.2.0/1/DataFiles/filegroup24.jar inflating: database/stage/Components/oracle.rdbms/12.1.0.2.0/1/DataFiles/filegroup70.jar inflating: database/stage/Components/oracle.rdbms/12.1.0.2.0/1/DataFiles/filegroup31.jar inflating: database/stage/Components/oracle.rdbms/12.1.0.2.0/1/DataFiles/filegroup81.jar inflating: database/stage/Components/oracle.rdbms/12.1.0.2.0/1/DataFiles/filegroup19.9.1.jar inflating: database/stage/Components/oracle.rdbms/12.1.0.2.0/1/DataFiles/filegroup66.jar inflating: database/stage/Components/oracle.rdbms/12.1.0.2.0/1/DataFiles/filegroup4.jar inflating: database/stage/Components/oracle.rdbms/12.1.0.2.0/1/DataFiles/filegroup19.jar creating: database/stage/Components/oracle.javavm.containers/ creating: database/stage/Components/oracle.javavm.containers/12.1.0.2.0/ creating: database/stage/Components/oracle.javavm.containers/12.1.0.2.0/1/ creating: database/stage/Components/oracle.javavm.containers/12.1.0.2.0/1/DataFiles/ inflating: database/stage/Components/oracle.javavm.containers/12.1.0.2.0/1/DataFiles/filegroup2.jar inflating: database/stage/Components/oracle.javavm.containers/12.1.0.2.0/1/DataFiles/filegroup1.jar inflating: database/install/.oui [root@oracledb12c software]# |
启动OUI:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 |
[root@oracledb12c ~]# su - oracle [oracle@oracledb12c ~]$ cd /software [oracle@oracledb12c software]$ ll total 4 drwxrwxrwx 7 root root 4096 Jul 7 2014 database [oracle@oracledb12c software]$ cd database/ [oracle@oracledb12c database]$ ls install response rpm runInstaller sshsetup stage welcome.html [oracle@oracledb12c database]$ [oracle@oracledb12c database]$ ./runInstaller Starting Oracle Universal Installer... Checking Temp space: must be greater than 500 MB. Actual 7355 MB Passed Checking swap space: must be greater than 150 MB. Actual 5951 MB Passed Checking monitor: must be configured to display at least 256 colors. Actual 16777216 Passed Preparing to launch Oracle Universal Installer from /tmp/OraInstall2015-08-31_06-40-20PM. Please wait ...[oracle@oracledb12c database]$ [oracle@oracledb12c database]$ |
执行脚本:
1. /u01/app/oraInventory/orainstRoot.sh
1 2 3 4 5 6 7 8 |
[root@oracledb12c ~]# /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@oracledb12c ~]# |
2. /u01/app/oracle/product/12/db_1/root.sh
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 |
[root@oracledb12c ~]# /u01/app/oracle/product/12/db_1/root.sh Performing root user operation. The following environment variables are set as: ORACLE_OWNER= oracle ORACLE_HOME= /u01/app/oracle/product/12/db_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. [root@oracledb12c ~]# |
这样,数据库的软件部分就安装完成了。
——————————————
扩容:
在开始DBCA建库之前,首先,看看当前的磁盘空间使用情况:
1 2 3 4 5 6 7 8 |
[oracle@oracledb12c ~]$ df -h Filesystem Size Used Avail Use% Mounted on /dev/mapper/VolGroup00-LogVol00 14G 8.4G 4.7G 65% / /dev/sda1 99M 25M 70M 26% /boot tmpfs 2.0G 0 2.0G 0% /dev/shm /dev/sr0 4.0G 4.0G 0 100% /iso [oracle@oracledb12c ~]$ |
先关掉虚拟机,增加一块20G的虚拟磁盘文件,对文件系统扩容:
1 |
shutdown -h now |
Oracle Linux,对新增的磁盘管理:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 |
[root@oracledb12c ~]# fdisk -l Disk /dev/sda: 21.4 GB, 21474836480 bytes 255 heads, 63 sectors/track, 2610 cylinders Units = cylinders of 16065 * 512 = 8225280 bytes Device Boot Start End Blocks Id System /dev/sda1 * 1 13 104391 83 Linux /dev/sda2 14 2610 20860402+ 8e Linux LVM Disk /dev/sdb: 32.2 GB, 32212254720 bytes 255 heads, 63 sectors/track, 3916 cylinders Units = cylinders of 16065 * 512 = 8225280 bytes Disk /dev/sdb doesn't contain a valid partition table Disk /dev/dm-0: 15.0 GB, 15099494400 bytes 255 heads, 63 sectors/track, 1835 cylinders Units = cylinders of 16065 * 512 = 8225280 bytes Disk /dev/dm-0 doesn't contain a valid partition table Disk /dev/dm-1: 6241 MB, 6241124352 bytes 255 heads, 63 sectors/track, 758 cylinders Units = cylinders of 16065 * 512 = 8225280 bytes Disk /dev/dm-1 doesn't contain a valid partition table [root@oracledb12c ~]# [root@oracledb12c ~]# fdisk /dev/sdb Device contains neither a valid DOS partition table, nor Sun, SGI or OSF disklabel Building a new DOS disklabel. Changes will remain in memory only, until you decide to write them. After that, of course, the previous content won't be recoverable. The number of cylinders for this disk is set to 3916. There is nothing wrong with that, but this is larger than 1024, and could in certain setups cause problems with: 1) software that runs at boot time (e.g., old versions of LILO) 2) booting and partitioning software from other OSs (e.g., DOS FDISK, OS/2 FDISK) Warning: invalid flag 0x0000 of partition table 4 will be corrected by w(rite) Command (m for help): p Disk /dev/sdb: 32.2 GB, 32212254720 bytes 255 heads, 63 sectors/track, 3916 cylinders Units = cylinders of 16065 * 512 = 8225280 bytes Device Boot Start End Blocks Id System Command (m for help): n Command action e extended p primary partition (1-4) p Partition number (1-4): 1 First cylinder (1-3916, default 1): Using default value 1 Last cylinder or +size or +sizeM or +sizeK (1-3916, default 3916): Using default value 3916 Command (m for help): p Disk /dev/sdb: 32.2 GB, 32212254720 bytes 255 heads, 63 sectors/track, 3916 cylinders Units = cylinders of 16065 * 512 = 8225280 bytes Device Boot Start End Blocks Id System /dev/sdb1 1 3916 31455238+ 83 Linux Command (m for help): w The partition table has been altered! Calling ioctl() to re-read partition table. Syncing disks. [root@oracledb12c ~]# [root@oracledb12c ~]# partprobe /dev/sdb [root@oracledb12c ~]# [root@oracledb12c ~]# mkfs.ext4 /dev/sdb1 mke4fs 1.41.12 (17-May-2010) Filesystem label= OS type: Linux Block size=4096 (log=2) Fragment size=4096 (log=2) Stride=0 blocks, Stripe width=0 blocks 1966080 inodes, 7863809 blocks 393190 blocks (5.00%) reserved for the super user First data block=0 Maximum filesystem blocks=4294967296 240 block groups 32768 blocks per group, 32768 fragments per group 8192 inodes per group Superblock backups stored on blocks: 32768, 98304, 163840, 229376, 294912, 819200, 884736, 1605632, 2654208, 4096000 Writing inode tables: done Creating journal (32768 blocks): done Writing superblocks and filesystem accounting information: done This filesystem will be automatically checked every 28 mounts or 180 days, whichever comes first. Use tune4fs -c or -i to override. [root@oracledb12c ~]# |
挂载以及权限赋予:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 |
[root@oracledb12c ~]# mkdir /oradata [root@oracledb12c ~]# [root@oracledb12c ~]# df -h Filesystem Size Used Avail Use% Mounted on /dev/mapper/VolGroup00-LogVol00 14G 8.4G 4.7G 65% / /dev/sda1 99M 25M 70M 26% /boot tmpfs 2.0G 0 2.0G 0% /dev/shm [root@oracledb12c ~]# [root@oracledb12c ~]# mount /dev/sdb1 /oradata/ [root@oracledb12c ~]# [root@oracledb12c ~]# df -h Filesystem Size Used Avail Use% Mounted on /dev/mapper/VolGroup00-LogVol00 14G 8.4G 4.7G 65% / /dev/sda1 99M 25M 70M 26% /boot tmpfs 2.0G 0 2.0G 0% /dev/shm /dev/sdb1 30G 172M 28G 1% /oradata [root@oracledb12c ~]# [root@oracledb12c ~]# ll -d /oradata/ drwxr-xr-x 3 root root 4096 Sep 1 11:13 /oradata/ [root@oracledb12c ~]# [root@oracledb12c ~]# chown -R oracle.oinstall /oradata/ [root@oracledb12c ~]# ll -d /oradata/ drwxr-xr-x 3 oracle oinstall 4096 Sep 1 11:13 /oradata/ [root@oracledb12c ~]# |
数据库的数据文件放在以上的:/oradata目录中。
——————————————
DBCA建库:
1 2 3 |
[oracle@oracledb12c ~]$ dbca & [1] 3934 [oracle@oracledb12c ~]$ |
查看后台进程的状态:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 |
[oracle@oracledb12c ~]$ ps -ef | grep --color ora_ oracle 4815 1 0 11:38 ? 00:00:00 ora_pmon_conorcl oracle 4817 1 0 11:38 ? 00:00:00 ora_psp0_conorcl oracle 4819 1 1 11:38 ? 00:00:06 ora_vktm_conorcl oracle 4823 1 0 11:38 ? 00:00:00 ora_gen0_conorcl oracle 4825 1 0 11:38 ? 00:00:00 ora_mman_conorcl oracle 4829 1 0 11:38 ? 00:00:00 ora_diag_conorcl oracle 4831 1 0 11:38 ? 00:00:00 ora_dbrm_conorcl oracle 4833 1 0 11:38 ? 00:00:00 ora_vkrm_conorcl oracle 4835 1 0 11:38 ? 00:00:00 ora_dia0_conorcl oracle 4837 1 0 11:38 ? 00:00:00 ora_dbw0_conorcl oracle 4839 1 0 11:38 ? 00:00:00 ora_lgwr_conorcl oracle 4841 1 0 11:38 ? 00:00:00 ora_ckpt_conorcl oracle 4843 1 0 11:38 ? 00:00:00 ora_smon_conorcl oracle 4845 1 0 11:38 ? 00:00:00 ora_reco_conorcl oracle 4847 1 0 11:38 ? 00:00:00 ora_lreg_conorcl oracle 4849 1 0 11:38 ? 00:00:00 ora_pxmn_conorcl oracle 4851 1 0 11:38 ? 00:00:01 ora_mmon_conorcl oracle 4853 1 0 11:38 ? 00:00:00 ora_mmnl_conorcl oracle 4855 1 0 11:38 ? 00:00:00 ora_d000_conorcl oracle 4857 1 0 11:38 ? 00:00:00 ora_s000_conorcl oracle 4869 1 0 11:38 ? 00:00:00 ora_tmon_conorcl oracle 4871 1 0 11:38 ? 00:00:00 ora_tt00_conorcl oracle 4873 1 0 11:38 ? 00:00:00 ora_smco_conorcl oracle 4875 1 0 11:38 ? 00:00:00 ora_w000_conorcl oracle 4877 1 0 11:38 ? 00:00:00 ora_w001_conorcl oracle 4879 1 0 11:38 ? 00:00:00 ora_aqpc_conorcl oracle 4883 1 0 11:38 ? 00:00:00 ora_p000_conorcl oracle 4885 1 0 11:38 ? 00:00:00 ora_p001_conorcl oracle 4887 1 0 11:38 ? 00:00:00 ora_p002_conorcl oracle 4889 1 0 11:38 ? 00:00:00 ora_p003_conorcl oracle 4891 1 0 11:38 ? 00:00:00 ora_cjq0_conorcl oracle 5144 1 0 11:38 ? 00:00:00 ora_p004_conorcl oracle 5146 1 0 11:38 ? 00:00:02 ora_p005_conorcl oracle 5161 1 0 11:38 ? 00:00:00 ora_qm02_conorcl oracle 5165 1 0 11:38 ? 00:00:00 ora_q002_conorcl oracle 5167 1 0 11:38 ? 00:00:00 ora_q003_conorcl oracle 5213 1 0 11:39 ? 00:00:00 ora_w002_conorcl oracle 5262 3821 0 11:47 pts/2 00:00:00 grep --color ora_ [oracle@oracledb12c ~]$ [oracle@oracledb12c ~]$ export ORACLE_SID=conorcl [oracle@oracledb12c ~]$ sqlplus / as sysdba SQL*Plus: Release 12.1.0.2.0 Production on Tue Sep 1 11:48:19 2015 Copyright (c) 1982, 2014, Oracle. All rights reserved. Connected to: Oracle Database 12c Enterprise Edition Release 12.1.0.2.0 - 64bit Production With the Partitioning, OLAP, Advanced Analytics and Real Application Testing options SQL> select instance_name,status from v$instance; INSTANCE_NAME STATUS ---------------- ------------ conorcl OPEN SQL> exit Disconnected from Oracle Database 12c Enterprise Edition Release 12.1.0.2.0 - 64bit Production With the Partitioning, OLAP, Advanced Analytics and Real Application Testing options [oracle@oracledb12c ~]$ |
至此,安装全部完成。
————————————————————————————
Done。