首页
Search
1
处理Vcenter 更新证书后NSX无法连接
258 阅读
2
Windows Server 2016 评估版转正式版
235 阅读
3
Oracle 19c 集群环境RU补丁安装
154 阅读
4
龙析系统安装Oracle19c
141 阅读
5
Centos7 安装Oracle19c环境准备
106 阅读
谈天论弟
数据库
Oracle
安装类
维护类
操作系统
Linux
Windows
其他
虚拟化
登录
/
注册
Search
Aux
累计撰写
29
篇文章
累计收到
0
条评论
首页
栏目
谈天论弟
数据库
Oracle
安装类
维护类
操作系统
Linux
Windows
其他
虚拟化
页面
搜索到
29
篇与
的结果
Windows 系统下使用DISM注入驱动到镜像
创建文件夹md C:\Drivers导出驱动dism /online /export-driver /destination:C:\Drivers挂载wim镜像Dism /Mount-Wim /WimFile:C:\path\to\winre.wim /Index:1 /MountDir:C:\mount\winre注入驱动Dism /Image:C:\mount\winre /Add-Driver /Driver:"C:\path\to\drivers\driver.inf"自动查找注入驱动Dism /Image:C:\mount\winre /Add-Driver /Driver:C:\Drivers /Recurse /ForceUnsigned保存并卸载镜像Dism /Unmount-Wim /MountDir:C:\mount\winre /Commitesd转换wimDism /Export-Image /SourceImageFile:[source File Path] /SourceIndex:1 /DestinationImageFle:[output Path]\install.wim /CheckIntegritywindows11 ARM64 windowsRE 已注入小米平板5 驱动点击下载
2024年11月14日
22 阅读
0 评论
0 点赞
Oracle数据库自启动,DG配置和备份脚本
数据库配置自启动修改/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 alter database recover managed standby database using current logfile disconnect from session; exit EOF然后root用户下增加以下内容到/etc/rc.localsu - oracle -lc /home/oracle/del_arch/autoapply.sh自动清理归档日志Oracle用户下创建脚本文件/home/oracle/del_arch/autoapply.sh#!/bin/sh export ORACLE_SID=webemr rman target / nocatalog log /home/oracle/del_arch/del_arch.sh << EOF run { crosscheck archivelog all; delete noprompt archivelog all completed before 'sysdate-3'; #删除3天前的归档日志 } exit EOF然后root用户下执行"crontab -e"来创建定时任务,添加以下内容0 2 * * * su - oracle -c /home/oracle/del_arch/del_arch.sh使用 "crontab -l" 检查定时任务[root@localhost ~]# crontab -l 0 2 * * * su - oracle -c /home/oracle/del_arch/del_arch.sh创建自动备份及清理备份的任务创建脚本文件/u01/rmanback/rmanbak.sh#!/bin/sh export ORACLE_SID=$ORACLE_SID rman target sys/aqa nocatalog log /u01/rmanback/rmanbak.log << EOF run { allocate channel t1 type disk; allocate channel t2 type disk; sql 'alter system archive log current'; backup as compressed backupset database tag 'dbfullbackup' format='/u01/rmanback/%T_db_%U_%d'; backup current controlfile format='/u01/rmanback/%T_ctl_%U_%d'; backup spfile format='/u01/rmanback/%T_sp_%U_%d'; sql 'alter system archive log current'; backup as compressed backupset archivelog from time "sysdate-1" until time "sysdate" format='/u01/rmanback/%T_arc_%U_%d'; crosscheck backupset; crosscheck archivelog all; delete noprompt archivelog all completed before 'sysdate-30'; delete noprompt backupset completed before 'sysdate-2'; release channel t1; release channel t2; } exit EOF然后root用户下执行"crontab -e"来创建定时任务,添加以下内容0 2 * * * su - oracle -c /u01/rmanback/rmanbak.sh使用 "crontab -l" 检查定时任务[root@localhost ~]# crontab -l 0 2 * * * su - oracle -c /u01/rmanback/rmanbak.sh
2024年09月14日
28 阅读
0 评论
0 点赞
Centos7/8迁移龙晰系统
==================centos8==================####======================添加an8_baseos苍老 (IP替换为搭建仓库的IP)====================== echo """[an8_baseos] name=AnolisOS-8 - BaseOS baseurl=http://mirrors.aliyun.com/anolis/8/BaseOS/\$basearch/os gpgcheck=0 enabled=1 [an8_appstream] name=AnolisOS-8 - AppStream baseurl=http://mirrors.aliyun.com/anolis/8/AppStream/\$basearch/os gpgcheck=0 enabled=1""">>/etc/yum.repos.d/switch-to-anolis.repo ####======================添加migration仓库 (IP替换为搭建仓库的IP)====================== echo """# Anolis OS migration repo [migration] name=Anolis OS - migration repo baseurl=https://mirrors.openanolis.cn/anolis/migration/\$releasever/\$basearch/os/ gpgcheck=0 gpgkey=https://mirrors.openanolis.cn/anolis/RPM-GPG-KEY-ANOLIS #failovermethod=priority enabled=1 [migration-debug] name=Anolis OS - migration debug repo baseurl=https://mirrors.openanolis.cn/anolis/migration/\$releasever/\$basearch/debug/ gpgcheck=1 gpgkey=https://mirrors.openanolis.cn/anolis/RPM-GPG-KEY-ANOLIS #failovermethod=priority enabled=0 [migration-source] name=Anolis OS - migration source repo baseurl=https://mirrors.openanolis.cn/anolis/migration/\$releasever/source/ gpgcheck=1 gpgkey=https://mirrors.openanolis.cn/anolis/RPM-GPG-KEY-ANOLIS #failovermethod=priority enabled=0""" >> /etc/yum.repos.d/anolis-migration.repo==================centos7==================####======================添加an7_baseos苍老 (IP替换为搭建仓库的IP)====================== echo """[an7_baseos] name=AnolisOS-7 - BaseOS baseurl=http://192.168.88.50/anolis/7.9/os/\$basearch/os gpgcheck=0 enabled=1 [an7_updates] name=AnolisOS-7 - Updates baseurl=http://192.168.88.50/anolis/7.9/updates/\$basearch/os gpgcheck=0 enabled=1""">>/etc/yum.repos.d/switch-to-anolis.repo ####======================添加migration仓库 (IP替换为搭建仓库的IP)====================== echo """# Anolis OS migration repo [migration] name=Anolis OS - migration repo baseurl=http://192.168.88.50/anolis/migration/\$releasever/\$basearch/os/ gpgcheck=1 gpgkey=http://192.168.88.50/anolis/RPM-GPG-KEY-ANOLIS failovermethod=priority enabled=1 [migration-debug] name=Anolis OS - migration debug repo baseurl=http://192.168.88.50/anolis/migration/\$releasever/\$basearch/debug/ gpgcheck=1 gpgkey=http://192.168.88.50/anolis/RPM-GPG-KEY-ANOLIS failovermethod=priority enabled=0 [migration-source] name=Anolis OS - migration source repo baseurl=http://192.168.88.50/anolis/migration/\$releasever/source/ gpgcheck=1 gpgkey=http://192.168.88.50/anolis/RPM-GPG-KEY-ANOLIS failovermethod=priority enabled=0""" >> /etc/yum.repos.d/anolis-migration.repo ####====================== 执行安装迁移工具 ====================== yum -y install centos2anolis ####====================== 开始迁移系统(过程可能会报错) ====================== centos2anolis.py -l ####====================== 迁移报错python依赖问题处理 ====================== python-chardet-2.2.1-3.el7.noarch.rpm python-kitchen-1.1.1-5.el7.noarch.rpm python36-psutil-5.6.7-1.el7.x86_64.rpm 将上述三个包传到服务器上 执行命令 yum localinstall python* -y 安装完成后再次执行 yum -y install centos2anolis ####====================== 迁移成功后更新龙蜥软件包 ====================== yum distro-sync
2024年09月04日
32 阅读
0 评论
0 点赞
Oracle11g单节点库通过搭建DG RAC的方式迁移至集群环境
一、环境配置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.conf.lo.disable_ipv6 = 1""" >> /etc/sysctl.conf sysctl -p1.3、配置ssh、关闭Selinux及防火墙# 配置LoginGraceTime参数为0, 将timeout wait设置为无限制 sed -i '/#LoginGraceTime 2m/ s/#LoginGraceTime 2m/LoginGraceTime 0/' /etc/ssh/sshd_config && grep LoginGraceTime /etc/ssh/sshd_config # 加快SSH登录 禁用DNS sed -i '/#UseDNS yes/ s/#UseDNS yes/UseDNS no/' /etc/ssh/sshd_config && grep UseDNS /etc/ssh/sshd_config sed -i 's/enforcing/disabled/g' /etc/selinux/config setenforce 0 service firewalld stop chkconfig firewalld off1.4用户组及变量相关设置1.4.1单机环境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 oracle echo """export ORACLE_SID=orcl export ORACLE_BASE=/u01/app/oracle export ORACLE_HOME=\${ORACLE_BASE}/product/11.2.0.4/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/JRE:\$ORACLE_HOME/jlib:\$ORACLE_HOME/rdbms/jlib:\$ORACLE_HOME/network/jlib export CV_ASSUME_DISTID=OL7 export THREADS_FLAG=native export TEMP=/tmp export TMPDIR=/tmp""" >> /home/oracle/.bash_profile1.4.2集群环境节点1 执行groupadd -g 1003 oinstall groupadd -g 1001 dba groupadd -g 1002 oper groupadd -g 1004 backupdba groupadd -g 1005 dgdba groupadd -g 1006 kmdba groupadd -g 1007 asmdba groupadd -g 1008 asmoper groupadd -g 1009 asmadmin groupadd -g 1010 racdba useradd -g oinstall -G dba,oper,backupdba,dgdba,kmdba,asmdba,racdba oracle useradd -g oinstall -G dba,asmdba,asmoper,asmadmin,racdba grid echo "oracle" | passwd --stdin oracle echo "grid" | passwd --stdin grid #节点1-Grid用户 cat >> /home/grid/.bash_profile << "EOF" umask 022 export TMP=/tmp export TMPDIR=$TMP export ORACLE_BASE=/u01/app/grid export ORACLE_HOME=/u01/app/11.2.0.4/grid export TNS_ADMIN=$ORACLE_HOME/network/admin export NLS_LANG=american_america.ZHS16GBK export LD_LIBRARY_PATH=$ORACLE_HOME/lib:/lib:/usr/lib export ORACLE_SID=+ASM1 export PATH=/usr/sbin:$PATH export PATH=$ORACLE_HOME/bin:$ORACLE_HOME/OPatch:$PATH #alias sas='sqlplus / as sysasm' export PS1="[\`whoami\`@\`hostname\`:"'$PWD]\$ ' EOF # 节点1-Oracle用户 echo """export ORACLE_SID=orcl1 export ORACLE_BASE=/u01/app/oracle export ORACLE_HOME=\${ORACLE_BASE}/product/11.2.0.4/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/JRE:\$ORACLE_HOME/jlib:\$ORACLE_HOME/rdbms/jlib:\$ORACLE_HOME/network/jlib export CV_ASSUME_DISTID=OL7 export THREADS_FLAG=native export TEMP=/tmp export TMPDIR=/tmp""" >> /home/oracle/.bash_profile节点2执行groupadd -g 1003 oinstall groupadd -g 1001 dba groupadd -g 1002 oper groupadd -g 1004 backupdba groupadd -g 1005 dgdba groupadd -g 1006 kmdba groupadd -g 1007 asmdba groupadd -g 1008 asmoper groupadd -g 1009 asmadmin groupadd -g 1010 racdba useradd -g oinstall -G dba,oper,backupdba,dgdba,kmdba,asmdba,racdba oracle useradd -g oinstall -G dba,asmdba,asmoper,asmadmin,racdba grid echo "oracle" | passwd --stdin oracle echo "grid" | passwd --stdin grid cat >> /home/grid/.bash_profile << "EOF" umask 022 export TMP=/tmp export TMPDIR=$TMP export ORACLE_BASE=/u01/app/grid export ORACLE_HOME=/u01/app/11.2.0.4/grid export TNS_ADMIN=$ORACLE_HOME/network/admin export NLS_LANG=american_america.ZHS16GBK export LD_LIBRARY_PATH=$ORACLE_HOME/lib:/lib:/usr/lib export ORACLE_SID=+ASM2 export PATH=/usr/sbin:$PATH export PATH=$ORACLE_HOME/bin:$ORACLE_HOME/OPatch:$PATH #alias sas='sqlplus / as sysasm' export PS1="[\`whoami\`@\`hostname\`:"'$PWD]\$ ' EOF # 节点2-Oracle用户 echo """export ORACLE_SID=orcl2 export ORACLE_BASE=/u01/app/oracle export ORACLE_HOME=\${ORACLE_BASE}/product/11.2.0.4/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/JRE:\$ORACLE_HOME/jlib:\$ORACLE_HOME/rdbms/jlib:\$ORACLE_HOME/network/jlib export CV_ASSUME_DISTID=OL7 export THREADS_FLAG=native export TEMP=/tmp export TMPDIR=/tmp""" >> /home/oracle/.bash_profile1.5、创建目录及赋予权限1.5.1、单机环境创建目录并赋予权限mkdir -p /u01/app/oracle/product/11.2.0.4/db_1 chown -R oracle:oinstall /u01/ chmod -R 775 /u01/1.5.2、集群环境创建目录并赋予权限mkdir -p /u01/app/11.2.0.4/grid mkdir -p /u01/app/grid mkdir -p /u01/app/oracle/product/11.2.0.4/db_1 chown -R grid:oinstall /u01 chown -R oracle:oinstall /u01/app/oracle chmod -R 775 /u01/二、存储配置2.1、ISCSI存储配置注:如未使用本地创建的磁盘,使用iscsi共享磁盘,需要先连接到共享磁盘yum install -y iscsi-initiator-utils systemctl start iscsi systemctl enable iscsi #发现target(discovery) iscsiadm -m discovery -t st -p 10.255.10.9:3260 #连接target(discovery)存储 iscsiadm -m node -T iqn.2005-10.org.freenas.ctl:orcl-rac -p 10.255.10.9 -l #查看登录的session 相当于iscsiadm -m session -P 0 iscsiadm -m session #扫描所有关联的target/session iscsiadm -m node -R iscsiadm -m session -R #自动登录 iscsiadm -m node -T iqn.2005-10.org.freenas.ctl:orcl-rac -p 10.255.10.9,3260 --op update -n node.startup -v automatic #扫描新添加的Iscsi存储设备 /usr/bin/scsi-rescan #查看已经建立的iscsi连接 iscsiadm -m session -P 3 #断开iscsi连接 iscsiadm --mode node --targetname <target_name> --portal <target_portal> --logout #断开所有iscsi连接 iscsiadm --mode node --logoutall=all #重启iscsi systemctl restart iscsid #取消掉自动登录 iscsiadm --mode node --targetname iqn.2005-10.org.freenas.ctl:orcl-rac --portal 10.255.10.9:3260 --op delete2.2、multipath+udev多路径2.2.1、multipath配置##安装multipath yum install -y device-mapper* mpathconf --enable --with_multipathd y ##查看共享盘的scsi_id /usr/lib/udev/scsi_id -g -u /dev/sdb /usr/lib/udev/scsi_id -g -u /dev/sdc /usr/lib/udev/scsi_id -g -u /dev/sdd /usr/lib/udev/scsi_id -g -u /dev/sde /usr/lib/udev/scsi_id -g -u /dev/sdf mv /etc/multipath.conf /etc/multipath.conf_bak # 将iscsi_id 替换到下边的代码块中 cat <<EOF>> /etc/multipath.conf defaults { user_friendly_names yes } blacklist { devnode "^sda" } multipaths { multipath { wwid "360002ac00000000000000018000278cf" alias asm_crs01 } multipath { wwid "360002ac00000000000000019000278cf" alias asm_crs02 } multipath { wwid "360002ac0000000000000001a000278cf" alias asm_crs03 } multipath { wwid "360002ac0000000000000001b000278cf" alias asm_fra } multipath { wwid "360002ac0000000000000001c000278cf" alias asm_data } } EOF #加载内核模块 modprobe dm_multipath #删除所有不使用的多路径设备 multipath -F #查看生成的多路径盘符 multipath -v2 #显示多路径配置状态 multipath -ll2.2.2、Udev配置for i in crs01 crs02 crs03 fra data; do echo "KERNEL==\"sd*\", ENV{DEVTYPE}==\"disk\",SUBSYSTEM==\"block\", PROGRAM==\"/lib/udev/scsi_id -g -u -d \$devnode\",RESULT==\"`/usr/lib/udev/scsi_id -g -u /dev/mapper/asm_$i`\",RUN+=\"/bin/sh -c 'mknod /dev/asm-$i b \$major \$minor; chown grid:asmadmin /dev/asm-$i; chmod 0660 /dev/asm-$i'\"" >> /etc/udev/rules.d/99-oracle-asmdevices.rules done ##重载udev udevadm control --reload-rules udevadm trigger --type=devices --action=change ll /dev/asm*2.2.3、Udev(非multipath)注:/dev/sd[b-f] 对应下边的 b c d e f 如有更多的盘添加到代码中for i in b c d e f; do echo "KERNEL==\"sd*\", ENV{DEVTYPE}==\"disk\", SUBSYSTEM==\"block\", PROGRAM==\"/lib/udev/scsi_id -g -u -d \$devnode\", RESULT==\"`/lib/udev/scsi_id -g -u -d /dev/sd$i`\", SYMLINK+=\"asm-disk$i\", OWNER=\"grid\", GROUP=\"asmadmin\", MODE=\"0660\"" >> /etc/udev/rules.d/99-oracle-asmdevices.rules done # 加载rules文件,重新加载udev rule /sbin/udevadm control --reload # 检查新的设备名称 /sbin/udevadm trigger --type=devices --action=change三、集群环境下其他配置3.1、主机名及解析# 注:检查双网卡配置 #网卡1: # 配置public IP 需要网关 网卡2: # 配置priv IP 不要网关 # 网卡都关闭IPv6 # 节点1 hostnamectl set-hostname rac01 # 节点2 hostnamectl set-hostname rac02 echo "#public ip 10.255.10.11 rac01 10.255.10.12 rac02 #priv ip 10.10.10.11 rac01-pri 10.10.10.12 rac02-pri #vip ip 10.255.10.13 rac01-vip 10.255.10.14 rac02-vip #scan ip 10.255.10.10 rac-scan" >> /etc/hosts # 测试连通性所有节点 ping -c 1 rac01; ping -c 1 rac02; ping -c 1 rac01-pri; ping -c 1 rac02-pri;3.2、调整Network-双节点echo "NOZEROCONF=yes" >>/etc/sysconfig/network && cat /etc/sysconfig/network3.3、调整/dev/shm -双节点# 修改shm大小 echo "tmpfs /dev/shm tmpfs rw,exec,size=32G 0 0">>/etc/fstab # 重新挂载 mount -o remount /dev/shm # 检测shm大小是否修改 df -h3.4、关闭透明大页cp /etc/default/grub /etc/default/grub.bak sed -i 's/quiet/quiet\ transparent_hugepage=never/g' /etc/default/grub #执行命令 grub2-mkconfig -o /boot/grub2/grub.cfg #不重启生效 echo never > /sys/kernel/mm/transparent_hugepage/enabled注:Rac集群下为所有节点配置互信#生成密钥对 rm -rf ~/.ssh mkdir ~/.ssh ssh-keygen -t rsa ssh-keygen -t dsa注:节点1(rac01)的所有用户(oracle,grud,root)执行追加互信cat ~/.ssh/id_rsa.pub >> ~/.ssh/authorized_keys cat ~/.ssh/id_dsa.pub >> ~/.ssh/authorized_keys ssh rac02 cat ~/.ssh/id_rsa.pub >> ~/.ssh/authorized_keys ssh rac02 cat ~/.ssh/id_dsa.pub >> ~/.ssh/authorized_keys scp ~/.ssh/authorized_keys rac02:~/.ssh/authorized_keys注:所有节点(rac01,rac02)的所有用户(oracle,grid,root)执行互信验证,都不需要密码则互信添加完成ssh rac01 date; ssh rac02 date; ssh rac01-pri date; ssh rac02-pri date;四、主库安装及DG配置安装步骤省略4.1、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 ('/u01/app/oracle/oradata/orcl/sredo04.log') size 50m; alter database add standby logfile group 5 ('/u01/app/oracle/oradata/orcl/sredo05.log') size 50m; alter database add standby logfile group 6 ('/u01/app/oracle/oradata/orcl/sredo06.log') size 50m; alter database add standby logfile group 7 ('/u01/app/oracle/oradata/orcl/sredo07.log') size 50m; select * from v$logfile order by group#; #查询日志组 GROUP# STATUS TYPE MEMBER ---------- ------- ------- ----------------------------------------------------- 1 ONLINE /u01/app/oracle/oradata/orcl/redo01.log 2 ONLINE /u01/app/oracle/oradata/orcl/redo02.log 3 ONLINE /u01/app/oracle/oradata/orcl/redo03.log 4 STANDBY /u01/app/oracle/oradata/orcl/sredo04.log 5 STANDBY /u01/app/oracle/oradata/orcl/sredo05.log 6 STANDBY /u01/app/oracle/oradata/orcl/sredo06.log 7 STANDBY /u01/app/oracle/oradata/orcl/sredo07.log 7 rows selected. #设置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=/u01/app/oracle/orcl_arch VALID_FOR=(ALL_LOGFILES,ALL_ROLES) DB_UNIQUE_NAME=primary' scope=spfile; #设置日志归档路径2 alter system set log_archive_dest_2='SERVICE=standby LGWR ASYNC VALID_FOR=(ONLINE_LOGFILES,PRIMARY_ROLES) DB_UNIQUE_NAME=standby' scope=spfile; #启用归档路径1 alter system set log_archive_dest_state_1='enable' scope=spfile; #启用归档路径2 alter system set log_archive_dest_state_2='enable' scope=spfile; #设置当前库获取归档日志的服务器listerner名称(与8成对出现,用于switchover角色切换) alter system set fal_server='standby' scope=spfile; #设置当前库获取归档日志的客户端名称listerner名称(与7成对出现,用于switchover角色切换) alter system set fal_client='primary' scope=spfile; #设置归档日志强制切换时间(s)1800表示30分钟 alter system set archive_lag_target=1800 scope=spfile; #设置归档日志文件名命名方式 alter system set log_archive_format='%t_%s_%r.arc'scope=spfile; #设置备库文件管理的方式为auto,结合后续的convert参数,当主库增删文件时会自动在备库也生成相应文件。 alter system set standby_file_management=auto scope=spfile; #设置数据文件名称的映射关系(注意顺序不能变) alter system set db_file_name_convert='standby','primary' scope=spfile; #设置日志文件名称的映射关系(注意顺序不能变) alter system set log_file_name_convert='standby','primary' scope=spfile;4.2、主库监听配置# 修改监听文件/u01/app/oracle/product/19c/db_1/network/admin/listener.ora # listener.ora Network Configuration File: /u01/app/oracle/product/19c/db_1/network/admin/listener.ora # Generated by Oracle configuration tools. LISTENER = (DESCRIPTION_LIST = (DESCRIPTION = (ADDRESS = (PROTOCOL = TCP)(HOST = localhost)(PORT = 1521)) #host为当前主机名 (ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1521)) ) ) #新增以下内容 SID_LIST_LISTENER = (SID_LIST = (SID_DESC = (SID_NAME = CLRExtProc) (ORACLE_HOME = /u01/app/oracle/product/19c/db_1) (PROGRAM = extproc) ) (SID_DESC = (GLOBAL_DBNAME = orcl) #改为实例名 (ORACLE_HOME = /u01/app/oracle/product/19c/db_1) (SID_NAME = orcl) #改为实例名 ) )# 修改主库客户端配置文件/u01/app/oracle/product/19c/db_1/network/admin/tnsnames.ora # tnsnames.ora Network Configuration File: /u01/app/oracle/product/19c/db_1/network/admin/tnsnames.ora # Generated by Oracle configuration tools. LISTENER_ORCL = (ADDRESS = (PROTOCOL = TCP)(HOST = localhost)(PORT = 1521)) ORCL = (DESCRIPTION = (ADDRESS = (PROTOCOL = TCP)(HOST = localhost)(PORT = 1521)) (CONNECT_DATA = (SERVER = DEDICATED) (SERVICE_NAME = orcl) ) ) # 新增内容 PRIMARY = (DESCRIPTION = (ADDRESS_LIST = (ADDRESS = (PROTOCOL = TCP)(HOST = orcldb)(PORT = 1521)) #HOST填写主库IP或者主机名 ) (CONNECT_DATA = (SERVICE_NAME = orcl) #实例名 ) ) STANDBY = (DESCRIPTION = (ADDRESS_LIST = (ADDRESS = (PROTOCOL = TCP)(HOST = orcldg)(PORT = 1521)) #HOST填写备库IP或者主机名 ) (CONNECT_DATA = (SERVICE_NAME = orcl) #实例名 ) )五、集群安装及DG配置5.1、安装前环境检查# 环境检查 ./runcluvfy.sh stage -pre crsinst -n rac01,rac02 -fixup -verbose ./runcluvfy.sh stage -pre crsinst -n rac01,rac02 -verbose ./runcluvfy.sh stage -post hwos -n rac01,rac02 -verbose安装过程省略,安装集群过程中出现问题按照下边方式处理# 执行过程中卡 Adding Clusterware entries to inittab # 新建一个窗口执行以下命令 # 方案1 dd if=/var/tmp/.oracle/npohasd of=/dev/null bs=1024 count=1 # 方案2 chown root:oinstall/var/tmp/.oracle/npohasd # 重新执行root.sh之前删除旧配置 /u01/app/11.2.0.4/grid/crs/install/roothas.pl -deconfig -force -verbose5.2、监听配置GRID 监听# /u01/app/11.2.0.4/grid/network/admin/listener.ora 增加以下配置 SID_LIST_LISTENER= (SID_LIST= (SID_DESC= (GLOBAL_DBNAME=rac01) (ORACLE_HOME=/u01/app/oracle/product/11.2.0/db_1) #此处为oracle的ORACLE_HOME (SID_NAME=orcl1) ) ) # 重载监听 lsnrctl reloadOracle Tnsnames# /u01/app/oracle/product/11.2.0.4/db_1/network/admin/tnsnames.ora PRIMARY = (DESCRIPTION = (ADDRESS_LIST = (ADDRESS = (PROTOCOL = TCP)(HOST = orcldb)(PORT = 1521)) ) (CONNECT_DATA = (SERVER=DEDICATED) (SERVICE_NAME = orcl) ) ) STANDBY = (DESCRIPTION = (ADDRESS_LIST = (ADDRESS = (PROTOCOL = TCP)(HOST = rac01)(PORT = 1521)) ) (CONNECT_DATA = (SERVER=DEDICATED) (SERVICE_NAME = orcl) ) )5.3、数据复制# oracle文件权限(谨慎使用) chmod 6751 oracle # 用户加组 usermod -aG 组名 用户名 # 移除组下的用户 gpasswd -d 用户名 组名 # 连接主库和辅助数据库 rman target sys/Xx961024@primary auxiliary sys/Xx961024@standby # 执行此命令为不自动回复 duplicate target database for standby from active database nofilenamecheck; # 执行首次同步,带自动恢复 duplicate target database for standby from active database dorecover nofilenamecheck; # 应用日志同步 alter database recover managed standby database disconnect from session; # 开启实时同步 alter database recover managed standby database using current logfile disconnect from session; # 停止同步 alter database recover managed standby database cancel; # 检查日志同步情况 select name,sequence#,applied, To_Char(a.COMPLETION_TIME, 'YYYY-MM-DD HH24:MI:SS') AS COMPLETETIME from v$archived_log a where a.COMPLETION_TIME>sysdate -3/24 order by sequence#; select name,sequence#,applied, To_Char(a.COMPLETION_TIME, 'YYYY-MM-DD HH24:MI:SS') AS COMPLETETIME from v$archived_log a where a.COMPLETION_TIME>sysdate -1 order by sequence#; select name,sequence#,applied, To_Char(a.COMPLETION_TIME, 'YYYY-MM-DD HH24:MI:SS') AS COMPLETETIME from v$archived_log a where APPLIED='YES' order by sequence#; # 注册归档日志 rman catalog start with 'path'; # 创建spfile create spfile='+DATA/oradata/spfileorcl.ora' from pfile='/u01/app/oracle/product/11.2.0.4/db_1/dbs/initorcl.ora'; # 备份initorcl1.ora文件,重新创建 spfile='+RACDATA/spfileorcl.ora' # 重启数据库验证spfile # 注册CRS资源管理 srvctl add database -d orcl -n orcl -o /u01/app/oracle/product/11.2.0.4/db_1 -p +DATA/oradata/spfileorcl.ora -r physical_standby -a "DATA" # 注册节点 srvctl add instance -d orcl -i orcl1 -n rac01 srvctl add instance -d orcl -i orcl2 -n rac02 # 检查资源配置 srvctl config database -d orcl # 为rac02节点配置自己的UNDOTBS # 主库操作 set pagesize 1000 linesize 1000 col FILE_NAME for a65; select file_name,bytes/1024/1024 from dba_data_files; # 在主库添加UNDOTBS2,RAC库同步(加完可以切一下日志) create undo tablespace undotbs2 datafile '/u01/app/oracle/oradata/orcl/undotbs02.dbf' size 100m; # 备库(rac)操作 # 检查UNDOTBS2是否已经同步过来 select file_name from dba_data_files; # 将数据库转换为rac模式,注:千万不能漏,漏会报错只能把本地pfile恢复重新来 alter system set cluster_database=true scope=spfile; alter system set cluster_database_instances=2 scope=spfile; alter system set instance_number=1 scope=spfile sid='orcl1'; alter system set instance_number=2 scope=spfile sid='orcl2'; alter system set thread=1 scope=spfile sid='orcl1'; alter system set thread=2 scope=spfile sid='orcl2'; alter system set undo_tablespace=undotbs1 scope=spfile sid='orcl1'; alter system set undo_tablespace=undotbs2 scope=spfile sid='orcl2'; # 重启数据库(rac1节点) # 主库处理日志组问题 === 见下一个项目 # 备库查询实例状态 select INSTANCE_NAME,STATUS,INSTANCE_ROLE,DATABASE_STATUS from gv$instance; # 主库状态检查 select database_role,switchover_status from v$database; # 将主库切换为备库 # 切换之前做一次 alter system switch logfile; alter database commit to switchover to physical standby with session shutdown; # 关闭备库 srvctl stop database -d orcl # 将新备库启动到mount状态 grid 用户执行 srvctl start database -d orcl -o mount # 将备库(rac)切换为主库 alter database commit to switchover to primary; # 将新主库(rac)打开 grid 用户执行 srvctl start database -d orcl -o open; 主库为备库添加日志组show parameter standby_file_management # 先改为手动模式 alter system set standby_file_management=manual; # 查询日志组信息 select a.group#,member,thread#,bytes/1024/1024 MB from v$logfile a, v$log b where a.group#=b.group#; # 查询所有日志组 select * from v$logfile; # 查询日志组使用情况 select group#,thread#,sequence#,members,status from v$log; # 删除日志组 alter database disable thread 2; alter database clear logfile group xx; alter database drop logfile group xx; alter database rename file '/u01/app/oracle/oradata/orcl/redo01.log' to '+DATA/oradata/orcl/redo01.log'; alter database rename file '/u01/app/oracle/oradata/orcl/redo02.log' to '+DATA/oradata/orcl/redo02.log'; alter database rename file '/u01/app/oracle/oradata/orcl/redo03.log' to '+DATA/oradata/orcl/redo03.log'; +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ alter database add standby logfile thread 1 '/u01/app/oracle/oradata/orcl/sredo01.log' size 50m; alter database add standby logfile thread 1 '/u01/app/oracle/oradata/orcl/sredo02.log' size 50m; alter database add standby logfile thread 1 '/u01/app/oracle/oradata/orcl/sredo03.log' size 50m; alter database add logfile thread 2 '/u01/app/oracle/oradata/orcl/redo04.log' size 50m; alter database add logfile thread 2 '/u01/app/oracle/oradata/orcl/redo05.log' size 50m; alter database add logfile thread 2 '/u01/app/oracle/oradata/orcl/redo06.log' size 50m; alter database add standby logfile thread 2 '/u01/app/oracle/oradata/orcl/sredo04.log' size 50m; alter database add standby logfile thread 2 '/u01/app/oracle/oradata/orcl/sredo05.log' size 50m; alter database add standby logfile thread 2 '/u01/app/oracle/oradata/orcl/sredo06.log' size 50m; alter database enable thread 2; alter system set standby_file_management=auto; +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ # 备库rac添加standby日志 alter database add logfile thread 1 '+DATA/oradata/orcl/redo01.log' size 50m; alter database add logfile thread 1 '+DATA/oradata/orcl/redo02.log' size 50m; alter database add logfile thread 1 '+DATA/oradata/orcl/redo03.log' size 50m; alter database add standby logfile thread 1 '+DATA/oradata/orcl/sredo01.log' size 50m; alter database add standby logfile thread 1 '+DATA/oradata/orcl/sredo02.log' size 50m; alter database add standby logfile thread 1 '+DATA/oradata/orcl/sredo03.log' size 50m; alter database add logfile thread 2 '+DATA/oradata/orcl/redo04.log' size 50m; alter database add logfile thread 2 '+DATA/oradata/orcl/redo05.log' size 50m; alter database add logfile thread 2 '+DATA/oradata/orcl/redo06.log' size 50m; alter database add standby logfile thread 2 '+DATA/oradata/orcl/sredo04.log' size 50m; alter database add standby logfile thread 2 '+DATA/oradata/orcl/sredo05.log' size 50m; alter database add standby logfile thread 2 '+DATA/oradata/orcl/sredo06.log' size 50m; alter system set standby_file_management=auto;增加或删除新的scan IP在集群# 先编辑/etc/hosts 文件-双节点-root用户 #scan ip 10.255.10.10 rac-scan 10.255.10.15 rac-scan # 停止监听 srvctl stop scan_listener # 停止scan srvctl stop scan # 查看状态 srvctl status scan_listener # 修改scan信息,-n后面接 hosts中的san ip网络名 /u01/app/11.2.0.4/grid/bin/srvctl modify scan -n rac-scan # 添加scanIP的监听,若不执行该命令,将只有一个listener_scan1监听,执行后将根据scan ip数自动增加listener_scan2,listener_scan3. /u01/app/11.2.0.4/grid/bin/srvctl modify scan_listener -u # 启动scan srvctl start scan # 启动监听 srvctl start scan_listener # 查看状态 srvctl status scan闪回的使用# 查询闪回状态 select flashback_on from v$database; # 取消备库的自动恢复 alter database recover managed standby database cancel; # mount模式下打开闪回 alter system set db_recovery_dest_size=5g; alter system set db_recovery_file_dest='+DATA'; alter database flashback on; # 创建还原点 create restore point test_sw; # 在主库归档当前日志,确保前一步创建还原点的scn的归档日志已经传到备库 alter system archive log current; # 将主库到备库的归档目的地状态设置为defer alter system set log_archive_dest_state_2=defer; select dest_name,error, status from gv$archive_dest; # 查询闪回scn select current_scn from v$database; # 激活备库到read/write状态 alter database activate standby database; shutdown immediate; startup; select open_mode from v$database; # 将数据库flashback回原来保存的还原点 startup mount force; flashback database to restore point test_sw; # 转换成备库 alter database convert to physical standby; # 将备库至于自动恢复状态 startup mount force; ALTER DATABASE RECOVER MANAGED STANDBY DATABASE DISCONNECT; # 将主库到备库的归档目的地状设置为enable alter system set log_archive_dest_state_2=enable; # 检查同步情况 set linesize 150; set pagesize 20; column name format a13; column value format a20; column unit format a30; column TIME_COMPUTED format a30; select name,value,unit,time_computed from v$dataguard_stats where name in ('transport lag','apply lag');修改Ip# 备份hosts文件 cp /etc/hosts /etc/hosts_bak # 停止集群 srvctl stop database -d orcl # 停止CRS 所有节点root执行 /u01/app/11.2.0.4/grid/bin/crsctl stop crs -f # 修改hosts文件 # 启动CRS 所有节点root执行 /u01/app/11.2.0.4/grid/bin/crsctl start crs # 检查状态 /u01/app/11.2.0.4/grid/bin/crsctl check cluster -all
2024年08月14日
39 阅读
0 评论
0 点赞
NBU 异机恢复 rman-06026 man-06023 异常处理
异常信息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/oradata/xxx.dbf'; set newname for datafile 27 to '/u01/app/oracle/oradata/xxx.dbf'; set newname for datafile 28 to '/u01/app/oracle/oradata/xxx.dbf'; set newname for datafile 29 to '/u01/app/oracle/oradata/xxx.dbf'; set newname for datafile 30 to '/u01/app/oracle/oradata/xxx.dbf'; set newname for datafile 31 to '/u01/app/oracle/oradata/xxx.dbf'; set newname for datafile 32 to '/u01/app/oracle/oradata/xxx.dbf'; set newname for datafile 33 to '/u01/app/oracle/oradata/xxx.dbf'; set newname for datafile 34 to '/u01/app/oracle/oradata/xxx.dbf'; set newname for datafile 35 to '/u01/app/oracle/oradata/xxx.dbf'; set newname for datafile 36 to '/u01/app/oracle/oradata/xxx.dbf'; set newname for datafile 37 to '/u01/app/oracle/oradata/xxx.dbf'; set newname for datafile 38 to '/u01/app/oracle/oradata/xxx.dbf'; set newname for datafile 39 to '/u01/app/oracle/oradata/xxx.dbf'; set newname for datafile 40 to '/u01/app/oracle/oradata/xxx.dbf'; set newname for datafile 41 to '/u01/app/oracle/oradata/xxx.dbf'; set newname for datafile 42 to '/u01/app/oracle/oradata/xxx.dbf'; set newname for datafile 43 to '/u01/app/oracle/oradata/xxx.dbf'; set newname for datafile 44 to '/u01/app/oracle/oradata/xxx.dbf'; set newname for datafile 45 to '/u01/app/oracle/oradata/xxx.dbf'; set newname for datafile 46 to '/u01/app/oracle/oradata/xxx.dbf'; set newname for datafile 47 to '/u01/app/oracle/oradata/xxx.dbf'; restore database; switch datafile all; release channel ch10; release channel ch11; release channel ch12; release channel ch13; release channel ch14; 62> } allocated channel: CH10 channel CH10: SID=1702 device type=SBT_TAPE channel CH10: Veritas NetBackup for Oracle - Release 10.2 (2023032421) allocated channel: CH11 channel CH11: SID=2268 device type=SBT_TAPE channel CH11: Veritas NetBackup for Oracle - Release 10.2 (2023032421) allocated channel: CH12 channel CH12: SID=2834 device type=SBT_TAPE channel CH12: Veritas NetBackup for Oracle - Release 10.2 (2023032421) allocated channel: CH13 channel CH13: SID=3400 device type=SBT_TAPE channel CH13: Veritas NetBackup for Oracle - Release 10.2 (2023032421) allocated channel: CH14 channel CH14: SID=3967 device type=SBT_TAPE channel CH14: Veritas NetBackup for Oracle - Release 10.2 (2023032421) sent command to channel: ORA_MAINT_SBT_TAPE_3 sent command to channel: ORA_MAINT_DISK_4 sent command to channel: CH10 sent command to channel: CH11 sent command to channel: CH12 sent command to channel: CH13 sent command to channel: CH14 executing command: SET NEWNAME executing command: SET NEWNAME executing command: SET NEWNAME executing command: SET NEWNAME executing command: SET NEWNAME executing command: SET NEWNAME executing command: SET NEWNAME executing command: SET NEWNAME executing command: SET NEWNAME executing command: SET NEWNAME executing command: SET NEWNAME executing command: SET NEWNAME executing command: SET NEWNAME executing command: SET NEWNAME executing command: SET NEWNAME executing command: SET NEWNAME executing command: SET NEWNAME executing command: SET NEWNAME executing command: SET NEWNAME executing command: SET NEWNAME executing command: SET NEWNAME executing command: SET NEWNAME executing command: SET NEWNAME executing command: SET NEWNAME executing command: SET NEWNAME executing command: SET NEWNAME executing command: SET NEWNAME executing command: SET NEWNAME executing command: SET NEWNAME executing command: SET NEWNAME executing command: SET NEWNAME executing command: SET NEWNAME executing command: SET NEWNAME executing command: SET NEWNAME executing command: SET NEWNAME executing command: SET NEWNAME executing command: SET NEWNAME executing command: SET NEWNAME executing command: SET NEWNAME executing command: SET NEWNAME executing command: SET NEWNAME executing command: SET NEWNAME executing command: SET NEWNAME executing command: SET NEWNAME executing command: SET NEWNAME executing command: SET NEWNAME executing command: SET NEWNAME Starting restore at 10-APR-24 released channel: CH10 released channel: CH11 released channel: CH12 released channel: CH13 released channel: CH14 RMAN-00571: =========================================================== RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS =============== RMAN-00571: =========================================================== RMAN-03002: failure of restore command at 04/10/2024 17:06:56 RMAN-06026: some targets not found - aborting restore RMAN-06023: no backup or copy of datafile 4 found to restore RMAN-06023: no backup or copy of datafile 3 found to restore RMAN-06023: no backup or copy of datafile 2 found to restore RMAN-06023: no backup or copy of datafile 1 found to restore显示找不到数据文件的备份文件。在目标机器上使用rman查询incarnatioin记录:rman target / RMAN> list incarnation; List of Database Incarnations DB Key Inc Key DB Name DB ID STATUS Reset SCN Reset Time ------- ------- -------- ---------------- --- ---------- ---------- 1 1 JHEMR 1358074586 ORPHAN 1 24-AUG-13 2 2 JHEMR 1358074586 ORPHAN 925702 22-JUL-19 3 3 JHEMR 1358074586 ORPHAN 86506916788 17-DEC-21 4 4 JHEMR 1358074586 CURRENT 88670576572 25-FEB-22在原数据库上执行相同的查询:RMAN> list incarnation; using target database control file instead of recovery catalog List of Database Incarnations DB Key Inc Key DB Name DB ID STATUS Reset SCN Reset Time ------- ------- -------- ---------------- --- ---------- ---------- 1 1 JHEMR 1358074586 PARENT 1 2013:08:2411:37:30 2 2 JHEMR 1358074586 PARENT 925702 2019:07:2200:57:01 3 3 JHEMR 1358074586 CURRENT 86506916788 2021:12:1700:51:45结论及处理方案对比incarnatioin记录 发现目标库的CURRENT记录号和原库的CURRENT记录号不一致, 将目标库的当前记录修改为原库一致的记录号:RMAN> reset database to incarnation 3; database reset to incarnation 3然后再次执行NBU恢复命令, 无异常敏感信息做脱敏处理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/oradata/xxx.dbf'; set newname for datafile 27 to '/u01/app/oracle/oradata/xxx.dbf'; set newname for datafile 28 to '/u01/app/oracle/oradata/xxx.dbf'; set newname for datafile 29 to '/u01/app/oracle/oradata/xxx.dbf'; set newname for datafile 30 to '/u01/app/oracle/oradata/xxx.dbf'; set newname for datafile 31 to '/u01/app/oracle/oradata/xxx.dbf'; set newname for datafile 32 to '/u01/app/oracle/oradata/xxx.dbf'; set newname for datafile 33 to '/u01/app/oracle/oradata/xxx.dbf'; set newname for datafile 34 to '/u01/app/oracle/oradata/xxx.dbf'; set newname for datafile 35 to '/u01/app/oracle/oradata/xxx.dbf'; set newname for datafile 36 to '/u01/app/oracle/oradata/xxx.dbf'; set newname for datafile 37 to '/u01/app/oracle/oradata/xxx.dbf'; set newname for datafile 38 to '/u01/app/oracle/oradata/xxx.dbf'; set newname for datafile 39 to '/u01/app/oracle/oradata/xxx.dbf'; set newname for datafile 40 to '/u01/app/oracle/oradata/xxx.dbf'; set newname for datafile 41 to '/u01/app/oracle/oradata/xxx.dbf'; set newname for datafile 42 to '/u01/app/oracle/oradata/xxx.dbf'; set newname for datafile 43 to '/u01/app/oracle/oradata/xxx.dbf'; set newname for datafile 44 to '/u01/app/oracle/oradata/xxx.dbf'; set newname for datafile 45 to '/u01/app/oracle/oradata/xxx.dbf'; set newname for datafile 46 to '/u01/app/oracle/oradata/xxx.dbf'; set newname for datafile 47 to '/u01/app/oracle/oradata/xxx.dbf'; restore database; switch datafile all; release channel ch10; release channel ch11; release channel ch12; release channel ch13; release channel ch14; 62> } allocated channel: CH10 channel CH10: SID=1702 device type=SBT_TAPE channel CH10: Veritas NetBackup for Oracle - Release 10.2 (2023032421) allocated channel: CH11 channel CH11: SID=2268 device type=SBT_TAPE channel CH11: Veritas NetBackup for Oracle - Release 10.2 (2023032421) allocated channel: CH12 channel CH12: SID=2834 device type=SBT_TAPE channel CH12: Veritas NetBackup for Oracle - Release 10.2 (2023032421) allocated channel: CH13 channel CH13: SID=3400 device type=SBT_TAPE channel CH13: Veritas NetBackup for Oracle - Release 10.2 (2023032421) allocated channel: CH14 channel CH14: SID=3967 device type=SBT_TAPE channel CH14: Veritas NetBackup for Oracle - Release 10.2 (2023032421) sent command to channel: ORA_MAINT_SBT_TAPE_3 sent command to channel: ORA_MAINT_DISK_4 sent command to channel: CH10 sent command to channel: CH11 sent command to channel: CH12 sent command to channel: CH13 sent command to channel: CH14 executing command: SET NEWNAME executing command: SET NEWNAME executing command: SET NEWNAME executing command: SET NEWNAME executing command: SET NEWNAME executing command: SET NEWNAME executing command: SET NEWNAME executing command: SET NEWNAME executing command: SET NEWNAME executing command: SET NEWNAME executing command: SET NEWNAME executing command: SET NEWNAME executing command: SET NEWNAME executing command: SET NEWNAME executing command: SET NEWNAME executing command: SET NEWNAME executing command: SET NEWNAME executing command: SET NEWNAME executing command: SET NEWNAME executing command: SET NEWNAME executing command: SET NEWNAME executing command: SET NEWNAME executing command: SET NEWNAME executing command: SET NEWNAME executing command: SET NEWNAME executing command: SET NEWNAME executing command: SET NEWNAME executing command: SET NEWNAME executing command: SET NEWNAME executing command: SET NEWNAME executing command: SET NEWNAME executing command: SET NEWNAME executing command: SET NEWNAME executing command: SET NEWNAME executing command: SET NEWNAME executing command: SET NEWNAME executing command: SET NEWNAME executing command: SET NEWNAME executing command: SET NEWNAME executing command: SET NEWNAME executing command: SET NEWNAME executing command: SET NEWNAME executing command: SET NEWNAME executing command: SET NEWNAME executing command: SET NEWNAME executing command: SET NEWNAME executing command: SET NEWNAME Starting restore at 10-APR-24 Starting restore at 10-APR-24 channel CH10: starting datafile backup set restore channel CH10: specifying datafile(s) to restore from backup set channel CH10: restoring datafile 00003 to /u01/app/oracle/oradata/xxx.dbf channel CH10: restoring datafile 00008 to /u01/app/oracle/oradata/xxx.dbf channel CH10: restoring datafile 00021 to /u01/app/oracle/oradata/xxx.dbf channel CH10: restoring datafile 00030 to /u01/app/oracle/oradata/xxx.dbf channel CH10: restoring datafile 00043 to /u01/app/oracle/oradata/xxx.dbf channel CH10: reading from backup piece bk_47370_1_1165622409 channel CH11: starting datafile backup set restore channel CH11: specifying datafile(s) to restore from backup set channel CH11: restoring datafile 00009 to /u01/app/oracle/oradata/xxx.dbf channel CH11: restoring datafile 00022 to /u01/app/oracle/oradata/xxx.dbf channel CH11: restoring datafile 00024 to /u01/app/oracle/oradata/xxx.dbf channel CH11: restoring datafile 00031 to /u01/app/oracle/oradata/xxx.dbf channel CH11: restoring datafile 00044 to /u01/app/oracle/oradata/xxx.dbf channel CH11: reading from backup piece bk_47371_1_1165622409 channel CH12: starting datafile backup set restore channel CH12: specifying datafile(s) to restore from backup set channel CH12: restoring datafile 00001 to /u01/app/oracle/oradata/xxx.dbf channel CH12: restoring datafile 00005 to /u01/app/oracle/oradata/xxx.dbf channel CH12: restoring datafile 00013 to /u01/app/oracle/oradata/xxx.dbf channel CH12: restoring datafile 00014 to /u01/app/oracle/oradata/xxx.dbf channel CH12: restoring datafile 00016 to /u01/app/oracle/oradata/xxx.dbf channel CH12: reading from backup piece bk_47372_1_1165629595 channel CH13: starting datafile backup set restore channel CH13: specifying datafile(s) to restore from backup set channel CH13: restoring datafile 00012 to /u01/app/oracle/oradata/xxx.dbf channel CH13: restoring datafile 00017 to /u01/app/oracle/oradata/xxx.dbf channel CH13: restoring datafile 00018 to /u01/app/oracle/oradata/xxx.dbf channel CH13: restoring datafile 00047 to /u01/app/oracle/oradata/xxx.dbf channel CH13: reading from backup piece bk_47373_1_1165638790 channel CH14: starting datafile backup set restore channel CH14: specifying datafile(s) to restore from backup set channel CH14: restoring datafile 00011 to /u01/app/oracle/oradata/xxx.dbf channel CH14: restoring datafile 00028 to /u01/app/oracle/oradata/xxx.dbf channel CH14: restoring datafile 00037 to /u01/app/oracle/oradata/xxx.dbf channel CH14: restoring datafile 00046 to /u01/app/oracle/oradata/xxx.dbf channel CH14: reading from backup piece bk_47374_1_1165641215
2024年04月10日
75 阅读
0 评论
0 点赞
2024-03-27
处理Vcenter 更新证书后NSX无法连接
处理Vcenter 更新证书后NSX无法连接1. 背景vcenter ssl证书即将过期,通过vcenter界面手动续期证书后NSX无法连接2. 错误信息2.1 NSX - Lookup Service URL 错误信息NSX Management Service operation failed.( 管理注册服务提供程序初始化失败。 根本原因: com.vmware.vim.vmomi.core.exception.CertificateValidationException: Server certificate chain is not trusted and thumbprint verification is not configured )2.2 VCenter - 主机准备未就绪现象1: VCenter - 网络和安全 - 安装和升级 - 主机准备 位置的状态为未就绪现象2: 弹出提示 ESX agent 未就绪3.解决方案3.1 解决问题 2.1登陆https://vcenter_IP_or_FQDN:5480/ 使用vcenter web账号密码登录访问 - 编辑 - 启用ssh登陆 - 确定ssh登录到Vcenter###########################x.x.x.x改为vcenter IP########################### MacBook-Pro ~ % ssh root@x.x.x.x VMware vCenter Server Appliance 6.7.0.50000 Type: vCenter Server with an embedded Platform Services Controller ###########################填入密码########################### root@x.x.x.x's password: Last login: Wed Mar 27 10:18:33 2024 from 192.168.89.1 Connected to service * List APIs: "help api list" * List Plugins: "help pi list" * Launch BASH: "shell" ###########################输入shell 然后回车########################### Command> shell Shell access is granted to root root@xxx [ ~ ]# 将脚本 ls_ssltrust_fixer_p3.py(点击下载) 放置到 /usr/lib/vmidentity/tools/scripts/ 路径下执行以下命令:###########################扫描证书########################### root@photon-machine [ ~ ]# python /usr/lib/vmidentity/tools/scripts/ls_ssltrust_fixer_p3.py -f scan Running function 'scan' Scan Phase1: Getting service IDs Picked up JAVA_TOOL_OPTIONS: -Xms32M -Xmx128M -Dcom.sun.org.apache.xml.internal.security.ignoreLineBreaks=true -Dorg.apache.xml.security.ignoreLineBreaks=true Found 35 service IDs Scan Phase2: Getting spec and verifying certicate/trust Processing ID: b'2d10e347-d40c-4678-94ed-759afb90cba8' Picked up JAVA_TOOL_OPTIONS: -Xms32M -Xmx128M -Dcom.sun.org.apache.xml.internal.security.ignoreLineBreaks=true -Dorg.apache.xml.security.ignoreLineBreaks=true FQDN used to retrieve current certificate:x.x.x.x Processing ID: b'5f7e35c3-50ee-4fdc-aba2-95bc6a98099f' Picked up JAVA_TOOL_OPTIONS: -Xms32M -Xmx128M -Dcom.sun.org.apache.xml.internal.security.ignoreLineBreaks=true -Dorg.apache.xml.security.ignoreLineBreaks=true FQDN used to retrieve current certificate:x.x.x.x Processing ID: b'548ffa6c-233c-49a7-9e06-6f1baab494fe' Picked up JAVA_TOOL_OPTIONS: -Xms32M -Xmx128M -Dcom.sun.org.apache.xml.internal.security.ignoreLineBreaks=true -Dorg.apache.xml.security.ignoreLineBreaks=true FQDN used to retrieve current certificate:x.x.x.x Processing ID: b'c4160a88-fd51-4e9e-8ce6-837b65987130' Picked up JAVA_TOOL_OPTIONS: -Xms32M -Xmx128M -Dcom.sun.org.apache.xml.internal.security.ignoreLineBreaks=true -Dorg.apache.xml.security.ignoreLineBreaks=true FQDN used to retrieve current certificate:x.x.x.x Processing ID: b'e0d673d3-f28e-4cff-b8d4-9b8e8020d833' Picked up JAVA_TOOL_OPTIONS: -Xms32M -Xmx128M -Dcom.sun.org.apache.xml.internal.security.ignoreLineBreaks=true -Dorg.apache.xml.security.ignoreLineBreaks=true FQDN used to retrieve current certificate:x.x.x.x Processing ID: b'default-site:522421e2-cf6f-407f-8965-594832d21e28' Picked up JAVA_TOOL_OPTIONS: -Xms32M -Xmx128M -Dcom.sun.org.apache.xml.internal.security.ignoreLineBreaks=true -Dorg.apache.xml.security.ignoreLineBreaks=true FQDN used to retrieve current certificate:x.x.x.x Processing ID: b'0b57e806-0c8b-4354-a941-bdcf37652465' Picked up JAVA_TOOL_OPTIONS: -Xms32M -Xmx128M -Dcom.sun.org.apache.xml.internal.security.ignoreLineBreaks=true -Dorg.apache.xml.security.ignoreLineBreaks=true FQDN used to retrieve current certificate:x.x.x.x Processing ID: b'default-site:af4ac372-7fbd-470a-8e8e-f9de68c1d16b' Picked up JAVA_TOOL_OPTIONS: -Xms32M -Xmx128M -Dcom.sun.org.apache.xml.internal.security.ignoreLineBreaks=true -Dorg.apache.xml.security.ignoreLineBreaks=true FQDN used to retrieve current certificate:x.x.x.x Processing ID: b'68e23985-a7e0-4497-aa02-b1c98f0f7d7c' Picked up JAVA_TOOL_OPTIONS: -Xms32M -Xmx128M -Dcom.sun.org.apache.xml.internal.security.ignoreLineBreaks=true -Dorg.apache.xml.security.ignoreLineBreaks=true FQDN used to retrieve current certificate:x.x.x.x Processing ID: b'b9c01fb7-069e-4d5e-b728-5dfc574a7acb' Picked up JAVA_TOOL_OPTIONS: -Xms32M -Xmx128M -Dcom.sun.org.apache.xml.internal.security.ignoreLineBreaks=true -Dorg.apache.xml.security.ignoreLineBreaks=true FQDN used to retrieve current certificate:x.x.x.x Processing ID: b'31a92fe9-b350-4067-92b8-6f94f7416ab7' Picked up JAVA_TOOL_OPTIONS: -Xms32M -Xmx128M -Dcom.sun.org.apache.xml.internal.security.ignoreLineBreaks=true -Dorg.apache.xml.security.ignoreLineBreaks=true FQDN used to retrieve current certificate:x.x.x.x Processing ID: b'c9fc7aa6-55cf-464f-8537-4981344db54c' Picked up JAVA_TOOL_OPTIONS: -Xms32M -Xmx128M -Dcom.sun.org.apache.xml.internal.security.ignoreLineBreaks=true -Dorg.apache.xml.security.ignoreLineBreaks=true FQDN used to retrieve current certificate:x.x.x.x Processing ID: b'd1575df1-c6e2-449e-b615-153841dd98c9' Picked up JAVA_TOOL_OPTIONS: -Xms32M -Xmx128M -Dcom.sun.org.apache.xml.internal.security.ignoreLineBreaks=true -Dorg.apache.xml.security.ignoreLineBreaks=true FQDN used to retrieve current certificate:x.x.x.x Processing ID: b'68e23985-a7e0-4497-aa02-b1c98f0f7d7c_authz' Picked up JAVA_TOOL_OPTIONS: -Xms32M -Xmx128M -Dcom.sun.org.apache.xml.internal.security.ignoreLineBreaks=true -Dorg.apache.xml.security.ignoreLineBreaks=true FQDN used to retrieve current certificate:x.x.x.x Processing ID: b'bfd58f1c-9d6e-4f9a-985f-d784f7f4d357' Picked up JAVA_TOOL_OPTIONS: -Xms32M -Xmx128M -Dcom.sun.org.apache.xml.internal.security.ignoreLineBreaks=true -Dorg.apache.xml.security.ignoreLineBreaks=true FQDN used to retrieve current certificate:x.x.x.x skipping validation as external solution on:b'55171520-02b8-4ea2-9276-f1ecc4cb019a_com.vmware.vsphere.client' Processing ID: b'24b3a39c-6a2c-41d5-b2d9-805f378d0b56' Picked up JAVA_TOOL_OPTIONS: -Xms32M -Xmx128M -Dcom.sun.org.apache.xml.internal.security.ignoreLineBreaks=true -Dorg.apache.xml.security.ignoreLineBreaks=true FQDN used to retrieve current certificate:x.x.x.x Processing ID: b'442a8577-e202-4457-b297-90827d6e8dce' Picked up JAVA_TOOL_OPTIONS: -Xms32M -Xmx128M -Dcom.sun.org.apache.xml.internal.security.ignoreLineBreaks=true -Dorg.apache.xml.security.ignoreLineBreaks=true FQDN used to retrieve current certificate:x.x.x.x Processing ID: b'6e98e977-6bde-4c58-bd96-0cfa170c5bab' Picked up JAVA_TOOL_OPTIONS: -Xms32M -Xmx128M -Dcom.sun.org.apache.xml.internal.security.ignoreLineBreaks=true -Dorg.apache.xml.security.ignoreLineBreaks=true FQDN used to retrieve current certificate:x.x.x.x Processing ID: b'4ecee96d-6e1f-4453-a351-628f9fcff978' Picked up JAVA_TOOL_OPTIONS: -Xms32M -Xmx128M -Dcom.sun.org.apache.xml.internal.security.ignoreLineBreaks=true -Dorg.apache.xml.security.ignoreLineBreaks=true FQDN used to retrieve current certificate:x.x.x.x Processing ID: b'72c282c0-7a8e-4472-94ba-43c00a0d7ae0' Picked up JAVA_TOOL_OPTIONS: -Xms32M -Xmx128M -Dcom.sun.org.apache.xml.internal.security.ignoreLineBreaks=true -Dorg.apache.xml.security.ignoreLineBreaks=true FQDN used to retrieve current certificate:x.x.x.x Processing ID: b'68e23985-a7e0-4497-aa02-b1c98f0f7d7c_kv' Picked up JAVA_TOOL_OPTIONS: -Xms32M -Xmx128M -Dcom.sun.org.apache.xml.internal.security.ignoreLineBreaks=true -Dorg.apache.xml.security.ignoreLineBreaks=true FQDN used to retrieve current certificate:x.x.x.x Processing ID: b'd2662e4c-7db8-40b2-a635-d563995d920c' Picked up JAVA_TOOL_OPTIONS: -Xms32M -Xmx128M -Dcom.sun.org.apache.xml.internal.security.ignoreLineBreaks=true -Dorg.apache.xml.security.ignoreLineBreaks=true FQDN used to retrieve current certificate:x.x.x.x Processing ID: b'd8183917-3b50-42c1-b4a0-0f4f03dfd654' Picked up JAVA_TOOL_OPTIONS: -Xms32M -Xmx128M -Dcom.sun.org.apache.xml.internal.security.ignoreLineBreaks=true -Dorg.apache.xml.security.ignoreLineBreaks=true FQDN used to retrieve current certificate:x.x.x.x Processing ID: b'33d42e30-65bf-4e7e-aa9f-2332d24e447c' Picked up JAVA_TOOL_OPTIONS: -Xms32M -Xmx128M -Dcom.sun.org.apache.xml.internal.security.ignoreLineBreaks=true -Dorg.apache.xml.security.ignoreLineBreaks=true FQDN used to retrieve current certificate:x.x.x.x Processing ID: b'default-site:9f8144ec-b405-40fd-8f1f-0aee6b3e6185' Picked up JAVA_TOOL_OPTIONS: -Xms32M -Xmx128M -Dcom.sun.org.apache.xml.internal.security.ignoreLineBreaks=true -Dorg.apache.xml.security.ignoreLineBreaks=true FQDN used to retrieve current certificate:x.x.x.x Processing ID: b'55171520-02b8-4ea2-9276-f1ecc4cb019a' Picked up JAVA_TOOL_OPTIONS: -Xms32M -Xmx128M -Dcom.sun.org.apache.xml.internal.security.ignoreLineBreaks=true -Dorg.apache.xml.security.ignoreLineBreaks=true FQDN used to retrieve current certificate:x.x.x.x Processing ID: b'6e901082-6a36-4239-86cc-463c7059f8d6' Picked up JAVA_TOOL_OPTIONS: -Xms32M -Xmx128M -Dcom.sun.org.apache.xml.internal.security.ignoreLineBreaks=true -Dorg.apache.xml.security.ignoreLineBreaks=true FQDN used to retrieve current certificate:x.x.x.x Processing ID: b'e304c0b9-01c2-424b-a5c2-2ffde66e76fa' Picked up JAVA_TOOL_OPTIONS: -Xms32M -Xmx128M -Dcom.sun.org.apache.xml.internal.security.ignoreLineBreaks=true -Dorg.apache.xml.security.ignoreLineBreaks=true FQDN used to retrieve current certificate:x.x.x.x Processing ID: b'654b4cdb-7405-4aea-b4ad-d6a279f5e6d7' Picked up JAVA_TOOL_OPTIONS: -Xms32M -Xmx128M -Dcom.sun.org.apache.xml.internal.security.ignoreLineBreaks=true -Dorg.apache.xml.security.ignoreLineBreaks=true FQDN used to retrieve current certificate:x.x.x.x Processing ID: b'6db23bca-9379-4a0c-84ea-09c255247849' Picked up JAVA_TOOL_OPTIONS: -Xms32M -Xmx128M -Dcom.sun.org.apache.xml.internal.security.ignoreLineBreaks=true -Dorg.apache.xml.security.ignoreLineBreaks=true FQDN used to retrieve current certificate:x.x.x.x Processing ID: b'450323ff-0d00-4b49-b09e-29ef2bdcd927' Picked up JAVA_TOOL_OPTIONS: -Xms32M -Xmx128M -Dcom.sun.org.apache.xml.internal.security.ignoreLineBreaks=true -Dorg.apache.xml.security.ignoreLineBreaks=true FQDN used to retrieve current certificate:x.x.x.x Processing ID: b'910bed68-59c8-487b-b8ab-967a13ddce48' Picked up JAVA_TOOL_OPTIONS: -Xms32M -Xmx128M -Dcom.sun.org.apache.xml.internal.security.ignoreLineBreaks=true -Dorg.apache.xml.security.ignoreLineBreaks=true FQDN used to retrieve current certificate:x.x.x.x Processing ID: b'cfe3b13a-fef3-4a58-b461-5212baccb8ca' Picked up JAVA_TOOL_OPTIONS: -Xms32M -Xmx128M -Dcom.sun.org.apache.xml.internal.security.ignoreLineBreaks=true -Dorg.apache.xml.security.ignoreLineBreaks=true FQDN used to retrieve current certificate:x.x.x.x Processing ID: b'b78e3c49-b904-437f-af2f-5db2fad76c9f' Picked up JAVA_TOOL_OPTIONS: -Xms32M -Xmx128M -Dcom.sun.org.apache.xml.internal.security.ignoreLineBreaks=true -Dorg.apache.xml.security.ignoreLineBreaks=true FQDN used to retrieve current certificate:x.x.x.x ***WARNING*** 4 Mismatched ID(s) found Written mismatched IDs to /var/log/ls_ssltrust_fixer/mismatchIDs List of registrations with cert mismatch **************************************** ID: b'default-site:522421e2-cf6f-407f-8965-594832d21e28' spec: /var/log/ls_ssltrust_fixer/default-site%522421e2-cf6f-407f-8965-594832d21e28 cert in use: /var/log/ls_ssltrust_fixer/default-site%522421e2-cf6f-407f-8965-594832d21e28.newcert ID: b'default-site:af4ac372-7fbd-470a-8e8e-f9de68c1d16b' spec: /var/log/ls_ssltrust_fixer/default-site%af4ac372-7fbd-470a-8e8e-f9de68c1d16b cert in use: /var/log/ls_ssltrust_fixer/default-site%af4ac372-7fbd-470a-8e8e-f9de68c1d16b.newcert ID: b'default-site:9f8144ec-b405-40fd-8f1f-0aee6b3e6185' spec: /var/log/ls_ssltrust_fixer/default-site%9f8144ec-b405-40fd-8f1f-0aee6b3e6185 cert in use: /var/log/ls_ssltrust_fixer/default-site%9f8144ec-b405-40fd-8f1f-0aee6b3e6185.newcert ID: b'cfe3b13a-fef3-4a58-b461-5212baccb8ca' spec: /var/log/ls_ssltrust_fixer/cfe3b13a-fef3-4a58-b461-5212baccb8ca cert in use: /var/log/ls_ssltrust_fixer/cfe3b13a-fef3-4a58-b461-5212baccb8ca.newcert Please DOUBLE CHECK the detection before running 'fix' NOTE: Partial upgrade state of 5.5 to 6.x is unsupported for this tool- 5.5 web client registration might change Completed running function 'scan' ###########################修复命令########################### root@photon-machine [ ~ ]# python /usr/lib/vmidentity/tools/scripts/ls_ssltrust_fixer_p3.py -f fix Running function 'fix' Fix phase 1: Reading IDs with incorrect certificate from scan results Using mismatch ID list from: /var/log/ls_ssltrust_fixer/mismatchIDs ###########################WEB登录账号,默认回车########################### SSO administrator user (Default:Administrator@vsphere.local): ###########################输入web登录密码########################### Password for Administrator@vsphere.local: Fix phase 2: Collecting site topology information Picked up JAVA_TOOL_OPTIONS: -Xms32M -Xmx128M -Dcom.sun.org.apache.xml.internal.security.ignoreLineBreaks=true -Dorg.apache.xml.security.ignoreLineBreaks=true <class 'bytes'> Fix Phase 3: creating new spec file with new ssltrust values and register Fixing ID: default-site:522421e2-cf6f-407f-8965-594832d21e28 Updated 1 End points with new cert for ID: default-site:522421e2-cf6f-407f-8965-594832d21e28 Re-registering ID: default-site:522421e2-cf6f-407f-8965-594832d21e28 using lsURL: https://x.x.x.x/lookupservice/sdk Picked up JAVA_TOOL_OPTIONS: -Xms32M -Xmx128M -Dcom.sun.org.apache.xml.internal.security.ignoreLineBreaks=true -Dorg.apache.xml.security.ignoreLineBreaks=true Fixing ID: default-site:522421e2-cf6f-407f-8965-594832d21e28 completed Fixing ID: default-site:af4ac372-7fbd-470a-8e8e-f9de68c1d16b Updated 1 End points with new cert for ID: default-site:af4ac372-7fbd-470a-8e8e-f9de68c1d16b Re-registering ID: default-site:af4ac372-7fbd-470a-8e8e-f9de68c1d16b using lsURL: https://x.x.x.x/lookupservice/sdk Picked up JAVA_TOOL_OPTIONS: -Xms32M -Xmx128M -Dcom.sun.org.apache.xml.internal.security.ignoreLineBreaks=true -Dorg.apache.xml.security.ignoreLineBreaks=true Fixing ID: default-site:af4ac372-7fbd-470a-8e8e-f9de68c1d16b completed Fixing ID: default-site:9f8144ec-b405-40fd-8f1f-0aee6b3e6185 Updated 1 End points with new cert for ID: default-site:9f8144ec-b405-40fd-8f1f-0aee6b3e6185 Re-registering ID: default-site:9f8144ec-b405-40fd-8f1f-0aee6b3e6185 using lsURL: https://x.x.x.x/lookupservice/sdk Picked up JAVA_TOOL_OPTIONS: -Xms32M -Xmx128M -Dcom.sun.org.apache.xml.internal.security.ignoreLineBreaks=true -Dorg.apache.xml.security.ignoreLineBreaks=true Fixing ID: default-site:9f8144ec-b405-40fd-8f1f-0aee6b3e6185 completed Fixing ID: cfe3b13a-fef3-4a58-b461-5212baccb8ca Updated 8 End points with new cert for ID: cfe3b13a-fef3-4a58-b461-5212baccb8ca Re-registering ID: cfe3b13a-fef3-4a58-b461-5212baccb8ca using lsURL: https://x.x.x.x/lookupservice/sdk Picked up JAVA_TOOL_OPTIONS: -Xms32M -Xmx128M -Dcom.sun.org.apache.xml.internal.security.ignoreLineBreaks=true -Dorg.apache.xml.security.ignoreLineBreaks=true Fixing ID: cfe3b13a-fef3-4a58-b461-5212baccb8ca completed *** 11 endpoints for 4 service IDs updated with current cetificates and trust *** Completed running function 'fix' root@photon-machine [ ~ ]# 修复完成后去NSX管理界面执行 Lookup Service URL 成功完成3.2 解决问题 2.2ssh登录VCenter执行命令:###########################x.x.x.x改为vcenter IP########################### MacBook-Pro ~ % ssh root@x.x.x.x VMware vCenter Server Appliance 6.7.0.50000 Type: vCenter Server with an embedded Platform Services Controller ###########################填入密码########################### root@192.168.88.49's password: Password: [ERROR]: Failed to connect to service. Use service-control command to manage applmgmt service * List APIs: "help api list" * List Plugins: "help pi list" * Launch BASH: "shell" ###########################输入shell########################### Command> shell Shell access is granted to root ###########################创建一个目录########################### root@photon-machine [ ~ ]# mkdir /certificate ###########################获取crt########################### root@photon-machine [ ~ ]# /usr/lib/vmware-vmafd/bin/vecs-cli entry getcert --store vpxd-extension --alias vpxd-extension --output /certificate/vpxd-extension.crt ###########################获取Key########################### root@photon-machine [ ~ ]# /usr/lib/vmware-vmafd/bin/vecs-cli entry getkey --store vpxd-extension --alias vpxd-extension --output /certificate/vpxd-extension.key ###########################更新扩展证书########################### ###########################-s:vcenter IP -u:web登录用户########################### root@photon-machine [ ~ ]# python /usr/lib/vmware-vpx/scripts/updateExtensionCertInVC.py -e com.vmware.vim.eam -c /certificate/vpxd-extension.crt -k /certificate/vpxd-extension.key -s x.x.x.x -u Administrator@vsphere.local ###########################输入web登录密码########################### Password to connect to VC server for user="Administrator@vsphere.local": 2024-03-27T03:39:24.377Z Updating certificate for "com.vmware.vim.eam" extension 2024-03-27T03:39:24.498Z Successfully updated certificate for "com.vmware.vim.eam" extension 2024-03-27T03:39:24.517Z Verified login to vCenter Server using certificate="/certificate/vpxd-extension.crt" is successful更新完成后 VCenter 网页刷新下观察防火墙页面状态
2024年03月27日
258 阅读
0 评论
0 点赞
归档日志清理
归档日志及备份清理相关命令//检查所有归档日志 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脚本直至完成运行任务测试结果
2024年02月19日
74 阅读
0 评论
0 点赞
2024-01-25
龙析系统安装Oracle19c
龙析系统安装 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/JRE:\$ORACLE_HOME/jlib:\$ORACLE_HOME/rdbms/jlib:\$ORACLE_HOME/network/jlib export CV_ASSUME_DISTID=OL7 export THREADS_FLAG=native export TEMP=/tmp export TMPDIR=/tmp""" >> /home/oracle/.bash_profile2.6 安装软件支持包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需要单独安装的软件包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.rpm3. 安装数据库软件3.1 软件准备`将Oracle 软件上传到服务器 修改用户组为oracle:oinstall` chown oracle:oinstall LINUX.X64_193000_db_home.zip `将Oracle软件移动到 $ORACLE_HOME 目录` mv LINUX.X64_193000_db_home.zip /u01/app/oracle/product/19c/db_1/ `oracle用户解压Oracle 软件` su - oracle cd $ORACLE_HOME unzip LINUX.X64_193000_db_home.zip3.2 软件安装3.2.1 运行安装命令./runInstaller3.2.2 Cunfiguration OptionSet Up Software Only3.2.3 Database Installation OptionSingle Instance database installation3.2.4 Database EditionEnterprise Edition3.2.5 Installation Location默认位置3.2.6 Create Inventory默认位置3.2.7 Operating System Groups默认用户组3.2.8 Root Script execution勾选Automatically run configuration scripts 并填写密码,自动执行root脚本。也可不勾选,手动执行root脚本3.2.9 Prerequisite Checks分析检查结果,根据情况判断是否需要处理3.2.10 Summary检查安装选项3.2.11 Install Product选yes 自动运行脚本3.2.12Finish完成4. 创建数据库4.1 数据库安装准备Oracle 用户登录服务器4.2 数据库创建4.2.1 运行创建命令dbca4.2.2 Database OperationCreate a database4.2.3 Creation ModeAdvanced configuration4.2.4 Deployment Type根据业务情况选择安装类型4.2.5 Database Identification输入数据库实例名根据情况选择是否创建cdb4.2.6 Storage Option根据情况选择,本此测试默认选项4.2.7 Fast Recovery Option指定fra参数,以及归档情况4.2.8 NetworkConfiguration勾选Create a new listenerListener name : LISTENERListener port: 15214.2.9 Data Vault Option默认4.2.10 Configuration Options根据情况配置内存参数和字符集信息4.2.11 Management Options根据情况选择是否开启EM4.2.12 User Credentials创建密码4.2.13 Creation Option根据业务情况选择,本次测试默认4.2.14 Summary检查安装信息4.2.15 Progress Page等待安装过程4.2.16 Finish完成5. 创建DG环境5.1 创建DG虚拟机环境参照本文章1,2,3,4章节创建服务器和安装数据库软件5.2 备库创建监听器数据库安装完成后创建监听器5.2.1 Oracle 用户创建监听器netca按照界面提示创建一个监听器5.3 主库配置DG环境5.3.1 主库配置检查检查archivelog是否开启SQL> archive log list; #执行命令检查archivelog状态 Database log mode Archive Mode Automatic archival Enabled Archive destination USE_DB_RECOVERY_FILE_DEST Oldest online log sequence 3 Next log sequence to archive 5 Current log sequence 5检查flashbackSQL> SELECT flashback_on FROM v$database; #执行命令检查flashback状态 FLASHBACK_ON ------------------------------------ NO SQL> show parameter db_recovery; #执行命令检查闪回位置及大小 NAME TYPE VALUE ------------------------------------ ---------------------- ---------------------------------- db_recovery_file_dest string /u01/app/oracle/fast_recovery_area db_recovery_file_dest_size big integer 8256M检查主库日志文件SQL> select * from v$logfile order by group#; GROUP# STATUS TYPE MEMBER IS_REC CON_ID ---------- -------------- -------------- --------------------------------------------------------------------------- ------ ---------- 1 ONLINE /u01/app/oracle/oradata/ORCL/onlinelog/o1_mf_1_lt1c27xy_.log NO 0 1 ONLINE /u01/app/oracle/fast_recovery_area/ORCL/onlinelog/o1_mf_1_lt1c28l0_.log YES 0 2 ONLINE /u01/app/oracle/oradata/ORCL/onlinelog/o1_mf_2_lt1c283q_.log NO 0 2 ONLINE /u01/app/oracle/fast_recovery_area/ORCL/onlinelog/o1_mf_2_lt1c29cj_.log YES 0 3 ONLINE /u01/app/oracle/oradata/ORCL/onlinelog/o1_mf_3_lt1c2852_.log NO 0 3 ONLINE /u01/app/oracle/fast_recovery_area/ORCL/onlinelog/o1_mf_3_lt1c2984_.log YES 0 6 rows selected.检查主库系统参数SQL> show parameter db_unique_name; NAME TYPE VALUE ------------------------------------ ---------------------- ------------------------------ db_unique_name string orcl SQL> show parameter log_archive_config; NAME TYPE VALUE ------------------------------------ ---------------------- ------------------------------ log_archive_config string SQL> show parameter log_archive_dest_1; NAME TYPE VALUE ------------------------------------ ---------------------- ------------------------------ log_archive_dest_1 string log_archive_dest_10 string log_archive_dest_11 string log_archive_dest_12 string log_archive_dest_13 string log_archive_dest_14 string log_archive_dest_15 string log_archive_dest_16 string log_archive_dest_17 string log_archive_dest_18 string log_archive_dest_19 string SQL> show parameter log_archive_dest_2; NAME TYPE VALUE ------------------------------------ ---------------------- ------------------------------ log_archive_dest_2 string log_archive_dest_20 string log_archive_dest_21 string log_archive_dest_22 string log_archive_dest_23 string log_archive_dest_24 string log_archive_dest_25 string log_archive_dest_26 string log_archive_dest_27 string log_archive_dest_28 string log_archive_dest_29 string SQL> show parameter log_archive_dest_state_1; NAME TYPE VALUE ------------------------------------ ---------------------- ------------------------------ log_archive_dest_state_1 string enable log_archive_dest_state_10 string enable log_archive_dest_state_11 string enable log_archive_dest_state_12 string enable log_archive_dest_state_13 string enable log_archive_dest_state_14 string enable log_archive_dest_state_15 string enable log_archive_dest_state_16 string enable log_archive_dest_state_17 string enable log_archive_dest_state_18 string enable log_archive_dest_state_19 string enable SQL> show parameter log_archive_dest_state_2; NAME TYPE VALUE ------------------------------------ ---------------------- ------------------------------ log_archive_dest_state_2 string enable log_archive_dest_state_20 string enable log_archive_dest_state_21 string enable log_archive_dest_state_22 string enable log_archive_dest_state_23 string enable log_archive_dest_state_24 string enable log_archive_dest_state_25 string enable log_archive_dest_state_26 string enable log_archive_dest_state_27 string enable log_archive_dest_state_28 string enable log_archive_dest_state_29 string enable SQL> show parameter fal_server; NAME TYPE VALUE ------------------------------------ ---------------------- ------------------------------ fal_server string SQL> show parameter fal_client; NAME TYPE VALUE ------------------------------------ ---------------------- ------------------------------ fal_client string SQL> show parameter archive_lag_target; NAME TYPE VALUE ------------------------------------ ---------------------- ------------------------------ archive_lag_target integer 0 SQL> show parameter log_archive_format; NAME TYPE VALUE ------------------------------------ ---------------------- ------------------------------ log_archive_format string %t_%s_%r.dbf SQL> show parameter standby_file_management; NAME TYPE VALUE ------------------------------------ ---------------------- ------------------------------ standby_file_management string MANUAL SQL> show parameter db_file_name_convert; NAME TYPE VALUE ------------------------------------ ---------------------- ------------------------------ db_file_name_convert string pdb_file_name_convert string SQL> show parameter log_file_name_convert; NAME TYPE VALUE ------------------------------------ ---------------------- ------------------------------ log_file_name_convert string5.3.2 主库重启到mount状态SQL> shutdown immediate; #关闭数据库 Database closed. Database dismounted. ORACLE instance shut down. SQL> startup mount; #启动到mount模式 ORACLE instance started. Total System Global Area 813692064 bytes Fixed Size 8901792 bytes Variable Size 218103808 bytes Database Buffers 578813952 bytes Redo Buffers 7872512 bytes Database mounted.5.3.3 修改归档信息和闪回信息SQL> alter system set log_archive_dest_1='location=/u01/app/oracle/arch_orcl'; #设置归档路径 System altered. SQL> alter database archivelog; #设置启用归档 Database altered. SQL> alter system set db_recovery_file_dest='/u01/app/oracle/fast_recovery_area' scope=spfile; #设置闪回位置 System altered. SQL> alter system set db_recovery_file_dest_size=8G; #设置闪回大小 System altered. SQL> alter database flashback on; #设置启用闪回 Database altered.5.3.4 配置日志组SQL> select * from v$logfile; #查询当前日志组信息 GROUP# STATUS TYPE MEMBER IS_REC CON_ID ---------- -------------- -------------- ----------------------------------------------------------------------------- ------ ---------- 3 ONLINE /u01/app/oracle/oradata/ORCL/onlinelog/o1_mf_3_lt1c2852_.log NO 0 3 ONLINE /u01/app/oracle/fast_recovery_area/ORCL/onlinelog/o1_mf_3_lt1c2984_.log YES 0 2 ONLINE /u01/app/oracle/oradata/ORCL/onlinelog/o1_mf_2_lt1c283q_.log NO 0 2 ONLINE /u01/app/oracle/fast_recovery_area/ORCL/onlinelog/o1_mf_2_lt1c29cj_.log YES 0 1 ONLINE /u01/app/oracle/oradata/ORCL/onlinelog/o1_mf_1_lt1c27xy_.log NO 0 1 ONLINE /u01/app/oracle/fast_recovery_area/ORCL/onlinelog/o1_mf_1_lt1c28l0_.log YES 0 6 rows selected. SQL> alter database add standby logfile group 4 ('/u01/app/oracle/fast_recovery_area/ORCL/onlinelog/sredo4.log','/u01/app/oracle/oradata/ORCL/onlinelog/sredo4.log') size 200M; #主库为备库添加日志组4 Database altered. SQL> alter database add standby logfile group 5 ('/u01/app/oracle/fast_recovery_area/ORCL/onlinelog/sredo5.log','/u01/app/oracle/oradata/ORCL/onlinelog/sredo5.log') size 200M; #主库为备库添加日志组5 Database altered. SQL> alter database add standby logfile group 6 ('/u01/app/oracle/fast_recovery_area/ORCL/onlinelog/sredo6.log','/u01/app/oracle/oradata/ORCL/onlinelog/sredo6.log') size 200M; #主库为备库添加日志组6 Database altered. SQL> alter database add standby logfile group 7 ('/u01/app/oracle/fast_recovery_area/ORCL/onlinelog/sredo7.log','/u01/app/oracle/oradata/ORCL/onlinelog/sredo7.log') size 200M; #主库为备库添加日志组7 Database altered.5.3.5 修改spfile参数#设置db_unique_name数据库唯一标识名 SQL> alter system set db_unique_name='primary' scope=spfile; System altered. #设置日志归档配置,用于限制日志传输的目标,只能在这两个指定的数据库进行,该配置中的顺序可以调换 SQL> alter system set log_archive_config='DG_CONFIG=(primary,standby)' scope=spfile; System altered. #设置日志归档路径1 SQL> alter system set log_archive_dest_1='location=/u01/app/oracle/arch_orcl VALID_FOR=(ALL_LOGFILES,ALL_ROLES) DB_UNIQUE_NAME=primary' scope=spfile; System altered. #设置日志归档路径2 SQL> alter system set log_archive_dest_2='SERVICE=standby LGWR ASYNC VALID_FOR=(ONLINE_LOGFILES,PRIMARY_ROLES) DB_UNIQUE_NAME=standby' scope=spfile; System altered. #启用归档路径1 SQL> alter system set log_archive_dest_state_1='enable' scope=spfile; System altered. #启用归档路径2 SQL> alter system set log_archive_dest_state_2='enable' scope=spfile; System altered. #设置当前库获取归档日志的服务器listerner名称(与8成对出现,用于switchover角色切换) SQL> alter system set fal_server='standby' scope=spfile; System altered. #设置当前库获取归档日志的客户端名称listerner名称(与7成对出现,用于switchover角色切换) SQL> alter system set fal_client='primary' scope=spfile; System altered. #设置归档日志强制切换时间(s)1800表示30分钟 SQL> alter system set archive_lag_target=1800 scope=spfile; System altered. #设置归档日志文件名命名方式 SQL> alter system set log_archive_format='%t_%s_%r.arc'scope=spfile; System altered. #设置备库文件管理的方式为auto,结合后续的convert参数,当主库增删文件时会自动在备库也生成相应文件。 SQL> alter system set standby_file_management=auto scope=spfile; System altered. #设置数据文件名称的映射关系(注意顺序不能变) SQL> alter system set db_file_name_convert='standby','primary' scope=spfile; System altered. #设置日志文件名称的映射关系(注意顺序不能变) SQL> alter system set log_file_name_convert='standby','primary' scope=spfile; System altered.5.3.6 修改数据库状态SQL> alter database open; #启动数据库到OPEN状态 Database altered. SQL> shutdown immediate; #关闭数据库 Database closed. Database dismounted. ORACLE instance shut down. SQL> startup; #使用修改后的spfile启动数据库,检查是否有报错 ORACLE instance started. Total System Global Area 813692064 bytes Fixed Size 8901792 bytes Variable Size 218103808 bytes Database Buffers 578813952 bytes Redo Buffers 7872512 bytes Database mounted. Database opened.5.3.7 创建pfile文件SQL> create pfile from spfile; #从spfile创建pfile文件 File created.5.3.8 主库修改网络监听修改监听文件/u01/app/oracle/product/19c/db_1/network/admin/listener.ora# listener.ora Network Configuration File: /u01/app/oracle/product/19c/db_1/network/admin/listener.ora # Generated by Oracle configuration tools. LISTENER = (DESCRIPTION_LIST = (DESCRIPTION = (ADDRESS = (PROTOCOL = TCP)(HOST = localhost)(PORT = 1521)) #host为当前主机名 (ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1521)) ) ) #新增以下内容 SID_LIST_LISTENER = (SID_LIST = (SID_DESC = (SID_NAME = CLRExtProc) (ORACLE_HOME = /u01/app/oracle/product/19c/db_1) (PROGRAM = extproc) ) (SID_DESC = (GLOBAL_DBNAME = orcl) #改为实例名 (ORACLE_HOME = /u01/app/oracle/product/19c/db_1) (SID_NAME = orcl) #改为实例名 ) )修改主库客户端配置文件/u01/app/oracle/product/19c/db_1/network/admin/tnsnames.ora# tnsnames.ora Network Configuration File: /u01/app/oracle/product/19c/db_1/network/admin/tnsnames.ora # Generated by Oracle configuration tools. LISTENER_ORCL = (ADDRESS = (PROTOCOL = TCP)(HOST = localhost)(PORT = 1521)) ORCL = (DESCRIPTION = (ADDRESS = (PROTOCOL = TCP)(HOST = localhost)(PORT = 1521)) (CONNECT_DATA = (SERVER = DEDICATED) (SERVICE_NAME = orcl) ) ) # 新增内容 PRIMARY = (DESCRIPTION = (ADDRESS_LIST = (ADDRESS = (PROTOCOL = TCP)(HOST = orcldb)(PORT = 1521)) #HOST填写主库IP或者主机名 ) (CONNECT_DATA = (SERVICE_NAME = orcl) #实例名 ) ) STANDBY = (DESCRIPTION = (ADDRESS_LIST = (ADDRESS = (PROTOCOL = TCP)(HOST = orcldg)(PORT = 1521)) #HOST填写备库IP或者主机名 ) (CONNECT_DATA = (SERVICE_NAME = orcl) #实例名 ) )5.3.9 主库重启和测试监听[oracle@localhost]$ lsnrctl reload #重加载监听文件 LSNRCTL for Linux: Version 19.0.0.0.0 - Production on 12-JAN-2024 15:40:45 Copyright (c) 1991, 2019, Oracle. All rights reserved. Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=localhost)(PORT=1521))) The command completed successfully [oracle@localhost]$ lsnrctl status #查看监听状态 LSNRCTL for Linux: Version 19.0.0.0.0 - Production on 12-JAN-2024 15:40:50 Copyright (c) 1991, 2019, Oracle. All rights reserved. Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=localhost)(PORT=1521))) STATUS of the LISTENER ------------------------ Alias LISTENER Version TNSLSNR for Linux: Version 19.0.0.0.0 - Production Start Date 12-JAN-2024 11:01:57 Uptime 0 days 4 hr. 38 min. 53 sec Trace Level off Security ON: Local OS Authentication SNMP OFF Listener Parameter File /u01/app/oracle/product/19c/db_1/network/admin/listener.ora Listener Log File /u01/app/oracle/diag/tnslsnr/localhost/listener/alert/log.xml Listening Endpoints Summary... (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=localhost)(PORT=1521))) (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC1521))) Services Summary... Service "CLRExtProc" has 1 instance(s). Instance "CLRExtProc", status UNKNOWN, has 1 handler(s) for this service... Service "orcl" has 1 instance(s). Instance "orcl", status UNKNOWN, has 1 handler(s) for this service... Service "orclXDB" has 1 instance(s). Instance "orcl", status READY, has 1 handler(s) for this service... Service "primary" has 1 instance(s). Instance "orcl", status READY, has 1 handler(s) for this service... The command completed successfully [oracle@localhost]$ tnsping primary #测试primary连接可用性 TNS Ping Utility for Linux: Version 19.0.0.0.0 - Production on 12-JAN-2024 15:41:17 Copyright (c) 1997, 2019, Oracle. All rights reserved. Used parameter files: /u01/app/oracle/product/19c/db_1/network/admin/sqlnet.ora Used TNSNAMES adapter to resolve the alias Attempting to contact (DESCRIPTION = (ADDRESS_LIST = (ADDRESS = (PROTOCOL = TCP)(HOST = orcldb)(PORT = 1521))) (CONNECT_DATA = (SERVICE_NAME = orcl))) OK (0 msec) [oracle@localhost]$ tnsping standby #测试standby连接可用性 TNS Ping Utility for Linux: Version 19.0.0.0.0 - Production on 12-JAN-2024 15:41:20 Copyright (c) 1997, 2019, Oracle. All rights reserved. Used parameter files: /u01/app/oracle/product/19c/db_1/network/admin/sqlnet.ora Used TNSNAMES adapter to resolve the alias Attempting to contact (DESCRIPTION = (ADDRESS_LIST = (ADDRESS = (PROTOCOL = TCP)(HOST = orcldg)(PORT = 1521))) (CONNECT_DATA = (SERVICE_NAME = orcl))) OK (40 msec)5.3.10 主库文件复制到备库[oracle@localhost]$ cd /u01/app/oracle/product/19c/db_1/dbs #定位到主库$ORACLE_HOME/dbs/ [oracle@localhost dbs]$ scp initorcl.ora orapworcl orcldg:/u01/app/oracle/product/19c/db_1/dbs/ # scp远程复制到备库 oracle@orcldg's password: initorcl.ora 100% 1805 292.5KB/s 00:00 orapworcl 100% 2048 410.2KB/s 00:005.4 备库配置5.4.1 备库监听文件配置修改监听文件/u01/app/oracle/product/19c/db_1/network/admin/listener.ora# listener.ora Network Configuration File: /u01/app/oracle/product/19c/db_1/network/admin/listener.ora # Generated by Oracle configuration tools. LISTENER = (DESCRIPTION_LIST = (DESCRIPTION = (ADDRESS = (PROTOCOL = TCP)(HOST = localhost)(PORT = 1521)) #host为当前主机名 (ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1521)) ) ) #新增以下内容 SID_LIST_LISTENER = (SID_LIST = (SID_DESC = (SID_NAME = CLRExtProc) (ORACLE_HOME = /u01/app/oracle/product/19c/db_1) (PROGRAM = extproc) ) (SID_DESC = (GLOBAL_DBNAME = orcl) #改为实例名 (ORACLE_HOME = /u01/app/oracle/product/19c/db_1) (SID_NAME = orcl) #改为实例名 ) )修改主库客户端配置文件/u01/app/oracle/product/19c/db_1/network/admin/tnsnames.ora# tnsnames.ora Network Configuration File: /u01/app/oracle/product/19c/db_1/network/admin/tnsnames.ora # Generated by Oracle configuration tools. LISTENER_ORCL = (ADDRESS = (PROTOCOL = TCP)(HOST = localhost)(PORT = 1521)) ORCL = (DESCRIPTION = (ADDRESS = (PROTOCOL = TCP)(HOST = localhost)(PORT = 1521)) (CONNECT_DATA = (SERVER = DEDICATED) (SERVICE_NAME = orcl) ) ) # 新增内容 PRIMARY = (DESCRIPTION = (ADDRESS_LIST = (ADDRESS = (PROTOCOL = TCP)(HOST = orcldb)(PORT = 1521)) #HOST填写主库IP或者主机名 ) (CONNECT_DATA = (SERVICE_NAME = orcl) #实例名 ) ) STANDBY = (DESCRIPTION = (ADDRESS_LIST = (ADDRESS = (PROTOCOL = TCP)(HOST = orcldg)(PORT = 1521)) #HOST填写备库IP或者主机名 ) (CONNECT_DATA = (SERVICE_NAME = orcl) #实例名 ) )5.4.2 备库重启和测试监听[oracle@localhost]$ lsnrctl reload #重加载监听配置文件 LSNRCTL for Linux: Version 19.0.0.0.0 - Production on 12-JAN-2024 15:58:40 Copyright (c) 1991, 2019, Oracle. All rights reserved. Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=localhost)(PORT=1521))) The command completed successfully [oracle@localhost]$ tnsping primary #测试primary连接可用性 TNS Ping Utility for Linux: Version 19.0.0.0.0 - Production on 12-JAN-2024 15:58:44 Copyright (c) 1997, 2019, Oracle. All rights reserved. Used parameter files: Used TNSNAMES adapter to resolve the alias Attempting to contact (DESCRIPTION = (ADDRESS_LIST = (ADDRESS = (PROTOCOL = TCP)(HOST = orcldb)(PORT = 1521))) (CONNECT_DATA = (SERVICE_NAME = orcl))) OK (10 msec) [oracle@localhost]$ tnsping standby #测试standby连接可用性 TNS Ping Utility for Linux: Version 19.0.0.0.0 - Production on 12-JAN-2024 15:58:49 Copyright (c) 1997, 2019, Oracle. All rights reserved. Used parameter files: Used TNSNAMES adapter to resolve the alias Attempting to contact (DESCRIPTION = (ADDRESS_LIST = (ADDRESS = (PROTOCOL = TCP)(HOST = orcldg)(PORT = 1521))) (CONNECT_DATA = (SERVICE_NAME = orcl))) OK (30 msec)5.4.3 备库修改pfile文件修改主库复制过来的pfile文件/u01/app/oracle/product/19c/db_1/dbs/initorcl.oraorcl.__data_transfer_cache_size=0 orcl.__db_cache_size=541065216 orcl.__inmemory_ext_roarea=0 orcl.__inmemory_ext_rwarea=0 orcl.__java_pool_size=0 orcl.__large_pool_size=4194304 orcl.__oracle_base='/u01/app/oracle'#ORACLE_BASE set from environment orcl.__pga_aggregate_target=272629760 orcl.__sga_target=813694976 orcl.__shared_io_pool_size=37748736 orcl.__shared_pool_size=213909504 orcl.__streams_pool_size=0 orcl.__unified_pga_pool_size=0 *.archive_lag_target=1800 *.audit_file_dest='/u01/app/oracle/admin/orcl/adump' *.audit_trail='db' *.compatible='19.0.0' *.control_files='/u01/app/oracle/oradata/ORCL/controlfile/o1_mf_lt1c25mt_.ctl','/u01/app/oracle/fast_recovery_area/ORCL/controlfile/o1_mf_lt1c25nt_.ctl' *.db_block_size=8192 *.db_create_file_dest='/u01/app/oracle/oradata' #修改点1 *.db_file_name_convert='primary','standby' *.db_name='orcl' *.db_recovery_file_dest='/u01/app/oracle/fast_recovery_area' *.db_recovery_file_dest_size=8589934592 #修改点2 *.db_unique_name='standby' *.diagnostic_dest='/u01/app/oracle' *.dispatchers='(PROTOCOL=TCP) (SERVICE=orclXDB)' #修改点3 *.fal_client='standby' #修改点4 *.fal_server='primary' *.local_listener='LISTENER_ORCL' *.log_archive_config='DG_CONFIG=(primary,standby)' #修改点5 *.log_archive_dest_1='location=/u01/app/oracle/arch_orcl VALID_FOR=(ALL_LOGFILES,ALL_ROLES) DB_UNIQUE_NAME=standby' #修改点6 *.log_archive_dest_2='SERVICE=primary LGWR ASYNC VALID_FOR=(ONLINE_LOGFILES,PRIMARY_ROLES) DB_UNIQUE_NAME=primary' *.log_archive_dest_state_1='enable' *.log_archive_dest_state_2='enable' *.log_archive_format='%t_%s_%r.arc' #修改点7 *.log_file_name_convert='primary','standby' *.nls_language='AMERICAN' *.nls_territory='AMERICA' *.open_cursors=300 *.pga_aggregate_target=259m *.processes=300 *.remote_login_passwordfile='EXCLUSIVE' *.sga_target=775m *.standby_file_management='AUTO' *.undo_tablespace='UNDOTBS1'除上述修改点外,如备库配置与主库不一致,还需注意sga,pga相关配置如主库为rac环境,还需修改控制文件路径,数据文件路径,归档日志路径5.4.4 位置创建根据pfile文件中的位置检查是否存在,不存在的则创建#根据pfile中的路径创建 mkdir -p /u01/app/oracle/{admin/orcl/adump,oradata/ORCL/controlfile,fast_recovery_area/ORCL,arch_orcl}5.4.5 测试pfile并创建spfileSQL> startup nomount pfile='/u01/app/oracle/product/19c/db_1/dbs/initorcl.ora'; # 测试启动到nomount模式 ORACLE instance started. Total System Global Area 813692064 bytes Fixed Size 8901792 bytes Variable Size 218103808 bytes Database Buffers 578813952 bytes Redo Buffers 7872512 bytes SQL> create spfile from pfile='/u01/app/oracle/product/19c/db_1/dbs/initorcl.ora'; # 创建spfile文件 File created. 5.4.6 备库RMAN连接主备库进行首次同步[oracle@localhost dbs]$ rman target sys/Xx961024@primary auxiliary sys/Xx961024@standby #RMAN连接主备库 Recovery Manager: Release 19.0.0.0.0 - Production on Fri Jan 12 16:32:50 2024 Version 19.3.0.0.0 Copyright (c) 1982, 2019, Oracle and/or its affiliates. All rights reserved. connected to target database: ORCL (DBID=1685839813) connected to auxiliary database: ORCL (not mounted) duplicate target database for standby from active database nofilenamecheck; #执行此命令为不自动回复 RMAN> duplicate target database for standby from active database dorecover nofilenamecheck; #执行首次同步,带自动恢复 ......5.4.7 首次同步完成后配置日志同步SQL> alter database recover managed standby database disconnect from session; #启动同步 Database altered.5.4.8 检查同步状态SQL> select process, status, GROUP#, SEQUENCE#, block#, blocks from v$managed_standby; #检查同步状态 PROCESS STATUS GROUP# SEQUENCE# BLOCK# BLOCKS ------------------ ------------------------ -------------------------------------------------------------------------------- ---------- ---------- ---------- ARCH CONNECTED N/A 0 0 0 DGRD ALLOCATED N/A 0 0 0 DGRD ALLOCATED N/A 0 0 0 ARCH CONNECTED N/A 0 0 0 ARCH CONNECTED N/A 0 0 0 ARCH CONNECTED N/A 0 0 0 RFS IDLE N/A 0 0 0 RFS IDLE 3 12 456 1 RFS IDLE N/A 0 0 0 MRP0 WAIT_FOR_LOG N/A 12 0 0 10 rows selected.5.4.9 检查日志应用状态SQL> select name,sequence#,applied, To_Char(a.COMPLETION_TIME, 'YYYY-MM-DD HH24:MI:SS') AS COMPLETETIME from v$archived_log a where a.COMPLETION_TIME>sysdate -1/24 order by sequence#; #检查1小时内日志同步情况 NAME SEQUENCE# APPLIED COMPLETETIME ------------------------------------------------------- ---------- ------------------ -------------------------------------- /u01/app/oracle/arch_orcl/1_11_1158059079.arc 11 YES 2024-01-12 16:41:12 SQL>5.4.10 DG配置完成DG 配置完成6. DG其他命令6.1 备库启动数据同步#完成后关闭数据库,启动到mount模式 startup mount; alter database recover managed standby database disconnect from session; #如果要停止同步 SQL> alter database recover managed standby database cancel; #注:如果想让备库比主库延迟几分钟可以启动为如下方式 SQL> alter database recover managed standby database delay 5 disconnect from session;6.2 恢复后数据测试#验证数据是否同步(在主库和备库上都执行,对比日志文件如果备库和主库一样表示同步完成) select name,sequence#,applied,completion_time from v$archived_log order by completion_time desc,sequence# desc; select name,sequence#,applied, To_Char(a.COMPLETION_TIME, 'YYYY-MM-DD HH24:MI:SS') AS COMPLETETIME from v$archived_log a where a.COMPLETION_TIME>sysdate -1/24 order by sequence#; #主库上切换日志文件再观察有没有正确同步到备库 alter system switch logfile;6.3 验证数据库状态SQL> select switchover_status from v$database; #主库状态为 TO STANDBY表示可切换为备库 #备库状态为 NOT ALLOWED6.4 主备切换##执行切换命令,并将主库转换为备库角色 ##主库执行切换: SQL> alter database commit to switchover to physical standby with session shutdown; ##主库角色转换为备库: SQL> shutdown immediate; SQL> startup nomount; SQL> alter database mount standby database; SQL> alter database recover managed standby database disconnect from session; ##备库执行切换: SQL> alter database commit to switchover to primary; SQL> shutdown immediate; SQL> startup ##切换完成后可以alter system switch logfile来验证一下切换后的主备库数据同步是否正常。 ##注意: ##如果当前主库上活动的SESSION正在查询数据,则select switchover_status from v$database 命令会显示SESSIONS ACTIVE,可以通过如下命令进行切换。 alter database commit to switchover to physical standby with session shutdown; ##在备库上查询select switchover_status from v$database会显示 NOT ALLOWED,只有当主库上执行了alter database commit to switchover to physical standby后,备库上才会显示TO PRIMARY6.5 故障切换##当主库发生无法修复的故障时,需要紧急将备库提升为主库来接管服务。这种情况下,需要预先开启主库的flashback,当主库修复后还可以通过flashback闪回到一个时间点,并切换为备库,否则就只能重建备库。 SQL> alter database recover managed standby database cancel; SQL> alter database recover managed standby database finish force; SQL> alter database commit to switchover to primary; SQL> alter database open; SQL> select database_role from v$database; DATABASE_ROLE -------------------------------- PRIMARY6.6 通过flashback重建备库##当原来的主库经过维修后还可以启动数据库,则可以通过闪回到指定的SCN来进行standby重建 ##A). 首先在当前主库,也就是failover过后的新的主库上查询到自己变成主库的那一刻的scn号: SQL> select to_char(standby_became_primary_scn) from v$database; TO_CHAR(STANDBY_BECAME_PRIMARY_SCN) ----------------------------------------------------------------------- 1400381 ##B). 对到原来的主库(已修好的机器)上闪回数据,并进行切换 SQL> shutdown immediate; SQL> startup mount; SQL> flashback database to scn 1400381; 闪回完成。 SQL> alter database convert to physical standby; SQL> shutdown immediate; SQL> startup mount; ##C). 在当前主库重新启用log_archive_dest_state_2并切换归档日志(或者直接重启数据库) SQL> alter system set log_archive_dest_state_2=enable; SQL> alter system switch logfile; ##D). 回到原主库(当前备库)开启日志应用进程 SQL> alter database recover managed standby database using current logfile disconnect; ##此时数据库已经完成切换,重新回到DG组中,并以备库的方式加入。可以通过3.13.5中的方法验证数据同步状态。6.7 备注##Oracle Dtataguard有三种保护模式: Maximum Availability Maximum Performance Maximum Protection AFFIRM NOAFFIRM AFFIRM SYNC ASYNC SYNC ##Oracle Dataguard配置过程中指定的log_archive_dest_2参数的值为SERVICE=standby LGWR ASYNC VALID_FOR=(ONLINE_LOGFILES,PRIMARY_ROLES) DB_UNIQUE_NAME=standby 其中ASYNC参数表示异步传输日志,这种日志传输方式只能配置为最佳性能模式,如果要修改为最高可用或者最大保护的话需要将该参数修改为AFFIRM。 ##通过select protection_mode from v$database查询保护模式 SQL> select protection_mode from v$database; PROTECTION_MODE ---------------------------------------- MAXIMUM PERFORMANCE ##备注2: ##当主备同步有问题时候可以通过查询错误输出来初步诊断 SQL> select error from v$archive_dest where target='STANDBY'; ##备注: ##当备库由于错误的操作(错误的提升角色或者错误的打开到OPEN状态并且被写入了数据,导致了主备不一致,这时只能抛弃被错误写入的数据)可以将备库闪回到一个正常状态下再重新进行数据同步。比如今天下午2点发现主库有问题,无法启动。这时将备库提升为了主库并开启为OPEN状态,客户端写入了一小部分数据时才发现,原来备库的数据没有即时同步到最新状态。这种情况下只有等主库修复完成正常启动,然后再从主库重新同步才能保证数据丢失更少。 ##查询某一个时间点的scn号: timestamp_to_scn('23-10月-19 11.00.00.000000000 上午') from dual;
2024年01月25日
141 阅读
0 评论
2 点赞
Centos7 安装Oracle19c环境准备
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_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 0002.6.安装软件包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 \ bc \ binutils \ compat-libcap1 \ compat-libstdc++-33 \ 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
2024年01月25日
106 阅读
0 评论
0 点赞
WindowsServer配置Oracle11g DG
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 alter system set log_archive_dest_2='SERVICE=standby LGWR ASYNC VALID_FOR=(ONLINE_LOGFILES,PRIMARY_ROLES) DB_UNIQUE_NAME=standby' scope=spfile; #启用归档路径1 alter system set log_archive_dest_state_1='enable' scope=spfile; #启用归档路径2 alter system set log_archive_dest_state_2='enable' scope=spfile; #设置当前库获取归档日志的服务器listerner名称(与8成对出现,用于switchover角色切换) alter system set fal_server='standby' scope=spfile; #设置当前库获取归档日志的客户端名称listerner名称(与7成对出现,用于switchover角色切换) alter system set fal_client='primary' scope=spfile; #设置归档日志强制切换时间(s)1800表示30分钟 alter system set archive_lag_target=1800 scope=spfile; #设置归档日志文件名命名方式 alter system set log_archive_format='%t_%s_%r.arc'scope=spfile; #设置备库文件管理的方式为auto,结合后续的convert参数,当主库增删文件时会自动在备库也生成相应文件。 alter system set standby_file_management=auto scope=spfile; #设置数据文件名称的映射关系(注意顺序不能变) alter system set db_file_name_convert='standby','primary' scope=spfile; #设置日志文件名称的映射关系(注意顺序不能变) alter system set log_file_name_convert='standby','primary' scope=spfile;主库重新启动数据库alter database open; shutdown immediate; startup;主库创建pfile文件create pfile from spfile; 文件位置:D:\app\Administrator\product\11.2.0\dbhome_1\database\INITorcl.ORA主库创建密码文件默认情况下已经生成了密码文件,位置在:D:\app\Administrator\product\11.2.0\dbhome_1\database\PWDorcl.ORA如果没有生成该文件,可以手工进行创建C:\Users\Administrator> orapwd file=D:\app\Administrator\product\11.2.0\dbhome_1\database\PWDorcl.ora password=Flexsystem123 entries=5主库配置网络监听Oracle服务器端,配置listener配置文件,添加一个orcl的静态注册 # listener.ora Network Configuration File: D:\listener.ora # Generated by Oracle configuration tools. SID_LIST_LISTENER = (SID_LIST = (SID_DESC = (SID_NAME = CLRExtProc) (ORACLE_HOME = D:\app\Administrator\product\11.2.0\dbhome_1) (PROGRAM = extproc) (ENVS = "EXTPROC_DLLS=ONLY:D:\app\Administrator\product\11.2.0\dbhome_1\bin\oraclr11.dll") ) #(SID_DESC = # (GLOBAL_DBNAME = orcl) # (ORACLE_HOME = D:\app\Administrator\product\11.2.0\dbhome_1) # (SID_NAME = orcl) #) ) LISTENER = (DESCRIPTION_LIST = (DESCRIPTION = (ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1521)) ) (DESCRIPTION = (ADDRESS = (PROTOCOL = TCP)(HOST = orcl1)(PORT = 1521)) //这里的主机名orcl1不要修改,windows的怪脾气,修改后监听会有问题 ) ) ADR_BASE_LISTENER = D:\app\Administrator Oracle客户端,配置tnsnames.ora # tnsnames.ora Network Configuration File: D:\tnsnames.ora # Generated by Oracle configuration tools. #PRIMARY = # (DESCRIPTION = # (ADDRESS_LIST = # (ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.68.21)(PORT = 1521)) # ) # (CONNECT_DATA = # (SERVICE_NAME = orcl) # ) # ) ORACLR_CONNECTION_DATA = (DESCRIPTION = (ADDRESS_LIST = (ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1521)) ) (CONNECT_DATA = (SID = CLRExtProc) (PRESENTATION = RO) ) ) #STANDBY = # (DESCRIPTION = # (ADDRESS_LIST = # (ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.68.22)(PORT = 1521)) # ) # (CONNECT_DATA = # (SERVICE_NAME = orcl) # ) # ) ORCL = (DESCRIPTION = (ADDRESS_LIST = (ADDRESS = (PROTOCOL = TCP)(HOST = orcl1)(PORT = 1521)) ) (CONNECT_DATA = (SERVICE_NAME = orcl) ) )主库测试监听在服务管理器里面重启listener服务和oracle数据库C:\Users\Administrator>tnsping primaryC:\Users\Administrator>tnsping orcl在主库上tnsping测试都能ping通C:\>sqlplus scott/Flexsystem123@192.168.68.21/primaryC:\>sqlplus scott/Flexsystem123@192.168.68.21/orcl在备库上sqlplus连接数据库都能连接主库复制配置及参数文件#关闭主数据库 SQL> shutdown immediate #将主库D:\app\Administrator文件夹下面的admin、cfgtoollogs、diag、flash_recover_area文件夹及PWDorcl.ora、 listener.ora和tnsnames.ora文件拷贝到备库相应目录下。 修改listener.ora中的监听地址(主机名HOST) # listener.ora Network Configuration File: D:\listener.ora # Generated by Oracle configuration tools. SID_LIST_LISTENER = (SID_LIST = (SID_DESC = (SID_NAME = CLRExtProc) (ORACLE_HOME = D:\app\Administrator\product\11.2.0\dbhome_1) (PROGRAM = extproc) (ENVS = "EXTPROC_DLLS=ONLY:D:\app\Administrator\product\11.2.0\dbhome_1\bin\oraclr11.dll") ) (SID_DESC = (GLOBAL_DBNAME = orcl) (ORACLE_HOME = D:\app\Administrator\product\11.2.0\dbhome_1) (SID_NAME = orcl) ) ) LISTENER = (DESCRIPTION_LIST = (DESCRIPTION = (ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1521)) ) (DESCRIPTION = # (ADDRESS = (PROTOCOL = TCP)(HOST = orcl2)(PORT = 1521)) ) ) ADR_BASE_LISTENER = D:\app\Administrator备库新建实例C:\>oradim -new -sid orcl oradim -new -sid spectra -startmode auto oradim -new -sid spectra1 -startmode auto 实例已创建。备库启动监听C:\> lsnrctl start #初次启动会在services.msc服务列表中注册Listener服务 #备库参数文件调整 #将主库的pfile文件拷贝到备库D:\app\Administrator\product\11.2.0\dbhome_1\database相应目录下并修改红色部分如下 orcl.__db_cache_size=704643072 orcl.__java_pool_size=16777216 orcl.__large_pool_size=16777216 orcl.__oracle_base='D:\app\Administrator'#ORACLE_BASE set from environment orcl.__pga_aggregate_target=704643072 orcl.__sga_target=1023410176 orcl.__shared_io_pool_size=0 orcl.__shared_pool_size=268435456 orcl.__streams_pool_size=0 *.archive_lag_target=1800 *.audit_file_dest='D:\app\Administrator\admin\orcl\adump' *.audit_trail='db' *.compatible='11.2.0.0.0' *.control_files='D:\app\Administrator\oradata\orcl\control01.ctl','D:\app\Administrator\flash_recovery_area\orcl\control02.ctl' *.db_block_size=8192 *.db_domain='' *.db_file_name_convert='primary','standby' *.db_name='orcl' *.db_recovery_file_dest='D:\app\Administrator\flash_recovery_area' *.db_recovery_file_dest_size=4102029312 *.db_unique_name='standby' *.diagnostic_dest='D:\app\Administrator' *.dispatchers='(PROTOCOL=TCP) (SERVICE=orclXDB)' *.fal_client='standby' *.fal_server='primary' *.log_archive_config='DG_CONFIG=(primary,standby)' *.log_archive_dest_1='location=D:\app\Administrator\archivelog\ VALID_FOR=(ALL_LOGFILES,ALL_ROLES) DB_UNIQUE_NAME=standby' *.log_archive_dest_2='SERVICE=primary LGWR ASYNC VALID_FOR=(ONLINE_LOGFILES,PRIMARY_ROLES) DB_UNIQUE_NAME=primary' *.log_archive_dest_state_1='enable' *.log_archive_dest_state_2='enable' *.log_archive_format='%t_%s_%r.arc' *.log_file_name_convert='primary','standby' *.memory_target=1717567488 *.open_cursors=300 *.processes=150 *.remote_login_passwordfile='EXCLUSIVE' *.standby_file_management='AUTO' *.undo_tablespace='UNDOTBS1' #在备库新建文件夹D:\app\Administrator\archivelog #在备库上用拷贝过来修改好的参数文件启动实例 SQL> startup nomount pfile='D:\app\Administrator\product\11.2.0\dbhome_1\database\INITorcl.ORA'复制主库数据建立一个完整备份到临时文件夹C:\Users\Administrator>rman target / 恢复管理器: Release 11.2.0.1.0 - Production on 星期日 7月 21 22:56:47 2019 Copyright (c) 1982, 2009, Oracle and/or its affiliates. All rights reserved. 连接到目标数据库: ORCL (DBID=1541935557) RMAN> backup full database format='D:\tmp\forstandby_%u%p%s.RMN' include current controlfile for standby; #归档当前二进制日志 RMAN> sql 'alter system archive log current';将主库的完整rman备份拷贝到备库相同的路径下在备库上创建与主库相同的数据目录然后在主库的rman终端连接备库进行数据恢复C:\Users\Administrator>rman target / RMAN> connect auxiliary sys/Flexsystem123@standby RMAN> duplicate target database for standby nofilenamecheck;备库启动数据同步C:\Users\Administrator>sqlplus / as sysdba SQL> startup nomount pfile='D:\app\Administrator\product\11.2.0\dbhome_1\database\INITorcl.ORA' SQL> alter database mount standby database; SQL> alter database recover managed standby database disconnect from session; SQL> create spfile from pfile; #开启数据库flashback特性 SQL> alter database flashback on; #关闭数据同步 SQL> ALTER DATABASE RECOVER MANAGED STANDBY DATABASE CANCEL; #注:如果想让备库比主库延迟几分钟可以启动为如下方式 alter database recover managed standby database delay 5 disconnect from session; 验证数据同步#在主库和备库上都执行,对比日志文件如果备库和主库一样表示同步完成 SQL> select name,sequence#,applied,completion_time from v$archived_log order by completion_time desc,sequence# desc; SQL> select name,sequence#,applied, To_Char(a.COMPLETION_TIME, 'YYYY-MM-DD HH24:MI:SS') AS COMPLETETIME from v$archived_log a where a.COMPLETION_TIME>sysdate -1/24 order by sequence#; #主库上切换日志文件再观察有没有正确同步到备库 SQL> alter system switch logfile;主备库切换#在主库上查询切换状态,只有为TO STANDBY的状态才可以进行无损切换,其他状态则需要修复。 SQL> select switchover_status from v$database; SWITCHOVER_STATUS ---------------------------------------- TO STANDBY #执行切换命令,并将主库转换为备库角色 #主库执行切换: SQL> alter database commit to switchover to physical standby with session shutdown; #主库角色转换为备库: SQL> shutdown immediate; SQL> startup nomount; SQL> alter database mount standby database; SQL> alter database recover managed standby database disconnect from session; #备库执行切换: SQL> alter database commit to switchover to primary; SQL> shutdown immediate; SQL> startup #切换完成后可以alter system switch logfile来验证一下切换后的主备库数据同步是否正常。 #注意: #如果当前主库上活动的SESSION正在查询数据,则select switchover_status from v$database 命令会显示SESSIONS ACTIVE,可以通过如下命令进行切换。 alter database commit to switchover to physical standby with session shutdown; #在备库上查询select switchover_status from v$database会显示 NOT ALLOWED,只有当主库上执行了alter database commit to switchover to physical standby后,备库上才会显示TO PRIMARY故障切换#当主库发生无法修复的故障时,需要紧急将备库提升为主库来接管服务。这种情况下,需要预先开启主库的flashback,当主库修复后还可以通过flashback闪回到一个时间点,并切换为备库,否则就只能重建备库。 SQL> alter database recover managed standby database cancel; SQL> alter database recover managed standby database finish force; SQL> alter database commit to switchover to primary; SQL> alter database open; SQL> select database_role from v$database; DATABASE_ROLE -------------------------------- PRIMARY通过flashback重建备库#当原来的主库经过维修后还可以启动数据库,则可以通过闪回到指定的SCN来进行standby重建 #A). 首先在当前主库,也就是failover过后的新的主库上查询到自己变成主库的那一刻的scn号: SQL> select to_char(standby_became_primary_scn) from v$database; TO_CHAR(STANDBY_BECAME_PRIMARY_SCN) ----------------------------------------------------------------------- 1400381 #B). 对到原来的主库(已修好的机器)上闪回数据,并进行切换 SQL> shutdown immediate; SQL> startup mount; SQL> flashback database to scn 1400381; 闪回完成。 SQL> alter database convert to physical standby; SQL> shutdown immediate; SQL> startup mount; #C). 在当前主库重新启用log_archive_dest_state_2并切换归档日志(或者直接重启数据库) SQL> alter system set log_archive_dest_state_2=enable; SQL> alter system switch logfile; #D). 回到原主库(当前备库)开启日志应用进程 SQL> alter database recover managed standby database using current logfile disconnect; #此时数据库已经完成切换,重新回到DG组中,并以备库的方式加入。可以通过3.13.5中的方法验证数据同步状态备注 #备注1: #Oracle Dtataguard有三种保护模式: Maximum Availability Maximum Performance Maximum Protection AFFIRM NOAFFIRM AFFIRM SYNC ASYNC SYNC #Oracle Dataguard配置过程中指定的log_archive_dest_2参数的值为SERVICE=standby LGWR ASYNC VALID_FOR=(ONLINE_LOGFILES,PRIMARY_ROLES) DB_UNIQUE_NAME=standby 其中ASYNC参数表示异步传输日志,这种日志传输方式只能配置为最佳性能模式,如果要修改为最高可用或者最大保护的话需要将该参数修改为AFFIRM。 #通过select protection_mode from v$database查询保护模式 SQL> select protection_mode from v$database; PROTECTION_MODE ---------------------------------------- MAXIMUM PERFORMANCE #备注2: #当主备同步有问题时候可以通过查询错误输出来初步诊断 SQL> select error from v$archive_dest where target='STANDBY'; #备注: #当备库由于错误的操作(错误的提升角色或者错误的打开到OPEN状态并且被写入了数据,导致了主备不一致,这时只能抛弃被错误写入的数据)可以将备库闪回到一个正常状态下再重新进行数据同步。比如今天下午2点发现主库有问题,无法启动。这时将备库提升为了主库并开启为OPEN状态,客户端写入了一小部分数据时才发现,原来备库的数据没有即时同步到最新状态。这种情况下只有等主库修复完成正常启动,然后再从主库重新同步才能保证数据丢失更少。 #查询某一个时间点的scn号: timestamp_to_scn('23-10月-19 11.00.00.000000000 上午') from dual;
2024年01月25日
55 阅读
0 评论
0 点赞
1
2
3