13.lsof recover deleted files

[root@temp ~]# lsof -p 5643
COMMAND  PID   USER   FD   TYPE DEVICE  SIZE/OFF    NODE NAME
oracle  5643 oracle  cwd    DIR    8,2      4096 1556206 /u01/app/oracle/product/10.2.0/db_1/dbs
oracle  5643 oracle  rtd    DIR    8,2      4096       2 /
oracle  5643 oracle  txt    REG    8,2  93362427 1557452 /u01/app/oracle/product/10.2.0/db_1/bin/oracle
oracle  5643 oracle  mem    REG    8,2     70077 1565448 /u01/app/oracle/product/10.2.0/db_1/lib/libclsra10.so
oracle  5643 oracle  mem    REG    8,2     50848  389032 /lib/libnss_files-2.5.so

** 把 o1_mf_ggs_data_8rq64t53_.dbf 删除 **
[oracle@temp datafile]$ rm -rf o1_mf_ggs_data_8rq64t53_.dbf

** 23 lists information file handle ***
[the root TEMP @ ~] # LS -alh / proc / 5643 / FD / 23
LRWX ------ Oracle the oinstall. 1 18:08 64 06-19 / proc / 5643 / fd / 23 -> /u01/app/oracle/oradata/ORCL/datafile/o1_mf_ggs_data_8rq64t53_.dbf (deleted)

** direct copy last on the list **
[the root TEMP @ ~] # CP / proc / 5643 / FD / 23 is / u01 / App / Oracle / oradata / ORCL / datafile /
[the root TEMP @ ~] # chown -R & lt Oracle: oinstall / u01 / app / oracle / oradata / ORCL / datafile / 23

[oracle@temp datafile]$ mv 23 o1_mf_ggs_data_8rq64t53_.dbf

sys@ORCL> shutdown immediate
sys@ORCL> startup
ORA-01113: file 6 needs media recovery
ORA-01110: data file 6: '/u01/app/oracle/oradata/ORCL/datafile/o1_mf_ggs_data_8rq64t53_.dbf' 
sys@ORCL> recover datafile 6;
sys@ORCL> alter database open;

Guess you like

Origin www.cnblogs.com/allenhu320/p/11284407.html