1、硬件环境确认
Oracle 12cR2的硬件环境需求参考:http://docs.oracle.com/database/122/LADBI/server-hardware-checklist-for-oracle-database-installation.htm#LADBI-GUID-D311E770-9444-45D0-A122-6491D1B66B8A
[root@my ~]# free -g
total used free shared buffers cached
Mem: 3 0 2 0 0 0
-/+ buffers/cache: 0 3
Swap: 3 0 3
满足要求。
2、操作系统确认。
Oracle 12cR2的操作系统支持矩阵参考:http://docs.oracle.com/database/122/LADBI/operating-system-checklist-for-oracle-database-installation-on-linux.htm#LADBI-GUID-E5C0A90E-7750-45D9-A8BC-C7319ED934F0
[root@my ~]# cat /etc/redhat-release
Red Hat Enterprise Linux Server release 6.4 (Santiago)
[root@my ~]# uname -a
Linux my 2.6.32-358.el6.x86_64 #1 SMP Tue Jan 29 11:47:41 EST 2013 x86_64 x86_64 x86_64 GNU/Linux
满足要求。
3、安装依赖包
Oracle 12cR2在RHEL6上的依赖包参考:http://docs.oracle.com/database/122/LADBI/supported-red-hat-enterprise-linux-6-distributions-for-x86-64.htm#LADBI-GUID-3B53A308-3EC2-4173-98A0-0FFD68994E90
如果是外网直接yum安装,如果是内网,可以先配置局域网yum或者本地yum,参考:
http://blog.itpub.net/28536251/viewspace-1750096/。
[root@my ~]# mount /dev/cdrom /media/
[root@my ~]# yum install binutils compat-libcap1 compat-libstdc++ compat-libstdc++-33 gcc gcc-c++ glibc libaio libaio-devel libgcc libstdc++ libstdc++-devel ksh make sysstat unixodbc
4、禁用防火墙和SELinux
[root@my ~]# /etc/init.d/iptables status
iptables: Firewall is not running.
[root@my ~]# getenforce
Disabled
5、确认主机名和IP映射
[root@my ~]# cat /etc/sysconfig/network
NETWORKING=yes
HOSTNAME=my
[root@my ~]# cat /etc/hosts
127.0.0.1 localhost localhost.localdomain localhost4 localhost4.localdomain4
::1 localhost localhost.localdomain localhost6 localhost6.localdomain6
192.168.254.151 my
6、创建组、用户和目录
[root@my ~]# vim ora_user_dir.sh
#!/bin/bash
groupadd oinstall
groupadd dba
useradd -g oinstall -G dba oracle
echo "123456" | passwd --stdin oracle
mkdir -p /u01/
chown -R oracle:oinstall /u01/
chmod -R 775 /u01/
[root@my ~]# sh ora_user_dir.sh
Changing password for user oracle.
passwd: all authentication tokens updated successfully.
7、配置环境变量
[root@my ~]# vim ora_env.txt
ORACLE_BASE=/u01/app/oracle; export ORACLE_BASE
ORACLE_HOME=$ORACLE_BASE/product/12.2.0/dbhome_1; export ORACLE_HOME
LD_LIBRARY_PATH=$ORACLE_HOME/lib; export LD_LIBRARY_PATH
ORACLE_SID=stone; export ORACLE_SID
NLS_LANG=american_america.al32utf8;export NLS_LANG
PATH=$ORACLE_HOME/bin:$PATH; export PATH
[root@my ~]# cat ora_env.txt >> /home/oracle/.bash_profile
查看确认:
[oracle@my ~]$ env | grep ORACLE
ORACLE_SID=stone
ORACLE_BASE=/u01/app/oracle
ORACLE_HOME=/u01/app/oracle/product/12.2.0/dbhome_1
8、解压安装
[oracle@my ~]$ unzip /mnt/hgfs/software/linuxx64_12201_database.zip
[oracle@my ~]$ export DISPLAY=192.168.254.1:0.0
[oracle@my ~]$ cd database/
[oracle@my database]$ ./runInstaller
[root@my ~]# /tmp/CVU_12.2.0.1.0_oracle/runfixup.sh
All Fix-up operations were completed successfully.
[root@my ~]# /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@my ~]# /u01/app/oracle/product/12.2.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.2.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.
Do you want to setup Oracle Trace File Analyzer (TFA) now ? yes|[no] :
Oracle Trace File Analyzer (TFA - User Mode) is available at :
/u01/app/oracle/product/12.2.0/dbhome_1/suptools/tfa/release/tfa_home/bin/tfactl
OR
Oracle Trace File Analyzer (TFA - Daemon Mode) can be installed by running this script :
/u01/app/oracle/product/12.2.0/dbhome_1/suptools/tfa/release/tfa_home/install/roottfa.sh
9、创建数据库
[oracle@my database]$ dbca
指定创建PDB的数量。
与11g相比,快速恢复区的默认值增大了。
将监听整合到了DBCA。
与11g相比,默认的processes由150增大到300。
与11g相比,默认日志大小由50M增大到了200M。
安装完成后监听已经启动:
[oracle@my ~]$ lsnrctl status
LSNRCTL for Linux: Version 12.2.0.1.0 - Production on 16-JUN-2017 15:00:08
Copyright (c) 1991, 2016, Oracle. All rights reserved.
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=my)(PORT=1521)))
STATUS of the LISTENER
------------------------
Alias LISTENER
Version TNSLSNR for Linux: Version 12.2.0.1.0 - Production
Start Date 16-JUN-2017 12:45:57
Uptime 0 days 2 hr. 14 min. 11 sec
Trace Level off
Security ON: Local OS Authentication
SNMP OFF
Listener Parameter File /u01/app/oracle/product/12.2.0/dbhome_1/network/admin/listener.ora
Listener Log File /u01/app/oracle/diag/tnslsnr/my/listener/alert/log.xml
Listening Endpoints Summary...
(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=my)(PORT=1521)))
(DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC1521)))
(DESCRIPTION=(ADDRESS=(PROTOCOL=tcps)(HOST=my)(PORT=5500))(Security=(my_wallet_directory=/u01/app/oracle/admin/stone/xdb_wallet))(Presentation=HTTP)(Session=RAW))
Services Summary...
Service "520dad70e8cb3b6be05397fea8c0af2e" has 1 instance(s).
Instance "stone", status READY, has 1 handler(s) for this service...
Service "520db06347a83b8ae05397fea8c07c98" has 1 instance(s).
Instance "stone", status READY, has 1 handler(s) for this service...
Service "stone" has 1 instance(s).
Instance "stone", status READY, has 1 handler(s) for this service...
Service "stoneXDB" has 1 instance(s).
Instance "stone", status READY, has 1 handler(s) for this service...
Service "stonepdb1" has 1 instance(s).
Instance "stone", status READY, has 1 handler(s) for this service...
Service "stonepdb2" has 1 instance(s).
Instance "stone", status READY, has 1 handler(s) for this service...
The command completed successfully
10、查看确认
(1)查看数据库版本
SQL> select * from v$version;
BANNER CON_ID
-------------------------------------------------------------------------------- ----------
Oracle Database 12c Enterprise Edition Release 12.2.0.1.0 - 64bit Production 0
PL/SQL Release 12.2.0.1.0 - Production 0
CORE 12.2.0.1.0 Production 0
TNS for Linux: Version 12.2.0.1.0 - Production 0
NLSRTL Version 12.2.0.1.0 - Production 0
(2)查看数据库信息
SQL> select dbid,name,OPEN_MODE,CDB,CON_ID,CON_DBID from v$database;
DBID NAME OPEN_MODE CDB CON_ID CON_DBID
---------- --------- -------------------- --- ---------- ----------
3057043705 STONE READ WRITE YES 0 3057043705
(3)查看PDB信息
SQL> select con_id,dbid,guid,name,open_mode from v$pdbs;
CON_ID DBID GUID NAME OPEN_MODE
---------- ---------- -------------------------------- --------------- ----------
2 2820366089 520D86F4A5F7335EE05397FEA8C04854 PDB$SEED READ ONLY
3 1077568213 520DAD70E8CB3B6BE05397FEA8C0AF2E STONEPDB1 READ WRITE
4 4252608347 520DB06347A83B8AE05397FEA8C07C98 STONEPDB2 READ WRITE
SQL> show con_name pdbs
CON_NAME
------------------------------
CDB$ROOT
CON_ID CON_NAME OPEN MODE RESTRICTED
---------- ------------------------------ ---------- ----------
2 PDB$SEED READ ONLY NO
3 STONEPDB1 READ WRITE NO
4 STONEPDB2 READ WRITE NO
来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/28536251/viewspace-2141021/,如需转载,请注明出处,否则将追究法律责任。
转载于:http://blog.itpub.net/28536251/viewspace-2141021/