oracle 12.1 rac to rac adg(maa)搭建保姆级教程

news2024/12/26 23:40:40

目录

资源配置

一、主库集群操作

1.主库增加standbylog

2.主库开启force logging及归档

3.主库配置参数

4.生成参数文件并将参数文件、密码文件拷贝至备库

4.1参数文件处理

4.2密码文件处理

二、备库操作

1.备库修改参数文件

1.1创建adump目录并在参数文件修改(两节点均创建)

1.2增加dg相关参数

1.3备库asm创建目录结构

1.4备库将主库asm传过来的密码文件放到dbs目录下

三、配置监听

四、恢复库

主库进行全库备份

将主库备份传至备库

备库恢复主库备份

开库


资源配置

主备角色主机名IP实例名
主库racstd1192.168.213.109std11
racstd2192.168.213.110std12
备库primary1192.168.213.101stdg11
primary2192.168.213.102stdg12

一、主库集群操作

1.1.主库增加standbylog

SQL> select group#,thread#,sequence#,bytes/1024/1024,members,status from v$log;

    GROUP#    THREAD#  SEQUENCE# BYTES/1024/1024    MEMBERS STATUS

---------- ---------- ---------- --------------- ---------- ----------------

         1          1         27              50          2 CURRENT

         2          1         26              50          2 INACTIVE

         3          2          9              50          2 CURRENT

         4          2          8              50          2 INACTIVE

增加日志

alter database add standby logfile thread 1 group 5 ('+DATA') size 50M,group 6 ('+DATA') size 50M,group 7 ('+DATA') size 50M;

alter database add standby logfile thread 2 group 8 ('+DATA') size 50M,group 9 ('+DATA') size 50M,group 10 ('+DATA') size 50M;

select group#,member from v$logfile;

注意:standbylog 要比原日志组至少多一组,日志大小建议与当前数据库配置保持一致。

1.2.主库开启force logging及归档

开启强记日志

SQL> select force_logging from v$database;

FORCE_LOGGING

---------------------------------------

NO

SQL> ALTER DATABASE FORCE LOGGING;

Database altered.

SQL> select force_logging from v$database;

FORCE_LOGGING

---------------------------------------

YES

SQL>  archive log list

Database log mode              No Archive Mode

Automatic archival             Disabled

Archive destination            USE_DB_RECOVERY_FILE_DEST

Oldest online log sequence     26

Current log sequence           27

SQL>

##开归档

[oracle@racstd1 ~]$ srvctl stop database -d standby

[oracle@racstd1 ~]$ sqlplus / as sysdba

SQL*Plus: Release 12.1.0.2.0 Production on Thu Jun 6 15:01:19 2024

Copyright (c) 1982, 2014, Oracle.  All rights reserved.

Connected to an idle instance.

SQL> startup mount

ORACLE instance started.

Total System Global Area 7532969984 bytes

Fixed Size                  2941920 bytes

Variable Size            1426066464 bytes

Database Buffers         6090129408 bytes

Redo Buffers               13832192 bytes

Database mounted.

##归档开启(如归档已开启请忽略这一步)

SQL> alter database archivelog;

Database altered.

SQL> archive log list;

Database log mode              Archive Mode

Automatic archival             Enabled

Archive destination            USE_DB_RECOVERY_FILE_DEST

Oldest online log sequence     26

Next log sequence to archive   27

Current log sequence           27

SQL>

1.3.主库配置参数

alter system set log_archive_config='dg_config=(standby,primary)'   scope=spfile sid='*';

alter system set log_archive_dest_1='location=+ARCH valid_for=(all_logfiles,all_roles) db_unique_name=standby'  scope=spfile sid='*';

alter system set log_archive_dest_2='service=primary valid_for=(online_logfiles,primary_role) db_unique_name=primary'   scope=spfile sid='*';

alter system set standby_file_management='auto'   scope=spfile sid='*';

alter system set fal_server='primary'   scope=spfile sid='*';

alter system set fal_client='standby'   scope=spfile sid='*';

alter system set db_file_name_convert='+DATA/PRIMARY/DATAFILE/','+DATA/STANDBY/DATAFILE/','+DATA/PRIMARY/DATAFILE/','+DATA/STANDBY/TEMPFILE/' scope=spfile sid='*';

alter system set log_file_name_convert='+DATA/PRIMARY/ONLINELOG','+DATA/STANDBY/ONLINELOG' scope=spfile sid='*';

##重启生效

[oracle@racstd1 tmp]$ srvctl stop database -d standby

[oracle@racstd1 tmp]$ srvctl start database -d standby

[oracle@racstd1 tmp]$ srvctl status database -d standby

Instance std11 is running on node racstd1

Instance std12 is running on node racstd2

1.4.生成参数文件并将参数文件、密码文件拷贝至备库

1.4.1参数文件处理

[oracle@racstd1 ~]$ sqlplus / as sysdba

SQL> create pfile='/tmp/initstd.ora' from spfile;

File created.

##将参数文件传到备库

[oracle@racstd1 tmp]$ scp initstd.ora oracle@192.168.213.101:/u01/app/oracle/product/12.1.0/dbhome_1/dbs

The authenticity of host '192.168.213.101 (192.168.213.101)' can't be established.

RSA key fingerprint is de:d5:a9:a1:b1:84:63:49:84:02:4b:d2:ff:30:e5:de.

Are you sure you want to continue connecting (yes/no)? yes

Warning: Permanently added '192.168.213.101' (RSA) to the list of known hosts.

oracle@192.168.213.101's password:

initstd.ora                                                                                                                  100% 1500     1.5KB/s   00:00

1.4.2密码文件处理

主库密码文件到备库,最开始放在$ORACLE_HOME/dbs目录下,后续配置完成后,需要将密码文件存放在ASM磁盘组中并进行改名。

[root@racstd1 ~]# su - grid

[grid@racstd1 ~]$ asmcmd          

ASMCMD> pwd

+DATA/STANDBY/PASSWORD

ASMCMD> ls

pwdstandby.256.1170868583

ASMCMD> pwcopy +DATA/STANDBY/PASSWORD/pwdstandby.256.1170868583 /tmp

注意:需要拷贝到tmp目录其他目录会报权限错误

[root@racstd1 tmp]# scp pwdstandby.256.1170868583 192.168.213.101:/tmp

The authenticity of host '192.168.213.101 (192.168.213.101)' can't be established.

RSA key fingerprint is de:d5:a9:a1:b1:84:63:49:84:02:4b:d2:ff:30:e5:de.

Are you sure you want to continue connecting (yes/no)? yes

Warning: Permanently added '192.168.213.101' (RSA) to the list of known hosts.

root@192.168.213.101's password:

pwdstandby.256.1170868583                                                                                                    100% 7680     7.5KB/s   00:00

二、备库操作

2.1.备库修改参数文件

cd $ORACLE_HOME/dbs

vi initstd.ora

先把涉及到实例名的参数改成一致主库是std*备库我们改成stdg*跟主库区别开

2.1.1创建adump目录并在参数文件修改(两节点均创建)

cd /u01/app/oracle/admin/

mkdir -p stdg/adump

参数文件中修改

2.1.2增加dg相关参数

##确认主库的数据文件、临时文件、日志文件目录

ASMCMD> cd DATAFILE

ASMCMD> pwd

+DATA/STANDBY/DATAFILE

ASMCMD> cd ..

ASMCMD> cd TEMPFILE/

ASMCMD> pwd

+DATA/STANDBY/TEMPFILE

ASMCMD> cd ..

ASMCMD> cd ONLINELOG/

ASMCMD> pwd

+DATA/STANDBY/ONLINELOG

*.db_file_name_convert='+DATA/STANDBY/DATAFILE/','+DATA/PRIMARY/DATAFILE/','+DATA/STANDBY/TEMPFILE/','+DATA/PRIMARY/TEMPFILE/'

*.db_unique_name='primary'

*.log_archive_config='DG_CONFIG=(standby,primary)'

*.log_archive_dest_1='LOCATION=+ARCH VALID_FOR=(ALL_LOGFILES,ALL_ROLES) DB_UNIQUE_NAME=primary'

*.log_archive_dest_2='SERVICE=standby ASYNC VALID_FOR=(ONLINE_LOGFILES,PRIMARY_ROLE) DB_UNIQUE_NAME=standby'

*.log_file_name_convert='+DATA/STANDBY/ONLINELOG','+DATA/PRIMARY/ONLINELOG'

*.fal_server='standby'

*.fal_client='primary'

参数文件:

stdg11.__data_transfer_cache_size=0

stdg12.__data_transfer_cache_size=0

stdg11.__db_cache_size=5821693952

stdg12.__db_cache_size=5821693952

stdg11.__java_pool_size=16777216

stdg12.__java_pool_size=16777216

stdg11.__large_pool_size=33554432

stdg12.__large_pool_size=33554432

stdg11.__oracle_base='/u01/app/oracle'#ORACLE_BASE set from environment

stdg12.__oracle_base='/u01/app/oracle'#ORACLE_BASE set from environment

stdg11.__pga_aggregate_target=2516582400

stdg12.__pga_aggregate_target=2516582400

stdg11.__sga_target=7532969984

stdg12.__sga_target=7532969984

stdg11.__shared_io_pool_size=385875968

stdg12.__shared_io_pool_size=385875968

stdg11.__shared_pool_size=1258291200

stdg12.__shared_pool_size=1258291200

stdg11.__streams_pool_size=0

stdg12.__streams_pool_size=0

*.audit_file_dest='/u01/app/oracle/admin/stdg/adump'

*.audit_trail='db'

#*.cluster_database=TRUE

*.compatible='12.1.0.2.0'

*.control_files='+DATA/PRIMARY/CONTROLFILE/controlfile01.ctl','+ARCH/PRIMARY/CONTROLFILE/controlfile02.ctl'

*.db_block_size=8192

*.db_create_file_dest='+DATA'

*.db_domain=''

*.db_name='standby'  --注意数据库名要与主库一致否则会报错 

*.db_recovery_file_dest='+ARCH'

*.db_recovery_file_dest_size=4785m

*.diagnostic_dest='/u01/app/oracle'

*.dispatchers='(PROTOCOL=TCP) (SERVICE=stdg1XDB)'

stdg11.instance_number=1

stdg12.instance_number=2

*.open_cursors=300

*.pga_aggregate_target=2392m

*.processes=300

*.remote_login_passwordfile='exclusive'

*.sga_target=7176m

stdg12.thread=2

stdg11.thread=1

stdg11.undo_tablespace='UNDOTBS1'

stdg12.undo_tablespace='UNDOTBS2'

*.db_file_name_convert='+DATA/STANDBY/DATAFILE/','+DATA/PRIMARY/DATAFILE/','+DATA/STANDBY/TEMPFILE/','+DATA/PRIMARY/TEMPFILE/'

*.db_unique_name='primary'

*.log_archive_config='DG_CONFIG=(standby,primary)'

*.log_archive_dest_1='LOCATION=+ARCH VALID_FOR=(ALL_LOGFILES,ALL_ROLES) DB_UNIQUE_NAME=primary'

*.log_archive_dest_2='SERVICE=BMACDB1 ASYNC VALID_FOR=(ONLINE_LOGFILES,PRIMARY_ROLE) DB_UNIQUE_NAME=standby'

*.log_file_name_convert='+DATA/STANDBY/ONLINELOG','+DATA/PRIMARY/ONLINELOG'

*.fal_server='standby'

*.fal_client='primary'

注意:集群参数暂时屏蔽

2.1.3备库asm创建目录结构

ASMCMD> mkdir PRIMARY

ASMCMD> cd PRIMARY

ASMCMD> mkdir ONLINELOG

ASMCMD> mkdir TEMPFILE

ASMCMD> mkdir DATAFILE

ASMCMD> mkdir CONTROLFILE

ASMCMD> ls

CONTROLFILE/

DATAFILE/

ONLINELOG/

TEMPFILE/

ASMCMD> pwd

+DATA/PRIMARY

2.1.4备库将主库asm传过来的密码文件放到dbs目录下

cd $ORACLE_HOME/dbs

cp /tmp/pwdstandby.256.1170868583 orapwstdg11

三、配置监听

##主备库都改

cd /u01/app/oracle/product/12.1.0/dbhome_1/network/admin/

vi tnsnames.ora

standby=

 (DESCRIPTION =

   (ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.213.109)(PORT = 1521))

   (ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.213.110)(PORT = 1521))

   (CONNECT_DATA =

    (SERVER = DEDICATED)

    (SERVICE_NAME =standby)

    )

  )

primary=

 (DESCRIPTION =

   (ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.213.101)(PORT = 1521))

   (ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.213.102)(PORT = 1521))

   (CONNECT_DATA =

    (SERVER = DEDICATED)

    (SERVICE_NAME =primary)

    )

  )

测试

四、恢复库

4.1主库进行全库备份

[root@racstd1 ~]# mkdir -p /backup

[root@racstd1 ~]# chown -R oracle:oinstall /backup/

[root@racstd1 ~]#

su - oracle

[oracle@racstd1 ~]$ rman target /

Recovery Manager: Release 12.1.0.2.0 - Production on Fri Jun 7 09:21:11 2024

Copyright (c) 1982, 2014, Oracle and/or its affiliates.  All rights reserved.

connected to target database: STANDBY (DBID=1982604216)

RMAN>

run{

allocate channel c1 type disk;

allocate channel c2 type disk;

backup database format '/backup/data_%d_%T_%s_%p' tag 'data';

sql 'alter system archive log current';

backup archivelog all format='/backup/arch_%d_%T_%s_%p' tag 'arc';

backup current controlfile for standby format='/backup/ctl_%d_%T_%s_%p' tag 'cur';

release channel c1;

release channel c2;

}

4.2将主库备份传至备库

[oracle@racstd1 ~]$ cd /backup/

[oracle@racstd1 backup]$ ls

arch_STANDBY_20240607_5_1  arch_STANDBY_20240607_7_1  data_STANDBY_20240607_1_1  data_STANDBY_20240607_3_1

arch_STANDBY_20240607_6_1  ctl_STANDBY_20240607_8_1   data_STANDBY_20240607_2_1  data_STANDBY_20240607_4_1

[oracle@racstd1 backup]$ du -s *

55272   arch_STANDBY_20240607_5_1

47648   arch_STANDBY_20240607_6_1

12      arch_STANDBY_20240607_7_1

18848   ctl_STANDBY_20240607_8_1

877900  data_STANDBY_20240607_1_1

702140  data_STANDBY_20240607_2_1

18848   data_STANDBY_20240607_3_1

96      data_STANDBY_20240607_4_1

##目标端创建目录

[root@primary1 ~]# mkdir -p /backup

[root@primary1 ~]# chown -R oracle:oinstall /backup/

##传送备份到备库

[oracle@racstd1 backup]$ scp * oracle@192.168.213.101:/backup/

4.3备库恢复主库备份

[root@primary1 ~]# cd /backup/

[root@primary1 backup]# ls

arch_STANDBY_20240607_5_1  arch_STANDBY_20240607_7_1  data_STANDBY_20240607_1_1  data_STANDBY_20240607_3_1

arch_STANDBY_20240607_6_1  ctl_STANDBY_20240607_8_1   data_STANDBY_20240607_2_1  data_STANDBY_20240607_4_1

[root@primary1 ~]# su - oracle

[oracle@primary1 ~]$ export ORACLE_SID=stdg11

[oracle@primary1 ~]$ rman target /

Recovery Manager: Release 12.1.0.2.0 - Production on Fri Jun 7 09:38:49 2024

Copyright (c) 1982, 2014, Oracle and/or its affiliates.  All rights reserved.

connected to target database (not started)

RMAN> startup nomount

Oracle instance started

Total System Global Area    7532969984 bytes

Fixed Size                     2941920 bytes

Variable Size               1358957600 bytes

Database Buffers            6157238272 bytes

Redo Buffers                  13832192 bytes

RMAN>

restore standby controlfile from '/backup/ctl_STANDBY_20240607_8_1';

alter database mount;

catalog start with "/backup";

Run{

allocate channel c1 type disk;

allocate channel c2 type disk;

restore database;

switch datafile all;

switch tempfile all;

recover database;

release channel c1;

release channel c2;

}

开库

[oracle@primary1 dbs]$ sqlplus / as sysdba

SQL*Plus: Release 12.1.0.2.0 Production on Fri Jun 7 10:09:52 2024

Copyright (c) 1982, 2014, Oracle.  All rights reserved.

Connected to:

Oracle Database 12c Enterprise Edition Release 12.1.0.2.0 - 64bit Production

With the Partitioning, Real Application Clusters, Automatic Storage Management, OLAP,

Advanced Analytics and Real Application Testing options

SQL> select name,open_mode from v$database;

NAME      OPEN_MODE

--------- --------------------

STANDBY   MOUNTED

SQL> alter database open;

Database altered.

SQL> select name,open_mode from v$database;

NAME      OPEN_MODE

--------- --------------------

STANDBY   READ ONLY

1.1创建spfile标准化

SQL> create pfile='/tmp/initstdg11.ora' from spfile;

File created.

SQL>  create spfile='+DATA/PRIMARY/PARAMETERFILE/spfilestdg.ora' from pfile='/tmp/initstdg11.ora';

File created.

##asmcmd查看

[oracle@primary1 dbs]$ rm -f spfilestdg11.ora

[oracle@primary1 dbs]$ rm -f /tmp/initstdg11.ora

1.1.1修改一二节点pfile内容

[oracle@primary1 dbs]$ vi initstdg11.ora

spfile='+DATA/PRIMARY/PARAMETERFILE/spfilestdg.ora

[oracle@primary1 dbs]$ scp initstdg11.ora oracle@primary2:/u01/app/oracle/product/12.1.0/dbhome_1/dbs/initstdg12.ora

initstdg11.ora                                                                                                                     100%   52     0.1KB/s   00:00

[root@primary2 ~]# su - oracle

[oracle@primary2 ~]$ cd $ORACLE_HOME/dbs

[oracle@primary2 dbs]$ ls

hc_racpm2.dat  id_racpm2.dat  init.ora  initstdg12.ora

[oracle@primary2 dbs]$ cat initstdg12.ora

spfile='+DATA/PRIMARY/PARAMETERFILE/spfilestdg.ora'

1.2拷贝密码文件到asm

[root@primary1 tmp]# chmod 777 pwdstandby.256.1170868583

[root@primary1 tmp]# ls -ld pwdstandby.256.1170868583

-rwxrwxrwx 1 grid oinstall 7680 Jun  6 15:30 pwdstandby.256.1170868583

[root@primary1 tmp]#

ASMCMD> cp /tmp/pwdstandby.256.1170868583 orapwdprimary

copying /tmp/pwdstandby.256.1170868583 -> +data/primary/password/orapwdprimary

[root@primary1 tmp]# su - oracle

[oracle@primary1 ~]$ cd $ORACLE_HOME/dbs

[oracle@primary1 dbs]$ ls

hc_racpm1.dat  hc_stdg11.dat  id_racpm1.dat  init.ora  initstdg11.ora  initstd.ora  orapwstdg11  snapcf_stdg11.f

[oracle@primary1 dbs]$ rm -f orapwstdg11

五、注册服务

5.1环境变量配置

[oracle@primary1 ~]$ vi .bash_profile

export ORACLE_SID=stdg11

[oracle@primary1 ~]$ . .bash_profile

5.2改参数

[oracle@primary1 ~]$ sqlplus / as sysdba

SQL*Plus: Release 12.1.0.2.0 Production on Fri Jun 7 10:41:01 2024

Copyright (c) 1982, 2014, Oracle.  All rights reserved.

Connected to:

Oracle Database 12c Enterprise Edition Release 12.1.0.2.0 - 64bit Production

With the Partitioning, Real Application Clusters, Automatic Storage Management, OLAP,

Advanced Analytics and Real Application Testing options

SQL> shu immediate

Database closed.

Database dismounted.

ORACLE instance shut down.

SQL> startup mount

ORACLE instance started.

Total System Global Area 7532969984 bytes

Fixed Size                  2941920 bytes

Variable Size            1358957600 bytes

Database Buffers         6157238272 bytes

Redo Buffers               13832192 bytes

Database mounted.

SQL> show parameter cluster;

NAME                                 TYPE        VALUE

------------------------------------ ----------- ------------------------------

cluster_database                     boolean     FALSE

cluster_database_instances           integer     1

cluster_interconnects                string

alter system set cluster_database=true scope=spfile;

alter system set cluster_database_instances=2 scope=spfile;

SQL> shu immediate

ORA-01109: database not open

Database dismounted.

ORACLE instance shut down.

5.3增加服务

srvctl add database -db primary -dbname standby -oraclehome /u01/app/oracle/product/12.1.0/dbhome_1 -dbtype RAC -role PHYSICAL_STANDBY

srvctl add instance -db primary -instance stdg11 -node primary1 

srvctl add instance -db primary -instance stdg12 -node primary2 

srvctl modify database -db primary -spfile '+DATA/PRIMARY/PARAMETERFILE/spfilestdg.ora' -pwfile '+DATA/PRIMARY/PASSWORD/orapwdprimary'

srvctl modify database -db primary -diskgroup ARCH,DATA

srvctl config database -d primary

srvctl start database -db primary -startoption open

六、备库应用日志

6.1查看主备库状态

select DBID,NAME,OPEN_MODE,PROTECTION_MODE,PROTECTION_LEVEL,DATAGUARD_BROKER,DB_UNIQUE_NAME from v$database;

select INST_ID,INSTANCE_NUMBER,INSTANCE_NAME,STATUS,DATABASE_STATUS,INSTANCE_ROLE from gv$instance;

主库是读写

开启flashback

SQL> select open_mode,flashback_on from v$database;

OPEN_MODE            FLASHBACK_ON

-------------------- ------------------

READ ONLY            NO

SQL> alter database flashback on;

Database altered.

SQL> select open_mode,flashback_on from v$database;

OPEN_MODE            FLASHBACK_ON

-------------------- ------------------

READ ONLY            YES

SQL> select process,status,sequence#,THREAD# from v$managed_standby where PROCESS='MRP0';

no rows selected

6.2开启日志应用

SQL> alter database recover managed standby database disconnect from session;

Database altered.

SQL> select process,status,sequence#,THREAD# from v$managed_standby where PROCESS='MRP0';

PROCESS   STATUS        SEQUENCE#    THREAD#

--------- ------------ ---------- ----------

MRP0      WAIT_FOR_LOG         28          2

SQL> select process,status,sequence#,THREAD# from v$managed_standby where PROCESS='MRP0';

##最大性能模式半同步状态正常

PROCESS   STATUS        SEQUENCE#    THREAD#

--------- ------------ ---------- ----------

MRP0      WAIT_FOR_LOG         28          2

6.2验证同步状态

主库切日志

SQL> alter system switch logfile;

System altered.

备库观察日志

备库可以马上应用到日志说明同步无问题

主库查看sequence

SQL> select sequence#,applied from v$archived_log order by sequence# asc;

备库查看sequence

主备库sequence一致 同步正常

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

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

相关文章

Mysql基础 - 事务

Mysql基础 - 事务 文章目录 Mysql基础 - 事务1 事务简介2 事务操作2.1 控制事务一2.2 控制事务二 3 事务四大特性4 并发事务问题5 事务隔离级别 1 事务简介 事务是一组操作的集合,他是一个不可分割的工作单位,事务会把所有操作作为一个整体一起向系统提…

Word中插入Mathtype右编号,调整公式与编号的位置

当你已经将mathtype内置于word后,可以使用右编号快速插入公式 但是往往会出现公式和编号出现的位置或之间的距离不合适 比如我在双栏下插入公式,会发现插入的公式与编号是适用于单栏的 解决办法: 开始->样式->MTDisplayLquation -&g…

力扣刷题--728. 自除数【简单】

题目描述 自除数 是指可以被它包含的每一位数整除的数。 例如,128 是一个 自除数 ,因为 128 % 1 0,128 % 2 0,128 % 8 0。 自除数 不允许包含 0 。 给定两个整数 left 和 right ,返回一个列表,列表的…

MySQL之查询性能优化(七)

查询性能优化 排序优化 无论如何排序都是一个成本很高的操作,所以从性能角度考虑,应尽可能避免排序或者尽可能避免对大量数据进行排序。前面已经提到了,当不能使用索引生成排序结果的时候,MySQL需要自己进行排序,如果…

02-JAVA面向对象编程

一、面向对象编程 1、面向过程编程思想(Process Oritented Programming) 将实现一个功能的一组指令组合在一起,成为一个函数。这个函数就能实现这一个功能,是对功能实现的一种抽象。通过这种抽象方式,将代码实现复用。…

Jmeter分布式、测试报告、并发数计算、插件添加方式、常用图表

Jmeter分布式 应用场景 当单个测试机无法模拟用户要求的业务场景时,可以使用多台测试机进行模拟,就是Jmeter的分布 式测试。 Jmeter分布式执行原理 Jmeter分布测试时,选择其中一台作为控制机(Controller)&#xff0c…

Python框架scrapy有什么天赋异禀

Scrapy框架与一般的爬虫代码之间有几个显著的区别,这些差异主要体现在设计模式、代码结构、执行效率以及可扩展性等方面。下面是一些关键的不同点: 结构化与模块化: Scrapy:提供了高度结构化的框架,包括定义好的Spider…

【InternLM实战营第二期笔记】07:OpenCompass :是骡子是马,拉出来溜溜

文章目录 课程实操 课程 评测的意义是什么呢?我最近也在想。看到这节开头的内容后忽然有个顿悟:如果大模型最终也会变成一种基础工具(类比软件),稳定或可预期的效果需要先于用户感知构建出来,评测 case 就…

jquery.datetimepicker无法添加清除按钮的问题

项目场景: 自从决定用现有新技术实现CRM老项目起,就开始了我的折腾之路,最近一直在折腾前端页面,不像后端Java,写的有问题运行会报错,大多数报错一搜就能找到解决方案,前端这个倒好&#xff0c…

《TCP/IP网络编程》(第十四章)多播与广播

当需要向多个用户发送多媒体信息时,如果使用TCP套接字,则需要维护与用户数量相等的套接字;如果使用之前学习的UDP,传输次数也需要和用户数量相同。 所以为了解决这些问题,可以采用多播和广播技术,这样只需要…

storage存储模块-vuex持久化处理

1:存储登录用户信息到vuex中 在store文件夹下面,创建modules文件夹在文件夹下创建user.js文件 user.js文件 const state {userInfo: {userId: ,token: } } const mutations {setUserInfo (state, obj) {console.info(obj)state.userInfo.userId obj…

字符串常量简单介绍

C/C内存四区介绍 如前文所示,字符串常量存储在静态存储区的字符串常量区,这样做的好处是 当程序使用到多个相同的字符串常量时,实际上都是使用的同一份,这样就可以减小程序的体积。注意字符串常量是只读的不能被修改。 如图所示&…

通用信息提取数据预处理

train_data./datasets/duuie output_folder./datasets/duuie_pre ignore_datasets["DUEE", "DUEE_FIN_LITE"] schema_folder./datasets/seen_schema # 对CCKS2022 竞赛数据进行预处理 import shutil # shutil.copytree(train_data,output_folder) impor…

「网络原理」三次握手四次挥手

🎇个人主页:Ice_Sugar_7 🎇所属专栏:计网 🎇欢迎点赞收藏加关注哦! 三次握手&四次挥手 🍉连接管理🍌三次握手🍌意义🍌四次挥手🍌TCP 状态转换…

电路防护-贴片陶瓷气体放电管

贴片陶瓷气体放电管 GDT工作原理GDT主要特性参数典型电路压敏电阻与 TVS 管的区别 GDT工作原理 陶瓷气体放电管是一种电子器件,其工作原理基于气体放电现象。这种管子的内部填充了一种特定的气体,通常是氖气或氩气。当管子两端施加足够的电压时&#xf…

vue3-使用富文本编辑器-wangEditor-文章发表1

最近在搞项目:我们组内几位成员正在搞一个网站搭建,以后更新会比较缓慢 引言:如果要网站要用的富文本编辑器的话,这边推荐用wangEditor 官网地址传送 : wangEditorhttps://www.wangeditor.com/ 我现在还在扩展我的写文章用的富文本编辑器 现在我将简单介绍一下其基本使用方…

Python的return和yield,哪个是你的菜?

目录 1、return基础介绍 📚 1.1 return用途:数据返回 1.2 return执行:函数终止 1.3 return深入:无返回值情况 2、yield核心概念 🍇 2.1 yield与迭代器 2.2 生成器函数构建 2.3 yield的暂停与续行特性 3、retur…

在 Android App 里使用 C 代码 - NDK

原生开发套件 (NDK) 是一套工具,使能够在 Android 应用中使用 C 和 C 代码,并提供众多平台库,可使用这些平台库管理原生 activity 和访问实体设备组件,例如传感器和触控输入。 NDK 可能不适合大多数 Android 编程初学者&#xff…

使用 Jetpack Compose 实现 Android 偏好设置分类界面

使用 Jetpack Compose 实现 Android 偏好设置分类界面 Jetpack Compose 提供了一种现代且声明式的构建 Android 用户界面的方法,使其非常适合实现偏好设置分类界面。以下是如何实现的逐步指南: 1. 定义数据模型: 首先,定义数据模型来表示…

集成学习模型对比优化—银行业务

1.Data Understanding 2.Data Exploration 3.Data Preparation 4.Training Models 5.Optimization Model 集成学习模型对比优化—银行业务 1.Data Understanding import pandas as pd from matplotlib import pyplot as plt import seaborn as sns df pd.read_csv(&quo…