Dataguard常用命令汇总

----标准DataGuard参数设置------------------------------
alter system set log_archive_dest_2=‘SERVICE=ta_std REOPEN=300  VALID_FOR=(ONLINE_LOGFILES,PRIMARY_ROLES) db_unique_name=ta_std‘;
alter system set fal_server=‘ta_std‘;
alter system set fal_client=‘ta‘;

alter system set fal_server=‘ta‘;
alter system set fal_client=‘ta_std‘;

----利用ssh tunnel的DataGuard参数设置------------------------------
alter system set log_archive_dest_2 = ‘SERVICE=ta_ssh NOREOPEN VALID_FOR=(ONLINE_LOGFILES,PRIMARY_ROLES) db_unique_name=ta_std alternate=log_archive_dest_3‘;
alter system set log_archive_dest_state_2= enable;
--注意:log_archive_dest_2需要设置noreopen或者reopen=0属性,否则无法迅速切换到备用路径。

alter system set log_archive_dest_3 = ‘SERVICE=ta_std REOPEN=300 VALID_FOR=(ONLINE_LOGFILES,PRIMARY_ROLES) db_unique_name=ta_std‘;
alter system set log_archive_dest_state_3=alternate;
--注意:当归档目标log_archive_dest_2不能正常归档时,数据库切换归档目标到log_archive_dest_3,即使log_archive_dest_2归档目标恢复正常,也不会再自动切换回去,需要手工重新修改路径状态参数:
--alter system set log_archive_dest_state_2= enable;
--alter system set log_archive_dest_state_3= alternate;

alter system set fal_server = ‘ta_ssh‘;
alter system set fal_client = ‘ta‘;

测试
tnsping ta     tnsing ta_std     tnsing ta_ssh

------------------------------------------------------
p170a:    ssh -L 15210:p170b:1521 -C -N p170b
p170b:    ssh -L 15210:p170a:1521 -C -N p170a

redhat1:    ssh -L 15210:redhat2:1521 -C -N redhat2
redhat2:    ssh -L 15210:redhat1:1521 -C -N redhat1

----DataGuard 中注册日志文件------------------------------
alter database register OR replace logfile ‘/data/arch_ta/1_515_673519034.dbf‘;

注册日志文件
catalog archivelog ‘....‘;

ALTER SESSION SET nls_date_format = ‘YYYY-MM-DD HH24:MI:SS‘;
SELECT TIMESTAMP,MESSAGE FROM V$DATAGUARD_STATUS;

SELECT * FROM (SELECT THREAD#,SEQUENCE#,FIRST_CHANGE#,NEXT_CHANGE#,APPLIED FROM V$ARCHIVED_LOG ORDER BY FIRST_CHANGE# DESC) WHERE ROWNUM<20;

一、PRIMARY DATABASE

1、设置DB FORCE_LOGGING为YES 
SELECT FORCE_LOGGING FROM V$DATABASE;
ALTER DATABASE FORCE LOGGING;
ALTER DATABASE NO FORCE LOGGING;

2、设置保护模式
SELECT OPEN_MODE,DATABASE_ROLE,SWITCHOVER_STATUS,PROTECTION_MODE, PROTECTION_LEVEL FROM V$DATABASE;
ALTER DATABASE SET STANDBY DATABASE TO MAXIMIZE PROTECTION;
ALTER DATABASE SET STANDBY DATABASE TO MAXIMIZE AVAILABILITY;
ALTER DATABASE SET STANDBY DATABASE TO MAXIMIZE PERFORMANCE;

3、设置归档目标
ALTER SYSTEM SET log_archive_dest_1=‘location=/app/oracle/arch‘;
ALTER SYSTEM set LOG_ARCHIVE_DEST_2=‘SERVICE=ta_std REOPEN=300  VALID_FOR=(ONLINE_LOGFILES,PRIMARY_ROLES)‘;
ALTER SYSTEM SET log_archive_dest_state_1=enable;
ALTER SYSTEM SET log_archive_dest_state_2=defer;

ALTER SYSTEM SET fal_server=ta_std;
ALTER SYSTEM SET fal_client=fmp;

ALTER SYSTEM set DB_FILE_NAME_CONVERT=‘fmpdb‘,‘fmpdb‘ SCOPE=SPFILE;
ALTER SYSTEM set LOG_FILE_NAME_CONVERT=‘fmpdb‘,‘fmpdb‘ SCOPE=SPFILE;
ALTER SYSTEM SET standby_file_management=auto;

二、STANDBY DATABASE

1、建目录结构
D:\oracle\product\10.2.0\admin
D:\oracle\product\10.2.0\flash_recovery_area
D:\oracle\product\10.2.0\oradata\fmpdb
D:\oracle\product\10.2.0\oradata\fmpdbarch

2、copy 
D:\oracle\product\10.2.0\db_1\database\PWDfmpdb.ora
D:\oracle\product\10.2.0\db_1\database\SPFILEFMPDB.ORA
D:\oracle\product\10.2.0\db_1\NETWORK\ADMIN\listener.ora  需修改IP
D:\oracle\product\10.2.0\db_1\NETWORK\ADMIN\tnsnames.ora

C:\> ORADIM -NEW -sid fmpdb
C:\> orapwd file=D:\oracle\product\10.2.0\db_1\database\PWDfmpdb.ora password=oracle force=y
--password必须与PRIMARY保持一致

starup nomount
ALTER SYSTEM SET log_archive_dest_1=‘location=D:\oracle\product\10.2.0\oradata\fmpdbarch‘;
ALTER SYSTEM set LOG_ARCHIVE_DEST_2=‘SERVICE= REOPEN=300 VALID_FOR=(ONLINE_LOGFILES,PRIMARY_ROLES)‘;
--ALTER SYSTEM reset LOG_ARCHIVE_DEST_2 scope=spfile sid=‘*‘;
ALTER SYSTEM SET log_archive_dest_state_1=enable;
ALTER SYSTEM SET log_archive_dest_state_1=defer;

ALTER SYSTEM SET fal_server=fmp;
ALTER SYSTEM SET fal_client=fmp_std;

三、PRIMARY DATABASE

RMAN 备份:
rman target /
crosscheck backup;
delete noprompt expired backup;
crosscheck archivelog all;
delete noprompt expired archivelog all;

BACKUP format ‘D:\oracle\product\10.2.0\oradata\backup\%d_STBY_%T_%s_%p‘ current controlfile for standby;
BACKUP format ‘D:\oracle\product\10.2.0\oradata\backup\%d_FULL_%T_%s_%p‘ database MAXSETSIZE 2G;
SQL ‘alter system archive log current‘;
BACKUP format ‘D:\oracle\product\10.2.0\oradata\backup\%d_ARCH_%T_%s_%p‘ archivelog all MAXSETSIZE 2G;
exit;

四、STANDBY DATABASE
1、copy 主D:\oracle\product\10.2.0\oradata\backup\*.*至备
2、
RMAN target sys/[email protected]
connect auxiliary sys/[email protected]_std
duplicate target database for standby nofilenamecheck;
 [dorecover];

五、PRIMARY DATABASE
ALTER SYSTEM SET log_archive_dest_state_2=enable;

六、STANDBY DATABASE
startup mount
ALTER SYSTEM SET log_archive_dest_state_2=enable;

--启动了MRP0进程(Managed Standby Recovery)
ALTER DATABASE RECOVER MANAGED STANDBY DATABASE DISCONNECT FROM SESSION;
ALTER DATABASE RECOVER MANAGED STANDBY DATABASE CANCEL;
ALTER DATABASE OPEN;

七、检查
--查询尚未APPLIED的archived log(STANDBY端)
SELECT * FROM (SELECT THREAD#,SEQUENCE#,FIRST_CHANGE#,NEXT_CHANGE#,APPLIED FROM V$ARCHIVED_LOG ORDER BY FIRST_CHANGE# DESC) WHERE ROWNUM<20;

--察看从数据库已经归档的redo
SELECT REGISTRAR,CREATOR,THREAD#,SEQUENCE#,APPLIED,FIRST_CHANGE#,NEXT_CHANGE# FROM V$ARCHIVED_LOG;

--察看从数据库已经应用的redo
SELECT THREAD#, SEQUENCE#, FIRST_CHANGE#, NEXT_CHANGE# FROM V$LOG_HISTORY;

--DATAGUARD 状态
ALTER SESSION SET nls_date_format = ‘YYYY-MM-DD HH24:MI:SS‘;
SELECT TIMESTAMP,MESSAGE FROM V$DATAGUARD_STATUS;

--从数据库端察看RFS(Remote File Service)接收日志情况和MRP应用日志同步主数据库情况
COL STATUS FORMAT A15
SELECT PROCESS,STATUS,THREAD#,SEQUENCE#,BLOCK#,BLOCKS FROM V$MANAGED_STANDBY;

--察看从数据库是否和主数据库同步
COL DEST_NAME FORMAT A20
SELECT DEST_NAME,ARCHIVED_THREAD#, ARCHIVED_SEQ#, APPLIED_THREAD#, APPLIED_SEQ# FROM V$ARCHIVE_DEST_STATUS;

col DESTINATION format a50
SELECT DEST_NAME,DESTINATION, STATUS, ARCHIVED_THREAD#, ARCHIVED_SEQ# FROM V$ARCHIVE_DEST_STATUS WHERE STATUS <> ‘DEFERRED‘ AND STATUS <> ‘INACTIVE‘;

--GAP
SELECT * FROM V$ARCHIVE_GAP;

第二部分 主数据库正常切换

一 人工干预主数据库正常切换

1 在主数据库端检验数据库可切换状态 
SQL> SELECT SWITCHOVER_STATUS FROM V$DATABASE;
SWITCHOVER_STATUS 
----------------- 
TO STANDBY 
1 row selected

SWITCHOVER_STATUS:TO STANDBY表示可以正常切换.
如果SWITCHOVER_STATUS的值为SESSIONS ACTIVE,表示当前有会话处于ACTIVE状态

2 开始主数据库正常切换 IP:172.16.75.35
如果SWITCHOVER_STATUS的值为TO STANDBY 则:
SQL> ALTER DATABASE COMMIT TO SWITCHOVER TO PHYSICAL STANDBY;
如果SWITCHOVER_STATUS的值为SESSIONS ACTIVE 则:
SQL> ALTER DATABASE COMMIT TO SWITCHOVER TO PHYSICAL STANDBY WITH SESSION SHUTDOWN;
成功运行这个命令后,主数据库被修改为从数据库

3 重启先前的主数据库 
SQL> SHUTDOWN IMMEDIATE;
SQL> STARTUP MOUNT;

4 在从数据库端验证可切换状态 IP:172.16.75.30
SQL> SELECT SWITCHOVER_STATUS FROM V$DATABASE; 
SWITCHOVER_STATUS 
----------------- 
TO_PRIMARY 
1 row selected

5 将目标从数据库转换为主数据库 IP:172.16.75.30
如果SWITCHOVER_STATUS的值为TO STANDBY 则:
SQL> ALTER DATABASE COMMIT TO SWITCHOVER TO PRIMARY;
如果SWITCHOVER_STATUS的值为SESSIONS ACTIVE 则:
SQL> ALTER DATABASE COMMIT TO SWITCHOVER TO PRIMARY WITH SESSION SHUTDOWN;
成功运行这个命令后,从数据库被修改为主数据库

6 重启目标从数据库
SQL> SHUTDOWN IMMEDIATE;
SQL> STARTUP;

7 先前主数据库启动日志传送进程
SQL> alter database recover managed standby database disconnect;

============================================================================
--ALTER SYSTEM set log_archive_config=‘DG_CONFIG=(testdb,testdb2)‘;

ALTER DATABASE CREATE STANDBY CONTROLFILE AS ‘D:\oracle\product\10.2.0\oradata\boston\CONTROL01.CTL‘;

--启动了MRP0进程(Managed Standby Recovery)
ALTER DATABASE RECOVER MANAGED STANDBY DATABASE DISCONNECT FROM SESSION;
ALTER DATABASE RECOVER MANAGED STANDBY DATABASE CANCEL;
ALTER DATABASE OPEN;

ALTER DATABASE RECOVER MANAGED STANDBY DATABASE;
ALTER DATABASE RECOVER MANAGED STANDBY DATABASE DISCONNECT;
ALTER DATABASE RECOVER MANAGED STANDBY DATABASE USING CURRENT LOGFILE;
ALTER DATABASE RECOVER MANAGED STANDBY DATABASE USING CURRENT LOGFILE DISCONNECT FROM SESSION;

SET PAGESIZE 200
SELECT * FROM V$PROCESS;
SELECT * FROM V$BGPROCESS WHERE PADDR<>‘00‘;

SELECT USERNAME,TERMINAL,PROGRAM FROM V$PROCESS;
SELECT * FROM V$BGPROCESS WHERE PADDR<>‘00‘;
COL USERNAME FORMAT A15
COL MACHINE FORMAT A30
SELECT USERNAME,MACHINE,TERMINAL,PROGRAM FROM V$SESSION;

-------

rman nocatalog target sys/[email protected]
run {
ALLOCATE CHANNEL c1 DEVICE TYPE DISK CONNECT ‘sys/[email protected]‘ format ‘/app/oracle/backup/rac1_%U‘;
ALLOCATE CHANNEL c2 DEVICE TYPE DISK CONNECT ‘sys/[email protected]‘ format ‘/app/oracle/backup/rac2_%U‘;
sql ‘alter system archive log current‘;
backup filesperset 3 archivelog all delete all input;
release channel c1;
release channel c2;
}

rman nocatalog target sys/[email protected]
run {
ALLOCATE CHANNEL c1 DEVICE TYPE DISK CONNECT ‘sys/[email protected]‘;
ALLOCATE CHANNEL c2 DEVICE TYPE DISK CONNECT ‘sys/[email protected]‘;
BACKUP FORMAT ‘/app/oracle/backup/%t_%U‘ DATABASE PLUS ARCHIVELOG;
BACKUP FORMAT ‘/app/oracle/backup/%t_%U‘ CURRENT CONTROLFILE FOR STANDBY;
release channel c1;
release channel c2;
}

-----RAC环境下,交叉验证-----------------------------------------
allocate channel for maintenance device type DISK connect ‘sys/[email protected]‘;
allocate channel for maintenance device type DISK connect ‘sys/[email protected]‘;
crosscheck archivelog all;
delete noprompt expired archivelog all;
release channel;

crosscheck backup;
delete noprompt expired backup;
delete noprompt obsolete;
release channel;
-------------------------------------------------------------------------

RMAN> 
catalog archivelog ‘/arch/ora92/2_1.dbf‘;
list archivelog all;

scp -p -r [email protected]:/app/oracle/backup /app/oracle
scp -p -r [email protected]:/app/oracle/backup /app/oracle

orapwd file=/app/oracle/product/10.2.0/db_1/dbs/orapwta password=oracle force=y

ALTER SYSTEM set DB_FILE_NAME_CONVERT=‘ta‘,‘ta‘ SCOPE=SPFILE;
ALTER SYSTEM set LOG_FILE_NAME_CONVERT=‘ta‘,‘ta‘ SCOPE=SPFILE;

rman target sys/[email protected]
connect auxiliary sys/[email protected]_std
duplicate target database for standby nofilenamecheck;

--primary
ALTER SYSTEM SET log_archive_config=‘dg_config=(ta,ta_std)‘ sid=‘*‘;
ALTER SYSTEM SET log_archive_dest_1=‘location=/app/oracle/arch‘ sid=‘*‘;
ALTER SYSTEM set LOG_ARCHIVE_DEST_2=‘SERVICE=ta_std REOPEN=300  VALID_FOR=(ONLINE_LOGFILES,PRIMARY_ROLES) db_unique_name=ta_std‘ sid=‘*‘;
ALTER SYSTEM SET log_archive_dest_state_1=enable sid=‘*‘;
ALTER SYSTEM SET log_archive_dest_state_2=defer sid=‘*‘;
ALTER SYSTEM SET standby_file_management=auto sid=‘*‘

--standby
ALTER SYSTEM SET log_archive_config=‘dg_config=(ta,ta_std)‘;
ALTER SYSTEM SET standby_file_management=auto;
ALTER SYSTEM SET fal_server=‘ta1‘,‘ta2‘;
ALTER SYSTEM SET fal_client=‘ta_std‘;

ALTER SYSTEM SET log_archive_dest_state_2=enable sid=‘*‘;

ALTER DATABASE COMMIT TO SWITCHOVER TO PRIMARY WITH SESSION SHUTDOWN;
recover managed standby database finish;

通过故障切换实现角色转换
1、查询备用数据中v$archive_gap视图来定位备用数据库中的日志缺失。
2、在备用数据库中通过下面的命令对归档日志进行注册
   alter database register physical logfile ‘......‘;
3、alter database recover managed standby database finish;
   alter database recover managed standby database finish skip standby logfile;
4、alter database commit to switchover to primary;
5、shutdown immediate;
   startup;

fmpdb =
  (DESCRIPTION =
    (ADDRESS_LIST =
      (ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.20.1)(PORT = 1521))
      (ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.20.2)(PORT = 1521))
      (LOAD_BALANCE = yes)
    )
    (CONNECT_DAfmpdb =
      (SERVICE_NAME = fmpdb)
       (FAILOVER_MODE =
        (TYPE = SELECT)
        (METHOD = BASIC)
        (RETRIES = 180)
        (DELAY = 5)
      )
    )
  )

fmpdb1 =
  (DESCRIPTION =
    (ADDRESS_LIST =
      (ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.20.1)(PORT = 1521))
    )
    (CONNECT_DAfmpdb =
      (SERVICE_NAME = fmpdb)
    )
  )

fmpdb2 =
  (DESCRIPTION =
    (ADDRESS_LIST =
      (ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.20.2)(PORT = 1521))
    )
    (CONNECT_DAfmpdb =
      (SERVICE_NAME = fmpdb)
    )
  )

fmpdb_std =
  (DESCRIPTION =
    (ADDRESS = (PROTOCOL = TCP)(HOST = 172.18.0.11)(PORT = 1521))
    (CONNECT_DAfmpdb =
      (SERVER = DEDICATED)
      (SERVICE_NAME = fmpdb)
    )
  )

-------------------------------------------------------------------------------
http://hi.baidu.com/dbaeyes/blog/item/740c3bfb3e0d5361034f568e.html

standby 管理和维护2008年07月13日 星期日 00:31管理:

查询库状态:
SQL> select name,SWITCHOVER_STATUS,open_mode,PROTECTION_MODE,DATABASE_ROLE
          from v$database;

验证archive log是否接收和 applied.
SQL> alter session set nls_datE_format=‘YYYY-MM-DD HH24:MI:SS‘;

select SEQUENCE#,DEST_ID,ARCHIVED,APPLIED,DELETED,
STATUS,FIRST_TIME from v$archived_log order by SEQUENCE#;

启动到管理模式:
SQL> shutdown immediate;
SQL> startup nomount
SQL> alter database mount standby database
SQL> recover managed standby database disconnect from session;
----------

SQL> ALTER DATABASE RECOVER MANAGED STANDBY DATABASE DISCONNECT FROM SESSION;

10g以后,采用联机日志的传递传递方式,
SQL> recover managed standby database using current logfile disconnect from session;

启动到只读模式:
SQL> shutdown immediate;
SQL> startup nomount
SQL> alter database mount standby database
SQL> alter databae open read only;

在管理模式恢复到只读模式:
SQL> recover managed standby database cancel;
SQL> alter database open read only

在只读模式可以给数据库添加临时数据文件(在rman备份是没有备份的),想让standby提供只读服务或者切换成主库,最好先增加链式文件
SQL> alter tablespace temp add tempfile ‘C:\oracle\product\10.2.0\oradata\dgtest\temp02.dbf‘ size 100m;

只读模式到管理模式
SQL> recover managed standby database disconnect from session;

在备库进行备份
1.停止应用程序,跳转到 read only模式,同坐backup database命令来备份数据库,这样数据库处于一致性模式
2. 备份完成后,备份控制文件
SQL> ALTER DATABASE BACKUP CONTROLFILE TO ‘FILE NAME‘;

主备切换

正常切换 (switchover)
切换准备: 准备参数文件,平时应该备好,注意参数 fal_server,fal_client

先确认能否转换:
SELECT SWITCHOVER_STATUS FROM V$DATABASE;

主 -> 备
$lsnrclt stop 
杀光进程或者重启数据库
SQL> alter database commit to switchover to physical standby with session shutdown;

SQL> shutdown immediate;
SQL> startup nomount pfile =‘‘;
SQL> alter database mount standby database;
SQL> recover managed standby database disconnect;

备 -> 主
SQL> alter database commit to switchover to primary with session shutdown;
SQL> shutdown immediate
SQL> startup pfile =‘‘

如果考虑在主备库来回切换,要保证数据库版本一致,参数compatible一致

失败切换 (Failover)
主服务器不能使用情况下

在备库
SQL> recover managed standby database cancel;

--如果在备用库上有备用库日志文件,参考命令
SQL> alter database recover managed standby database finish; -- [force|wait|nowait] 10g or later
--没有备库日志文件[10gR2之前]
SQL> alter database recover managed standby database finish skip standby logfile;

--切换备库到主库
SQL> alter database commit to switchover to primary;
-- open
SQL> shutdown immediate;
SQL> startup pfile=‘‘

如果还有为传递的归档日志或者主库的联机日志
SQL>alter database register logfile ‘c:\...‘
SQL>recover standby database;

强行切换(激活)
激活备用服务器,在重启数据库时,备库会resetlog。
SQL>alter system archive log current;
SQL>recover managed standby database cancel;
SQL>alter database activate standby database;
SQL>shutdown immediate;
SQL>startup pfile=‘‘

-----
apply 主库redolog并强制切换
SQL> ALTER DATABASE RECOVER MANAGED STANDBY DATABASE CANCEL;
--选定redolog恢复
SQL> recover standby database until cancel;

Specify log: { =suggested | filename | AUTO | CANCEL} 
/u01/oradata/dgtest/redo02.log 
Log applied. 
Media recovery complete.

recovery 完成之后就要failover了。

SQL>alter database activate standby database;
SQL>shutdown immediate;
SQL>startup pfile=‘‘
-- http://hi.baidu.com/wa0362/blog/item/33e52912a91eadcbc2fd78b9.html
-- http://zf_wu.itpub.net/

-- 参考来源: 《oracle高可用环境》

--http://www.oracleblog.cn/study-note/reduce-the-data-loss-of-data-guard-when-failover/

相关视图

v$archive_dest 
v$archive_dest_status
v$log_history
v$archvied_log
v$managed_standby
v$archive_gap

-- EOF --

http://oracle.chinaitlab.com/serial/740174.html

激活备库到read/write状态 
SQL> alter database activate standby database;
数据库已更改。
SQL> alter database open;
数据库已更改。

转换成备库 
SQL> alter database convert to physical standby;
数据库已更改。

-- EOF --

时间: 2024-11-09 00:47:23

Dataguard常用命令汇总的相关文章

Linux 常用命令汇总

Linux 常用命令汇总 1. 显示日期与时间:date 可修改显示日期格式,如:date +%Y/%m/%d %H:%M à2016/12/25 17:05(%Y:年:%m:月:%d:日:%H:24小时制:%M:分) date –d 参数后可加:today/yesterday/tomorrow 来显示今天.昨天.明天日期 2. 显示日历:cal(默认显示本月月历) cal 2001 可显示2001年整年日历:cal 10 2001 可具体显示某月月历 3.  计算器:bc 4. Tab键:用在

GIT 版本控制常用命令汇总

[转自]:http://www.cnblogs.com/sawyerzhu/p/3578268.html GIT 版本控制常用命令汇总 git version 查看当前git版本信息 git help 获取全部命令帮助信息 git help <command> 获取指定命令帮助信息 git config user.name "Your Name Comes Here" 设置当前项目git用户名 git config --global user.name "Your

Postgres数据库常用命令汇总

1.导出查询语句的结果到文件(你必须通过psql登录后切换到数据库后执行该语句): \copy (select id,mk,bth from basic where state='0') to /tmp/test.csv  2.直接通过psql命令导出数据到文件(-f 后面跟存放sql语句的文件): psql -h 127.0.0.1 -Uusertest -d testdb -t -f tb2redis.sql >> format2redis.txt Postgres数据库常用命令汇总

【Linux】Linux 常用命令汇总

查看软件xxx安装内容:dpkg -L xxx 查找软件库中的软件:apt-cache search 正则表达式 查找软件库中的软件:aptitude search 软件包 查找文件属于哪个包:dpkg -S filename 查找文件属于哪个包:apt-file search filename 查询软件xxx依赖哪些包:apt-cache depends xxx 查询软件xxx被哪些包依赖:apt-cache rdepends xxx 增加一个光盘源:sudo apt-cdrom add 系统

linux vi(vim)常用命令汇总(转)

前言 首先解析一个vim vi是unix/linux下极为普遍的一种文本编辑器,大部分机器上都有vi的各种变种,在不同的机器上常用不同的变种软件,其中vim比较好用也用的比较广泛.vim是Vi Improved的缩写,表示更好的vi.本文就说些比较有用.比较常用的命令,若能熟练运用这些命令,那么会发现编辑文件很大帮助,尤其作为开发人员,能够快速的提高开发效率. 说明 以下的例子中 xxx表示在命令模式下输入xxx并回车 以下的例子中 :xxx表示在扩展模式下输入xxx并回车 小括号中的命令表示相

Cisco路由器配置的常用命令汇总

路由器是工作在OSI参考模型第三层--网络层的数据包转发设备.路由器通过转发数据包来实现网络互连.虽然路由器可以支持多种协议(如TCP/IP. IPX/SPX.AppleTalk等协议),但是在我国绝大多数路由器运行TCP/IP协议.路由器通常连接两个或多个由IP子网或点到点协议标识的逻辑端口,至少拥有1个物理端口.路由器根据收到数据包中的网络层地址以及路由器内部维护的路由表决定输出端口以及下一跳地址,并且重写链路层数据包头实现转发数据包.路由器通过动态维护路由表来反映当前的网络拓扑,并通过与网

Linux运维最常用命令汇总

Linux运维最常用命令汇总?线上查询及帮助命令? 命令 说明 man 查看命令帮助,命令的词典,更复杂的还有info,但不常用.(man手册) help 查看Linux内置命令的帮助,比如cd命令.查看命令帮助,命令的词典,更复杂的还有info,但不常用.(man手册)help 查看Linux内置命令的帮助,比如cd命令. ?文件和目录操作命令 命令 说明 ls 全拼list,功能是列出目录的内容及其内容属性信息. cd 全拼change directory,功能是从当前工作目录切换到指定的工

pipenv常用命令汇总

常用命令汇总 pipenv具有下列的选项: $ pipenv Usage: pipenv [OPTIONS] COMMAND [ARGS]... Options: --where 显示项目文件所在路径 --venv 显示虚拟环境实际文件所在路径 --py 显示虚拟环境Python解释器所在路径 --envs 显示虚拟环境的选项变量 --rm 删除虚拟环境 --bare 最小化输出 --completion 完整输出 --man 显示帮助页面 --three / --two 使用Python 3/

linux四剑客常用命令汇总

**四剑客常用命令汇总** 1.find find path -option [ -print ] [ -exec -ok command ] {} (find 查找路径 -type f/d -name ..... -size 1k/M -mtime/atime/ctime +-9 文件) find -type/-perm/-empty/ find /tmp -type f -name "*.tmp" -exec rm -rf '{}' \; find / -type f -name