昨天晚上看到盖总的微信里发布12.2.0.1版本开放下载了,于是立马登上edelivery去下载,现在只开放了Linux 64位版的。
今天就测试了一下12.2.0.1的rhel7.2上的安装。
总体的安装步骤跟12.1版本中没有太大的区别下面只列出了简单的配置和安装步骤
1、修改主机名和配置/etc/hosts
2、安装依赖包
参考了12.2的官方文档,现在只提供Oracle Linux上的依赖包,但是手头没有OEL7.2,于是选择了RHEL7.2,没有太多的差别
yum install -y binutils*
yum install -y compat-libcap1*
yum install -y compat-libstdc++*
yum install -y glibc*
yum install -y glibc-devel*
yum install -y ksh*
yum install -y libX11*
yum install -y libXau*
yum install -y libXi*
yum install -y libXtst*
yum install -y libaio*
yum install -y libaio-devel*
yum install -y libgcc*
yum install -y libstdc++*
yum install -y libstdc++-devel*
yum install -y libxcb*
yum install -y make*
yum install -y net-tools*
yum install -y nfs-utils*
yum install -y smartmontools*
yum install -y sysstat*
yum install -y unixODBC*
yum install -y binutils*686*
yum install -y compat-libcap1*686*
yum install -y compat-libstdc++*686*
yum install -y glibc*686*
yum install -y glibc-devel*686*
yum install -y ksh*686*
yum install -y libX11*686*
yum install -y libXau*686*
yum install -y libXi*686*
yum install -y libXtst*686*
yum install -y libaio*686*
yum install -y libaio-devel*686*
yum install -y libgcc*686*
yum install -y libstdc++*686*
yum install -y libstdc++-devel*686*
yum install -y libxcb*686*
yum install -y make*686*
yum install -y net-tools*686*
yum install -y nfs-utils*686*
yum install -y smartmontools*686*
yum install -y sysstat*686*
yum install -y unixODBC*686*
3、配置内核参数
vi /etc/sysctl.conf
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
systemctl -p 应用修改
4、创建oracle用户和用户组及创建目录
groupadd -g 5001 oinstall
groupadd -g 5002 dba
useradd -g oinstall -G dba -u 5001 oracle
passwd oracle
mkdir -p /u01/app/oracle/product/12.2/db1
chown oracle:oinstall -R /u01
5、修改Oracle用户的系统限制
vi /etc/security/limits.conf
oracle soft nofile 1024
oracle hard nofile 65536
oracle soft nproc 2047
oracle hard nproc 16384
oracle soft stack 10240
oracle hard stack 32786
6、修改oracle用户的.bash_profile
vi /home/oracle/.bash_profile
export ORACLE_BASE=/u01/app/oracle
export ORACLE_HOME=$ORACLE_BASE/product/12.2/db1
export ORACLE_SID=orcl
export PATH=$ORACLE_HOME/bin:$PATH
7、安装数据库软件
./runInstall
执行root.sh
8、创建数据库
在使用dbca创建包含CDB和PDB的数据库时报了好几次错,都莫名其妙的,比如:
Error while executing "/u01/app/oracle/product/12.2/db1/rdbms/admin/execemx.sql". Refer to "/u01/app/oracle/cfgtoollogs/dbca/orcl/execemx0.log"
查看log日志文件里是空的
还有ORA-00600: internal error code, arguments: [kcrf_make_redokey], [18446744073709551615], [], [], [], [], [], [], [], [], [], []
查了MOS上没有关于12.2的文档
于是想到了只不创建CDB的数据库是否还报错,结果正常创建成功。
后来与同事讨论,他提到了手工创建数据库是否有问题呢,于是尝试手工创建包含CDB和PDB的数据库。
手动创建数据库简略步骤:
1、创建pfile
db_name=orcl
enabled_pluggable_database=true #要创建CDB/PDB数据库必须有这个参数
control_files='/u01/app/oracle/oradata/orcl/control01.ctl'
2、创建spfile
create spfile from pfile;
3、执行CREATE DATABASE语句
CREATE DATABASE orcl
USER SYS IDENTIFIED BY oracle
USER SYSTEM IDENTIFIED BY oracle
LOGFILE GROUP 1 ('/u01/app/oracle/oradata/orcl/redo01a.log') SIZE 100M BLOCKSIZE 512,
GROUP 2 ('/u01/app/oracle/oradata/orcl/redo02a.log') SIZE 100M BLOCKSIZE 512,
GROUP 3 ('/u01/app/oracle/oradata/orcl/redo03a.log') SIZE 100M BLOCKSIZE 512
MAXLOGHISTORY 1
MAXLOGFILES 16
MAXLOGMEMBERS 3
MAXDATAFILES 1024
CHARACTER SET ZHS16GBK
NATIONAL CHARACTER SET AL16UTF16
EXTENT MANAGEMENT LOCAL
DATAFILE '/u01/app/oracle/oradata/orcl/cdb/system.dbf'
SIZE 700M REUSE AUTOEXTEND ON NEXT 10240K MAXSIZE UNLIMITED
SYSAUX DATAFILE '/u01/app/oracle/oradata/orcl/cdb/sysaux.dbf'
SIZE 550M REUSE AUTOEXTEND ON NEXT 10240K MAXSIZE UNLIMITED
DEFAULT TEMPORARY TABLESPACE tempts1
TEMPFILE '/u01/app/oracle/oradata/orcl/cdb/temp.dbf'
SIZE 20M REUSE AUTOEXTEND ON NEXT 640K MAXSIZE UNLIMITED
UNDO TABLESPACE undotbs1
DATAFILE '/u01/app/oracle/oradata/orcl/cdb/undo.dbf'
SIZE 200M REUSE AUTOEXTEND ON NEXT 5120K MAXSIZE UNLIMITED
ENABLE PLUGGABLE DATABASE
SEED
FILE_NAME_CONVERT=('/u01/app/oracle/oradata/orcl/cdb/','/u01/app/oracle/oradata/orcl/seed/')
SYSTEM DATAFILES size 125M autoextend on next 10M maxsize unlimited
SYSAUX DATAFILES size 100M autoextend on next 10M maxsize unlimited;
4、执行创建数据字典脚本
1)In SQL*Plus, connect to your Oracle Database instance with the SYSDBA administrative privilege:
@?/rdbms/admin/catalog.sql
@?/rdbms/admin/catproc.sql
@?/rdbms/admin/utlrp.sql
2)In SQL*Plus, connect to your Oracle Database instance as SYSTEM user:
@?/sqlplus/admin/pupbld.sql
到此创建完成。
整体过程与12.1版本的安装没有多大的区别,就是在dbca时报的错很奇怪。
官方文档:http://docs.oracle.com/database/122/LADBI/toc.htm
本文转自hbxztc 51CTO博客,原文链接:http://blog.51cto.com/hbxztc/1897810,如需转载请自行联系原作者