一、环境准备
二、解压文件
三、文件配置
四、安装
五、相关调整
六、打补丁
一、环境准备
0.依赖包安装
rpm -q --qf ‘%{NAME}-%{VERSION}-%{RELEASE} (%{ARCH})\n‘ binutils \ compat-libcap1 compat-libstdc++-33 e2fsprogs e2fsprogs-libs elfutils-libelf elfutils-libelf-devel gcc gcc-c++ glibc glibc-devel libaio libaio-devel libgcc libstdc++ libstdc++-devel make sysstat unixODBC ksh libX11 libXau libXi libXtst libxcb smartmontools unixODBC-devel net-tools |grep installed
1.防火墙禁用
systemctl is-enabled firewalld #输出disabled # https://www.linuxidc.com/Linux/2017-03/142096.htm -- linux 7 sudo systemctl stop firewalld.service && sudo systemctl disable firewalld.service cat /etc/selinux/config #输出SELINUX=disabled
2.硬件配置
查询存储空间安装目录空间>35G /tmp >7G 内存>60g配置内存大页,关闭透明大页 AMM配置内存</dev/shm,不满足需要调整/dev/shm,如ASMM忽略 $ df -h /tmp $ free -g $ df -h /dev/shm
3.调整Shell资源限制
1)配置修改 vi /etc/security/limits.conf oracle soft nproc 131072 oracle hard nproc 131072 oracle soft nofile 40964 oracle hard nofile 65536 oracle soft stack 10240 oracle hard stack 32768 oracle soft memlock 26843545 oracle hard memlock 26843545 --备注说明 Memlock 字节单位< 系统内存
2)检查
#查文件描述符设置的软限制和硬限制>=即可 $ ulimit -Sn 1024 $ ulimit -Hn 65536 检查软限制和硬限制,以确定用户可用的进程数。确保结果在推荐范围内。例如: $ ulimit -Su 2047 $ ulimit -Hu 16384 检查堆栈设置的软限制。确保结果在推荐范围内。例如: $ ulimit -Ss 10240 $ ulimit -Hs 32768
4.调整内核参数
1)参数列举说明 #kernel.shmall 59*1024*1024*1024/4096 15466496 #kernel.shmmax 59*1024*1024*1024 63350767616 #vm.nr_hugepages 45*1024/2 sga 45G 23040 2)执行 echo "fs.file-max = 6815744 kernel.sem = 10000 10240000 10000 1024 kernel.shmmni = 4096 kernel.shmall = 3932000 kernel.shmmax = 16106127000 net.ipv4.ip_local_port_range = 9000 65500 net.core.rmem_default = 16777216 net.core.rmem_max = 16777216 net.core.wmem_max = 16777216 net.core.wmem_default = 16777216 fs.aio-max-nr = 6194304 vm.dirty_ratio=20 vm.dirty_background_ratio=3 vm.dirty_writeback_centisecs=100 vm.dirty_expire_centisecs=500 vm.swappiness=10 vm.min_free_kbytes=524288 net.core.netdev_max_backlog = 30000 net.core.netdev_budget = 600 #vm.nr_hugepages = net.ipv4.conf.all.rp_filter = 2 net.ipv4.conf.default.rp_filter = 2">> /etc/sysctl.conf && sysctl --system
5.修改主机名
vi /etc/sysconfig/network hostname=hskf vi /etc/hostname HOSTNAME=hskf vi /etc/hosts
6.创建组
1)删除用户and 组i id oracle根据查询组进行删除 userdel -r oracle groupdel oinstal 2)执行 groupadd -g 1001 oinstall groupadd -g 1200 dba groupadd -g 1201 oper /usr/sbin/useradd -u 1001 -g oinstall -G dba,oper oracle 3)配置密码 passwd oracle
7.创建安装目录
mkdir -p /oracle/app/oracle mkdir -p /oracle/app/19.11 chown -R oracle:oinstall /oracle chown oracle:oinstall /oracle/app/oracle chmod -R 775 /oracle/ chown -R oracle:oinstall /oracle/app/19.11
8.环境变量
su - oracle vi .bash_profile ORACLE_BASE=/oracle/app/oracle ORACLE_HOME=$ORACLE_BASE/product/19.11/db_1 ORACLE_SID=ygfw1 LD_LIBRARY_PATH=$ORACLE_HOME/lib:/usr/lib PATH=$PATH:$ORACLE_HOME/bin:/sbin:/usr/sbin:/bin:/usr/local/bin export ORACLE_BASE ORACLE_HOME ORACLE_SID LD_LIBRARY_PATH PATH export NLS_LANG=american_america.ZHS16GBK export PS1=`hostname`:‘$PWD‘"$ " cd $ORACLE_BASE ORACLE_TERM=xterm; export ORACLE_TERM TNS_ADMIN=$ORACLE_HOME/network/admin; export TNS_ADMIN ORA_NLS11=$ORACLE_HOME/nls/data; export ORA_NLS11 PATH=${PATH}:/usr/bin:/bin:/usr/bin/X11:/usr/local/bin export PATH LD_LIBRARY_PATH=$ORACLE_HOME/lib LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:$ORACLE_HOME/oracm/lib LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:/lib:/usr/lib:/usr/local/lib export LD_LIBRARY_PATH CLASSPATH=$ORACLE_HOME/JRE CLASSPATH=${CLASSPATH}:$ORACLE_HOME/jlib CLASSPATH=${CLASSPATH}:$ORACLE_HOME/rdbms/jlib CLASSPATH=${CLASSPATH}:$ORACLE_HOME/network/jlib export CLASSPATH THREADS_FLAG=native; export THREADS_FLAG export TEMP=/tmp export TMPDIR=/tmp umask 022 export PS1=`hostname`:‘$PWD‘"$ " cd $ORACLE_BASE stty erase ^H
二、解压文件
unzip LINUX.X64_193000_db_home.zip -d $ORACLE_HOME 重点:必须要解压到ORACLE_HOME路径下。
三、文件配置,安装软件
cat /oracle/app/oracle/product/19.11/db_1/install/response/db_install.rsp |grep -v "^#"|grep -v "^$"
red79:/oradata$ cat /oracle/app/oracle/product/19.11/db_1/install/response/db_install.rsp
oracle.install.responseFileVersion=/oracle/install/rspfmt_dbinstall_response_schema_v19.0.0 oracle.install.option=INSTALL_DB_SWONLY UNIX_GROUP_NAME=oinstall INVENTORY_LOCATION=/oracle/app/oraInventory ORACLE_HOME=/oracle/app/oracle/product/19.11/db_1 ORACLE_BASE=/oracle/app/oracle oracle.install.db.InstallEdition=EE oracle.install.db.OSDBA_GROUP=dba oracle.install.db.OSOPER_GROUP=oper oracle.install.db.OSBACKUPDBA_GROUP=dba oracle.install.db.OSDGDBA_GROUP=dba oracle.install.db.OSKMDBA_GROUP=dba oracle.install.db.OSRACDBA_GROUP=dba oracle.install.db.rootconfig.executeRootScript=false oracle.install.db.rootconfig.configMethod=ROOT oracle.install.db.rootconfig.sudoPath= oracle.install.db.rootconfig.sudoUserName= oracle.install.db.CLUSTER_NODES= oracle.install.db.config.starterdb.type= oracle.install.db.config.starterdb.globalDBName= oracle.install.db.config.starterdb.SID= oracle.install.db.ConfigureAsContainerDB= oracle.install.db.config.PDBName= oracle.install.db.config.starterdb.characterSet= oracle.install.db.config.starterdb.memoryOption= oracle.install.db.config.starterdb.memoryLimit= oracle.install.db.config.starterdb.installExampleSchemas= oracle.install.db.config.starterdb.password.ALL= oracle.install.db.config.starterdb.password.SYS= oracle.install.db.config.starterdb.password.SYSTEM= oracle.install.db.config.starterdb.password.DBSNMP= oracle.install.db.config.starterdb.password.PDBADMIN= oracle.install.db.config.starterdb.managementOption= oracle.install.db.config.starterdb.omsHost= oracle.install.db.config.starterdb.omsPort= oracle.install.db.config.starterdb.emAdminUser= oracle.install.db.config.starterdb.emAdminPassword= oracle.install.db.config.starterdb.enableRecovery= oracle.install.db.config.starterdb.storageType= oracle.install.db.config.starterdb.fileSystemStorage.dataLocation= oracle.install.db.config.starterdb.fileSystemStorage.recoveryLocation= oracle.install.db.config.asm.diskGroup= oracle.install.db.config.asm.ASMSNMPPassword=
/oracle/app/oracle/product/19.11/db_1/runInstaller -force -silent -noconfig -ignorePrereq -responseFile /oracle/app/oracle/product/19.11/db_1/install/response/db_install.rsp
四、安装数据库
dbca -silent -createDatabase -templateName General_Purpose.dbc -gdbname syjkptzbtest -responseFile NO_VALUE -characterSet ZHS16GBK -sysPassword syjkptzbtest -systemPassword syjkptzbtest -createAsContainerDatabase true -numberOfPDBs 1 -pdbName syjkptzbtest1 -pdbAdminPassword Oracle19c -databaseType MULTIPURPOSE -automaticMemoryManagement false -totalMemory 10240 -redoLogFileSize 50 -emConfiguration NONE -ignorePreReqs
五、相关调整
1.监听
netca -silent -responsefile /oracle/app/oracle/product/19.11/db_1/assistants/netca/netca.rsp LISTENER = (DESCRIPTION_LIST = (DESCRIPTION = (ADDRESS = (PROTOCOL = TCP)(HOST = red79)(PORT = 11521)) (ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC11521)) ) ) alter system set local_listener=‘(ADDRESS = (PROTOCOL = TCP)(HOST = red79)(PORT = 11521))‘;
2.最佳实践参数等
六、打补丁,打一个RU,19.3的版本升级为19.11(注意:需要关库,没有ora_进程)
cd /oracle/app/oracle/product/19.11/db_1 mv OPatch OPatchbak unzip /oracle/p6880880_190000_Linux-x86-64.zip -d /oracle/app/oracle/product/19.11/db_1/ OPatch/opatch version unzip p32545008_190000_Linux-x86-64.zip cd 32545013 /oracle/app/oracle/product/19.11/db_1/OPatch/opatch apply
总结:
1.环境安装是一个熟练度的工作,在交付实施时,准备好软件和测试一遍流程,可以起到事半功倍的效果。
2.当一个机器上存在多个实例,并且每个实例使用不同的监听端口的时候,修改listener.ora文件。查看状态需要指明每个监听的名字。
3.19c的单实例安装除了需要将软件的压缩包解压到ORACLE_HOME路径下,其他和10g、11g的完全一样。