首页 > 数据库 > Oracle > dataguard日常维护
l 启用备用数据库的方法
startup nomount;
alter database mount standby database; 手工恢复模式
alter database recover managed standby database disconnect from session; 管理恢复模式
l 备用库只能以read noly方式打开,步骤如下:
alter database recover managed standby database finish/cancel;
alter database open read only;
切换回恢复模式
alter database recover managed standby database disconnect from session;
打开之后,为了避免排序出错,需要
Alter tablespace add tempfile ‘‘ size 100m reuse;
l 激活standby库
备用数据库一旦激活成为主数据库,就不能再成为备用数据库,需要重新建立备用数据库。
激活备用数据库,首先要停止备用数据库的恢复进程。
SQL>recover managed standby database cancel;
激活备用数据库
SQL>alter database activate standby database;
SQL>shutdown;
SQL>connect sys/sys_password as sysdba;
SQL>startup;
l 主库主动取消最大可用性模式
shutdown immediate;
startup mount;
create pfile=’/location/inittestdb.ora’ from spfile
cp /location/inittestdb.ora /location/inittestdb.ora.backup
alter database set standby to maximize performance
shutdown immediate;
修改inittestdb.ora去掉standby相关的启动参数(log_archive_dest_2)
Create spfile from pfile=’/location/inittestdb.ora’
startup
l 查询当前dataguard出于何种保护状态
SQL>select dd.protection_mode,dd.protection_level from v$database dd;
来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/137423/viewspace-929556/ ,如需转载,请注明出处,否则将追究法律责任。