12.2新特性 使用DBCA duplicate创建物理备用数据库 (Doc ID 2283697.1)

Creating a Physical Standby database using DBCA duplicate (Doc ID 2283697.1)

APPLIES TO:

Oracle Database Cloud Exadata Service - Version N/A and later
Oracle Database - Enterprise Edition - Version 12.2.0.1 to 12.2.0.1 [Release 12.2]
Oracle Database Cloud Schema Service - Version N/A and later
Oracle Database Exadata Cloud Machine - Version N/A and later
Oracle Cloud Infrastructure - Database Service - Version N/A and later
Information in this document applies to any platform.

GOAL

NOTE: In the images and/or the document content below, the user information and environment data used represents fictitious data from the Oracle sample schema(s), Public Documentation delivered with an Oracle database product or other training material. Any similarity to actual environments, actual persons, living or dead, is purely coincidental and not intended in any manner

For the purposes of this document, the following fictitious environment is used as an example to describe the procedure:  出于本文档的目的,以以下虚拟环境为例来描述该过程

Primary Database:
DB_NAME: Chicago
Primary host name : exa503

Standby Database:
DB_UNIQUE_NAME: boston
standby hostname : exa504

Diskgroups used for both :- +DATAC1 and +RECOC1  --两者均使用的磁盘组

Maximum Availability Architecture  最高可用性架构

The Maximum Availability Architecture (MAA) defines Oracle’s most comprehensive architecture for reducing downtime for scheduled outages as well as preventing, detecting and recovering from unscheduled outages. Real Application Clusters (RAC) and Oracle Data Guard are integral components of the Database MAA reference architectures and solutions.  最大可用性体系结构(MAA)定义了Oracle最全面的体系结构,以减少计划内停机的停机时间,并防止,检测和从计划外停机中恢复。实际应用集群(RAC)和Oracle Data Guard是数据库MAA参考体系结构和解决方案的组成部分。

More detailed information, such as a discussion of the purpose of MAA and the benefits it provides, can be found on the Oracle Technology Network (OTN) at http://www.oracle.com/technetwork/database/features/availability/maa-096107.html

Purpose of this Document  本文目的

The purpose of this document is to provide a step-by-step guide for creating a standby database using DBCA in an Oracle Database 12.2 environment integrating the MAA Oracle Data Guard configuration best practices. This paper assumes that the following conditions exist:

本文档的目的是提供逐步指南,以在集成了MAA Oracle Data Guard配置最佳实践的Oracle Database 12.2环境中使用DBCA创建备用数据库。本文假定存在以下条件

  1. A Primary single instance database utilizing ASM for data file storage  利用ASM进行数据文件存储的主单实例数据库
  2. The Primary database is in archive log mode  主数据库处于存档日志模式
  3. Password and Spfile are stored in ASM.  密码和Spfile存储在ASM中。
  4. The target Standby host has all the required Oracle software installed and configured.  目标备用主机已安装并配置了所有必需的Oracle软件。
  5. The Standby target database storage will utilize ASM. 备用目标数据库存储将利用ASM。
  6. The standby target resides in a separate system.  备用目标位于单独的系统中
  7. If role separation is used in your environment set the environment based on the roles with oracle or grid. In our example The oracle user owns both grid and oracle software installations.  如果在您的环境中使用角色分离,请使用oracle或grid根据角色设置环境。在我们的示例中,oracle用户拥有grid和oracle软件安装

NOTE: The DBCA duplicate command in this release can only create a single instance standby database from single instance primary database. It does not support RAC or multitenant configurations.

注意:此版本中的DBCA duplicate命令只能从单实例主数据库创建一个单实例备用数据库。它不支持RAC或多租户配置


Supported Versions  支持的版本

  • This document applies to Oracle Database Server versions 12.2.0.x or higher.   本文档适用于Oracle Database Server 12.2.0.x或更高版本

Multiple Channels Consideration:  多渠道注意事项

Performing a DBCA duplicate and using multiple channels on the primary node can significantly improve performance. If the Primary database is a RAC use multiple RMAN channels spread across the primary nodes. This utilizes more network interfaces for the data transfer.  执行DBCA duplicate并在主节点上使用多个通道可以显着提高性能。如果主数据库是RAC,请使用分布在主节点上的多个RMAN通道。这利用更多的网络接口进行数据传输

Parallelize backups across all primary database nodes leveraging disk and network bandwidth as available. MAA best practice recommend using 8 channels minimum or 2 channels per node.  利用可用的磁盘和网络带宽在所有主数据库节点上并行备份。MAA最佳实践建议每个节点至少使用8个通道或2个通道

Use automatic load balancing to distribute RMAN channels among the allocated nodes. Analyze the impact on existing production databases and reduce the RMAN parallelism if necessary.  使用自动负载平衡在分配的节点之间分配RMAN通道。分析对现有生产数据库的影响,并在必要时减少RMAN并行性

Make the following RMAN configuration changes at the primary database. Our example uses 4 preconfigured channels for RMAN to use during the standby creation step. These 4 channels will suffice for single node but can be increased if the server has additional capacity.  在主数据库上进行以下RMAN配置更改。我们的示例使用4个预配置的通道供RMAN在备用创建步骤中使用。这四个通道对于单个节点就足够了,但是如果服务器具有附加容量,则可以增加这四个通道。

[[email protected]]$ rman target /
RMAN> CONFIGURE DEFAULT DEVICE TYPE TO DISK;
RMAN> CONFIGURE DEVICE TYPE DISK PARALLELISM 4;

All of the examples illustrated in this document use the following naming:  本文档中说明的所有示例均使用以下命名


Databases and Hosts Used in this example


Primary


Standby


Hosts


exa503


exa504


Database Unique Name


chicago


boston


Instance names


chicago


boston

SOLUTION

Steps to Duplicate the Primary Database

PRIMARY DATABASE

  1. Force Logging

    Database force logging is recommended as an MAA Data Guard best practice. To enable force logging, use the following command on the primary.
    建议将数据库强制日志记录作为MAA Data Guard最佳实践。要启用强制日志记录,请在主数据库上使用以下命令

    [[email protected]]$ sqlplus / as sysdba
    SQL> alter database force logging;
  2. Create Standby Redo logs

    Create standby redo logs on the primary database that are the same size of the online redo logs. This will ensure that standby redo log files are automatically created at the standby during the DBCA duplication process and that standby redo log files are available on the current Primary after a role transition occurs in the future and the Primary becomes a standby.  在主数据库上创建与在线重做日志大小相同的备用重做日志。这将确保在DBCA复制过程中在备用数据库上自动创建备用数据库重做日志文件,并且在将来发生角色转换且主数据库成为备用数据库之后,当前主数据库上的备用数据库重做日志文件可用。

    Oracle recommends having the same number of standby redo log files as there are online redo log files plus 1 extra for each thread. Our primary database has 3 online redo log files for single thread. We therefore need 4 Standby Redo Log per thread for total of 4 standby Redo logs files. As per MAA Best Practice we recommend to create only one member for standby redo log. For example:  Oracle建议使用与在线重做日志文件相同数量的备用重做日志文件,并为每个线程额外增加1个备用重做日志文件。我们的主数据库有3个单线程在线重做日志文件。因此,每个线程我们需要4个备用重做日志,以便总共有4个备用重做日志文件。根据MAA最佳实践,我们建议仅创建一个成员作为备用重做日志。例如:

    • Check existing redo log members and their sizes.  检查现有重做日志成员及其大小
    [[email protected]]$ sqlplus / as sysdba
    SQL> select thread#,group#,bytes/1024/1024/1024 SIZE_IN_GB, status from v$log;
    
    THREAD#       GROUP# SIZE_IN_GB    STATUS
    ---------- ---------- -------------- ----------------
     1            1             4             CURRENT
     1            2             4             UNUSED
     1            3             4             UNUSED
    
    • Create the Standby redo logs:  创建备用重做日志
    [[email protected]]$ sqlplus / as sysdba
    
    SQL> alter database add standby logfile thread 1
    group 4 (‘+DATAC1’)  size 4G,
    group 5 (‘+DATAC1’)  size 4G,
    group 6 (‘+DATAC1’)  size 4G;
    group 7 (‘+DATAC1’)  size 4G;
  3. Ensure archiving is set to Fast Recovery Area on the primary.  确保在主数据库上将归档设置为“快速恢复区域”

    [[email protected]]$ sqlplus / as sysdba
    SQL> alter system set log_archive_dest_1=‘location=USE_DB_RECOVERY_FILE_DEST valid_for=(ALL_LOGFILES,ALL_ROLES) db_unique_name=chicago‘
  4. Create net alias for primary and standby database.  为主数据库和备用数据库创建网络别名


    In tnsnames.ora file on the primary node


    In tnsnames.ora file on the standby node


    chicago =
    (DESCRIPTION =
    (ADDRESS_LIST =
    (ADDRESS=(PROTOCOL= TCP)(HOST=exa503)(PORT=1521)))

    (CONNECT_DATA =
    (SERVER = DEDICATED)
    (SERVICE_NAME = chicago)
    )
    )

    boston =
    (DESCRIPTION =
    (ADDRESS_LIST =
    (ADDRESS=(PROTOCOL = TCP)(HOST=exa504) (PORT=1521)))

    (CONNECT_DATA =
    (SERVER = DEDICATED)
    (SERVICE_NAME = boston)
    )
    )

    chicago_local_listener =
    (DESCRIPTION =
    (ADDRESS_LIST =
    (ADDRESS=(PROTOCOL = TCP)(HOST=exa503)(PORT=1521))))


    chicago =
    (DESCRIPTION =
    (ADDRESS_LIST =
    (ADDRESS=(PROTOCOL= TCP)(HOST=exa503)(PORT=1521)))

    (CONNECT_DATA =
    (SERVER = DEDICATED)
    (SERVICE_NAME = chicago)
    )
    )

    boston =
    (DESCRIPTION =
    (ADDRESS_LIST =
    (ADDRESS=(PROTOCOL = TCP)(HOST=exa504) (PORT=1521)))

    (CONNECT_DATA =
    (SERVER = DEDICATED)
    (SERVICE_NAME = boston)
    )
    )

    boston_local_listener =
    (DESCRIPTION =
    (ADDRESS_LIST =
    (ADDRESS=(PROTOCOL = TCP)(HOST=exa504)(PORT=1521))))

    STANDBY DATABASE

  5. On Standby site execute the DBCA duplicate command  在备用站点上执行DBCA重复命令

    [[email protected] ~]$ dbca -silent -createDuplicateDB -gdbName chicago -sid boston -sysPassword welcome1 -primaryDBConnectionString exa503:1521/chicago -createAsStandby -dbUniqueName boston –initParams db_create_file_dest=+DATAC1,db_recovery_file_dest=+RECOC1,local_listener=”boston_local_listener”
  6. Set the parameters and create the Broker configuration  设置参数并创建Broker配置

    Modify the script below to your environment and save as PostCR.sql  将以下脚本修改为您的环境,然后另存为PostCR.sql

    NOTE: Flashback database is required to reinstate a failed primary after a failover role transition. Optionally enable flashback on both the primary and standby. The standby database can begin using flashback on execution of the PostCR script.

    注意:故障转移角色转换后,需要闪回数据库才能恢复发生故障的主数据库。(可选)在主数据库和备用数据库上启用闪回。备用数据库可以在执行PostCR脚本时开始使用闪回。

    [[email protected] ~]$ cat PostCR.sql
    
    connect sys/welcome1 as sysdba
    alter system set LOG_ARCHIVE_DEST_1=‘LOCATION=USE_DB_RECOVERY_FILE_DEST VALID_FOR=(ALL_LOGFILES,ALL_ROLES) DB_UNIQUE_NAME=boston‘ scope=spfile;
    alter system set db_file_name_convert=‘+DATAC1/chicago‘,‘+DATAC1/boston‘ scope=spfile;
    alter system set log_file_name_convert=‘+RECOC1/chicago‘,‘+RECOC1/boston‘ scope=spfile;
    alter system set standby_file_management=auto scope=spfile;
    alter system set dg_broker_config_file1=‘+DATAC1/boston/dr1.dat‘ scope=spfile;
    alter system set dg_broker_config_file2=‘+RECOC1/boston/dr2.dat‘ scope=spfile;
    alter system set db_flashback_retention_target=120 scope=spfile;
    alter database flashback on;
    alter system set dg_broker_start=true scope=spfile;
    alter system set remote_listener=‘prmy-scan:1521‘ scope=spfile;
    shutdown immediate
    startup
    alter system register;
    connect sys/[email protected] as sysdba
    alter system set standby_file_management=auto scope=both;
    alter system set dg_broker_config_file1=‘+DATAC1/chicago/dr1.dat‘ scope=both;=
    alter system set dg_broker_config_file2=‘+RECOC1/chicago/dr2.dat‘ scope=both;
    alter system set dg_broker_start=TRUE;
    host sleep 30
    host dgmgrl sys/[email protected] "CREATE CONFIGURATION dgconfig AS PRIMARY DATABASE IS CHICAGO CONNECT IDENTIFIER IS CHICAGO";
    host sleep 30
    host dgmgrl sys/[email protected] "ADD DATABASE BOSTON AS CONNECT IDENTIFIER IS BOSTON" ;
    host dgmgrl sys/[email protected] "ENABLE CONFIGURATION"
    exit
  7. Execute the script PosrtCR.sql on the standby database. Set your oracle database environment on standby host.  在备用数据库上执行脚本PosrtCR.sql。在备用主机上设置oracle数据库环境

    [[email protected] ~]$ export ORACLE_HOME=/u01/app/12.2.0.1/dbhome_1
    [[email protected] ~]$ export ORACLE_SID=boston
    [[email protected] ~]$ export PATH=$ORACLE_HOME/bin:$PATH
    [[email protected]]$ sqlplus / as sysdba
    
    SQL> @PostCR.sql
    
  8. Validate the Broker configuration  验证Broker配置

    [[email protected] ~]$dgmgrl sys/<password>
    DGMGRL> show configuration
    
    Configuration - dgconfig
    
    Protection Mode: MaxPerformance
    Members:
    chicago - Primary database
    boston - Physical standby database
    
    Fast-Start Failover: DISABLED
    
    Configuration Status:
    SUCCESS (status updated 58 seconds ago)
  9. Create the password file and spfile in ASM.  在ASM中创建密码文件和spfile

    [[email protected] ~]$ export ORACLE_SID=+ASM1
    [[email protected]]$ export ORACLE_HOME=/u01/app/12.2.0.1/grid
    [[email protected] ~]$ export PATH=$ORACLE_HOME/bin:$PATH
    [[email protected]]$asmcmd –p
    
    ASMCMD [+] > mkdir DATAC1/BOSTON/PASSWORD
    
    ASMCMD [+] > pwcopy /u01/app/oracle/product/12.2.0.1/dbhome_1/dbs/orapwboston +DATAC1/BOSTON/PASSWORD/pwboston
    
    [[email protected]]$ rm /u01/app/oracle/product/12.2.0.1/dbhome_1/dbs/orapwboston
    
    [[email protected] ~]$ export ORACLE_HOME=/u01/app/12.2.0.1/dbhome_1
    [[email protected] ~]$ export ORACLE_SID=boston
    [[email protected] ~]$ export PATH=$ORACLE_HOME/bin:$PATH
    
    [email protected]]$ sqlplus / as sysdba
    
    SQL> create pfile=‘/tmp/b.ora‘ from spfile;
    
    SQL> create spfile=‘+DATAC1/BOSTON/spfileboston.ora‘ from pfile=‘/tmp/b.ora‘;
    
    [[email protected]]$ rm /u01/app/oracle/product/12.2.0.1/dbhome_1/dbs/spfileboston.ora
  10. Create initboston.ora and shutdown database  创建initboston.ora并关闭数据库

    [[email protected]]$ echo “spfile=‘+DATAC1/BOSTON/spfileboston.ora‘” > /u01/app/oracle/product/12.2.0.1/dbhome_1/dbs/initboston.ora
    SQL> shutdown immediate
    SQL>exit
    
  11. Add the Physical standby database to the Oracle Restart configuration and start the database  将物理备用数据库添加到Oracle Restart配置中并启动数据库

    [[email protected]]$ srvctl add database -db boston -oraclehome /u01/app/oracle/product/12.2.0.1/dbhome_1 -dbtype Single -instance boston -node exa504-dbname chicago -diskgroup RECOC1,DATAC1 -role physical_standby -spfile ‘+DATAC1/BOSTON/spfileboston.ora‘ -pwfile ‘+DATAC1/BOSTON/PASSWORD/pwboston‘
    [[email protected]]$ srvctl start database -db boston

This concludes building a single instance standby database from single instance primary database using DBCA.  至此,使用DBCA从单实例主数据库构建了一个单实例备用数据库

原文地址:https://www.cnblogs.com/zylong-sys/p/12042980.html

时间: 2024-07-30 11:38:32

12.2新特性 使用DBCA duplicate创建物理备用数据库 (Doc ID 2283697.1)的相关文章

Oracle Audit Vault and Database Firewall 12.2 新特性

Oracle Audit Vault and Database Firewall 12.2 新特性 Audit Vault Server的备份恢复组件被集成进AVDF产品. 当Audit Vault Agent(审计代理)重新启动或AVDF升级收,Audit Trail(审计线索)将会自动启动. AVCLI组件可以非交互式使用,通过存储在AVCLI的Wallet里存储管理员的认证信息. 可以使用Auidit Vault Agent(审计代理)的处理线程数量优化主机处理的性能. 可以配置Datab

【译】 Node.js v0.12的新特性 -- Cluster模式采用Round-Robin负载均衡

原文:https://strongloop.com/strongblog/whats-new-in-node-js-v0-12-cluster-round-robin-load-balancing Node.js v0.12的新特性 -- Cluster采用轮询调度算法来进行负载均衡 November 19, 2013 by Ben Noordhuis 欢迎来到由Node的核心提交者 Ben Noordhuis 和 Bert Belder撰写的系列博文的第一篇.本系列可能由7-8篇构成,主要涵盖

版本12.1新特性:优先级负载均衡法

如果不希望负载均衡,一组服务器down掉才启用下一组怎么办?在以前版本的实现方法是backup vserver,或者做个反向的monitor.如果实现的组比较多,逻辑上还是有些复杂的. 而在 12.1单独实现了最简单的逻辑:优配先级 新版多了一个按钮 优先级负载均衡 建立vserver时定义下面有几组备份服务器 定义好后插入服务器组,每组直接选定优先级就可以了 版本12.1新特性:优先级负载均衡法 原文地址:http://blog.51cto.com/netscaler/2120602

Oracle11g Data Guard物理备用数据库搭建与配置(第1部分 主数据库实例创建)

环境准备 在我的测试环境中,准备了两台CentOS7.4虚拟机,并同时都安装了Oracle11gR2的11.2.0.1.0企业版的数据库软件,其中只有主服务器创建一个数据库实例,备用服务器仅安装Oracle数据库软件. 主数据库(DB1) OS CentOS7.4 Hostname hmdb11dg-db1 Oracle Version 11.2.0.1.0 Oracle SID HMDG(使用DBCA工具创建的一个数据库) 备数据库(DB2) OS CentOS7.4 Hostname hmd

Oracle Database 12.2新特性详解

在2015年旧金山的Oracle OpenWorld大会上,Oracle发布了Database 12.2的Beta版本,虽然Beta版本只对部分用户开放,但是大会上已经公布了12.2的很多重要的新特性,云和恩墨是Oracle的Beta用户,已经开始测试这一产品.在刚刚结束的"Oracle技术嘉年华"大会上,更详细的主题分享披露了更多内容.在这篇文章中,我将和大家一一来细数Oracle Database 12.2的新特性. Oracle Sharding的实现 简单来说,Oracle的S

goldengate 12c 12.2 新特性

GoldenGate 12.2已经提供下载,增加了不少新特性 1. 异构配置加强不在需要sourceDefs和AssumeTargetDefs文件,在队列文件中已经包含metadata信息,比如table name, column name, column type等,进一步降低OGG在异构环境下配置的工作量: 2. 内置心跳表在早期的OGG版本中,如果要监控进程的延迟状态,需要手工创建心跳表,现在通过配置就可以启用心跳表监控功能,在GGSCI中add heartBeatTable即可.此时,会

Oracle 12.1新特性----使用RMAN从备份中实现recover table

在Oracle12c版本之前,使用RMAN能恢复的级别为数据库级别和表空间级别,如果只有一张表需要恢复,而在数据库级别或表空间级别做恢复,影响范围就太大了.因此12.2版本中提供了一个新特性使用RMAN在表级别做恢复,并且恢复过程中不影响数据库的正常使用.这一功能不仅可以恢复表,还可以恢复表分区. 下面在12.2版本上做表级别恢复的实验 [email protected]>select * from v$version; BANNER      CON_ID ------------------

Oracle 12.2新特性----在线move表

Oracle12.2版本之前,对表做move操作时会对表加exclusive锁,表上无法执行DML操作.虽然move操作有ONLINE子句,但只适用于IOT表,不适用于堆表.这就意味着在对表做move操作时,无法执行任何DML操作,如果对关键表做move操作时只能停业务来完成.到了Oracle12.2版本,推出了一个新特性----在线move表,对于普通堆表可以在move过程中执行DML操作. 下面以11.2.0.4和12.2.0.1这两个版本为对比,观察这一新特性. 1.11.2.0.4版本的

Oracle 12.2新特性----在线把非分区表转为分区表

在Oracle12.2版本之前,如果想把一个非分区表转为分区表常用的有这几种方法:1.建好分区表然后insert into select 把数据插入到分区表中:2.使用在线重定义(DBMS_REDEFINITION)的方法.它们的币是:第一种方法,如果对表有频繁的DML操作,尤其是update操作,就需要停业务来做转换.第二种方法可以在线进行操作,不需要停业务,但操作步骤比较复杂,且可能出错. Oracle12cR2版本中提供了一种新特性,一条语句就可以把非分区表转换为分区表,语法如下: ALT