好,现在了解了大致的目录结构,那么当我们由于误操作删除了/home/oracle目录后,恢复其实就很容易了
即只需要把/etc/skel目录下的文件全都拷贝到原目录下,应该就可以解决这个问题了,下面我们来看一下测试过程
在数据库正常运行的情况下,把/home/oracle目录删除,为了提高可恢复性,把具有危险操作的rm -rf操作替换成mv更名操作
[oracle@ora11g ~]$ sqlplus / as sysdba
SQL*Plus: Release 11.2.0.4.0 Production on Mon May 4 11:17:21 2015
Copyright (c) 1982, 2013, Oracle. All rights reserved.
Connected to an idle instance.
SQL> startup
ORACLE instance started.
Total System Global Area 835104768 bytes
Fixed Size 2257840 bytes
Variable Size 507513936 bytes
Database Buffers 322961408 bytes
Redo Buffers 2371584 bytes
Database mounted.
Database opened.
SQL> host
[oracle@ora11g ~]$ ps -ef | grep oracle
root 3402 3289 0 10:22 pts/2 00:00:00 su - oracle
oracle 3403 3402 0 10:22 pts/2 00:00:00 -bash
root 3587 3433 0 10:56 pts/2 00:00:00 su - oracle
oracle 3588 3587 0 10:56 pts/2 00:00:00 -bash
root 24415 3618 0 11:14 pts/2 00:00:00 su - oracle
oracle 24416 24415 0 11:14 pts/2 00:00:00 -bash
oracle 24453 24416 0 11:17 pts/2 00:00:00 sqlplus as sysdba
oracle 24463 1 0 11:17 ? 00:00:00 ora_pmon_ora11g
oracle 24467 1 0 11:17 ? 00:00:00 ora_psp0_ora11g
oracle 24471 1 2 11:17 ? 00:00:02 ora_vktm_ora11g
oracle 24477 1 0 11:17 ? 00:00:00 ora_gen0_ora11g
oracle 24481 1 0 11:17 ? 00:00:00 ora_diag_ora11g
oracle 24485 1 0 11:17 ? 00:00:00 ora_dbrm_ora11g
oracle 24489 1 0 11:17 ? 00:00:00 ora_dia0_ora11g
oracle 24493 1 0 11:17 ? 00:00:00 ora_mman_ora11g
oracle 24497 1 0 11:17 ? 00:00:00 ora_dbw0_ora11g
oracle 24501 1 0 11:17 ? 00:00:00 ora_lgwr_ora11g
oracle 24505 1 0 11:17 ? 00:00:00 ora_ckpt_ora11g
oracle 24509 1 0 11:17 ? 00:00:00 ora_smon_ora11g
oracle 24513 1 0 11:17 ? 00:00:00 ora_reco_ora11g
oracle 24517 1 0 11:17 ? 00:00:00 ora_mmon_ora11g
oracle 24521 1 0 11:17 ? 00:00:00 ora_mmnl_ora11g
oracle 24525 1 0 11:17 ? 00:00:00 ora_d000_ora11g
oracle 24529 1 0 11:17 ? 00:00:00 ora_s000_ora11g
oracle 24543 24453 0 11:17 ? 00:00:01 oracleora11g (DESCRIPTION=(LOCAL=YES)(ADDRESS=(PROTOCOL=beq)))
oracle 24547 1 0 11:17 ? 00:00:00 ora_arc0_ora11g
oracle 24551 1 0 11:17 ? 00:00:00 ora_arc1_ora11g
oracle 24555 1 0 11:17 ? 00:00:00 ora_arc2_ora11g
oracle 24559 1 0 11:17 ? 00:00:00 ora_arc3_ora11g
oracle 24563 1 0 11:17 ? 00:00:00 ora_qmnc_ora11g
oracle 24591 1 0 11:18 ? 00:00:00 ora_q000_ora11g
oracle 24595 1 0 11:18 ? 00:00:00 ora_q001_ora11g
oracle 24599 1 0 11:18 ? 00:00:00 ora_cjq0_ora11g
oracle 24665 24453 0 11:19 pts/2 00:00:00 /bin/bash
oracle 24684 24665 0 11:19 pts/2 00:00:00 ps -ef
oracle 24685 24665 0 11:19 pts/2 00:00:00 grep oracle
[oracle@ora11g ~]$ exit
[root@ora11g ~]# cd /home
[root@ora11g home]# mv /home/oracle /home/oracle_bak