基于ASM环境Oracle Database 12c单实例安装与配置

教程发布:风哥 教程分类:ITPUX技术网 更新日期:2022-02-12 浏览学习:2208

Oracle 12C安装参考:http://docs.oracle.com/database/122/CWLIN/preface.htm#CWLIN-GUID-69C6312A-43D6-4982-8C8E-611C3F9A91A51、检查系统环境1)配置本地YUM源[root@localhost ~]# rm -rf /etc/yum.repos.d/*.repo mkdir /mnt/cdrom && echo "/dev/sr0/mnt/cdrom iso9660 defaults 0 0" >> /etc/fstab && mount -a cat > /etc/yum.repos.d/rhel6-media.repo < /etc/yum.repos.d/CentOS6-Base-idc.repo< <完整的机器名> <机器名> 2、检查服务器硬件和内存配置 1)检查物理内存: [root@localhost ~]# grep MemTotal /proc/meminfo 最小1G △ 推荐2G或更多 2)检查swap空间: [root@localhost ~]# grep SwapTotal /proc/meminfo 物理内存在1-2G之间,配置是同等物理内存的1.5倍 物理内存在2-16G之间,配置同等于物理内存 物理内存大于16G,配置同等于16G 3)检查/tmp目录可用空间 [root@localhost ~]# df -h /tmp 至少1G △ 推荐2G 4)检查硬盘剩余空间 [root@localhost ~]# df -h 企业版 6.4 GB 标准版 6.1 GB 标准版1 6.1 GB △推荐:30G 5)检查内存和硬盘交换空间大小: [root@localhost ~]# free 6)查看服务器系统架构 [root@localhost ~]# uname -m 3、安装前准备工作: 安装rpm包 需要的rpm包如下: Oracle Linux 7 Supported distributions: Oracle Linux 7 with the Unbreakable Enterprise kernel:3.8.13-33.el7uek.x86_64 or later Oracle Linux 7 with the Red Hat Compatible kernel:3.10.0-123.el7.x86_64 or later Red Hat Enterprise Linux 7 Supported distributions: Red Hat Enterprise Linux 7:3.10.0-123.el7.x86_64 or later Packages for Oracle Linux 7 and Red Hat EnterpriseLinux 7 binutils-2.23.52.0.1-12.el7.x86_64 compat-libcap1-1.10-3.el7.x86_64 compat-libstdc++-33-3.2.3-71.el7.i686 compat-libstdc++-33-3.2.3-71.el7.x86_64 gcc-4.8.2-3.el7.x86_64 gcc-c++-4.8.2-3.el7.x86_64 glibc-2.17-36.el7.i686 glibc-2.17-36.el7.x86_64 glibc-devel-2.17-36.el7.i686 glibc-devel-2.17-36.el7.x86_64 ksh libaio-0.3.109-9.el7.i686 libaio-0.3.109-9.el7.x86_64 libaio-devel-0.3.109-9.el7.i686 libaio-devel-0.3.109-9.el7.x86_64 libgcc-4.8.2-3.el7.i686 libgcc-4.8.2-3.el7.x86_64 libstdc++-4.8.2-3.el7.i686 libstdc++-4.8.2-3.el7.x86_64 libstdc++-devel-4.8.2-3.el7.i686 libstdc++-devel-4.8.2-3.el7.x86_64 libXi-1.7.2-1.el7.i686 libXi-1.7.2-1.el7.x86_64 libXtst-1.2.2-1.el7.i686 libXtst-1.2.2-1.el7.x86_64 make-3.82-19.el7.x86_64 sysstat-10.1.5-1.el7.x86_64 yum -y install binutils compat-libcap1compat-libstdc++-33 compat-libstdc++-33.i686 gcc gcc-c++ glibc glibc.i686glibc-devel glibc-devel.i686 ksh libgcc libgcc.i686 libstdc++ libstdc++.i686libstdc++-devel libstdc++-devel.i686 libaio libaio.i686 libaio-devellibaio-devel.i686 libXext libXext.i686 libXtst libXtst.i686 libX11 libX11.i686libXau libXau.i686 libxcb libxcb.i686 libXi libXi.i686 make sysstat unixODBCunixODBC-devel readline libtermcap-devel pdksh -------------------------------------------------------------------------------OracleLinux 6 Supported distributions: Oracle Linux 6 with the Unbreakable Enterprise Kernel(UEK): Update 2 or higher, 2.6.39-200.24.1.el6uek.x86_64 orlater UEK2 kernels Update 4 or higher, 3.8.13-16 or later UEK3 kernels Update 7 or higher, 4.1.12-32 or later UEK4 kernels Oracle Linux 6 with the Red Hat Compatible kernel:2.6.32-71.el6.x86_64 or later Red Hat Enterprise Linux 6 Supported distributions: Red Hat Enterprise Linux 6: 2.6.32-71.el6.x86_64 orlater Packages for Oracle Linux 6 and Red Hat EnterpriseLinux 6 The following packages (or later versions) must beinstalled: binutils-2.20.51.0.2-5.11.el6 (x86_64) compat-libcap1-1.10-1 (x86_64) compat-libstdc++-33-3.2.3-69.el6 (x86_64) compat-libstdc++-33-3.2.3-69.el6 (i686) gcc-4.4.4-13.el6 (x86_64) gcc-c++-4.4.4-13.el6 (x86_64) glibc-2.12-1.7.el6 (i686) glibc-2.12-1.7.el6 (x86_64) glibc-devel-2.12-1.7.el6 (x86_64) glibc-devel-2.12-1.7.el6 (i686) ksh libgcc-4.4.4-13.el6 (i686) libgcc-4.4.4-13.el6 (x86_64) libstdc++-4.4.4-13.el6 (x86_64) libstdc++-4.4.4-13.el6 (i686) libstdc++-devel-4.4.4-13.el6 (x86_64) libstdc++-devel-4.4.4-13.el6 (i686) libaio-0.3.107-10.el6 (x86_64) libaio-0.3.107-10.el6 (i686) libaio-devel-0.3.107-10.el6 (x86_64) libaio-devel-0.3.107-10.el6 (i686) libXext-1.1 (x86_64) libXext-1.1 (i686) libXtst-1.0.99.2 (x86_64) libXtst-1.0.99.2 (i686) libX11-1.3 (x86_64) libX11-1.3 (i686) libXau-1.0.5 (x86_64) libXau-1.0.5 (i686) libxcb-1.5 (x86_64) libxcb-1.5 (i686) libXi-1.3 (x86_64) libXi-1.3 (i686) make-3.81-19.el6 sysstat-9.0.4-11.el6 (x86_64) unixODBC-2.2.14-11.el6 (64-bit) or later unixODBC-devel-2.2.14-11.el6 (64-bit) or later -------------------------------------------------------------------------------OracleLinux 5 Supported distributions: Oracle Linux 5 Update 6 with the UnbreakableEnterprise kernel: 2.6.32-100.0.19 or later Oracle Linux 5 Update 6 with the Red Hat compatiblekernel: 2.6.18-238.0.0.0.1.el5 or later Red Hat Enterprise Linux 5 Supported distributions: Red Hat Enterprise Linux 5 Update 6:2.6.18-238.0.0.0.1.el5 or later Package requirements for Oracle Linux 5 and Red HatEnterprise Linux 5 The following packages (or later versions) must beinstalled: binutils-2.17.50.0.6 compat-libstdc++-33-3.2.3 compat-libstdc++-33-3.2.3 (32 bit) gcc-4.1.2 gcc-c++-4.1.2 glibc-2.5-58 glibc-2.5-58 (32 bit) glibc-devel-2.5-58 glibc-devel-2.5-58 (32 bit) ksh libaio-0.3.106 libaio-0.3.106 (32 bit) libaio-devel-0.3.106 libaio-devel-0.3.106 (32 bit) libgcc-4.1.2 libgcc-4.1.2 (32 bit) libstdc++-4.1.2 libstdc++-4.1.2 (32 bit) libstdc++-devel 4.1.2 libXext-1.0.1 libXext-1.0.1 (32 bit) libXtst-1.0.1 libXtst-1.0.1 (32 bit) libX11-1.0.3 libX11-1.0.3 (32 bit) libXau-1.0.1 libXau-1.0.1 (32 bit) libXi-1.0.1 libXi-1.0.1 (32 bit) make-3.81 sysstat-7.0.2 -------------------------------------------------------------------------------安装依赖包 yum -y install binutils compat-libcap1compat-libstdc++-33 compat-libstdc++-33.i686 gcc gcc-c++ glibc glibc.i686glibc-devel glibc-devel.i686 ksh libgcc libgcc.i686 libstdc++ libstdc++.i686libstdc++-devel libstdc++-devel.i686 libaio libaio.i686 libaio-devellibaio-devel.i686 libXext libXext.i686 libXtst libXtst.i686 libX11 libX11.i686libXau libXau.i686 libxcb libxcb.i686 libXi libXi.i686 make sysstat unixODBCunixODBC-devel smartmontools #rpm install non-database packages(Options) net-tools* smartmontools nfs-utils* e2fsprogs* rpm -qa --queryformat"%{NAME}-%{VERSION}-%{RELEASE} (%{ARCH})\n" binutils compat-libcap1compat-libstdc++-33 gcc gcc-c++ glibc glibc-devel ksh libgcc libstdc++libstdc++-devel libaio libaio-devel libXext libXtst libX11 libXau libxcb libXimake sysstat unixODBC unixODBC-devel rpm -qa --queryformat "%{NAME}-%{VERSION}-%{RELEASE}(%{ARCH})\n" binutils-2.20.51.0.2-5.11.el6 \ compat-libcap1-1.10-1 \ compat-libstdc++-33-3.2.3-69.el6 \ gcc-4.4.4-13.el6 \ gcc-c++-4.4.4-13.el6 \ glibc-2.12-1.7.el6 \ glibc-devel-2.12-1.7.el6 \ ksh \ libgcc-4.4.4-13.el6 \ libstdc++-4.4.4-13.el6 \ libstdc++-devel-4.4.4-13.el6 \ libaio-0.3.107-10.el6 \ libaio-devel-0.3.107-10.el6 \ libXext-1.1 \ libXtst-1.0.99.2 \ libX11-1.3 \ libXau-1.0.5 \ libxcb-1.5 \ libXi-1.3 \ make-3.81-19.el6 \ sysstat-9.0.4-11.el6 \ unixODBC-2.2.14-11.el6 \ unixODBC-devel-2.2.14-11.el6 4、增加用户及组,创建安装目录并授权 i=1001; for group in dba oinstall oper backupdba dgdba kmdbaracdba asmdba asmadmin asmoper; do     groupadd -g $i $group; i=`expr$i + 1` done useradd -u 1001 -g oinstall -G dba,oper,backupdba,dgdba,kmdba,racdba,asmdba-d /home/oracle oracle useradd -u 1002 -g oinstall -Gdba,asmdba,asmadmin,asmoper -d /home/grid grid echo oracle | passwd --stdin oracle echo oracle | passwd --stdin grid 创建grid和oracle用户安装目录mkdir -p /u01/app/grid/product/12.2.0/grid mkdir -p /u01/app/oraInventory mkdir -p /u01/app/oracle/product/12.2.0/dbhome_1 chown -R grid:oinstall /u01 chown -R oracle:oinstall /u01/app/oracle [color=#00CCFF]chmod -R 775 /u01 5、配置内核参数 export $MEMTOTAL=$(free -b | sed -n'2p' | awk '{print $2}') export $SHMMAX=$(expr $MEMTOTAL \*4 / 5) SHMMNI=4096 export $SHMALL=$(expr $MEMTOTAL /\( 4 \* 1024 \)) # kernel.shmmax 大于共享内存区,小于物理内存# kernel.shmall 物理内存/4K 1)修改内核参数 cat >> /etc/sysctl.conf <> /etc/pam.d/login <> /etc/profile <> /etc/security/limits.conf <> /home/oracle/.bash_profile <> /home/grid/.bash_profile <> .bash_profile< select status,instance_name from v$instance; STATUS INSTANCE_NAME -------------------------------------------------------- OPEN orcl 12、安装示例 unzip linuxx64_12201_examples.zip && rm -rflinuxx64_12201_examples.zip cd examples ./runInstaller 13、配置归档和闪回: #配好归档方可启动闪回 mkdir /u01/app/oracle/arch sqlplus "/as sysdba" altersystem set db_recovery_file_dest_size=2gscope=both; altersystem setdb_recovery_file_dest='/u01/app/oracle/arch' scope=both; shutdown immediate; startup mount; alter database archivelog; alter database flashback on; alter database open; archive log list; 14、验证 [grid@localhost ~]$ ocrcheck crsctl status res -t srvctl status database -d orcl srvctl config database -d orcl srvctl status listener [oracle@localhost ~]$ sqlplus / as sysdba SQL> set lin 140 select * from v$version; show con_name col pdb_name for a20 select pdb_name,con_uid,pdb_id,status from dba_pdbs; select con_id,dbid,name,open_mode from v$pdbs; select instance_name,status from gv$instance; col open_time for a25 col name for a10 selectcon_id,name,open_mode,open_time,create_scn,total_size from v$pdbs; 查看归档启用与否: SQL> archive log list 手动开启归档: [oracle@12crac1 ~]$ srvctl stop database -d orcl srvctl start database -d orcl -o mount 节点1: [oracle@12crac1 ~]$ sqlplus / as sysdba idle> alter database archivelog;
alter database open;

本文标签:
网站声明:本文由风哥整理发布,转载请保留此段声明,本站所有内容将不对其使用后果做任何承诺,请读者谨慎使用!
【上一篇】
【下一篇】