Oracle 11.2.0.4.0 dataguard部署和日常维护(2)

1. primary库设置dataguard相关参数

1.1. 强制primay库在任何状态下必须记录日志

SYS@userdata>select FORCE_LOGGING from v$database;

FORCE_LOG
---------
NO

SYS@userdata>alter database force logging;

Database altered.

SYS@userdata>select FORCE_LOGGING from v$database;

FORCE_LOG
---------
YES

1.2. 设置primay库在归档模式

SYS@userdata>shutdown immediate;
SYS@userdata>startup mount;
SYS@userdata>alter database archivelog;
SYS@userdata>alter database open;
SYS@userdata>archive log list;
Database log mode              Archive Mode
Automatic archival             Enabled
Archive destination            USE_DB_RECOVERY_FILE_DEST
Oldest online log sequence     2
Next log sequence to archive   4
Current log sequence           4

1.3. 设置primary和standby库的tnsnames

$ cat $ORACLE_HOME/network/admin/tnsnames.ora
# tnsnames.ora Network Configuration File: /u01/app/oracle/product/11.2.0/db_1/network/admin/tnsnames.ora
# Generated by Oracle configuration tools.

userdata1 =
  (DESCRIPTION =
    (ADDRESS = (PROTOCOL = TCP)(HOST = ec2t-userdata-01)(PORT = 1521))
    (CONNECT_DATA =
      (SERVER = DEDICATED)
      (SERVICE_NAME = userdata)
    )
  )

userdata2 =
  (DESCRIPTION =
    (ADDRESS = (PROTOCOL = TCP)(HOST = ec2t-userdata-02)(PORT = 1521))
    (CONNECT_DATA =
      (SERVER = DEDICATED)
      (SERVICE_NAME = userdata)
    )
  )

1.4. 根据spfile创建可更新的pfile文件

SYS@userdata>create pfile=‘/home/oracle/pfile.ora‘ from spfile;

File created.

1.5. 更新pfile文件,添加dataguard相关参数

$ mkdir /u01/app/oracle/arch
$ cat /home/oracle/pfile.ora
userdata.__db_cache_size=620756992
userdata.__java_pool_size=16777216
userdata.__large_pool_size=33554432
userdata.__oracle_base=‘/u01/app/oracle‘#ORACLE_BASE set from environment
userdata.__pga_aggregate_target=620756992
userdata.__sga_target=905969664
userdata.__shared_io_pool_size=0
userdata.__shared_pool_size=218103808
userdata.__streams_pool_size=0
*.audit_file_dest=‘/u01/app/oracle/admin/userdata/adump‘
*.audit_trail=‘db‘
*.compatible=‘11.2.0.4.0‘
*.control_files=‘/u01/app/oracle/oradata/userdata/control01.ctl‘,‘/u01/app/oracle/fast_recovery_area/userdata/control02.ctl‘
*.db_block_size=8192
*.db_domain=‘‘
*.db_name=‘userdata‘
*.db_recovery_file_dest=‘/u01/app/oracle/fast_recovery_area‘
*.db_recovery_file_dest_size=4294967296
*.diagnostic_dest=‘/u01/app/oracle‘
*.dispatchers=‘(PROTOCOL=TCP) (SERVICE=userdataXDB)‘
*.java_jit_enabled=FALSE
*.memory_target=1526726656
*.open_cursors=600
*.processes=600
*.remote_login_passwordfile=‘EXCLUSIVE‘
*.undo_tablespace=‘UNDOTBS1‘
*.db_unique_name=‘userdata1‘
*.log_archive_config=‘DG_CONFIG=(userdata1,userdata2)‘
*.log_archive_dest_1=‘location=/u01/app/oracle/arch‘
*.log_archive_dest_2=‘SERVICE=userdata2 LGWR ASYNC VALID_FOR=(ONLINE_LOGFILES,PRIMARY_ROLE) DB_UNIQUE_NAME=userdata2‘
*.log_archive_dest_state_1=‘ENABLE‘
*.log_archive_dest_state_2=‘ENABLE‘
*.standby_file_management=‘AUTO‘
*.fal_client=‘userdata1‘
*.fal_server=‘userdata2‘

1.5. 导入新的参数文件,使dataguard配置生效

SYS@userdata>shutdown immediate;
SYS@userdata>create spfile from pfile=‘/home/oracle/pfile.ora‘;
SYS@userdata>startup;

2. standby库设置dataguard相关参数

3. 对primary库做备份

4. 传输备份到standby库

5. 还原standby库

6. 创建standby联机日志

7. 开启stanby库恢复进程

8.primary库归档,查看dataguard数据同步是否成功

时间: 2024-10-25 10:44:58

Oracle 11.2.0.4.0 dataguard部署和日常维护(2)的相关文章

Oracle 11.2.0.4.0 Dataguard部署和日常维护(6)-Active dataguard

1. 检查主备库的状态 on primary column DATABASE_ROLE format a20 column OPEN_MODE format a15 column PROTECTION_MODE format a20 column SWITCHOVER_STATUS format a20 select DATABASE_ROLE,OPEN_MODE,PROTECTION_MODE,SWITCHOVER_STATUS from v$database; DATABASE_ROLE O

Oracle 11.2.0.4.0 Dataguard部署和日常维护(5)-Datauard 主备切换和故障转移篇

1. dataguard主备切换 1.1. 查看当前主备库是否具备切换条件 on slave select sequence#,first_time,next_time,archived,applied from v$archived_log where SEQUENCE#=(select max(SEQUENCE#) from v$archived_log); SEQUENCE# FIRST_TIME NEXT_TIME ARCHIVED APPLIED ---------- --------

Oracle 11.2.0.4.0 Dataguard部署和日常维护(7) - Dataguard Flashback

1. 检查主备库同步状态 2. 开启备库的闪回功能和闪回目录 3. 取消备库的恢复进程 4. 创建备库的还原点 5. 在主库归档日志 6. 确认备库已经归档了最新的日志 7. 延迟指向将被激活的备的日志归档目的地 8. 激活备库 9. 向备库写入测试数据 10. 将备库闪回至还原点 11. 重新启用到备库的日志归档目的地 12. 测试数据同步是否正常

Oracle 11.2.0.4.0 Dataguard部署和日常维护(6)-Dataguard Snapshot

1. 检查当前主备库同步状态 on primary select ads.dest_id,max(sequence#) "Current Sequence", max(log_sequence) "Last Archived" from v$archived_log al, v$archive_dest ad, v$archive_dest_status ads where ad.dest_id=al.dest_id and al.dest_id=ads.dest_

Oracle 11.2.4.0 ACTIVE DATAGUARD 单实例安装(COPY创建备库)

Oracle 11.2.4.0 ADG 单实例安装(COPY创建备库) 规划: 主: OS: Linux Centos 6.5 X64 hostname:ORA11G-DG1 ipaddress:192.168.213.199 db_unique_name=netdata_pd db_name=netdata 备: OS: Linux Centos 6.5 X64 hostname:ORA11G-DG2 ipaddress:192.168.213.200 db_unique_name=netda

Oracle 11.2.0.4 RAC Standby实施手册

Oracle RAC Standby实施手册   目录 1 实施环境规划 3 1.1 IP地址规划 3 1.2 归档配置相关参数 3 1.3 主库软件环境信息 4 1.4 备库软件环境信息 4 2 Active DataGuard实施条件 6 3 Active DataGuard实施准备 8 3.1 配置DG专用监听 8 3.1.1 创建LISTENER_DG 8 3.1.2 将监听加入到crs资源 10 3.2 配置TNS别名 10 3.3 同步口令文件 11 3.4 测试TNS配置有效性 1

Oracle 11.2.0.4.0 DG (ASM) 搭建案例

图示:ARC进程 实验环境 主机:CentOS release 6.5 (Final) 软件:Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production 主库:db_unique_name:orcl1 备库:db_unique_name:orcl1dg ============================================================================

Asianux 7.3安装Oracle 11.2.0.4单实例体验

环境:Asianux 7.3 需求:安装Oracle 11.2.0.4 单实例 背景:系统使用默认的最小安装部署,Oracle安装额外需要的包统一使用yum安装. 查看当前系统相关信息: [[email protected] ~]# uname -a Linux localhost.localdomain 3.10.0-514.axs7.x86_64 #1 SMP Fri Feb 17 19:31:50 CST 2017 x86_64 x86_64 x86_64 GNU/Linux [[emai

我的淘宝:Ubuntu 14.04.5上安装 Oracle 11.2.0.4 RAC

进入淘宝店铺 教程:Ubuntu 14.04.5上安装 Oracle 11.2.0.4 RAC 请支持下.价格好商量!