Oracle 19c RAC到单机ADG部署及Broker管理配置-最佳实践

一、概述

  1. 前面文章列举了几种ADG常见的搭建方式,此处我以最佳的方式作为实践过程演示;架构为RAC到单机,通常这种架构大家用得比较多;
  2. 这里实践的案例ADG全程是Broker进行管理,Broker其实是ADG非常简单易用的工具,尽量我们将相关的工作交给Oracle本身管理是最好的。
    比如Broker本身自动守护MRP进程就很不错了。

配置信息

配置项主库 (Primary)备库 (Standby)
操作系统 (OS)Red Hat Enterprise Linux Server 7.4Red Hat Enterprise Linux Server 7.4
DB 版本 (DB Version)19.3.0.019.3.0.0
主机 IP192.168.189.211 (rac1), 192.168.189.212 (rac2)192.168.189.209 (hisdg)
SCAN IP192.168.189.215 (rac-scan)
数据库名称 (DB_NAME)hishis
唯一数据库名称 (DB_UNIQUE_NAME)hishisdg
实例名称 (Instance_Name)hishisdg
归档文件路径 (Archivelog)+ARCH/u01/arch/
数据库存储 (DB Storage)ASMFileSystem
数据库文件路径+DATA/HIS/DATAFILE//u01/app/oracle/oradata/hisdg/
日志文件路径+DATA/HIS/ONLINELOG//u01/app/oracle/oradata/hisdg/
临时文件路径+DATA/HIS/TEMPFILE//u01/app/oracle/oradata/hisdg/
ORACLE_HOME 目录/u01/app/oracle/product/19.3.0/db_1//u01/app/oracle/product/19.3.0/db_1/

二、主库参数环境配置

1、添加备库日志

查看日志组数

select thread#,group#,members,bytes/1024/1024/1024 from v$log order by thread#;
select thread#,group#,bytes/1024/1024/1024 from v$standby_log;

PS:这里我们查出来主库的redo日志组数为4组,所以我们standby log创建5组;因为官方建议是比主库多一组,没有硬性要求。

添加日志组

alter database add standby logfile thread 1 group 13('+DATA','+ARCH') size 1024m;
alter database add standby logfile thread 1 group 14('+DATA','+ARCH') size 1024m;
alter database add standby logfile thread 1 group 15('+DATA','+ARCH') size 1024m;
alter database add standby logfile thread 1 group 16('+DATA','+ARCH') size 1024m;
alter database add standby logfile thread 1 group 17('+DATA','+ARCH') size 1024m;alter database add standby logfile thread 2 group 18('+DATA','+ARCH') size 1024m;
alter database add standby logfile thread 2 group 19('+DATA','+ARCH') size 1024m;
alter database add standby logfile thread 2 group 20('+DATA','+ARCH') size 1024m;
alter database add standby logfile thread 2 group 21('+DATA','+ARCH') size 1024m;
alter database add standby logfile thread 2 group 22('+DATA','+ARCH') size 1024m;

PS:注意thread 数要跟主库对应上。

2、开启归档和强制日志

archive log list;
alter database archivelog;
PS:这里不详细展开select force_logging from v$database;
alter database force logging;

3、主库参数配置

alter system set log_archive_config='DG_CONFIG=(his,hisdg)';
select * from v$dataguard_config;alter system set db_unique_name='his'scope=spfile;
alter system set standby_file_management='AUTO';                                        
alter system set db_file_name_convert='/u01/app/oracle/oradata/hisdg/','+DATA/HIS/DATAFILE/' scope=spfile;
alter system set log_file_name_convert='/u01/app/oracle/oradata/hisdg/','+DATA/HIS/ONLINELOG/' scope=spfile;

PS:备库为单机环境,所以转换参数要配好

三、备库参数环境配置

PS:备库参数这里看个人习惯,我习惯性拿主库的参数过来修改,出错率小

1、主库创建个pfile

create pfile='/home/oracle/pfile.bak' from spfile;

2、备库参数修改

*.audit_file_dest='/u01/app/oracle/admin/hisdg/adump'
*.audit_trail='db'
*.cluster_database=false
*.compatible='19.0.0'
*.control_files='/data/oradata/hisdg/controlfile01.ctl'
*.db_block_size=8192
*.db_file_name_convert='+DATA/his/DATAFILE/','/data/oradata/hisdg/','+DATA/his/TEMPFILE/','/data/oradata/hisdg/'
*.db_files=4000
*.db_name='his'
*.db_recovery_file_dest_size=536870912000
*.db_recovery_file_dest='/data/oradata/fast_recovery_area'
*.db_unique_name='hisdg'
*.diagnostic_dest='/u01/app/oracle'
*.log_archive_config='DG_CONFIG=(his,hisdg)'
*.log_file_name_convert='+DATA/his/ONLINELOG/','/data/oradata/hisdg/','+ARCH/his/ONLINELOG/','/data/oradata/hisdg/'
*.nls_language='AMERICAN'
*.nls_territory='AMERICA'
*.open_cursors=2000
*.pga_aggregate_limit=12g
*.pga_aggregate_target=6g
*.processes=2000
*.remote_login_passwordfile='exclusive'
*.sga_max_size=10g
*.sga_target=10g
*.standby_file_management='AUTO'
*.undo_tablespace='UNDOTBS1'

PS:参数样例,供大家参考,注意很多细节改对,集群相关的参数要去掉

3、创建备库关键目录

mkdir -p /u01/app/oracle/admin/hisdg/adump
mkdir -p /u01/app/oracle/oradata/hisdg
mkdir -p /u01/app/oracle/oradata/fast_recovery_area

四、配置TNS网络

PS:主备库之间同步是走TCP网络,故要配好TNS;有条件的话,建议配置专门的网络,避免走业务网

1、配置TNS客户端信息

vi tnsnames.ora
HIS=(DESCRIPTION =(ADDRESS = (PROTOCOL = TCP)(HOST = his-scan)(PORT = 1521))(CONNECT_DATA =(SERVER = DEDICATED)(SERVICE_NAME = his)(FAILOVER_MODE = (TYPE = SELECT)(METHOD = BASE)(RETIRES = 20)(DELAY = 15))))HISDG =(DESCRIPTION =(ADDRESS = (PROTOCOL = TCP)(HOST = hisdg)(PORT = 1521))(CONNECT_DATA =(SERVER = DEDICATED)(SERVICE_NAME = hisdg)))

2、配置静态监听

#主库
SID_LIST_LISTENER =(SID_LIST =(SID_DESC =(GLOBAL_DBNAME = his)(ORACLE_HOME = /u01/app/oracle/product/19.0.0/dbhome_1)(SID_NAME = his1))(SID_DESC =(GLOBAL_DBNAME = his_dgmgrl)(ORACLE_HOME = /u01/app/oracle/product/19.0.0/dbhome_1)(SID_NAME = his1)))
PS:两个节点配置好
#重启下监听
srvctl stop lisenter
srvctl start lisenter#备库
SID_LIST_LISTENER =(SID_LIST =(SID_DESC =(GLOBAL_DBNAME = hisdg)(ORACLE_HOME = /u01/app/oracle/product/19.0.0/dbhome_1)(SID_NAME = hisdg))(SID_DESC =(GLOBAL_DBNAME = hisdg_dgmgrl)(ORACLE_HOME = /u01/app/oracle/product/19.0.0/dbhome_1)(SID_NAME = hisdg)))#重启下监听
lsnrctl start
lsnrctl stat

五、Backup-Based方式搭建备库

1、拷贝密码文件

#主库
asmcmd
cp +DATA/HIS/PASSWORD/pwdhis.282.1093287491 /home/gridscp /home/grid/pwdhis.282.1093287491 oracle@hisdg:/u01/app/oracle/product/19.0.0/dbhome_1/dbs#备库
cd $ORACLE_HOME/dbs
mv pwdhis.282.1093287491 orapwhisdg

2、备库启动nomount

create spfile from pfile='/home/oracle/pfile.bak';
startup nomount

3、主库备份

创建备份目录

mkdir /backup

PS:此目录主备库要创建一致

run{
allocate channel c1 type disk;
allocate channel c2 type disk;
backup database format '/backup/%U' plus archivelog;
backup format '/backup/%U'  current controlfile ;
release channel c1;
release channel c2;
}scp /backup/* hisdg:/backup

4、备库恢复还原

rman target sys/Oracle123@his auxiliary sys/Oracle123
#PS:注意要进行主备库连接,要利用主库的catalog信息进行恢复run{
allocate channel c1 type disk;
allocate channel c2 type disk;
allocate AUXILIARY channel c3 type disk;
allocate AUXILIARY channel c4 type disk;
duplicate target database for standby;
}

恢复过程:

Recovery Manager: Release 19.0.0.0.0 - Production on Fri Jan 7 12:00:29 2022
Version 19.13.0.0.0Copyright (c) 1982, 2019, Oracle and/or its affiliates.  All rights reserved.connected to target database: his (DBID=3475847471)
connected to auxiliary database: his (not mounted)RMAN> run{
allocate channel c1 type disk;
allocate channel c2 type disk;
allocate AUXILIARY channel c3 type disk;
allocate AUXILIARY channel c4 type disk;
duplicate target database for standby;
}2> 3> 4> 5> 6> 7> using target database control file instead of recovery catalog
allocated channel: c1
channel c1: SID=197 instance=hip1 device type=DISKallocated channel: c2
channel c2: SID=2465 instance=hip1 device type=DISKallocated channel: c3
channel c3: SID=1513 device type=DISKallocated channel: c4
channel c4: SID=1137 device type=DISKStarting Duplicate Db at 07-JAN-22contents of Memory Script:
{restore clone standby controlfile;
}
executing Memory ScriptStarting restore at 07-JAN-22channel c3: starting datafile backup set restore
channel c3: restoring control file
channel c3: reading from backup piece +ARCH/his/AUTOBACKUP/2022_01_07/s_1093348509.298.1093348509
channel c3: ORA-19870: error while restoring backup piece +ARCH/his/AUTOBACKUP/2022_01_07/s_1093348509.298.1093348509
ORA-19505: failed to identify file "+ARCH/his/AUTOBACKUP/2022_01_07/s_1093348509.298.1093348509"
ORA-17503: ksfdopn:2 Failed to open file +ARCH/his/AUTOBACKUP/2022_01_07/s_1093348509.298.1093348509
ORA-15001: diskgroup "DG_ARCH" does not exist or is not mounted
failover to previous backupchannel c3: starting datafile backup set restore
channel c3: restoring control file
channel c3: reading from backup piece /backup/0a0imb4r_10_1_1
channel c3: piece handle=/backup/0a0imb4r_10_1_1 tag=TAG20220107T115506
channel c3: restored backup piece 1
channel c3: restore complete, elapsed time: 00:00:01
output file name=/data/oradata/hisdg/controlfile01.ctl
Finished restore at 07-JAN-22contents of Memory Script:
{sql clone 'alter database mount standby database';
}
executing Memory Scriptsql statement: alter database mount standby databasecontents of Memory Script:
{set newname for tempfile  1 to "/data/oradata/hisdg/temp.290.1093287863";set newname for tempfile  2 to "/data/oradata/hisdg/temp.293.1093346713";set newname for tempfile  3 to "/data/oradata/hisdg/temp.292.1093346713";switch clone tempfile all;set newname for datafile  1 to "/data/oradata/hisdg/system.283.1093287729";set newname for datafile  2 to "/data/oradata/hisdg/system.289.1093346719";set newname for datafile  3 to "/data/oradata/hisdg/sysaux.284.1093287763";set newname for datafile  4 to "/data/oradata/hisdg/undotbs1.285.1093287789";set newname for datafile  5 to "/data/oradata/hisdg/undotbs2.291.1093288043";set newname for datafile  7 to "/data/oradata/hisdg/users.286.1093287789";set newname for datafile  8 to "/data/oradata/hisdg/undotbs1.288.1093346723";set newname for datafile  9 to "/data/oradata/hisdg/undotbs1.320.1093346727";set newname for datafile  10 to "/data/oradata/hisdg/undotbs2.321.1093346731";set newname for datafile  11 to "/data/oradata/hisdg/undotbs2.322.1093346735";restoreclone database;
}
executing Memory Scriptexecuting command: SET NEWNAMEexecuting command: SET NEWNAMEexecuting command: SET NEWNAMErenamed tempfile 1 to /data/oradata/hisdg/temp.290.1093287863 in control file
renamed tempfile 2 to /data/oradata/hisdg/temp.293.1093346713 in control file
renamed tempfile 3 to /data/oradata/hisdg/temp.292.1093346713 in control fileexecuting command: SET NEWNAMEexecuting command: SET NEWNAMEexecuting command: SET NEWNAMEexecuting command: SET NEWNAMEexecuting command: SET NEWNAMEexecuting command: SET NEWNAMEexecuting command: SET NEWNAMEexecuting command: SET NEWNAMEexecuting command: SET NEWNAMEexecuting command: SET NEWNAMEStarting restore at 07-JAN-22channel c3: starting datafile backup set restore
channel c3: specifying datafile(s) to restore from backup set
channel c3: restoring datafile 00002 to /data/oradata/hisdg/system.289.1093346719
channel c3: restoring datafile 00005 to /data/oradata/hisdg/undotbs2.291.1093288043
channel c3: restoring datafile 00007 to /data/oradata/hisdg/users.286.1093287789
channel c3: restoring datafile 00009 to /data/oradata/hisdg/undotbs1.320.1093346727
channel c3: restoring datafile 00011 to /data/oradata/hisdg/undotbs2.322.1093346735
channel c3: reading from backup piece /backup/070imb48_7_1_1
channel c4: starting datafile backup set restore
channel c4: specifying datafile(s) to restore from backup set
channel c4: restoring datafile 00001 to /data/oradata/hisdg/system.283.1093287729
channel c4: restoring datafile 00003 to /data/oradata/hisdg/sysaux.284.1093287763
channel c4: restoring datafile 00004 to /data/oradata/hisdg/undotbs1.285.1093287789
channel c4: restoring datafile 00008 to /data/oradata/hisdg/undotbs1.288.1093346723
channel c4: restoring datafile 00010 to /data/oradata/hisdg/undotbs2.321.1093346731
channel c4: reading from backup piece /backup/060imb48_6_1_1
channel c3: piece handle=/backup/070imb48_7_1_1 tag=TAG20220107T115447
channel c3: restored backup piece 1
channel c3: restore complete, elapsed time: 00:00:25
channel c4: piece handle=/backup/060imb48_6_1_1 tag=TAG20220107T115447
channel c4: restored backup piece 1
channel c4: restore complete, elapsed time: 00:00:25
Finished restore at 07-JAN-22contents of Memory Script:
{switch clone datafile all;
}
executing Memory Scriptdatafile 1 switched to datafile copy
input datafile copy RECID=1 STAMP=1093348896 file name=/data/oradata/hisdg/system.283.1093287729
datafile 2 switched to datafile copy
input datafile copy RECID=2 STAMP=1093348896 file name=/data/oradata/hisdg/system.289.1093346719
datafile 3 switched to datafile copy
input datafile copy RECID=3 STAMP=1093348896 file name=/data/oradata/hisdg/sysaux.284.1093287763
datafile 4 switched to datafile copy
input datafile copy RECID=4 STAMP=1093348896 file name=/data/oradata/hisdg/undotbs1.285.1093287789
datafile 5 switched to datafile copy
input datafile copy RECID=5 STAMP=1093348896 file name=/data/oradata/hisdg/undotbs2.291.1093288043
datafile 7 switched to datafile copy
input datafile copy RECID=6 STAMP=1093348896 file name=/data/oradata/hisdg/users.286.1093287789
datafile 8 switched to datafile copy
input datafile copy RECID=7 STAMP=1093348896 file name=/data/oradata/hisdg/undotbs1.288.1093346723
datafile 9 switched to datafile copy
input datafile copy RECID=8 STAMP=1093348897 file name=/data/oradata/hisdg/undotbs1.320.1093346727
datafile 10 switched to datafile copy
input datafile copy RECID=9 STAMP=1093348897 file name=/data/oradata/hisdg/undotbs2.321.1093346731
datafile 11 switched to datafile copy
input datafile copy RECID=10 STAMP=1093348897 file name=/data/oradata/hisdg/undotbs2.322.1093346735
Finished Duplicate Db at 07-JAN-22
released channel: c1
released channel: c2
released channel: c3
released channel: c4RMAN>

PS:至此备库恢复完成

六、配置broker

PS:剩下关键步骤,配置broker建立主备库之间的通讯同步

1、主库启动broker

ALTER SYSTEM SET DG_BROKER_CONFIG_FILE1 = '+DATA/HIS/BROKER/DR1.DAT' SCOPE=BOTH;
ALTER SYSTEM SET DG_BROKER_CONFIG_FILE2 = '+DATA/HIS/BROKER/DR2.DAT' SCOPE=BOTH;alter system set dg_broker_start=true;

PS:这里我们将broker配置文件放在ASM当中

2、备库启动broker

alter system set dg_broker_start=true;

3、创建dg配置

PS:主备库任意节点操作即可

#连接命令工具
dgmgrl /#创建broker配置
DGMGRL> create configuration 'hisadg' as primary database is 'his' connect identifier is 'his';#添加备库到配置中
DGMGRL> add database 'hisdg' as connect identifier is 'hisdg';

4、启用配置

DGMGRL> enable configuration;

PS:启用后自动同步配置文件到主库或者备库,次过程为关键过程,会自动建立主备库的通讯连接,配置arch dest、fal server 等参数,启动启动mrp等进程

5、查看配置

DGMGRL> show configuration;
Configuration - hisadgProtection Mode: MaxPerformanceMembers:his   - Primary databasehisdg - Physical standby database Fast-Start Failover:  DisabledConfiguration Status:
SUCCESS   (status updated 52 seconds ago)

PS:可以看到配置状态正常

6、查看数据库配置

DGMGRL> show database verbose hisdg;
Database - hisdgRole:               PHYSICAL STANDBYIntended State:     APPLY-ONTransport Lag:      0 seconds (computed 0 seconds ago)Apply Lag:          0 seconds (computed 0 seconds ago)Average Apply Rate: 1.00 KByte/sActive Apply Rate:  40.00 KByte/sMaximum Apply Rate: 40.00 KByte/sReal Time Query:    ONInstance(s):hisdgProperties:DGConnectIdentifier             = 'hisdg'ObserverConnectIdentifier       = ''FastStartFailoverTarget         = ''PreferredObserverHosts          = ''LogShipping                     = 'ON'RedoRoutes                      = ''LogXptMode                      = 'ASYNC'DelayMins                       = '0'Binding                         = 'optional'MaxFailure                      = '0'ReopenSecs                      = '300'NetTimeout                      = '30'RedoCompression                 = 'DISABLE'PreferredApplyInstance          = ''ApplyInstanceTimeout            = '0'ApplyLagThreshold               = '30'TransportLagThreshold           = '30'TransportDisconnectedThreshold  = '30'ApplyParallel                   = 'AUTO'ApplyInstances                  = '0'StandbyFileManagement           = ''ArchiveLagTarget                = '0'LogArchiveMaxProcesses          = '0'LogArchiveMinSucceedDest        = '0'DataGuardSyncLatency            = '0'LogArchiveTrace                 = '0'LogArchiveFormat                = ''DbFileNameConvert               = ''LogFileNameConvert              = ''ArchiveLocation                 = ''AlternateLocation               = ''StandbyArchiveLocation          = ''StandbyAlternateLocation        = ''InconsistentProperties          = '(monitor)'InconsistentLogXptProps         = '(monitor)'LogXptStatus                    = '(monitor)'SendQEntries                    = '(monitor)'RecvQEntries                    = '(monitor)'HostName                        = 'hisdg'StaticConnectIdentifier         = '(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=hipdg)(PORT=1521))(CONNECT_DATA=(SERVICE_NAME=hisdg_DGMGRL)(INSTANCE_NAME=hipdg)(SERVER=DEDICATED)))'TopWaitEvents                   = '(monitor)'SidName                         = '(monitor)'Log file locations:Alert log               : /u01/app/oracle/diag/rdbms/hisdg/hipdg/trace/alert_hisdg.logData Guard Broker log   : /u01/app/oracle/diag/rdbms/hisdg/hipdg/trace/drchipdg.logDatabase Status:
SUCCESSDGMGRL> 

PS:至此ADG搭建完成

七、后续配置与主备切换

一个合格的ADG是可以进行主备之前来回任意切换的,并且创建数据文件和切换归档是正常同步的

1、配置最高可用模式

DGMGRL> edit database 'his' set property 'LogXptMode'='SYNC';
DGMGRL> edit database 'hisdg' set property 'LogXptMode'='SYNC';
DGMGRL> edit configuration set protection mode as maxavailability;

查看

DGMGRL> show configuration;Configuration - hisadgProtection Mode: MaxAvailabilityMembers:his   - Primary databasehisdg - Physical standby database Fast-Start Failover:  DisabledConfiguration Status:
SUCCESS   (status updated 52 seconds ago)

PS:可以看到已经改变为最高可用模式了

2、主备切换

连接

dgmgrl
DGMGRL> connect sys/Oracle123@his

PS:注意一定要使用密码连接。

开启转换

DGMGRL> switchover to hisdg
Performing switchover NOW, please wait...
New primary database "hisdg" is opening...
Operation requires start up of instance "his" on database "his"
Starting instance "his"...
Connected to an idle instance.
ORACLE instance started.
Connected to "his"
Database mounted.
Database opened.
Connected to "his"
Switchover succeeded, new primary is "hisdg"
DGMGRL> 

PS:可以看到切换是相当的方便,在切换的过程中注意观察主备库之间alert日志,监测实时过程。

查看配置

DGMGRL> show configuration;
Configuration - hisadgProtection Mode: MaxAvailabilityMembers:hisdg - Primary databasehis   - Physical standby database Fast-Start Failover:  DisabledConfiguration Status:
SUCCESS   (status updated 27 seconds ago)DGMGRL> 

PS:等待一会,进行查看,可以看到角色已经互换了。

3、同步测试

创建数据文件

#新主库:
create tablespace test datafile '/data/oradata/hisdg/test01.dbf' size 100m
Completed: create tablespace test datafile '/data/oradata/hisdg/test01.dbf' size 100m#新备库:
2022-01-07T14:16:52.894528+08:00
Successfully added datafile 12 to media recovery
Datafile #12: '+DATA/his/DATAFILE/test.326.1093357013'

切换归档测试

#新主库:
2022-01-07T14:19:36.844258+08:00
Thread 1 advanced to log sequence 32 (LGWR switch),  current SCN: 3333166Current log# 8 seq# 32 mem# 0: /data/oradata/hisdg/group_8.315.1093346407Current log# 8 seq# 32 mem# 1: /data/oradata/hisdg/group_8.274.1093346411
2022-01-07T14:19:36.861642+08:00
ARC3 (PID:7472): Archived Log entry 28 added for T-1.S-31 ID 0xcf2e0982 LAD:1#新备库:
2022-01-07T14:19:33.730141+08:00
PR00 (PID:10498): Media Recovery Waiting for T-1.S-32 (in transit)
2022-01-07T14:19:33.734836+08:00
Recovery of Online Redo Log: Thread 1 Group 13 Seq 32 Reading mem 0Mem# 0: +DATA/his/ONLINELOG/group_13.297.1093304763Mem# 1: +ARCH/his/ONLINELOG/group_13.256.1093304767

PS:可以看到同步正常

至此,全部配置已完成!

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.mzph.cn/bicheng/63558.shtml

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈email:809451989@qq.com,一经查实,立即删除!

相关文章

每日一题 LCR 097. 不同的子序列

LCR 097. 不同的子序列 使用动态规划就可以解决&#xff0c;重点是知道 动态规划的状态是如何转移的 class Solution { public:int numDistinct(string s, string t) {int ns s.size();int nt t.size();vector<vector<long>> dp(ns1,vector<long>(nt1,0)…

如何在 JavaScript 中进行深度克隆?

在 JavaScript 中进行深度克隆&#xff08;deep clone&#xff09;是指创建一个对象的完整副本&#xff0c;并且副本中所有的嵌套对象也被复制&#xff0c;而不是只是引用原始对象中的嵌套对象。深度克隆与浅克隆的主要区别在于&#xff0c;浅克隆只复制对象的引用&#xff0c;…

C# 关于加密技术以及应用(一)

在 开发过程中&#xff0c;加密是一个常见的需求&#xff0c;数字签名和验证、网络通信安全、数据加密解密、用于保护数据的安全性和隐私。如几种常用的加密技术AES、SSL/TLS、RSA、HMAC 、SHA等&#xff0c;都是我们开发过程中常用到的加密方式&#xff0c;只不过每一个加密方…

Python 爬虫 (1)基础 | XHR

一、XHR 1、概念 XHR&#xff0c;全称XMLHttpRequest&#xff0c;是一种在无需重新加载整个网页的情况下&#xff0c;能够更新部分网页的技术。它允许网页的JavaScript代码与服务器进行异步通信&#xff0c;即在发送请求后&#xff0c;浏览器不会阻塞用户的后续操作&#xff0…

二进制部署Prometheus+grafana+alertmanager+node_exporter

Prometheus 是一个开源的监控和告警工具包&#xff0c;旨在提供高可靠性和可扩展性。它最初由 SoundCloud 开发&#xff0c;现已成为云原生计算基金会&#xff08;CNCF&#xff09;的一部分。以下是 Prometheus 的一些关键特性和概念&#xff1a; 1. **时间序列数据库**&#…

工业智能网关如何为企业实现智能制造赋能?

在数字化转型的浪潮中&#xff0c;工业智能网关作为连接物理世界与数字世界的桥梁&#xff0c;正逐步成为智能制造领域的核心组件。本文将通过一个实际使用案例&#xff0c;深入剖析工业智能网关如何助力企业实现生产流程的优化、数据的高效采集与分析&#xff0c;以及智能化决…

算法设计6_随机化算法

随机化算法 随机算法的随机性&#xff08;基本特征&#xff09; – 对于同一实例的多次执行, 效果可能完全不同 – 时间复杂性的一个随机变量 – 解的正确性和准确性也是随机的 数值随机化算法 随机数值算法 – 主要用于数值问题求解 – 算法的输出往往是近似解 – 近似…

使用mmdeploy框架C++预测mask并绘制最小外接矩形

目录 解决目标 逻辑思路 代码实现 第1部分 第2部分 解决目标 这段代码实现了&#xff0c;一个基于深度学习的图像检测程序。它使用mmdeploy框架&#xff0c;加载一个预训练的模型【实例分割模型】来检测图像中的物体。 逻辑思路 程序首先加载模型&#xff0c;然后&#…

Java --- JVM编译运行过程

目录 一.Java编译与执行流程&#xff1a; 二.编译过程&#xff1a; 1.编译器&#xff08;javac&#xff09;&#xff1a; 2.字节码文件&#xff08;.class&#xff09;&#xff1a; 三.执行过程&#xff1a; 1.启动JVM&#xff08;Java虚拟机&#xff09;&#xff1a; 2…

【Makefile】编译日志之输出重定向符号 >

用法1 make all >& compilelog.txt make all > compilelog.txt这两个编译命令在功能上有一些细微的区别&#xff0c;主要在于标准输出和标准错误的处理方式。 make all >& compilelog.txt 这个命令会将标准输出&#xff08;stdout&#xff09;和标准错误&a…

使用 `typing_extensions.TypeAlias` 简化类型定义:初学者指南

使用 typing_extensions.TypeAlias 简化类型定义&#xff1a;初学者指南 什么是 TypeAlias&#xff1f;安装 typing_extensions示例代码&#xff1a;如何使用 TypeAlias示例 1&#xff1a;为简单类型定义别名示例 2&#xff1a;为复杂类型定义别名示例 3&#xff1a;结合 Union…

11.关于vim编辑器的简单配置

1. 说明 在linux系统中编辑文件内容的方式有很多种&#xff0c;比如直接在系统中暗中某些IDE&#xff0c;方便快捷&#xff0c;也可以直接在windows系统中编辑好文件后上传到linux系统中&#xff0c;这些方式对于编写内容较多的文件或者整个项目的文件还是非常适合的。不过有时…

qq空间管理小助手教程代码演示

headers {"Authorization": "Bearer YOUR_ACCESS_TOKEN","Content-Type": "application/json" }# 发布说说示例&#xff08; def post_moment(content):url "https://qzone-api.example.com/post_moment"data {"con…

pytest 的简单介绍

官方文档&#xff1a;pytest 文档 1. pytest 概述 pytest 是一个功能强大的 Python 测试框架&#xff0c;旨在简化单元测试和功能测试的编写与执行。它不仅支持简单的单元测试&#xff0c;还能进行更复杂的测试&#xff0c;如数据驱动的测试、并发测试等。pytest 支持自动化发…

【ArcGIS微课1000例】0133:二维建筑物依据高度生成三维模型

拓展阅读:【ArcGIS Pro微课1000例】0032:创建具有指定高程Z值的矢量数据 文章目录 一、二维面要素拉伸实现三维显示二、依据高度实现要素转3D一、二维面要素拉伸实现三维显示 打开ArcScene软件,加载实验配套数据0133.rar中的建筑物.shp数据,如下图: 数据属性表中的Z为建筑…

快速搭建SpringBoot3+Vue3+ElementPlus管理系统

快速搭建SpringBoot3Vue3管理系统 前端项目搭建&#xff08;默认开发环境&#xff1a;node20,Jdk17&#xff09;创建项目并下载依赖--执行以下命令 前端项目搭建&#xff08;默认开发环境&#xff1a;node20,Jdk17&#xff09; 创建项目并下载依赖–执行以下命令 创建项目 y…

力扣--LCR 134.Pow(x,n)

题目 实现 pow(x, n) &#xff0c;即计算 x 的 n 次幂函数&#xff08;即&#xff0c;xn&#xff09;。 示例 1&#xff1a; 输入&#xff1a;x 2.00000, n 10 输出&#xff1a;1024.00000 示例 2&#xff1a; 输入&#xff1a;x 2.10000, n 3 输出&#xff1a;9.2610…

道可云人工智能元宇宙每日资讯|全国工商联人工智能委员会成立会议在南京举办

道可云元宇宙每日简报&#xff08;2024年12月5日&#xff09;讯&#xff0c;今日元宇宙新鲜事有&#xff1a; 全国工商联人工智能委员会成立会议在南京举办 全国工商联人工智能委员会成立会议日前在江苏省南京市举办。中央统战部副部长、全国工商联党组书记沈莹出席会议并讲话…

基于Qt的文字处理软件(二)

这期文章我们进行主窗口的一些函数的定义&#xff0c;同时导入一些文字处理软件的状态栏会用到的图标。下面图片是图标导入到项目后的一个示例&#xff0c;图标可以到阿里矢量图标库里面找到。 一、导入图标资源: 1.首先在项目目录的位置创建一个images的文件,然后将收集好的图…

如何使用WinCC DataMonitor基于Web发布浏览Excel报表文档

本文介绍使用 WinCC DataMonitor 的 "Excel Workbooks" 功能&#xff0c;通过 Excel 表格显示 WinCC 项目的过程值、归档变量值和报警归档消息。并可以通过 Web 发布浏览访问数据 1&#xff0e;WinCC DataMonitor是什么 ? DataMonitor 是 SIMATIC WinCC 工厂智能中…