db2 => list history backup all for db sample
List History File for sample
Number of matching file entries = 2
Op Obj Timestamp+Sequence Type Dev Earliest Log Current Log Backup ID
-- --- ------------------ ---- --- ------------ ------------ --------------
B D 20101208120448001 F D S0000000.LOG S0000000.LOG
----------------------------------------------------------------------------
Contains 5 tablespace(s):
00001 SYSCATSPACE
00002 USERSPACE1
00003 IBMDB2SAMPLEREL
00004 IBMDB2SAMPLEXML
00005 SYSTOOLSPACE
----------------------------------------------------------------------------
Comment: DB2 BACKUP SAMPLE OFFLINE
Start Time: 20101208120448
End Time: 20101208120459
Status: A
----------------------------------------------------------------------------
EID: 4 Location: /arch
Op Obj Timestamp+Sequence Type Dev Earliest Log Current Log Backup ID
-- --- ------------------ ---- --- ------------ ------------ --------------
B D 20101210132310001 N D S0000007.LOG S0000007.LOG
----------------------------------------------------------------------------
Contains 7 tablespace(s):
00001 SYSCATSPACE
00002 USERSPACE1
00003 IBMDB2SAMPLEREL
00004 IBMDB2SAMPLEXML
00005 SYSTOOLSPACE
00006 TBS00
00007 TBS02
----------------------------------------------------------------------------
Comment: DB2 BACKUP SAMPLE ONLINE
Start Time: 20101210132310
End Time: 20101210132323
Status: A
----------------------------------------------------------------------------
EID: 19 Location: /arch
db2 =>
db2 => force application all
DB20000I The FORCE APPLICATION command completed successfully.
DB21024I This command is asynchronous and may not be effective immediately.
db2 =>
db2 =>
db2 =>
db2 =>
db2 => restore db sample from /arch/
SQL2522N More than one backup file matches the timestamp value provided for
the backed up database image.
db2 => restore db sample from /arch/ taken at 20101210132310
SQL2539W Warning! Restoring to an existing database that is the same as the
backup image database. The database files will be deleted.
Do you want to continue ? (y/n) y
DB20000I The RESTORE DATABASE command completed successfully.
db2 =>
[db2inst1@localhost ~]$ db2 connect to sample
SQL1117N A connection to or activation of database "SAMPLE" cannot be made
because of ROLL-FORWARD PENDING. SQLSTATE=57019
--这个时候数据库是处于ROLL-FORWARD 的状态的
db2 => rollforward db sample to end of logs and complete
Rollforward Status
Input database alias = sample
Number of nodes have returned status = 1
Node number = 0
Rollforward status = not pending
Next log file to be read =
Log files processed = S0000007.LOG - S0000007.LOG
Last committed transaction = 2010-12-10-05.23.22.000000 UTC
DB20000I The ROLLFORWARD command completed successfully.
[db2inst1@localhost ~]$ db2 connect to sample
Database Connection Information
Database server = DB2/LINUX 9.7.1
SQL authorization ID = DB2INST1
Local database alias = SAMPLE
分享到:
相关推荐
db2 BACKUP DATABASE <database_name> ONLINE TO <backup_location> ``` 例如,对`testdb`数据库进行在线备份: ```sql db2 BACKUP DATABASE testdb ONLINE TO /backup_location ``` 恢复联机备份同样可以使用`...
如果遇到找不到文件的错误,可使用`recover database until cancel using backup controlfile`命令,允许在找到最后一个online redo log时中断恢复过程。 整个恢复过程中,重要的是确保所有必要的归档日志都已备份...
4. 通过 Backup Exec 恢复最新的 FULL ONLINE 备份,确保选择 "Restore over Existing files" 选项,以覆盖现有文件。所有在 FULL CLOSED 备份后的归档日志必须已备份且可访问,否则数据库无法恢复到最新状态。 5. ...
- **使表空间在线**:`sql 'alter tablespace pxb_ts online';` 使表空间在线。 以上内容涵盖了Oracle数据库备份与恢复的基础概念和技术细节,通过对这些脚本的理解和应用,可以帮助我们更好地管理数据库的备份与...
- `BACKUP FULL DATABASE FORMAT='D:\backup\full_database_%U.dbf' INCLUDE CURRENT CONTROLFILE FOR STANDBY;` - 创建 Standby 控制文件: - `ALTER DATABASE CREATE STANDBY CONTROLFILE AS 'D:\oracle\...
RESTORE DATABASE NewDBName FROM C:\\Temp\\ TAKEN AT 20020919094932 TO D: INTO OldDBName WITH 2 BUFFERS BUFFER 1024 WITHOUT PROMPTING ``` - `NewDBName`:新建数据库的名称。 - `C:\\Temp\\`:备份文件...
db2backup db TestDB online incremental to D:\backup ``` 增量备份会将自上一次全量备份后发生的所有数据变化记录下来并存储于指定目录。 #### 五、数据库恢复 1. **删除原数据库:** - 在进行恢复前,先删除...
- 使用`ALTER TABLESPACE users ONLINE`将表空间重新设置为在线状态。 通过以上知识点的学习和实践,初学者可以掌握如何使用RMAN进行Oracle数据库的基本备份和恢复操作,这对于数据库管理员来说是非常重要的技能。
- **在线备份(Online Backup)**:即使在备份过程中,数据库也能继续处理应用程序的请求。这种方式提高了系统的可用性,但要求数据库的日志模式设置为归档日志(Archival Logging)。 #### 三、DB2的数据恢复方法 ...
RMAN> sql 'alter tablespace users online'; ``` 以上命令涵盖了RMAN中常见的操作,包括启动和关闭数据库、配置RMAN环境、备份和恢复数据库及其组件等关键步骤。通过这些命令,DBA可以有效地管理和保护Oracle...
Firebird server maintenance operations such as backup and restore database, shutdown database and bringing database online are easy and fast to perform in Firebird Maestro. Full customization ...
- `db2 backup database database_name online`:在线备份数据库。 - `db2 restore database database_name`:恢复数据库。注意,恢复可能覆盖现有的数据库。 13. **性能监控**: - `db2pd -db database_name -...
adocmmd.CommandText := ' alter database dzyl set online with rollback immediate'; adocmmd.Execute; showmessage('数据库恢复成功!'); application.Terminate; except on e: exception do begin ...
4. **切换还原的表空间在线**:在恢复表空间后,使用`alter tablespace users online;`使其可读写。 5. **介质恢复**:当数据文件丢失时,需要从备份中恢复,`restore datafile '/u01/oracle/data/users01.dbf' ...
a) 如果出现以下提示:ORA-01151: use media recovery to recover block, restore backup if needed,则需要做介质恢复,需要做以下工作: * 关闭数据库 SQL>shutdown immediate; * 以 nomount 方式打开数据库 SQL>...
RMAN> sql 'alter tablespace users online'; ``` 上述命令用于离线表空间`users`,然后还原和恢复该表空间,最后将其重新上线。 以上介绍了RMAN的一些基本使用方法和操作,这些命令和步骤对于数据库管理员来说...
"Alter Database xxdl Set Online with Rollback Immediate;"; // 创建SQL命令 SqlCommand command = new SqlCommand(sql2, conn); // 打开数据库连接 conn.Open(); // 设置备份文件路径 string path = ...
`分别查看数据文件和联机重做日志的状态,确保它们都在`ONLINE`状态。 7. **表空间和数据文件检查**:使用`select tablespace_name, file_name, status from dba_data_files;`和`select tablespace_name, group#, ...