修改备份文件的有效时间(必须用spfile启动数据库)SQLgt; alter system set control_file_record_keep_time=30 scope=both;
修改备份文件的有效时间(必须用spfile启动数据库)
SQL> alter system set control_file_record_keep_time=30 scope=both;
System altered.
先启动归档
SQL> startup mount
Oracle instance started.
Total System Global Area 314572800 bytes
Fixed Size 1219136 bytes
Variable Size 96470464 bytes
Database Buffers 209715200 bytes
Redo Buffers 7168000 bytes
Database mounted.
SQL> alter database archivelog;
Database altered.
[root@bw ~]# su - oracle
[oracle@bw ~]$ rman target /
Recovery Manager: Release 10.2.0.1.0 - Production on Sun Apr 24 10:14:45 2011
Copyright (c) 1982, 2005, Oracle. All rights reserved.
connected to target database: BW (DBID=3011863310)
RMAN> show all;
using target database control file instead of recovery catalog
RMAN configuration parameters are:
CONFIGURE RETENTION POLICY TO REDUNDANCY 1; # default
CONFIGURE BACKUP OPTIMIZATION OFF; # default
CONFIGURE DEFAULT DEVICE TYPE TO DISK; # default
CONFIGURE CONTROLFILE AUTOBACKUP OFF; # default
CONFIGURE CONTROLFILE AUTOBACKUP FORMAT FOR DEVICE TYPE DISK TO '%F'; # default
CONFIGURE DEVICE TYPE DISK PARALLELISM 1 BACKUP TYPE TO BACKUPSET; # default
CONFIGURE DATAFILE BACKUP COPIES FOR DEVICE TYPE DISK TO 1; # default
CONFIGURE ARCHIVELOG BACKUP COPIES FOR DEVICE TYPE DISK TO 1; # default
CONFIGURE MAXSETSIZE TO UNLIMITED; # default
CONFIGURE ENCRYPTION FOR DATABASE OFF; # default
CONFIGURE ENCRYPTION ALGORITHM 'AES128'; # default
CONFIGURE ARCHIVELOG DELETION POLICY TO NONE; # default
CONFIGURE SNAPSHOT CONTROLFILE NAME TO '/u01/app/oracle/product/10.2/db_1/dbs/snapcf_bw.f'; # default
RMAN> CONFIGURE CONTROLFILE AUTOBACKUP ON;
new RMAN configuration parameters:
CONFIGURE CONTROLFILE AUTOBACKUP ON;
new RMAN configuration parameters are successfully stored
[oracle@bw u01]$ rman target /
RMAN> run{
2> allocate channel d1 type disk;
3> allocate channel d2 type disk;
4>backup full database format '/u01/bak/bw20110430_%u.bak' tag=bwfull01;
5> release channel d1;
6> release channel d2;
7> }
回车
开始恢复数据库文件
在/u01/oradata/bw下删除dbf文件 (没有删除控制文件)
[oracle@bw bw]$ rm -rf *dbf
恢复
[oracle@bw u01]$ rman target /
RMAN> startup nomount;
RMAN> alter database mount;
RMAN> restore database;
RMAN> recover database;
Starting recover at 23-APR-11
using channel ORA_DISK_1
starting media recovery
media recovery complete, elapsed time: 00:00:01
Finished recover at 23-APR-11(表示还原成功)
如果控制文件和数据文件都删除
[oracle@bw ~]$ cd /u01/oradata/bw/
[oracle@bw bw]$ ll
total 1005496
-rw-r----- 1 oracle oinstall 104865792 Apr 26 20:53 bw01.dbf
-rw-r----- 1 oracle oinstall 115351552 Apr 26 21:14 bwtbs01.dbf
-rw-r----- 1 oracle oinstall 17547264 Apr 26 21:14 control01.ctl(红色部分都删除)
-rw-r----- 1 oracle oinstall 17547264 Apr 26 21:14 control02.ctl
-rw-r----- 1 oracle oinstall 17547264 Apr 26 21:14 control03.ctl
-rw-r----- 1 oracle oinstall 20972032 Apr 26 21:14 redo1_1.dbf
-rw-r----- 1 oracle oinstall 20972032 Apr 26 20:36 redo2_1.dbf
-rw-r----- 1 oracle oinstall 20972032 Apr 26 20:48 redo3_1.dbf
-rw-r----- 1 oracle oinstall 314580992 Apr 26 21:14 sysaux01.dbf
-rw-r----- 1 oracle oinstall 314580992 Apr 26 21:14 system01.dbf
-rw-r----- 1 oracle oinstall 209723392 Apr 26 21:09 temp01.dbf
-rw-r----- 1 oracle oinstall 20972032 Apr 26 21:14 redo1_1.rdo
-rw-r----- 1 oracle oinstall 20972032 Apr 26 20:36 redo2_1.rdo
部分功能简介:商品收藏夹功能热门商品最新商品分级价格功能自选风格打印结算页面内部短信箱商品评论增加上一商品,下一商品功能增强商家提示功能友情链接用户在线统计用户来访统计用户来访信息用户积分功能广告设置用户组分类邮件系统后台实现更新用户数据系统图片设置模板管理CSS风格管理申诉内容过滤功能用户注册过滤特征字符IP库管理及来访限制及管理压缩,恢复,备份数据库功能上传文件管理商品类别管理商品添加/修改/
0
-rw-r----- 1 oracle oinstall 20972032 Apr 26 20:48 redo3_1.rdo
[oracle@bw ~]$rm –rf*dbf
[oracle@bw ~]$rm –rf*ctl
[oracle@bw ~]$ll
-rw-r----- 1 oracle oinstall 20972032 Apr 26 21:14 redo1_1.rdo
-rw-r----- 1 oracle oinstall 20972032 Apr 26 20:36 redo2_1.rdo
-rw-r----- 1 oracle oinstall 20972032 Apr 26 20:48 redo3_1.rdo
[oracle@bw ~]$rman target /
Recovery Manager: Release 10.2.0.1.0 - Production on Tue Apr 26 19:46:45 2011
Copyright (c) 1982, 2005, Oracle. All rights reserved.
connected to target database: bw (not mounted)
RMAN> startup nomount;
database is already started
[oracle@bw ~]$ cd $ORACLE_HOME/dbs
[oracle@bw dbs]$ ll
total 34452
-rw-r----- 1 oracle oinstall 17629184 Apr 26 19:37 c-3011863310-20110426-00
-rw-r--r-- 1 oracle oinstall 849 Apr 22 13:38 db.sql
-rw-rw---- 1 oracle oinstall 1544 Apr 22 13:37 hc_bw.dat
-rw-r--r-- 1 oracle oinstall 960 Apr 22 13:36 initbw.ora
-rw-r----- 1 oracle oinstall 12920 May 3 2001 initdw.ora
-rw-r----- 1 oracle oinstall 8385 Sep 11 1998 init.ora
-rw-rw---- 1 oracle oinstall 24 Apr 22 13:38 lkBW
-rw-r----- 1 oracle oinstall 1536 Apr 22 13:36 orapwbw
-rw-r----- 1 oracle oinstall 17547264 Apr 26 19:37 snapcf_bw.f
-rw-r----- 1 oracle oinstall 2560 Apr 26 19:28 spfilebw.ora
RMAN> set dbid=3011863310;
executing command: SET DBID
·
RMAN> restore controlfile from autobackup;
Starting restore at 26-APR-11
using target database control file instead of recovery catalog
allocated channel: ORA_DISK_1
channel ORA_DISK_1: sid=47 devtype=DISK
channel ORA_DISK_1: looking for autobackup on day: 20110426
channel ORA_DISK_1: autobackup found: c-3011863310-20110426-00
channel ORA_DISK_1: control file restore from autobackup complete
output filename=/u01/oradata/bw/control01.ctl
output filename=/u01/oradata/bw/control02.ctl
output filename=/u01/oradata/bw/control03.ctl
Finished restore at 26-APR-11
(控制文件恢复成功)
开始恢复数据文件
[oracle@bw u01]$ rman target /
RMAN> startup nomount;
RMAN> alter database mount;
RMAN> restore database;
RMAN> recover database;
Starting recover at 23-APR-11
using channel ORA_DISK_1
starting media recovery
media recovery complete, elapsed time: 00:00:01
Finished recover at 23-APR-11(表示还原成功)
[oracle@bw ~]$ sqlplus / as sysdba
SQL*Plus: Release 10.2.0.1.0 - Production on Tue Apr 26 20:12:42 2011
Copyright (c) 1982, 2005, Oracle. All rights reserved.
Connected to an idle instance.
SQL> startup
ORACLE instance started.
Total System Global Area 314572800 bytes
Fixed Size 1219136 bytes
Variable Size 96470464 bytes
Database Buffers 209715200 bytes
Redo Buffers 7168000 bytes
Database mounted.
ORA-01589: must use RESETLOGS or NORESETLOGS option for database open
SQL> alter database open resetlogs;
Database altered.
SQL> shutdown immediate
Database closed.
Database dismounted.
ORACLE instance shut down.
SQL> startup
ORACLE instance started.
Total System Global Area 314572800 bytes
Fixed Size 1219136 bytes
Variable Size 96470464 bytes
Database Buffers 209715200 bytes
Redo Buffers 7168000 bytes
Database mounted.
Database opened.
SQL>

每个人都需要一台速度更快、更稳定的 PC。随着时间的推移,垃圾文件、旧注册表数据和不必要的后台进程会占用资源并降低性能。幸运的是,许多工具可以让 Windows 保持平稳运行。
Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号