大菜狗の博客 - Oracle
type: channel
link: https://auxos.cn/category/oracle/
items: Oracle数据库自启动,DG配置和备份脚本
items: Oracle11g单节点库通过搭建DG RAC的方式迁移至集群环境
items: NBU 异机恢复 rman-06026 man-06023 异常处理
items: 归档日志清理
items: 龙析系统安装Oracle19c
items: Centos7 安装Oracle19c环境准备
items: Oracle 11g集群Rac安装 Centos7
items: WindowsServer配置Oracle11g DG
items: Oracle 19c 集群环境安装 Centos7
items: Oracle 12c升级 Oracle 19c

Oracle数据库自启动,DG配置和备份脚本
type: item
date: 2024-09-14T10:28:00+08:00
description: 数据库配置自启动修改/etc/oratab文件# # This file is used by ORACLE utilities. It is created by root.sh # and updated by either Database Configuration Assistant while creating # a database or ASM Configuration Assistant while creating ASM instance. # A colon, ':', is used as the field terminator. A new line terminates # the entry. Lines beginning with a pound sign, '#', are comments. # # Entries are of the form: # $ORACLE_SID:$ORACLE_HOME:<N|Y>: # # The first and second fields are the system identifier and home # directory of the database respectively. The third field indicates # to the dbstart utility that the database should , "Y", or should not, # "N", be brought up at system boot time. # # Multiple entries with the same $ORACLE_SID are not allowed. # # {ORACLE_SID}:{ORACLE_HOME}:Y #增加该行内容 sid 和 home替换为数据库的信息Oracle用户下修改"$ORACLE_HOME/bin/dbstart" 和 "$ORACLE_HOME/bin/dbshut".............. # Set path if path not set (if called from /etc/rc) SAVE_PATH=/bin:/usr/bin:/etc:${PATH} ; export PATH SAVE_LLP=$LD_LIBRARY_PATH # First argument is used to bring up Oracle Net Listener #ORACLE_HOME_LISTNER=$1 #注释掉改行 ORACLE_HOME_LISTNER=$ORACLE_HOME #添加该内容 if [ ! $ORACLE_HOME_LISTNER ]; then echo "Since ORACLE_HOME is not set, cannot auto-start Oracle Net Listener." echo "Usage: $0 ORACLE_HOME" else ..............root用户下增加以下内容到/etc/rc.localsu - oracle -lc "/u01/app/oracle/product/19.0.0/dbhome_1/bin/lsnrctl start" #启动监听 su - oracle -lc /u01/app/oracle/product/19.0.0/dbhome_1/bin/dbstart #启动数据库/etc/rc.local文件需要给可执行权限chmod +x /etc/rc.localDG库实现启动后自动应用归档日志Oracle用户下创建脚本文件/home/oracle/del_arch/autoapply.sh#!/bin/sh # 检查数据库是否启动的函数 check_db_is_up() { sqlplus -silent / as sysdba << EOF SET PAGESIZE 0 FEEDBACK OFF VERIFY OFF HEADING OFF ECHO OFF SELECT 1 FROM DUAL; EXIT; EOF } # 循环直到数据库启动 while ! check_db_is_up; do echo "Database is not up yet. Waiting for 10 seconds..." sleep 10 done # 数据库已启动，设置环境变量并执行恢复脚本 export ORACLE_SID=webemr sqlplus / as sysdba << EOF >> /home/oracle/del_arch/autoapply.log 2>&1 …

Oracle11g单节点库通过搭建DG RAC的方式迁移至集群环境
type: item
date: 2024-08-14T16:31:00+08:00
description: 一、环境配置1.1、安装软件包1.1.1、配置本地源注:能通过公网安装软件包的情况下跳过该项mv /etc/yum.repos.d/* /tmp/ echo "[local_yum]" >> /etc/yum.repos.d/henry.repo echo "name = henry_repo" >> /etc/yum.repos.d/henry.repo echo "baseurl = file:///mnt/" >> /etc/yum.repos.d/henry.repo echo "enabled = 1" >> /etc/yum.repos.d/henry.repo echo "gpgcheck = 0" >> /etc/yum.repos.d/henry.repo mount /dev/cdrom /mnt/1.1.2、安装软件包yum -y install bc binutils elfutils-libelf elfutils-libelf-devel fontconfig-devel gcc gcc-c++ glibc glibc-devel ksh libgcc libstdc++ libstdc++-devel libaio libaio-devel libXtst libX11 libXau libxcb libXi libXrender make smartmontools sysstat kmod* sysstat unixODBC unixODBC-devel libnsl lm_sensors-libs ksh make glibc-devel libaio-devel libstdc++-devel nano需要单独安装的软件包yum -y localinstall https://yum.oracle.com/repo/OracleLinux/OL7/latest/x86_64/getPackage/compat-libcap1-1.10-7.el7.x86_64.rpm yum -y localinstall https://yum.oracle.com/repo/OracleLinux/OL7/latest/x86_64/getPackage/sysstat-10.1.5-20.0.3.el7_9.x86_64.rpm yum -y localinstall https://mirrors.aliyun.com/centos/7/os/x86_64/Packages/compat-libstdc++-33-3.2.3-72.el7.x86_64.rpm yum -y localinstall http://vault.centos.org/5.11/os/x86_64/CentOS/pdksh-5.2.14-37.el5_8.1.x86_64.rpm1.2、内核参数调整,执行以下代码块自动完成export shmall=$(echo "`cat /proc/meminfo | grep "MemTotal" | awk '{print $2}'` / (`getconf PAGESIZE` / 1024)" | bc) export shmax=$(echo "`cat /proc/meminfo | grep "MemTotal" | awk '{print $2}'` * 1024 * 0.8" | bc | sed 's#\..*$##') echo """kernel.shmall = $shmall kernel.shmmax = $shmax kernel.shmmni = 4096 kernel.sem = 250 32000 100 128 fs.file-max = 6815744 fs.aio-max-nr = 1048576 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 = 104857 vm.swappiness = 0 vm.dirty_background_ratio = 3 vm.dirty_ratio = 80 vm.dirty_expire_centisecs = 500 vm.dirty_writeback_centisecs = 100 net.ipv6.conf.all.disable_ipv6 = 1 net.ipv6.conf.default.disable_ipv6 = 1 net.ipv6.c…

NBU 异机恢复 rman-06026 man-06023 异常处理
type: item
date: 2024-04-10T17:23:00+08:00
description: 异常信息rman异机恢复时，报错RMAN-06026、RMAN-06023，如下所示：敏感信息做脱敏处理RMAN> run { ALLOCATE CHANNEL CH10 TYPE 'sbt_tape'; ALLOCATE CHANNEL CH11 TYPE 'sbt_tape'; ALLOCATE CHANNEL CH12 TYPE 'sbt_tape'; ALLOCATE CHANNEL CH13 TYPE 'sbt_tape'; ALLOCATE CHANNEL CH14 TYPE 'sbt_tape'; SEND 'NB_ORA_SERV=nbuServer, NB_ORA_CLIENT=xxxdb'; set newname for datafile 1 to '/u01/app/oracle/oradata/xxx.dbf'; set newname for datafile 2 to '/u01/app/oracle/oradata/xxx.dbf'; set newname for datafile 3 to '/u01/app/oracle/oradata/xxx.dbf'; set newname for datafile 4 to '/u01/app/oracle/oradata/xxx.dbf'; set newname for datafile 5 to '/u01/app/oracle/oradata/xxx.dbf'; set newname for datafile 6 to '/u01/app/oracle/oradata/xxx.dbf'; set newname for datafile 7 to '/u01/app/oracle/oradata/xxx.dbf'; set newname for datafile 8 to '/u01/app/oracle/oradata/xxx.dbf'; set newname for datafile 9 to '/u01/app/oracle/oradata/xxx.dbf'; set newname for datafile 10 to '/u01/app/oracle/oradata/xxx.dbf'; set newname for datafile 11 to '/u01/app/oracle/oradata/xxx.dbf'; set newname for datafile 12 to '/u01/app/oracle/oradata/xxx.dbf'; set newname for datafile 13 to '/u01/app/oracle/oradata/xxx.dbf'; set newname for datafile 14 to '/u01/app/oracle/oradata/xxx.dbf'; set newname for datafile 15 to '/u01/app/oracle/oradata/xxx.dbf'; set newname for datafile 16 to '/u01/app/oracle/oradata/xxx.dbf'; set newname for datafile 17 to '/u01/app/oracle/oradata/xxx.dbf'; set newname for datafile 18 to '/u01/app/oracle/oradata/xxx.dbf'; set newname for datafile 19 to '/u01/app/oracle/oradata/xxx.dbf'; set newname for datafile 20 to '/u01/app/oracle/oradata/xxx.dbf'; set newname for datafile 21 to '/u01/app/oracle/oradata/xxx.dbf'; set newname for datafile 22 to '/u01/app/oracle/oradata/xxx.dbf'; set newname for datafile 23 to '/u01/app/oracle/oradata/xxx.dbf'; set newname for datafile 24 to '/u01/app/oracle/oradata/xxx.dbf'; set newname for datafile 25 to '/u01/app/oracle/oradata/xxx.dbf'; set newname for datafile 26 to '/u01/app/oracle/o…

归档日志清理
type: item
date: 2024-02-19T17:19:00+08:00
description: 归档日志及备份清理相关命令//检查所有归档日志 CROSSCHECK ARCHIVELOG ALL; //删除三天前的归档日志 DELETE NOPROMPT ARCHIVELOG ALL COMPLETED BEFORE 'SYSDATE-3'; //验证所有归档日志的备份是否有效 BACKUP VALIDATE ARCHIVELOG ALL; //检查备份一致性 CROSSCHECK BACKUP; //删除无效的备份 DELETE NOPROMPT EXPIRED BACKUP; //退出 EXIT;Windows下自动清理归档日志创建脚本执行命令注意修改脚本中的位置rman target / nocatalog log D:\arch\clear_arch.log cmdfile=D:\arch\clear_arch.txt创建一个文件存放清理归档日志的命令D:\arch\chear_arch.txt 文件位置根据情况选择CROSSCHECK ARCHIVELOG ALL; DELETE NOPROMPT ARCHIVELOG ALL COMPLETED BEFORE 'SYSDATE-3'; delete expired archivelog all; EXIT;windows 下打开 任务计划程序创建基本任务填写任务名称选择触发时间选择启动程序程序选择bat脚本直至完成运行任务测试结果

龙析系统安装Oracle19c
type: item
date: 2024-01-25T10:09:00+08:00
description: 龙析系统安装 Oracle19c1.安装背景本次教程使用VMware workstation Pro 17 创建虚拟机完成安装测试1.1 系统选择os版本信息:AnolisOS-8.8-x86_64-dvd.iso数据库版本信息:LINUX.X64_193000_db_home.zip1.2 硬件配置信息参数值核心1 H 2 G内存2048 M存储60 G虚拟机个数2 个1.3 分区配置分区大小/boot1024 M/boot/efi1024 Mswap2048 M/all2. 环境配置2.1 内核参数调整执行以下内容export shmall=$(echo "`cat /proc/meminfo | grep "MemTotal" | awk '{print $2}'` / (`getconf PAGESIZE` / 1024)" | bc) export shmax=$(echo "`cat /proc/meminfo | grep "MemTotal" | awk '{print $2}'` * 1024 * 0.8" | bc | sed 's#\..*$##') echo """kernel.shmall = $shmall kernel.shmmax = $shmax kernel.shmmni = 4096 kernel.sem = 250 32000 100 128 fs.file-max = 6815744 fs.aio-max-nr = 1048576 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 = 104857 vm.swappiness = 0 vm.dirty_background_ratio = 3 vm.dirty_ratio = 80 vm.dirty_expire_centisecs = 500 vm.dirty_writeback_centisecs = 100""" >> /etc/sysctl.conf sysctl -p2.2 关闭 Selinux 及防火墙执行以下内容sed -i 's/enforcing/disabled/g' /etc/selinux/config setenforce 0 service firewalld stop chkconfig firewalld off # 龙析8.8 系统没有network服务 关闭NetworkManager后重启无法联网 # service NetworkManager stop # chkconfig NetworkManager off2.3 用户组相关设置执行以下内容groupadd -g 1003 oinstall groupadd -g 1001 dba groupadd -g 1002 oper useradd -u 1001 -g oinstall -G dba,oper oracle echo oracle |passwd --stdin oracle2.4 创建目录赋予权限mkdir -p /u01/app/oracle/product/19c/db_1 chown -R oracle:oinstall /u01/ chmod -R 775 /u01/2.5 修改Oracle用户下变量echo """export ORACLE_SID=orcl export ORACLE_BASE=/u01/app/oracle export ORACLE_HOME=\${ORACLE_BASE}/product/19c/db_1 export NLS_DATE_FORMAT="YYYY:MM:DDHH24:MI:SS" export NLS_LANG=american_america.ZHS16GBK export TNS_ADMIN=\$ORACLE_HOME/network/admin export ORA_NLS11=\$ORACLE_HOME/nls/data export PATH=.:\${PATH}:\$ORACLE_HOME/bin:/usr/bin:/usr/bin/X11:/usr/local/bin: export LD_LIBRARY_PATH=\$ORACLE_HOME/lib:\$ORACLE_HOME/oracm/lib:/lib:/usr/lib:/usr/local/lib # export CLASSPATH=\$ORACLE_HOME/…

Centos7 安装Oracle19c环境准备
type: item
date: 2024-01-25T10:06:00+08:00
description: CentOS_7 Install Oracle 19c configuration1.安装操作系统系统磁盘分配：/boot 200M/boot/efi 300Mswap 16384M/ all系统版本：CentOS-7-x86_64-DVD-2009.isoOracle版本：LINUX.X64_193000_db_home.zip2.系统准备2.1内核参数调整vi /etc/sysctl.conf kernel.shmall = 264060061 #填入命令echo "`cat /proc/meminfo | grep "MemTotal" | awk '{print $2}'` / (`getconf PAGESIZE` / 1024)" | bc 的运行结果 kernel.shmmax = 865272007884 #填入命令echo "`cat /proc/meminfo | grep "MemTotal" | awk '{print $2}'` * 1024 * 0.8" | bc | sed 's#\..*$##' 的运行结果 kernel.shmmni = 4096 kernel.sem = 250 32000 100 128 fs.file-max = 6815744 fs.aio-max-nr = 1048576 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 = 104857 vm.swappiness = 0 vm.dirty_background_ratio = 3 vm.dirty_ratio = 80 vm.dirty_expire_centisecs = 500 vm.dirty_writeback_centisecs = 100 sysctl -p #使参数生效2.2.关闭selinux及防火墙sed -i 's/enforcing/disabled/g' /etc/selinux/config setenforce 0 service firewalld stop chkconfig firewalld off service NetworkManager stop chkconfig NetworkManager off2.3.用户组相关设置groupadd -g 1003 oinstall groupadd -g 1001 dba groupadd -g 1002 oper useradd -u 1001 -g oinstall -G dba,oper oracle echo oracle |passwd --stdin oracle2.4.创建目录赋予权限mkdir -p /u01/app/oracle/product/19c/db_1 chown -R oracle:oinstall /u01/ chmod -R 775 /u01/2.5.修改Oracle变量(oracle用户下执行)vi .bash_profile ORACLE_SID=; export ORACLE_SID ORACLE_BASE=/u01/app/oracle; export ORACLE_BASE ORACLE_HOME=${ORACLE_BASE}/product/19c/db_1; export ORACLE_HOME NLS_DATE_FORMAT="YYYY:MM:DDHH24:MI:SS"; export NLS_DATE_FORMAT NLS_LANG=american_america.ZHS16GBK; export NLS_LANG TNS_ADMIN=$ORACLE_HOME/network/admin; export TNS_ADMIN ORA_NLS11=$ORACLE_HOME/nls/data; export ORA_NLS11 PATH=.:${JAVA_HOME}/bin:${PATH}:$HOME/bin:$ORACLE_HOME/bin:$ORA_CRS_HOME/bin PATH=${PATH}:/usr/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_…

Oracle 11g集群Rac安装 Centos7
type: item
date: 2024-01-25T10:05:00+08:00
description: Oracle 11g RAC 双节点一、规划1.1、系统规划磁盘名称磁盘大小作用/dev/sda20GOS 操作系统1.2、网络规划主机名称rac1rac2public ip172.16.130.200172.16.130.210private ip10.0.80.20010.0.80.210vip172.16.130.201172.16.130.211scan ip172.16.130.220172.16.130.2201.3、磁盘规划采用Free NAS 的 iSCSI 块共享存储磁盘名称磁盘大小ASM磁盘名称作用/dev/sdb2Gasm-ocr1OCR/Voting File/dev/sdc2Gasm-ocr2OCR/Voting File/dev/sdd2Gasm-ocr3OCR/Voting File/dev/sde20Gasm-dataData Files二、系统环境及参数设置2.1、YUM仓库配置（双节点）mv /etc/yum.repos.d/* /tmp/ echo "[local_yum]" >> /etc/yum.repos.d/henry.repo echo "name = henry_repo" >> /etc/yum.repos.d/henry.repo echo "baseurl = file:///mnt/" >> /etc/yum.repos.d/henry.repo echo "enabled = 1" >> /etc/yum.repos.d/henry.repo echo "gpgcheck = 0" >> /etc/yum.repos.d/henry.repo mount /dev/cdrom /mnt/ yum -y install autoconf automake binutils binutils-devel bison cpp dos2unix ftp gcc gcc-c++ lrzsz python-devel compat-libcap1 compat-libstdc* libXpm-*.i686 libXext libXext.i686 libX11 libX11.i686 libxcb libxcb.i686 libaio* libaio-devel libaio-devel.i686 ksh libXp libaio-devel numactl numactl-devel make sysstat unixODBC unixODBC-devel elfutils-libelf-devel redhat-lsb-core unzip libXrender libXrender-devel nfs-utils smartmontools tigervnc* libvirt* e2fsprogs.x86_64 libXau* libXi* libXtst* libstdc* glibc* libgcc* ksh gcc-c++*2.2、编辑HOSTS文件（双节点）vim /etc/hosts # 添加内容 #scanip 172.16.130.220 racscan #rac1 172.16.130.200 rac1 10.0.80.200 rac1pri 172.16.130.201 rac1vip #rac2 172.16.130.210 rac2 10.0.80.210 rac2pri 172.16.130.211 rac2vip2.3、创建用户和组（双节点）/usr/sbin/groupadd -g 5001 oinstall /usr/sbin/groupadd -g 5002 dba /usr/sbin/groupadd -g 5003 oper /usr/sbin/groupadd -g 5004 asmadmin /usr/sbin/groupadd -g 5005 asmoper /usr/sbin/groupadd -g 5006 asmdba /usr/sbin/useradd -g oinstall -G dba,asmdba,oper -d /home/oracle -m oracle /usr/sbin/useradd -g oinstall -G asmadmin,asmdba,asmoper,dba -d /home/grid -m grid # 修改用户 oracle 及 grid 密码 echo "oracle" | passwd --stdin oracle echo "grid" | passwd --stdin grid2.4、创建文件夹及授权（双节点）mkdir -p /u01/app/{grid,11g/grid,oracle…

WindowsServer配置Oracle11g DG
type: item
date: 2024-01-25T10:05:00+08:00
description: Oracle 11g DG服务器环境操作系统 Server 2012 R2数据库版本 Oracle 11G 11.2.0.4.0配置准备主库安装数据库，备库只需要安装数据库软件安装路径主备库的路径要一致DG配置主库开启强制归档和闪回恢复sqlplus / as sysdba shutdown immediate startup mount alter database archivelog; alter database force logging; alter database flashback on;主库为备库创建日志文件set wrap off; select * from v$logfile order by group#; #查询日志组 GROUP# STATUS TYPE MEMBER ---------- -------------- -------------------- --------------- 1 ONLINE D:\APP\ADMINISTRATOR\ORADATA\ORCL\REDO01.LOG 2 ONLINE D:\APP\ADMINISTRATOR\ORADATA\ORCL\REDO02.LOG 3 ONLINE D:\APP\ADMINISTRATOR\ORADATA\ORCL\REDO03.LOG # 当前在线日志共有3组，为备库创建的日志建议比在线日志多一组，即4组 alter database add standby logfile group 4 ('D:\APP\ADMINISTRATOR\ORADATA\ORCL\stdredo004.log') size 50m; alter database add standby logfile group 5 ('D:\APP\ADMINISTRATOR\ORADATA\ORCL\stdredo005.log') size 50m; alter database add standby logfile group 6 ('D:\APP\ADMINISTRATOR\ORADATA\ORCL\stdredo006.log') size 50m; alter database add standby logfile group 7 ('D:\APP\ADMINISTRATOR\ORADATA\ORCL\stdredo007.log') size 50m; select * from v$logfile order by group#; #查询日志组 GROUP# STATUS TYPE MEMBER ---------- -------------- -------------------- ---------------------------------------------------- 1 ONLINE D:\APP\ADMINISTRATOR\ORADATA\ORCL\REDO01.LOG 2 ONLINE D:\APP\ADMINISTRATOR\ORADATA\ORCL\REDO02.LOG 3 ONLINE D:\APP\ADMINISTRATOR\ORADATA\ORCL\REDO03.LOG 4 STANDBY D:\APP\ADMINISTRATOR\ORADATA\ORCL\STDREDO004.LOG 5 STANDBY D:\APP\ADMINISTRATOR\ORADATA\ORCL\STDREDO005.LOG 6 STANDBY D:\APP\ADMINISTRATOR\ORADATA\ORCL\STDREDO006.LOG 7 STANDBY D:\APP\ADMINISTRATOR\ORADATA\ORCL\STDREDO007.LOG主库修改系统参数#设置db_unique_name alter system set db_unique_name='primary' scope=spfile; #设置日志归档配置，用于限制日志传输的目标，只能在这两个指定的数据库进行，该配置中的顺序可以调换 alter system set log_archive_config='DG_CONFIG=(primary,standby)' scope=spfile; #设置日志归档路径1 alter system set log_archive_dest_1='location=D:\app\Administrator\archivelog\ VALID_FOR=(ALL_LOGFILES,ALL_ROLES) DB_UNIQUE_NAME=primary' scope=spfile; #设置日志归档路径2 alte…

Oracle 19c 集群环境安装 Centos7
type: item
date: 2024-01-25T10:04:00+08:00
description: Oracle 19c Rac Install测试环境，Vmware + CentOS 7x64 + Oracle 11g，本次测试安装系统采用最小安装一，规划1.1，IP规划主机名public IPPrivate IPVIPScanner IPrac_110.10.10.1011.11.11.1010.10.10.810.10.10.7rac_210.10.10.1111.11.11.1110.10.10.910.10.10.71.2，磁盘规划进入Windows CMD命令行窗口到VMware安装位置执行命令创建cd C:\Program Files (x86)\VMware\VMware Workstation vmware-vdiskmanager.exe -c -s 2Gb -a lsilogic -t 2 "C:\Users\syspn\Documents\Virtual Machines\shareDisk\OCR01.vmdk" vmware-vdiskmanager.exe -c -s 2Gb -a lsilogic -t 2 "C:\Users\syspn\Documents\Virtual Machines\shareDisk\OCR02.vmdk" vmware-vdiskmanager.exe -c -s 2Gb -a lsilogic -t 2 "C:\Users\syspn\Documents\Virtual Machines\shareDisk\OCR03.vmdk" vmware-vdiskmanager.exe -c -s 20Gb -a lsilogic -t 2 "C:\Users\syspn\Documents\Virtual Machines\shareDisk\DATA.vmdk" vmware-vdiskmanager.exe -c -s 5Gb -a lsilogic -t 2 "C:\Users\syspn\Documents\Virtual Machines\shareDisk\ARCH.vmdk"二，系统配置2.1，系统配置(所有节点)进入虚拟机配置界面，添加两个网卡，一个nat，一个仅主机，IP段按照规划来配置进入系统，挂载光盘，修改yum仓库为光驱mv /etc/yum.repos.d/* /tmp/ echo "[local_yum]" >> /etc/yum.repos.d/henry.repo echo "name = henry_repo" >> /etc/yum.repos.d/henry.repo echo "baseurl = file:///mnt/" >> /etc/yum.repos.d/henry.repo echo "enabled = 1" >> /etc/yum.repos.d/henry.repo echo "gpgcheck = 0" >> /etc/yum.repos.d/henry.repo mount /dev/cdrom /mnt/2.2，添加硬盘(所有节点)将上边的硬盘添加到虚拟机，然后点击高级-勾选独立-永久-确定，集群中虚拟机都需要添加创建的几个磁盘，模式都设置成独立永久然后关闭虚拟机，打开虚拟机保存目录修改所有虚拟机的文件Oracle_Rac_1.vmx#添加以下代码 disk.locking="FALSE" disk.EnableUUID = "TRUE"修改完成后开机2.3，网络(所有节点)rac中所有服务器按照规划中的IP划分做好，两张网卡，一张public IP，一张private IP2.4，检查系统依赖(所有节点)vi /etc/yum.repos.d/iso.repo [iso] name=iso baseurl=file:///mnt enabled=1 gpgcheck=0 mount /dev/cdrom /mnt yum -y install binutils compat-libstdc++-33 glibc ksh libaio libgcc libstdc++ make compat-libcap1 gcc gcc-c++ glibc-devel libaio-devel libstdc++-devel sysstat autoconf automake binutils binutils-devel bison cpp dos2unix ftp gcc gcc-c++ lrzsz python-devel compat-libcap1 compat-libstdc* libXpm-*.i686 libXext libXext.i686 libX11 libX11.i686 libxcb libx…

Oracle 12c升级 Oracle 19c
type: item
date: 2024-01-25T10:04:00+08:00
description: Oracle 12c 升级 Oracle 19c本次升级是以原库备份，恢复到目标数据库修改配置后执行dbua升级备份脚本run { allocate channel ch1 device type disk; allocate channel ch2 device type disk; sql 'alter system archive log current'; backup as compressed backupset database format '/u03/backup/fullbackup_%U_%T_%D'; release channel ch1; release channel ch2; allocate channel ch1 device type disk; allocate channel ch2 device type disk; backup as compressed backupset archivelog all format '/u03/backup/archive_%U_%T_%D'; release channel ch1; release channel ch2; allocate channel ch1 device type disk; backup format '/u03/backup/control_%U_%T_%D' current controlfile; release channel ch1; allocate channel ch1 device type disk; backup spfile format '/u03/backup/spfile_%U_%T_%D'; release channel ch1; }恢复脚本## dafafile 和 数据文件编号查询 ## select file#,name from v$datafile; ## 查询出的原数据文件编号，恢复到指定的目标位置 SQL> shutdown immediate; SQL> startup nomount; SQL> set dbid XXXXXXXXXX; SQL> restore controlfile from "xxxxxxxxx"; SQL> alter database mount; RMAN> run { allocate channel c1 device type disk; allocate channel c2 device type disk; set newname for datafile x to "xxxxxxxx.dbf"; restore database; switch datafile all; release channel c1; release channel c2; }备份归档日志##创建指定归档日志目录 mkdir /u03/backup/archivelog ##创建一张测试表 create table testtable (id number(10)); insert into testtable values(1); insert into testtable values(2); insert into testtable values(3); ##执行检查点 alter system chekpoint; ##切换日志 alter system switch logfile; ##备份全部归档日志 backup archivelog all format '/u03/backup/archivelog/rman_arch_%T_%u';恢复新的归档日志##注册归档日志 RMAN> catalog start with '/u03/backup/archivelog/'; ##恢复归档日志 RMAN> restore archivelog all; RMAN> restore archivelog from logseq 78574; RMAN> recover database until scn 86327108973; ##设置输出格式 SQL> set pagesize 1000 linesize 1000; SQL> col member for a50; ##查看redolog SQL> select a.group#,a.member,b.status from v$logfile a left join v$log b on a.group#=b.group#; ##重命名redolog SQL> alter database rename file '/u02/oradata/xxx/redo04.log' t…