数据库热备
① 启动数据库服务
[root@localhost ~]$ su dmdba
[root@localhost ~]$ cd /dm8/bin
[dmdba@localhost bin]$ ./DmServiceDMSVR01 start
② 开启归档模式
[dmdba@localhost bin]$ ./disql SYSDBA/DM01SYDBA@LOCALHOST:5236
disql V8
SQL> alter database mount;
SQL> alter database add archivelog 'type=local,dest=/dm8/arch,file_size=80,space_limit=0';
SQL> alter database archivelog;
SQL> alter database open;
SQL> exit
③ 执行热备
[dmdba@localhost bin]$ ./disql SYSDBA/DM01SYDBA@LOCALHOST:5236
SQL> backup database full backupset '/dm8/backup';
SQL> exit
数据库还原
① 关闭数据库服务
[dmdba@localhost ~]$ cd /dm8/bin
[dmdba@localhost bin]$ ./DmServiceDMSERVER stop
② 检查备份集是否可用
[dmdba@localhost bin]$ ./dmrman
RMAN> check backupset '/dm8/backup';
③ 还原、恢复、更新
[dmdba@localhost bin]$ ./dmrman
dmrman V8
RMAN> restore database '/dm8/data/DAMENG/dm.ini' from backupset '/dm8/backup';
RMAN> recover database '/dm8/data/DAMENG/dm.ini' with archivedir '/dm8/arch';
RMAN> recover database '/dm8/data/DAMENG/dm.ini' update db_magic ;
④ 重启数据库服务
[dmdba@localhost ~]$ cd /dm8/bin
[dmdba@localhost bin]$ ./DmServiceDMSERVER start
文章
阅读量
获赞