oracle exp 00006,Oracle 12.1新特性----使用RMAN从备份中实现recover table

Oracle 12.1新特性----使用RMAN从备份中实现recover table

发布时间:2020-06-26 19:41:44

来源:51CTO

阅读:4750

作者:hbxztc

在Oracle12c版本之前,使用RMAN能恢复的级别为数据库级别和表空间级别,如果只有一张表需要恢复,而在数据库级别或表空间级别做恢复,影响范围就太大了。因此12.2版本中提供了一个新特性使用RMAN在表级别做恢复,并且恢复过程中不影响数据库的正常使用。这一功能不仅可以恢复表,还可以恢复表分区。

To recover a table or table partition, you must have a full backup of undo, SYSTEM, SYSAUX, and the tablespace that contains the table or table partition.

使用recover table的一些限制条件:

When you use the RECOVER command to recover tables or table partitions contained in an RMAN backup, the following limitations exist.Tables and table partitions belonging to SYS schema cannot be recovered.

Tables and table partitions from SYSTEM and SYSAUX tablespaces cannot be recovered.

Tables and table partitions on standby databases cannot be recovered.

Tables with named NOT NULL constraints cannot be recovered with the REMAP option.

下面在12.2版本上做表级别恢复的实验sys@ORA12C>select * from v$version;

BANNER     CON_ID

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

Oracle Database 12c Enterprise Edition Release 12.2.0.1.0 - 64bit Production  0

PL/SQL Release 12.2.0.1.0 - Production  0

CORE12.2.0.1.0Production  0

TNS for Linux: Version 12.2.0.1.0 - Production  0

NLSRTL Version 12.2.0.1.0 - Production  0

1、创建一个数据库的全备RMAN> backup database;

Starting backup at 20170720 17:12:05

using target database control file instead of recovery catalog

allocated channel: ORA_DISK_1

channel ORA_DISK_1: SID=36 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/ORA12C/DATAFILE/system.256.949764433

channel ORA_DISK_1: starting piece 1 at 20170720 17:12:07

channel ORA_DISK_1: finished piece 1 at 20170720 17:12:22

piece handle=/u01/app/oracle/product/12.2/db_home1/dbs/0vs9rar7_1_1 tag=TAG20170720T171206 comment=NONE

channel ORA_DISK_1: backup set complete, elapsed time: 00:00:15

channel ORA_DISK_1: starting full datafile backup set

channel ORA_DISK_1: specifying datafile(s) in backup set

input datafile file number=00004 name=+DATA/ORA12C/DATAFILE/users.266.949764465

channel ORA_DISK_1: starting piece 1 at 20170720 17:12:22

channel ORA_DISK_1: finished piece 1 at 20170720 17:12:23

piece handle=/u01/app/oracle/product/12.2/db_home1/dbs/10s9rarm_1_1 tag=TAG20170720T171206 comment=NONE

channel ORA_DISK_1: backup set complete, elapsed time: 00:00:01

channel ORA_DISK_1: starting full datafile backup set

channel ORA_DISK_1: specifying datafile(s) in backup set

input datafile file number=00002 name=+DATA/ORA12C/DATAFILE/sysaux.261.949764491

channel ORA_DISK_1: starting piece 1 at 20170720 17:12:23

channel ORA_DISK_1: finished piece 1 at 20170720 17:12:38

piece handle=/u01/app/oracle/product/12.2/db_home1/dbs/11s9rarn_1_1 tag=TAG20170720T171206 comment=NONE

channel ORA_DISK_1: backup set complete, elapsed time: 00:00:15

channel ORA_DISK_1: starting full datafile backup set

channel ORA_DISK_1: specifying datafile(s) in backup set

input datafile file number=00005 name=+DATA/ORA12C/DATAFILE/examples.265.949764515

channel ORA_DISK_1: starting piece 1 at 20170720 17:12:38

channel ORA_DISK_1: finished piece 1 at 20170720 17:12:39

piece handle=/u01/app/oracle/product/12.2/db_home1/dbs/12s9ras6_1_1 tag=TAG20170720T171206 comment=NONE

channel ORA_DISK_1: backup set complete, elapsed time: 00:00:01

channel ORA_DISK_1: starting full datafile backup set

channel ORA_DISK_1: specifying datafile(s) in backup set

input datafile file number=00008 name=/tmp/FY_RST_DATA.DAT

input datafile file number=00007 name=/tmp/FY_REC_DATA.DAT

input datafile file number=00003 name=+DATA/ORA12C/DATAFILE/undotbs1.264.949764541

input datafile file number=00006 name=+DATA/ORA12C/DATAFILE/t_move.dbf

channel ORA_DISK_1: starting piece 1 at 20170720 17:12:40

channel ORA_DISK_1: finished piece 1 at 20170720 17:12:41

piece handle=/u01/app/oracle/product/12.2/db_home1/dbs/13s9ras8_1_1 tag=TAG20170720T171206 comment=NONE

channel ORA_DISK_1: backup set complete, elapsed time: 00:00:01

Finished backup at 20170720 17:12:41

Starting Control File and SPFILE Autobackup at 20170720 17:12:41

piece handle=/u01/app/oracle/product/12.2/db_home1/dbs/c-326793150-20170720-00 comment=NONE

Finished Control File and SPFILE Autobackup at 20170720 17:12:42

2、创建测试表,插入测试数据并记录中间的scn号zx@ORA12C>create table t2 (id number,name varchar2(10),birthday date);

Table created.

zx@ORA12C>insert into t2 values(1,'zx',sysdate);

1 row created.

zx@ORA12C>commit;

Commit complete.

zx@ORA12C>select current_scn from v$database;

CURRENT_SCN

-----------

650101

zx@ORA12C>insert into t2 values(2,'lx',sysdate);

1 row created.

zx@ORA12C>commit;

Commit complete.

zx@ORA12C>select * from t2;

ID NAME       BIRTHDAY

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

1 zx      20170720 17:18:52

2 lx      20170720 17:19:34

3、执行表级别恢复,使用remap table参数不覆盖原表,恢复成t2_r表RMAN> recover table zx.t2 until scn 650101 remap table zx.t2:t2_r auxiliary destination '/tmp';

Starting recover at 20170720 17:23:50

current log archived

using channel ORA_DISK_1

RMAN-05026: warning: presuming following set of tablespaces applies to specified point-in-time

List of tablespaces expected to have UNDO segments

Tablespace SYSTEM

Tablespace UNDOTBS1

Creating automatic instance, with SID='htzD'

initialization parameters used for automatic instance:

db_name=ORA12C

db_unique_name=htzD_pitr_ORA12C

compatible=12.2.0

db_block_size=8192

db_files=200

diagnostic_dest=/u01/app/oracle

_system_trig_enabled=FALSE

sga_target=1712M

processes=200

db_create_file_dest=/tmp

log_archive_dest_1='location=/tmp'

#No auxiliary parameter file used

starting up automatic instance ORA12C

Oracle instance started

Total System Global Area    1795162112 bytes

Fixed Size                     8621760 bytes

Variable Size                436207936 bytes

Database Buffers            1342177280 bytes

Redo Buffers                   8155136 bytes

Automatic instance created

contents of Memory Script:

{

# set requested point in time

set until  scn 650101;

# restore the controlfile

restore clone controlfile;

# mount the controlfile

sql clone 'alter database mount clone database';

# archive current online log

sql 'alter system archive log current';

}

executing Memory Script

executing command: SET until clause

Starting restore at 20170720 17:24:12

allocated channel: ORA_AUX_DISK_1

channel ORA_AUX_DISK_1: SID=18 device type=DISK

channel ORA_AUX_DISK_1: starting datafile backup set restore

channel ORA_AUX_DISK_1: restoring control file

channel ORA_AUX_DISK_1: reading from backup piece /u01/app/oracle/product/12.2/db_home1/dbs/c-326793150-20170720-00

channel ORA_AUX_DISK_1: piece handle=/u01/app/oracle/product/12.2/db_home1/dbs/c-326793150-20170720-00 tag=TAG20170720T171241

channel ORA_AUX_DISK_1: restored backup piece 1

channel ORA_AUX_DISK_1: restore complete, elapsed time: 00:00:01

output file name=/tmp/ORA12C/controlfile/o1_mf_dq0xoxot_.ctl

Finished restore at 20170720 17:24:14

sql statement: alter database mount clone database

sql statement: alter system archive log current

contents of Memory Script:

{

# set requested point in time

set until  scn 650101;

# set destinations for recovery set and auxiliary set datafiles

set newname for clone datafile  1 to new;

set newname for clone datafile  3 to new;

set newname for clone datafile  2 to new;

set newname for clone tempfile  1 to new;

# switch all tempfiles

switch clone tempfile all;

# restore the tablespaces in the recovery set and the auxiliary set

restore clone datafile  1, 3, 2;

switch clone datafile all;

}

executing Memory Script

executing command: SET until clause

executing command: SET NEWNAME

executing command: SET NEWNAME

executing command: SET NEWNAME

executing command: SET NEWNAME

renamed tempfile 1 to /tmp/ORA12C/datafile/o1_mf_temp_%u_.tmp in control file

Starting restore at 20170720 17:24:19

using channel ORA_AUX_DISK_1

channel ORA_AUX_DISK_1: starting datafile backup set restore

channel ORA_AUX_DISK_1: specifying datafile(s) to restore from backup set

channel ORA_AUX_DISK_1: restoring datafile 00001 to /tmp/ORA12C/datafile/o1_mf_system_%u_.dbf

channel ORA_AUX_DISK_1: reading from backup piece /u01/app/oracle/product/12.2/db_home1/dbs/0vs9rar7_1_1

channel ORA_AUX_DISK_1: piece handle=/u01/app/oracle/product/12.2/db_home1/dbs/0vs9rar7_1_1 tag=TAG20170720T171206

channel ORA_AUX_DISK_1: restored backup piece 1

channel ORA_AUX_DISK_1: restore complete, elapsed time: 00:00:45

channel ORA_AUX_DISK_1: starting datafile backup set restore

channel ORA_AUX_DISK_1: specifying datafile(s) to restore from backup set

channel ORA_AUX_DISK_1: restoring datafile 00002 to /tmp/ORA12C/datafile/o1_mf_sysaux_%u_.dbf

channel ORA_AUX_DISK_1: reading from backup piece /u01/app/oracle/product/12.2/db_home1/dbs/11s9rarn_1_1

channel ORA_AUX_DISK_1: piece handle=/u01/app/oracle/product/12.2/db_home1/dbs/11s9rarn_1_1 tag=TAG20170720T171206

channel ORA_AUX_DISK_1: restored backup piece 1

channel ORA_AUX_DISK_1: restore complete, elapsed time: 00:00:35

channel ORA_AUX_DISK_1: starting datafile backup set restore

channel ORA_AUX_DISK_1: specifying datafile(s) to restore from backup set

channel ORA_AUX_DISK_1: restoring datafile 00003 to /tmp/ORA12C/datafile/o1_mf_undotbs1_%u_.dbf

channel ORA_AUX_DISK_1: reading from backup piece /u01/app/oracle/product/12.2/db_home1/dbs/13s9ras8_1_1

channel ORA_AUX_DISK_1: piece handle=/u01/app/oracle/product/12.2/db_home1/dbs/13s9ras8_1_1 tag=TAG20170720T171206

channel ORA_AUX_DISK_1: restored backup piece 1

channel ORA_AUX_DISK_1: restore complete, elapsed time: 00:00:15

Finished restore at 20170720 17:25:55

datafile 1 switched to datafile copy

input datafile copy RECID=16 STAMP=949857956 file name=/tmp/ORA12C/datafile/o1_mf_system_dq0xp4jt_.dbf

datafile 3 switched to datafile copy

input datafile copy RECID=17 STAMP=949857956 file name=/tmp/ORA12C/datafile/o1_mf_undotbs1_dq0xrnq2_.dbf

datafile 2 switched to datafile copy

input datafile copy RECID=18 STAMP=949857956 file name=/tmp/ORA12C/datafile/o1_mf_sysaux_dq0xqkm0_.dbf

contents of Memory Script:

{

# set requested point in time

set until  scn 650101;

# online the datafiles restored or switched

sql clone "alter database datafile  1 online";

sql clone "alter database datafile  3 online";

sql clone "alter database datafile  2 online";

# recover and open database read only

recover clone database tablespace  "SYSTEM", "UNDOTBS1", "SYSAUX";

sql clone 'alter database open read only';

}

executing Memory Script

executing command: SET until clause

sql statement: alter database datafile  1 online

sql statement: alter database datafile  3 online

sql statement: alter database datafile  2 online

Starting recover at 20170720 17:26:02

using channel ORA_AUX_DISK_1

starting media recovery

archived log for thread 1 with sequence 2 is already on disk as file /u01/app/oracle/product/12.2/db_home1/dbs/arch2_2_949077789.dbf

archived log for thread 1 with sequence 3 is already on disk as file /u01/app/oracle/product/12.2/db_home1/dbs/arch2_3_949077789.dbf

archived log file name=/u01/app/oracle/product/12.2/db_home1/dbs/arch2_2_949077789.dbf thread=1 sequence=2

archived log file name=/u01/app/oracle/product/12.2/db_home1/dbs/arch2_3_949077789.dbf thread=1 sequence=3

media recovery complete, elapsed time: 00:00:02

Finished recover at 20170720 17:26:07

sql statement: alter database open read only

contents of Memory Script:

{

sql clone "create spfile from memory";

shutdown clone immediate;

startup clone nomount;

sql clone "alter system set  control_files =

''/tmp/ORA12C/controlfile/o1_mf_dq0xoxot_.ctl'' comment=

''RMAN set'' scope=spfile";

shutdown clone immediate;

startup clone nomount;

# mount database

sql clone 'alter database mount clone database';

}

executing Memory Script

sql statement: create spfile from memory

database closed

database dismounted

Oracle instance shut down

connected to auxiliary database (not started)

Oracle instance started

Total System Global Area    1795162112 bytes

Fixed Size                     8621760 bytes

Variable Size                436207936 bytes

Database Buffers            1342177280 bytes

Redo Buffers                   8155136 bytes

sql statement: alter system set  control_files =   ''/tmp/ORA12C/controlfile/o1_mf_dq0xoxot_.ctl'' comment= ''RMAN set'' scope=spfile

Oracle instance shut down

connected to auxiliary database (not started)

Oracle instance started

Total System Global Area    1795162112 bytes

Fixed Size                     8621760 bytes

Variable Size                436207936 bytes

Database Buffers            1342177280 bytes

Redo Buffers                   8155136 bytes

sql statement: alter database mount clone database

contents of Memory Script:

{

# set requested point in time

set until  scn 650101;

# set destinations for recovery set and auxiliary set datafiles

set newname for datafile  4 to new;

# restore the tablespaces in the recovery set and the auxiliary set

restore clone datafile  4;

switch clone datafile all;

}

executing Memory Script

executing command: SET until clause

executing command: SET NEWNAME

Starting restore at 20170720 17:27:18

allocated channel: ORA_AUX_DISK_1

channel ORA_AUX_DISK_1: SID=23 device type=DISK

channel ORA_AUX_DISK_1: starting datafile backup set restore

channel ORA_AUX_DISK_1: specifying datafile(s) to restore from backup set

channel ORA_AUX_DISK_1: restoring datafile 00004 to /tmp/HTZD_PITR_ORA12C/datafile/o1_mf_users_%u_.dbf

channel ORA_AUX_DISK_1: reading from backup piece /u01/app/oracle/product/12.2/db_home1/dbs/10s9rarm_1_1

channel ORA_AUX_DISK_1: piece handle=/u01/app/oracle/product/12.2/db_home1/dbs/10s9rarm_1_1 tag=TAG20170720T171206

channel ORA_AUX_DISK_1: restored backup piece 1

channel ORA_AUX_DISK_1: restore complete, elapsed time: 00:00:25

Finished restore at 20170720 17:27:44

datafile 4 switched to datafile copy

input datafile copy RECID=20 STAMP=949858064 file name=/tmp/HTZD_PITR_ORA12C/datafile/o1_mf_users_dq0xvq9q_.dbf

contents of Memory Script:

{

# set requested point in time

set until  scn 650101;

# online the datafiles restored or switched

sql clone "alter database datafile  4 online";

# recover and open resetlogs

recover clone database tablespace  "USERS", "SYSTEM", "UNDOTBS1", "SYSAUX" delete archivelog;

alter clone database open resetlogs;

}

executing Memory Script

executing command: SET until clause

sql statement: alter database datafile  4 online

Starting recover at 20170720 17:27:44

using channel ORA_AUX_DISK_1

starting media recovery

archived log for thread 1 with sequence 2 is already on disk as file /u01/app/oracle/product/12.2/db_home1/dbs/arch2_2_949077789.dbf

archived log for thread 1 with sequence 3 is already on disk as file /u01/app/oracle/product/12.2/db_home1/dbs/arch2_3_949077789.dbf

archived log file name=/u01/app/oracle/product/12.2/db_home1/dbs/arch2_2_949077789.dbf thread=1 sequence=2

archived log file name=/u01/app/oracle/product/12.2/db_home1/dbs/arch2_3_949077789.dbf thread=1 sequence=3

media recovery complete, elapsed time: 00:00:01

Finished recover at 20170720 17:27:48

database opened

contents of Memory Script:

{

# create directory for datapump import

sql "create or replace directory TSPITR_DIROBJ_DPDIR as ''

/tmp''";

# create directory for datapump export

sql clone "create or replace directory TSPITR_DIROBJ_DPDIR as ''

/tmp''";

}

executing Memory Script

sql statement: create or replace directory TSPITR_DIROBJ_DPDIR as ''/tmp''

sql statement: create or replace directory TSPITR_DIROBJ_DPDIR as ''/tmp''

Performing export of tables...

EXPDP> Starting "SYS"."TSPITR_EXP_htzD_mhEh":

EXPDP> Processing object type TABLE_EXPORT/TABLE/TABLE_DATA

EXPDP> Processing object type TABLE_EXPORT/TABLE/STATISTICS/TABLE_STATISTICS

EXPDP> Processing object type TABLE_EXPORT/TABLE/TABLE

EXPDP> . . exported "ZX"."T2"                                   5.898 KB       1 rows

EXPDP> Master table "SYS"."TSPITR_EXP_htzD_mhEh" successfully loaded/unloaded

EXPDP> ******************************************************************************

EXPDP> Dump file set for SYS.TSPITR_EXP_htzD_mhEh is:

EXPDP>   /tmp/tspitr_htzD_98436.dmp

EXPDP> Job "SYS"."TSPITR_EXP_htzD_mhEh" successfully completed at Thu Jul 20 17:29:48 2017 elapsed 0 00:01:05

Export completed

contents of Memory Script:

{

# shutdown clone before import

shutdown clone abort

}

executing Memory Script

Oracle instance shut down

Performing import of tables...

IMPDP> Master table "SYS"."TSPITR_IMP_htzD_bhqf" successfully loaded/unloaded

IMPDP> Starting "SYS"."TSPITR_IMP_htzD_bhqf":

IMPDP> Processing object type TABLE_EXPORT/TABLE/TABLE

IMPDP> Processing object type TABLE_EXPORT/TABLE/TABLE_DATA

IMPDP> . . imported "ZX"."T2_R"                                 5.898 KB       1 rows

IMPDP> Processing object type TABLE_EXPORT/TABLE/STATISTICS/TABLE_STATISTICS

IMPDP> Job "SYS"."TSPITR_IMP_htzD_bhqf" successfully completed at Thu Jul 20 17:30:10 2017 elapsed 0 00:00:10

Import completed

Removing automatic instance

Automatic instance removed

auxiliary instance file /tmp/ORA12C/datafile/o1_mf_temp_dq0xskvm_.tmp deleted

auxiliary instance file /tmp/HTZD_PITR_ORA12C/onlinelog/o1_mf_3_dq0xwo3d_.log deleted

auxiliary instance file /tmp/HTZD_PITR_ORA12C/onlinelog/o1_mf_2_dq0xwo3d_.log deleted

auxiliary instance file /tmp/HTZD_PITR_ORA12C/onlinelog/o1_mf_1_dq0xwo0q_.log deleted

auxiliary instance file /tmp/HTZD_PITR_ORA12C/datafile/o1_mf_users_dq0xvq9q_.dbf deleted

auxiliary instance file /tmp/ORA12C/datafile/o1_mf_sysaux_dq0xqkm0_.dbf deleted

auxiliary instance file /tmp/ORA12C/datafile/o1_mf_undotbs1_dq0xrnq2_.dbf deleted

auxiliary instance file /tmp/ORA12C/datafile/o1_mf_system_dq0xp4jt_.dbf deleted

auxiliary instance file /tmp/ORA12C/controlfile/o1_mf_dq0xoxot_.ctl deleted

auxiliary instance file tspitr_htzD_98436.dmp deleted

Finished recover at 20170720 17:30:13

4、验证结果,查询t2_r表zx@ORA12C>select * from t2_r;

ID NAME       BIRTHDAY

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

1 zx      20170720 17:18:52

5、即使表t2做了DDL操作修改了表结构,也可以用这种方法进行恢复--表t2添加一个字段

zx@ORA12C>alter table t2 add address varchar2(10);

Table altered.

--恢复表到t2_r2

RMAN> recover table zx.t2 until scn 650101 remap table zx.t2:t2_r2 auxiliary destination '/tmp';

Starting recover at 20170720 17:57:00

using channel ORA_DISK_1

RMAN-05026: warning: presuming following set of tablespaces applies to specified point-in-time

......

Finished recover at 20170720 18:02:03

--验证表t2_r2

zx@ORA12C>select * from t2_r2;

ID NAME       BIRTHDAY

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

1 zx      20170720 17:18:52

--恢复成功

这一功能很大程度减小了数据恢复的影响范围。

参考:http://docs.oracle.com/database/121/BRADV/rcmresind.htm#BRADV686

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

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

相关文章

spring social_Spring Social入门–第2部分

spring social几周前,我写了一篇文章,展示了我认为可以使用Spring Social编写的最简单的应用程序。 该应用程序读取并显示了Twitter用户的公共数据,并被编写为Spring Social和社交编码领域的介绍。 但是,让您的应用程序显示用户的…

【luogu 1024 一元三次方程求解】二分思想

题目出自luogu 1024 一元三次方程求解 描述: 有形如:ax3bx2cxd0 这样的一个一元三次方程。给出该方程中各项的系数(a,b,c,d 均为实数),并约定该方程存在三个不同实根(根的范围在-100至100之间),…

linux c统计进程网络读写,linux网络分析、性能分析、文本格式化、文件读写操作之利器(mtr、top、jq、sponge)...

好的工具能够让我们工作更加高效,结合工作中的情况,今天分享下linux下比较好用的几个工具。网络分析工具mtrmtr是网络链路检测判断问题非常好用的工具,集成了tracert和ping这两个命令的功能,动态的输出检测结果。mtr 默认发送icmp…

局域网(校园网)内服务之间通过ssh -L互相访问

一、前言 同一个局域网内有两台linux服务器A和B,B上有一个服务,可以通过curl传输数据访问,现在想从A上也通过curl访问B上的服务 二、两种情况 1. 如果B服务器上使用docker: 首先建立docker容器时,需要做端口映射 docker run …

ubantu 中配置Flash Player

1.Flash只能在Chrome中使用它的最新版本。 2.如果你使用的是Firefox浏览器,那么你需要更换浏览器才能使用最新版本的Flash。如果你使用的Chrome浏览器,你只需要将它升级到最新版本就可以了。 转载于:https://www.cnblogs.com/saturnlee/p/7502158.html

实施注释界面

对于Java开发人员来说,每天都需要使用注释。 如果没有别的,简单的Override注释应该响起。 创建注释要复杂一些。 在运行时通过反射使用“自制”注释或创建编译时调用的注释处理器也是一种复杂性。 但是我们很少“实现”注释接口。 暗中有人暗地里为我们做…

C++入门经典-例2.13-左移运算

1&#xff1a;代码如下&#xff1a; // 2.13.cpp : 定义控制台应用程序的入口点。 //#include "stdafx.h" #include<iostream> using namespace std; void main() {int a0x40,b;ba<<1;//左移1位cout << b << endl;//以十进制输出 } View Cod…

linux修改su的PAM配置文件,linux pam安全认证模块su命令的安全隐患

PAM安全认证1、su命令的安全隐患默认情况下&#xff0c;任何用户都允许使用su命令&#xff0c;从而有机会反复尝试其他用户(如root)的登录密码&#xff0c;带来安全风险。为了增强sum命令的使用控制&#xff0c;可以借助PAM认证模块&#xff0c;只允许极个别用户使用su命令进行…

jwebsocket传图片_Java中带有JWebSocket的WebServerSocket

jwebsocket传图片首先&#xff0c;转到http://jwebsocket.org/下载2个软件包Server and Client。 如果要查看源代码&#xff0c;请下载源代码包。 服务器 解压缩服务器程序包。 转到“ conf”文件夹 选择“ jWebSocket.xml”文件打开 编辑“ jWebSocket.xml”文件&#xff…

i3能装Linux虚拟机,使用i3wm重新安装Ubuntu

过去几天&#xff0c;我一直在Kubuntu 14.04.1 LTS(Ubuntu衍生产品)上使用i3wm&#xff0c;但体验有些不同。由于Ubuntu使用LightDM Display Manager&#xff0c;因此您可以安装i3wm并尝试与当前的窗口管理器一起使用。只需在外壳中使用以下命令安装适当的软件包&#xff1a;su…

99. 恢复二叉搜索树

99. 恢复二叉搜索树题意在BST中存在两个元素被交换了&#xff0c;现在需要把这两个元素给交换回来变成BST。解题思路将其转为数组&#xff0c;并且排好序后重新赋值给树结点&#xff1b;使用变量pre来保存访问的前一个结点&#xff0c;因为是中序遍历&#xff0c;所以前面一个结…

用Hamcrest验证DateTime和日期

自从我开始涉足自动化测试和练习TDD以来&#xff0c;验证日期值很痛苦。 幸运的是&#xff0c;这里有一个不错的库&#xff0c;可用于遗留Date和新的Java 8 DateTime API &#xff0c;从而解决了这一难题。 如果您属于Java开发社区中较健康的部分&#xff0c;并且每天练习单元…

linux找回rm的文件夹,Linux rm 文件恢复

Linux下删除命令 rm 大家肯定是熟悉得不能再熟悉了&#xff0c;然后有时候却阴沟里翻船不小心删除了某些重要的文件&#xff0c;想死的心都有了。。。。现在我们就来看看被误删除的文件要如何恢复&#xff1f;Linux文件系统Linux的文件系统(如ext3、ext4)由三部分组成&#xff…

linux xargs命令,xargs 命令教程

xargs是 Unix 系统的一个很有用的命令&#xff0c;但是常常被忽视&#xff0c;很多人不了解它的用法。本文介绍如何使用这个命令。一、标准输入与管道命令Unix 命令都带有参数&#xff0c;有些命令可以接受"标准输入"(stdin)作为参数。$ cat /etc/passwd | grep root…

java 职责链模式_Java中的责任链模式

java 职责链模式当应有几个处理器来执行某项操作并为这些处理器定义特定顺序时&#xff0c;就需要采用责任链设计模式。 在运行时处理器顺序的可变性也很重要。模式的UML表示如下&#xff1a; 处理程序定义处理器对象的一般结构。 这里的“ HandleRequest”是抽象处理器方法。 …

ArcMap 导入Excel坐标数据

1 准备Excel坐标数据集合 2 ArcMap加入Excel数据 将excel文件放入arcmap工作区的物理路径下在工作区的根图层上点键&#xff0c;选择添加数据&#xff0c;找到excel文件并选择相应的工作薄完成后&#xff0c;excel工作薄即导入工作区左边的图层下。3 ArcMap加入图层文件 在S…

linux6如何分区,CentOS6.9安装 硬盘分区方案与分区步骤

Linux默认可分为3个分区&#xff0c;分别是boot分区、swap分区和根分区&#xff1a;1、swap&#xff1a;交换分区&#xff0c;实现虚拟内存&#xff0c;建议大小是物理内存的1~2倍。2、/boot&#xff1a;用来存放与系统启动有关的程序&#xff0c;比如启动引导装载程序等&#…

实施自定义JMeter采样器

随着我们采用不同的体系结构和实现方式&#xff0c;对通用压力测试工具的需求不断增长。 Apache Jmeter是进行负载测试时最著名的工具之一。 它支持许多协议&#xff0c;例如ftp http tcp&#xff0c;并且可以轻松地用于分布式测试。 Jmeter还为您提供了一种创建自定义采样器…

hdu 6194 后缀数组

题意&#xff1a;一个字符串&#xff0c;查询恰好出现k次的子串的数目 思路&#xff1a;后缀数组在height上进行操作。我们直接枚举长度为k的区间求min值&#xff0c;但是要注意的是直接这么算是会重复的&#xff0c;同时也可能超过k次&#xff0c;这样我们就需要把枚举的前一个…

linux grep命令 例子,14个grep命令使用例子

所有的类linux系统都会提供一个名为grep(global regular expression print&#xff0c;全局正则表达式输出)的搜索工具。grep命令在对一个或多个文件的内容进行基于模式的搜索的情况下是非常有用的。模式可以是单个字符、多个字符、单个单词、或者是一个句子。当命令匹配到执行…