Oracle RMAN Recover中使用BBED 跳过缺失的归档恢复测试

2023-12-07 04:48

本文主要是介绍Oracle RMAN Recover中使用BBED 跳过缺失的归档恢复测试,希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!

一.测试场景

Oracle RMAN 备份的恢复分2个步骤:RESTROE 和 RECOVER。
在这个过程中,Recover 是依赖与归档文件的。
假设一种情况:周一对数据库做了全备,然后保留归档。周四发现数据库有异常,准备恢复,发现周二的时候少了一个归档。 
按照正常的情况,我们只能将数据库恢复到周二缺失归档的之前的点。
这里测试,如何跳过这个缺失的归档,让数据库继续进行Recover。
根据测试结果,Recover 是可以继续,但是测试的结果意义不是很大,因为还是有数据丢失。
二、测试步骤
1.测试环境:
OS:Centos6.8
数据库:11.2.0.4
2.使用RMAN 全备数据库

cebpm:/home/oracle@cebpm>rman target /Recovery Manager: Release 11.2.0.4.0 - Production on Wed Jan 10 09:10:31 2018Copyright (c) 1982, 2011, Oracle and/or its affiliates.  All rights reserved.connected to target database: CEBPM (DBID=3677012495)RMAN> backup database format '/data/backup/cebpm/fullback/bak_U%';Starting backup at 2018/01/10 09:11:00
using target database control file instead of recovery catalog
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=48 device type=DISK
channel ORA_DISK_1: starting full datafile backup set
channel ORA_DISK_1: specifying datafile(s) in backup set
input datafile file number=00001 name=/data/CEBPM/datafile/o1_mf_system_dm1flxkw_.dbf
input datafile file number=00002 name=/data/CEBPM/datafile/o1_mf_sysaux_dm1fnw5v_.dbf
input datafile file number=00003 name=/data/CEBPM/datafile/o1_mf_undotbs1_dm1foow9_.dbf
input datafile file number=00005 name=/data/CEBPM/datafile/test01.dbf
input datafile file number=00004 name=/data/CEBPM/datafile/o1_mf_users_dm1fqcrp_.dbf
channel ORA_DISK_1: starting piece 1 at 2018/01/10 09:11:02
channel ORA_DISK_1: finished piece 1 at 2018/01/10 09:12:18
piece handle=/data/backup/cebpm/fullback/bak_U% tag=TAG20180110T091102 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:01:16
Finished backup at 2018/01/10 09:12:18Starting Control File and SPFILE Autobackup at 2018/01/10 09:12:18
piece handle=/data/backup/cebpm/ctlbackup/control_c-3677012495-20180110-01 comment=NONE
Finished Control File and SPFILE Autobackup at 2018/01/10 09:12:20
3.创建测试表test并切换归档

09:16:01 SQL>  create table test (id int,times date);Table created.09:16:15 SQL> insert into test values(1,sysdate);1 row created.09:16:36 SQL> commit;Commit complete.09:16:38 SQL> select sequence# from v$log;SEQUENCE#
----------453
09:17:46 SQL> alter system archive log current;System altered.09:18:29 SQL> select sequence# from v$log;SEQUENCE#
----------45609:18:43 SQL> insert into test values(2,sysdate);1 row created.09:19:08 SQL> commit;Commit complete.09:19:11 SQL> alter system archive log current;System altered.09:19:22 SQL> select sequence# from v$log;SEQUENCE#
----------756
4.删除6的归档

cebpm:/data/CEBPM/archivelog@cebpm>ll
总用量 35132
-rw-r-----. 1 oracle dba   100864 12月 13 11:05 1_125_945593423.arc
-rw-r-----. 1 oracle dba     1024 12月 13 11:05 1_126_945593423.arc
-rw-r-----. 1 oracle dba   284672 12月 13 11:06 1_127_945593423.arc
-rw-r-----. 1 oracle dba   196096 12月 13 11:06 1_129_945593423.arc
-rw-r-----. 1 oracle dba  9365504 1月   5 07:35 1_1_962622394.arc
-rw-r-----. 1 oracle dba 17507328 1月  10 08:17 1_2_962622394.arc
-rw-r-----. 1 oracle dba  6851072 1月  10 08:53 1_3_962622394.arc
-rw-r-----. 1 oracle dba  1241600 1月  10 09:03 1_4_962622394.arc
-rw-r-----. 1 oracle dba   399872 1月  10 09:18 1_5_962622394.arc
-rw-r-----. 1 oracle dba     2048 1月  10 09:19 1_6_962622394.arc
-rw-r-----. 1 oracle dba     2048 1月  10 09:19 1_7_962622394.arc
cebpm:/data/CEBPM/archivelog@cebpm>rm -rf 1_6_962622394.arc 

5.然后restore和recover 操作

SQL> shutdown immediate
Database closed.
Database dismounted.
ORACLE instance shut down.
SQL> startup mount;
ORACLE instance started.Total System Global Area  688959488 bytes
Fixed Size		    2256432 bytes
Variable Size		  566231504 bytes
Database Buffers	  117440512 bytes
Redo Buffers		    3031040 bytes
Database mounted.
cebpm:/home/oracle@cebpm>rman target /Recovery Manager: Release 11.2.0.4.0 - Production on Wed Jan 10 09:21:39 2018Copyright (c) 1982, 2011, Oracle and/or its affiliates.  All rights reserved.connected to target database: CEBPM (DBID=3677012495, not open)RMAN> restore database;Starting restore at 2018/01/10 09:21:51
using target database control file instead of recovery catalog
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=20 device type=DISKchannel ORA_DISK_1: starting datafile backup set restore
channel ORA_DISK_1: specifying datafile(s) to restore from backup set
channel ORA_DISK_1: restoring datafile 00001 to /data/CEBPM/datafile/o1_mf_system_dm1flxkw_.dbf
channel ORA_DISK_1: restoring datafile 00002 to /data/CEBPM/datafile/o1_mf_sysaux_dm1fnw5v_.dbf
channel ORA_DISK_1: restoring datafile 00003 to /data/CEBPM/datafile/o1_mf_undotbs1_dm1foow9_.dbf
channel ORA_DISK_1: restoring datafile 00004 to /data/CEBPM/datafile/o1_mf_users_dm1fqcrp_.dbf
channel ORA_DISK_1: restoring datafile 00005 to /data/CEBPM/datafile/test01.dbf
channel ORA_DISK_1: reading from backup piece /data/backup/cebpm/fullback/bak_1msoagpe_1_1
channel ORA_DISK_1: piece handle=/data/backup/cebpm/fullback/bak_1msoagpe_1_1 tag=TAG20180110T091317
channel ORA_DISK_1: restored backup piece 1
channel ORA_DISK_1: restore complete, elapsed time: 00:01:15
Finished restore at 2018/01/10 09:23:07RMAN> recover database;Starting recover at 2018/01/10 09:23:49
using channel ORA_DISK_1starting media recoveryarchived log for thread 1 with sequence 5 is already on disk as file /data/CEBPM/archivelog/1_5_962622394.arc
archived log for thread 1 with sequence 7 is already on disk as file /data/CEBPM/archivelog/1_7_962622394.arc
RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-03002: failure of recover command at 01/10/2018 09:23:50
RMAN-06053: unable to perform media recovery because of missing log
RMAN-06025: no backup of archived log for thread 1 with sequence 6 and starting SCN of 1070624 found to restore
这个6是我们刚才手工删掉的归档。如果这个不搞定,后面没办法恢复。


6.BBED 修改SCN

(1)修改原理说明

System Checkpoint SCN:
SQL> select checkpoint_change# from v$database;CHECKPOINT_CHANGE#
------------------1070928
Datafile CheckpointSCN:
SQL> select name,checkpoint_change# from v$datafile;NAME							     CHECKPOINT_CHANGE#
------------------------------------------------------------ ------------------
/data/CEBPM/datafile/o1_mf_system_dm1flxkw_.dbf 			1070928
/data/CEBPM/datafile/o1_mf_sysaux_dm1fnw5v_.dbf 			1070928
/data/CEBPM/datafile/o1_mf_undotbs1_dm1foow9_.dbf			1070928
/data/CEBPM/datafile/o1_mf_users_dm1fqcrp_.dbf				1070928
/data/CEBPM/datafile/test01.dbf 					1070928
START SCN:
SQL> select name,checkpoint_change# from v$datafile_header;NAME							     CHECKPOINT_CHANGE#
------------------------------------------------------------ ------------------
/data/CEBPM/datafile/o1_mf_system_dm1flxkw_.dbf 			1070427
/data/CEBPM/datafile/o1_mf_sysaux_dm1fnw5v_.dbf 			1070427
/data/CEBPM/datafile/o1_mf_undotbs1_dm1foow9_.dbf			1070427
/data/CEBPM/datafile/o1_mf_users_dm1fqcrp_.dbf				1070427
/data/CEBPM/datafile/test01.dbf 					1070427


在数据库启动过程中,当SystemCheckpoint SCN、Datafile Checkpoint SCN和Start SCN号都相同时,数据库可以正常启动,不需要做media recovery.三者当中有一个不同时,则需要做media recovery。
如果在启动的过程中,EndSCN号为NULL,则需要做instance recovery。ORACLE在启动过程中首先检查是否需要media recovery,然后再检查是否需要instance recovery。

在进行recovery的时候,我们根据归档,推进START SCN,但是归档缺失,导致无法推荐,数据库也无法启动。
我们这里缺失的是6的归档,我们只需要手工的修改datafile header,让数据库认为这个归档已经恢复了,即可。 这是一种欺骗行为,虽然可以继续,但还是会出现问题。
可以使用如下方法确定具体缺失的归档SCN,然后使用BBED 跳过这些SCN 即可

select sequence#,first_change#,next_change# from v$archived_log;SEQUENCE# FIRST_CHANGE# NEXT_CHANGE#
---------- ------------- ------------94	  886923       88711295	  887112       88770196	  887701       88778197	  887781       88791798	  887917       88833699	  888336       88844585	  882971       88368786	  883687       884020102	  889538       889754102	  889538       889754103	  889754       889770SEQUENCE# FIRST_CHANGE# NEXT_CHANGE#
---------- ------------- ------------103	  889754       889770104	  889770       889779104	  889770       889779105	  889779       889784105	  889779       889784106	  889784       889806106	  889784       889806107	  889806       890028107	  889806       890028108	  890028       894208108	  890028       894208SEQUENCE# FIRST_CHANGE# NEXT_CHANGE#
---------- ------------- ------------109	  894208       894296109	  894208       894296110	  894296       910788110	  894296       910788111	  910788       910887111	  910788       910887112	  910887       934551113	  934551       934580112	  910887       934551113	  934551       934580114	  934580       934864SEQUENCE# FIRST_CHANGE# NEXT_CHANGE#
---------- ------------- ------------114	  934580       934864115	  934864       936779116	  936779       936788117	  936788       939244119	  977459       977469118	  939244       977459120	  977469       986086121	  986086       986095122	  986095       987949123	  987949       987957124	  987957      1008998SEQUENCE# FIRST_CHANGE# NEXT_CHANGE#
---------- ------------- ------------125	 1008998      1009546126	 1009546      1009554127	 1009554      1010197128	 1010197      1010205125	 1008998      1009546126	 1009546      1009554127	 1009554      1010197129	 1010205      10107381	 1010058      10411702	 1041170      10669423	 1066942      1069309SEQUENCE# FIRST_CHANGE# NEXT_CHANGE#
---------- ------------- ------------4	 1069309      10696865	 1069686      1070624 6	 1070624      10706467	 1070646      1070658103 rows selected.
这个正好与我们之前RMAN 错误一致:

archived log for thread 1 with sequence 5 is already on disk as file /data/CEBPM/archivelog/1_5_962622394.arc
archived log for thread 1 with sequence 7 is already on disk as file /data/CEBPM/archivelog/1_7_962622394.arc
RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-03002: failure of recover command at 01/10/2018 09:23:50
RMAN-06053: unable to perform media recovery because of missing log
RMAN-06025: no backup of archived log for thread 1 with sequence 6 and starting SCN of 1070624 found to restore
(2)使用BBED 推进所有DATAFILE  header SCN

关于BBED安装配置请参考:

http://blog.csdn.net/shiyu1157758655/article/details/56279479

这里,我们只修改kscnbas的值:
kscnbas (at offset 484) - SCN of lastchange to the datafile.

cebpm:/home/oracle@cebpm>bbed parfile=/home/oracle/bbed_parameter.txt 
Password: BBED: Release 2.0.0.0.0 - Limited Production on Wed Jan 10 09:44:16 2018Copyright (c) 1982, 2011, Oracle and/or its affiliates.  All rights reserved.************* !!! For Oracle Internal Use only !!! ***************BBED> info File#  Name                                                        Size(blks)-----  ----                                                        ----------1  /data/CEBPM/datafile/o1_mf_system_dm1flxkw_.dbf                  896002  /data/CEBPM/datafile/o1_mf_sysaux_dm1fnw5v_.dbf                  768003  /data/CEBPM/datafile/o1_mf_undotbs1_dm1foow9_.dbf                371204  /data/CEBPM/datafile/o1_mf_users_dm1fqcrp_.dbf                     6405  /data/CEBPM/datafile/test01.dbf                                   1280
我们需要将所有datafile 的SCN从1070624 推到1070646

SQL> select to_char(1070646,'xxxxxxxxx') from dual;TO_CHAR(10
----------105636
因此我们的kscnbas 的新值是:0x00105636。
但是注意,对于little-endian的format,他存储是先存储低位的,因此实际block 存储的是:36561000.
我们需要使用BBED 将所有datafileheader 的@484 的值修改成:36561000。

BBED> d /v dba 1,1 offset 484File: /data/CEBPM/datafile/o1_mf_system_dm1flxkw_.dbf (1)Block: 1       Offsets:  484 to  995  Dba:0x00400001
-------------------------------------------------------5b551000 00000000 2e438539 01000000 l [U.......C.9....05000000 b9020000 10000000 02000000 l ....1...........00000000 00000000 00000000 00000000 l ................00000000 00000000 00000000 00000000 l ................00000000 00000000 00000000 00000000 l ................00000000 00000000 00000000 00000000 l ................00000000 00000000 00000000 00000000 l ................00000000 00000000 00000000 00000000 l ................00000000 00000000 00000000 00000000 l ................00000000 00000000 00000000 00000000 l ................0d000d00 0d000100 00000000 00000000 l ................00000000 02004000 504d0e00 00000000 l ......@.PM......00000000 00000000 00000000 00000000 l ................00000000 00000000 00000000 00000000 l ................00000000 00000000 00000000 00000000 l ................00000000 00000000 00000000 00000000 l ................00000000 00000000 00000000 00000000 l ................00000000 00000000 00000000 00000000 l ................00000000 00000000 00000000 0217f375 l ..............5cbea959 0e00be60 e9a26afe 9b000000 l \??Y..?`顪t....00000000 00000000 00000000 00000000 l ................00000000 00300000 00000000 003a1817 l .....0.......:..f6ca8655 2395b099 11bffb0e e9010600 l ??#.°..???.a3f10f00 00000000 00000000 00000000 l £??...........00000000 00000000 00000000 00000000 l ................00000000 00000000 00000000 00000000 l ................00000000 00000000 00000000 00000000 l ................00000000 00000000 00000000 00000000 l ................00000000 00000000 00000000 00000000 l ................00000000 00000000 00000000 00000000 l ................00000000 00000000 00000000 00000000 l ................00000000 00000000 00000000 00000000 l ................<16 bytes per line>BBED> modify /x 3656 dba 1,1 offset 484File: /data/CEBPM/datafile/o1_mf_system_dm1flxkw_.dbf (1)Block: 1                Offsets:  484 to  995           Dba:0x00400001
------------------------------------------------------------------------36561000 00000000 2e438539 01000000 05000000 b9020000 10000000 02000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 0d000d00 0d000100 00000000 00000000 00000000 02004000 504d0e00 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 0217f375 5cbea959 0e00be60 e9a26afe 9b000000 00000000 00000000 00000000 00000000 00000000 00300000 00000000 003a1817 f6ca8655 2395b099 11bffb0e e9010600 a3f10f00 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 <32 bytes per line>BBED> sum dba 1,1 apply
Check value for File 1, Block 1:
current = 0xf385, required = 0xf385
按照同样的步骤,把剩下的4个datafile都修改

最终结果如下:

SQL>  select file#,checkpoint_change#,status from v$datafile_header;FILE# CHECKPOINT_CHANGE# STATUS
---------- ------------------ -------1	      1070646 ONLINE2	      1070646 ONLINE3	      1070646 ONLINE4	      1070646 ONLINE5	      1070646 ONLINE
这里的datafile 的SCN 都跳过了我们缺失的归档,我们可以继续进行recover了。
(3)重新recover

RMAN> recover database;Starting recover at 2018/01/10 13:09:33
using channel ORA_DISK_1starting media recovery
media recovery failed
RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-03002: failure of recover command at 01/10/2018 13:09:57
ORA-00283: recovery session canceled due to errors
RMAN-11003: failure during parse/execution of SQL statement: alter database recover if neededstart
ORA-00283: recovery session canceled due to errors
ORA-00600: internal error code, arguments: [3020], [3], [34370], [12617282], [], [], [], [], [], [], [], []
ORA-10567: Redo is inconsistent with data block (file# 3, block# 34370, file offset is 281559040 bytes)
ORA-10564: tablespace UNDOTBS1
ORA-01110: data file 3: '/data/CEBPM/datafile/o1_mf_undotbs1_dm1foow9_.dbf'
ORA-10560: block type 'KTU UNDO BLOCK'
根据官网的说明,我们这是UNDO 表空间恢复无法继续了,详见:

Resolving ORA-600[3020] Raised During Recovery (文档 ID 361172.1)
尝试跳过坏块测试:

RMAN>  recover database allow 50  corruption;Starting recover at 2018/01/10 13:10:33
using channel ORA_DISK_1starting media recovery
media recovery complete, elapsed time: 00:00:02Finished recover at 2018/01/10 13:10:36
恢复是没有问题,但是打开是有问题的:

SQL> alter database open;
alter database open
*
ERROR at line 1:
ORA-01092: ORACLE instance terminated. Disconnection forced
ORA-01578: ORACLE data block corrupted (file # 3, block # 128)
ORA-01110: data file 3: '/data/CEBPM/datafile/o1_mf_undotbs1_dm1foow9_.dbf'
Process ID: 7040
Session ID: 21 Serial number: 35
(4)重建UNDO 表空间
这里里面的 3 就是我们的undo 表空间,我们把重新创建一个UNDO 在拉起数据库:

修改pfile:

SQL> create pfile from spfile;
cebpm:/data/CEBPM/archivelog@cebpm>vi /u01/app/oracle/product/11.2.0/db_1/dbs/initcebpm.ora
修改如下:
#*.undo_tablespace='UNDOTBS1'
*.undo_management='MANUAL'
*.rollback_segments='SYSTEM'
利用修改之后的pfile,重启数据库

SQL> startup pfile='/u01/app/oracle/product/11.2.0/db_1/dbs/initcebpm.ora';
ORACLE instance started.Total System Global Area  688959488 bytes
Fixed Size		    2256432 bytes
Variable Size		  545259984 bytes
Database Buffers	  138412032 bytes
Redo Buffers		    3031040 bytes
Database mounted.
Database opened.
删除原来的表空间,创建新的UNDO 表空间

SQL> select tablespace_name from dba_tablespaces;TABLESPACE_NAME
------------------------------
SYSTEM
SYSAUX
UNDOTBS1
TEMP
USERS
TEST6 rows selected.SQL> select name from v$datafile;NAME
--------------------------------------------------------------------------------
/data/CEBPM/datafile/o1_mf_system_dm1flxkw_.dbf
/data/CEBPM/datafile/o1_mf_sysaux_dm1fnw5v_.dbf
/data/CEBPM/datafile/o1_mf_undotbs1_dm1foow9_.dbf
/data/CEBPM/datafile/o1_mf_users_dm1fqcrp_.dbf
/data/CEBPM/datafile/test01.dbfSQL> drop tablespace UNDOTBS1;Tablespace dropped.SQL> create undo tablespace UNDOTBS1 datafile '/data/CEBPM/datafile/undotbs01.dbf' size 100M autoextend on next 32M maxsize  unlimited;Tablespace created.
关闭数据库,修改pfile参数,然后用新的pfile创建spfile,在正常启动数据库。
*.undo_tablespace='UNDOTBS1'
#*.undo_management='MANUAL'
#*.rollback_segments='SYSTEM'
SQL> shutdown immediate
Database closed.
Database dismounted.
ORACLE instance shut down.
SQL> create spfile from pfile;File created.SQL> startup
ORACLE instance started.Total System Global Area  688959488 bytes
Fixed Size		    2256432 bytes
Variable Size		  566231504 bytes
Database Buffers	  117440512 bytes
Redo Buffers		    3031040 bytes
Database mounted.
Database opened.
(5)验证

SQL> col name for a60
SQL> select name,checkpoint_change# from v$datafile;NAME							     CHECKPOINT_CHANGE#
------------------------------------------------------------ ------------------
/data/CEBPM/datafile/o1_mf_system_dm1flxkw_.dbf 			1131748
/data/CEBPM/datafile/o1_mf_sysaux_dm1fnw5v_.dbf 			1131748
/data/CEBPM/datafile/undotbs01.dbf					1131748
/data/CEBPM/datafile/o1_mf_users_dm1fqcrp_.dbf				1131748
/data/CEBPM/datafile/test01.dbf 					1131748SQL> select name,checkpoint_change# from v$datafile_header;NAME							     CHECKPOINT_CHANGE#
------------------------------------------------------------ ------------------
/data/CEBPM/datafile/o1_mf_system_dm1flxkw_.dbf 			1131748
/data/CEBPM/datafile/o1_mf_sysaux_dm1fnw5v_.dbf 			1131748
/data/CEBPM/datafile/undotbs01.dbf					1131748
/data/CEBPM/datafile/o1_mf_users_dm1fqcrp_.dbf				1131748
/data/CEBPM/datafile/test01.dbf 					1131748SQL> select checkpoint_change# from v$database;CHECKPOINT_CHANGE#
------------------1131748SQL> conn test/test
Connected.
SQL> select * from test;ID TIMES
---------- ---------1 10-JAN-18
如上我们数据库已经正常启动,但是测试表里之前是有2条数据,由于跳过丢失的归档现在只有1条数据。





这篇关于Oracle RMAN Recover中使用BBED 跳过缺失的归档恢复测试的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!



http://www.chinasem.cn/article/464528

相关文章

性能测试介绍

性能测试是一种测试方法,旨在评估系统、应用程序或组件在现实场景中的性能表现和可靠性。它通常用于衡量系统在不同负载条件下的响应时间、吞吐量、资源利用率、稳定性和可扩展性等关键指标。 为什么要进行性能测试 通过性能测试,可以确定系统是否能够满足预期的性能要求,找出性能瓶颈和潜在的问题,并进行优化和调整。 发现性能瓶颈:性能测试可以帮助发现系统的性能瓶颈,即系统在高负载或高并发情况下可能出现的问题

中文分词jieba库的使用与实景应用(一)

知识星球:https://articles.zsxq.com/id_fxvgc803qmr2.html 目录 一.定义: 精确模式(默认模式): 全模式: 搜索引擎模式: paddle 模式(基于深度学习的分词模式): 二 自定义词典 三.文本解析   调整词出现的频率 四. 关键词提取 A. 基于TF-IDF算法的关键词提取 B. 基于TextRank算法的关键词提取

使用SecondaryNameNode恢复NameNode的数据

1)需求: NameNode进程挂了并且存储的数据也丢失了,如何恢复NameNode 此种方式恢复的数据可能存在小部分数据的丢失。 2)故障模拟 (1)kill -9 NameNode进程 [lytfly@hadoop102 current]$ kill -9 19886 (2)删除NameNode存储的数据(/opt/module/hadoop-3.1.4/data/tmp/dfs/na

Hadoop数据压缩使用介绍

一、压缩原则 (1)运算密集型的Job,少用压缩 (2)IO密集型的Job,多用压缩 二、压缩算法比较 三、压缩位置选择 四、压缩参数配置 1)为了支持多种压缩/解压缩算法,Hadoop引入了编码/解码器 2)要在Hadoop中启用压缩,可以配置如下参数

Makefile简明使用教程

文章目录 规则makefile文件的基本语法:加在命令前的特殊符号:.PHONY伪目标: Makefilev1 直观写法v2 加上中间过程v3 伪目标v4 变量 make 选项-f-n-C Make 是一种流行的构建工具,常用于将源代码转换成可执行文件或者其他形式的输出文件(如库文件、文档等)。Make 可以自动化地执行编译、链接等一系列操作。 规则 makefile文件

字节面试 | 如何测试RocketMQ、RocketMQ?

字节面试:RocketMQ是怎么测试的呢? 答: 首先保证消息的消费正确、设计逆向用例,在验证消息内容为空等情况时的消费正确性; 推送大批量MQ,通过Admin控制台查看MQ消费的情况,是否出现消费假死、TPS是否正常等等问题。(上述都是临场发挥,但是RocketMQ真正的测试点,还真的需要探讨) 01 先了解RocketMQ 作为测试也是要简单了解RocketMQ。简单来说,就是一个分

使用opencv优化图片(画面变清晰)

文章目录 需求影响照片清晰度的因素 实现降噪测试代码 锐化空间锐化Unsharp Masking频率域锐化对比测试 对比度增强常用算法对比测试 需求 对图像进行优化,使其看起来更清晰,同时保持尺寸不变,通常涉及到图像处理技术如锐化、降噪、对比度增强等 影响照片清晰度的因素 影响照片清晰度的因素有很多,主要可以从以下几个方面来分析 1. 拍摄设备 相机传感器:相机传

电脑桌面文件删除了怎么找回来?别急,快速恢复攻略在此

在日常使用电脑的过程中,我们经常会遇到这样的情况:一不小心,桌面上的某个重要文件被删除了。这时,大多数人可能会感到惊慌失措,不知所措。 其实,不必过于担心,因为有很多方法可以帮助我们找回被删除的桌面文件。下面,就让我们一起来了解一下这些恢复桌面文件的方法吧。 一、使用撤销操作 如果我们刚刚删除了桌面上的文件,并且还没有进行其他操作,那么可以尝试使用撤销操作来恢复文件。在键盘上同时按下“C

pdfmake生成pdf的使用

实际项目中有时会有根据填写的表单数据或者其他格式的数据,将数据自动填充到pdf文件中根据固定模板生成pdf文件的需求 文章目录 利用pdfmake生成pdf文件1.下载安装pdfmake第三方包2.封装生成pdf文件的共用配置3.生成pdf文件的文件模板内容4.调用方法生成pdf 利用pdfmake生成pdf文件 1.下载安装pdfmake第三方包 npm i pdfma

零基础学习Redis(10) -- zset类型命令使用

zset是有序集合,内部除了存储元素外,还会存储一个score,存储在zset中的元素会按照score的大小升序排列,不同元素的score可以重复,score相同的元素会按照元素的字典序排列。 1. zset常用命令 1.1 zadd  zadd key [NX | XX] [GT | LT]   [CH] [INCR] score member [score member ...]