今天手贱了一下:
[oracle@primary dbs]$ rm -rf 02puub93_1_1 *
本是想rm掉$ORACLE_HOME/dbs下的rman备份文件,哪知小手一抖没注意在后面加了个* 然后就酿成悲剧.......,然后
[oracle@primary dbs]$ ls 下面都是空的了
参数文件及密码文件等全么了,么了
1.以下是恢复步奏,从alert日志中找到最近启动数据库的初始化的参数,拷贝至新建的initvage.ora文件中。
[oracle@primary ~]$ strings alert_vage.log
Starting up:
Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options.
ORACLE_HOME = /u01/oracle/product/11.2.0/dbhome_1
System name: Linux
Node name: primary
Release: 2.6.18-238.el5
Version: #1 SMP Sun Dec 19 14:22:44 EST 2010
Machine: x86_64
Using parameter settings in server-side spfile /u01/oracle/product/11.2.0/dbhome_1/dbs/spfilevage.ora
System parameters with non-default values:
processes = 150
sga_target = 300M
control_files = "/oradata/vage/control01.ctl"
control_files = "/oradata/vage/control02.ctl"
db_block_size = 8192
_db_aging_touch_time = 3
compatible = "11.2.0.4.0"
log_archive_dest_state_1 = "DEFER"
log_archive_dest_state_2 = "DEFER"
log_archive_format = "%t_%s_%r.arc"
log_archive_max_processes= 30
log_checkpoints_to_alert = TRUE
undo_tablespace = "UNDOTBS1"
sec_case_sensitive_logon = FALSE
remote_login_passwordfile= "EXCLUSIVE"
db_domain = ""
dispatchers = "(PROTOCOL=TCP) (SERVICE=ocpXDB)"
audit_file_dest = "/u01/oracle/admin/vage/adump"
audit_trail = "DB"
db_name = "vage"
db_unique_name = "vage"
open_cursors = 300
pga_aggregate_target = 0
diagnostic_dest = "/u01/oracle"
Wed Feb 11 19:07:15 2015
PMON started with pid=2, OS id=27738
Wed Feb 11 19:07:15 2015
PSP0 started with pid=3, OS id=27742
Wed Feb 11 19:07:15 2015
VKTM started with pid=4, OS id=27746
VKTM running at (100ms) precision
Wed Feb 11 19:07:15 2015
GEN0 started with pid=5, OS id=27752
Wed Feb 11 19:07:15 2015
DIAG started with pid=6, OS id=27756
Wed Feb 11 19:07:15 2015
DBRM started with pid=7, OS id=27760
Wed Feb 11 19:07:15 2015
DIA0 started with pid=8, OS id=27764
Wed Feb 11 19:07:15 2015
MMAN started with pid=9, OS id=27768
Wed Feb 11 19:07:15 2015
DBW0 started with pid=10, OS id=27772
Wed Feb 11 19:07:15 2015
LGWR started with pid=11, OS id=27776
Wed Feb 11 19:07:15 2015
CKPT started with pid=12, OS id=27780
Wed Feb 11 19:07:15 2015
SMON started with pid=13, OS id=27784
Wed Feb 11 19:07:15 2015
RECO started with pid=14, OS id=27788
Wed Feb 11 19:07:15 2015
MMON started with pid=15, OS id=27792
starting up 1 dispatcher(s) for network address '(ADDRESS=(PARTIAL=YES)(PROTOCOL=TCP))'...
Wed Feb 11 19:07:15 2015
MMNL started with pid=16, OS id=27796
starting up 1 shared server(s) ...
ORACLE_BASE from environment = /u01/oracle
Wed Feb 11 19:07:15 2015
ALTER DATABASE MOUNT
Successful mount of redo thread 1, with mount id 4083711139
Database mounted in Exclusive Mode
Lost write protection disabled
Completed: ALTER DATABASE MOUNT
Wed Feb 11 19:07:20 2015
ALTER DATABASE OPEN
Errors in file /u01/oracle/diag/rdbms/vage/vage/trace/vage_ora_27819.trc:
ORA-01190: control file or data file 6 is from before the last RESETLOGS
ORA-01110: data file 6: '/oradata/vage/tp01.dbf'
ORA-1190 signalled during: ALTER DATABASE OPEN..
2.[oracle@primary dbs]$ vi initvage.ora
processes = 150
sga_target = 300M
control_files = "/oradata/vage/control01.ctl"
control_files = "/oradata/vage/control02.ctl"
db_block_size = 8192
_db_aging_touch_time = 3
compatible = "11.2.0.4.0"
log_archive_dest_state_1 = "DEFER"
log_archive_dest_state_2 = "DEFER"
log_archive_format = "%t_%s_%r.arc"
log_archive_max_processes= 30
log_checkpoints_to_alert = TRUE
undo_tablespace = "UNDOTBS1"
sec_case_sensitive_logon = FALSE
remote_login_passwordfile= "EXCLUSIVE"
db_domain = ""
dispatchers = "(PROTOCOL=TCP) (SERVICE=ocpXDB)"
audit_file_dest = "/u01/oracle/admin/vage/adump"
audit_trail = "DB"
db_name = "vage"
db_unique_name = "vage"
open_cursors = 300
pga_aggregate_target = 0
diagnostic_dest = "/u01/oracle"
3.创建密码文件
[oracle@primary dbs]$ orapwd file=orapwvage password=oracle entries=30
[oracle@primary dbs]$ ls
arch1_6_871319841.arc hc_vage.dat initvage.ora lkVAGE orapwvage snapcf_vage.f
[oracle@primary dbs]$
4.最后打开
SQL> startup pfile=$ORACLE_HOME/dbs/initvage.ora
ORACLE instance started.
Total System Global Area 313159680 bytes
Fixed Size 2252824 bytes
Variable Size 167776232 bytes
Database Buffers 138412032 bytes
Redo Buffers 4718592 bytes
Database mounted.
Database opened.
SQL>
成功打开database
谨以此警醒自己
总结:这次幸好只是测试库,幸好rm的只是参数文件及密码文件等,如果是rm了数据文件及日志文件控制文件那可就麻烦了,尤其是还没有备份。
告诫自己以后谨慎用rm,太危险了。每一次的任何一个动作都不可以马虎凡事需谨慎,备份重于一切。