DataGuard 记录

1. 系统参数设置:

查看AIX用户进程数限制

lsattr -E -l sys0| grep maxuproc 

修改AIX用户进程数限制

chdev -l sys0 -a maxuproc=16384

如果进程数达到上限会报错:

TNS-12500: TNS:listener failed to start a dedicated server process 
TNS-12540: TNS:internal limit restriction exceeded 
TNS-12560: TNS:protocol adapter error 
TNS-00510: Internal limit restriction exceeded 
IBM/AIX RISC System/6000 Error: 11: Resource temporarily unavailable

2. Oracle 参数设置:

首先恢复主库最新的备份至备库,然后创建standby control file:

SQL> ALTER DATABASE CREATE STANDBY CONTROLFILE AS '/home/oracle/standby.ctl'

使用standby control file将数据库启动至mount状态。
主库备库增加standby log files,数量和在线日志相同:

SQL> alter database add standby logfile group 11 ('/lv_emr/logfiles/stdby01_1','/lv_emr/logfiles/stdby01_2') size 50M;

其他参数:

*.db_file_name_convert='/u01/app/oracle/oradata/rmyyzemr/','/lv_emr/datafile/'
*.db_name='rmyyzemr'
*.db_unique_name='RMYYZEMR_S'
*.fal_client='RMYYZEMR_S'
*.fal_server='RMYYZEMR'
*.log_archive_config='dg_config=(rmyyzemr,rmyyzemr_s)'
*.log_archive_dest_1='location=/lv_emr/arch valid_for=(all_logfiles,all_roles) db_unique_name=rmyyzemr_s'
*.log_archive_dest_2='service=rmyyzemr LGWR ASYNC valid_for=(online_logfiles,primary_role) db_unique_name=rmyyzemr'
*.log_file_name_convert='/u01/app/oracle/oradata/rmyyzemr/','/lv_emr/logfile/'
*.remote_login_passwordfile='EXCLUSIVE'

3. DataGuard 启动及监控:

启动日志应用:

SQL> ALTER DATABASE RECOVER MANAGED STANDBY DATABASE USING CURRENT LOGFILE DISCONNECT FROM SESSION;

停止恢复:

SQL> ALTER DATABASE RECOVER MANAGED STANDBY DATABASE CANCEL;

确认归档目的地有效性:

SQL> select DEST_ID, STATUS, DESTINATION, ERROR from V$ARCHIVE_DEST where DEST_ID<=2;

查看日志应用状态:

SQL> select SEQUENCE#, FIRST_TIME, NEXT_TIME, APPLIED, ARCHIVED from V$ARCHIVED_LOG order by FIRST_TIME;

进程活动状态:

SQL> select PROCESS,CLIENT_PROCESS,SEQUENCE#,STATUS from V$MANAGED_STANDBY;

重做日志缺口:

SQL> select STATUS, GAP_STATUS from V$ARCHIVE_DEST_STATUS where DEST_ID = 2;

DataGuard 状态日志表:

SQL> select * from V$DATAGUARD_STATUS order by TIMESTAMP;

你可能感兴趣的:(DataGuard 记录)