Oracle 11gR2 Duplicate target database for standby

1. copy standby control file from primary db to standby db and rename the file name and location in stdby db same as the primary db

2. copy password file from primary db to the standby db (keep both of them same )

3. use the pfile to startup the standby database using  >>>>>>>>>>

SQL> conn [email protected] as sysdba
输入口令:
已连接到空闲例程。
SQL> startup nomount pfile=‘d:\pfileBRS.ora‘
ORACLE 例程已经启动。startup nomount  pfile= ‘

>>>use recovery catalog to duplicate database

rman target  sys/[email protected]  auxiliary sys/[email protected] catalog rman/[email protected]

run
{
allocate channel disk1 device type disk;
allocate channel disk2 device type disk ;
allocate channel disk3 device type disk ;
allocate channel disk4 device type disk ;
allocate auxiliary channel aux1 device type disk ;
allocate auxiliary channel aux2 device type disk ;
allocate auxiliary channel aux3 device type disk ;
allocate auxiliary channel aux4 device type disk ;
DUPLICATE TARGET DATABASE
  FOR STANDBY
  FROM ACTIVE DATABASE
  DORECOVER
  PASSWORD FILE
  SPFILE
    SET db_unique_name=‘BRSSTBY‘ COMMENT ‘Is standby‘
    SET LOG_ARCHIVE_DEST_2=‘SERVICE=BRS ASYNC VALID_FOR=(ONLINE_LOGFILES,PRIMARY_ROLE) DB_UNIQUE_NAME=BRS‘
    SET FAL_SERVER=‘BRS‘ COMMENT ‘Is primary‘
  NOFILENAMECHECK;
}

SQL> shutdown immediate;
ORA-01109: database not open
SQL> startup mount;

SQL> alter database recover managed standby database disconnect from session;

Start the apply process on standby server.

# Foreground redo apply. Session never returns until cancel.
ALTER DATABASE RECOVER MANAGED STANDBY DATABASE;

# Background redo apply. Control is returned to the session once the apply process is started.

ALTER DATABASE RECOVER MANAGED STANDBY DATABASE DISCONNECT FROM SESSION;

If you need to cancel the apply process, issue the following command.

SQL> ALTER DATABASE RECOVER MANAGED STANDBY DATABASE CANCEL;

On Primary:

SQL> archive log list
SQL> alter system switch logfile;

On Standby:

SQL> SELECT SEQUENCE#,APPLIED FROM V$ARCHIVED_LOG ORDER BY SEQUENCE#;

SEQUENCE# APPLIED
———- —————————
31 YES
32 YES
33 YES
34 YES
35 IN-MEMORY

SQL> ALTER DATABASE REGISTER LOGFILE ‘<archive destination with archive file>‘;

on prod DB
SQL> SELECT STATUS,PROCESS FROM V$MANAGED_STANDBY;

STATUS PROCESS
------------ ---------
CLOSING ARCH
CLOSING ARCH
CLOSING ARCH
WRITING LNS

on standby

SQL> SELECT STATUS,PROCESS FROM V$MANAGED_STANDBY;

SQL> select database_role from v$database;

DATABASE_ROLE
————————————————
PHYSICAL STANDBY

注意Data Guard 启动顺序:
启动顺序:先standby ,后primary;
关闭顺序:先primary 后standby;

SQL> select member from v$logfile;

MEMBER
-----------------------------------------------
G:\ORACLE_DATA\BRS\REDO41.LOG
D:\ORACLE_DATA\BRS\REDO42.LOG
F:\ORACLE_DATA\BRS\REDO31.LOG
G:\ORACLE_DATA\BRS\REDO32.LOG
E:\ORACLE_DATA\BRS\REDO21.LOG
F:\ORACLE_DATA\BRS\REDO22.LOG
D:\ORACLE_DATA\BRS\REDO11.LOG
E:\ORACLE_DATA\BRS\REDO12.LOG
E:\ORACLE_DATA\STANDBYBRS\STDY_REDO51.LOG
D:\ORACLE_DATA\STANDBYBRS\STDY_REDO52.LOG
F:\ORACLE_DATA\STANDBYBRS\STDY_REDO61.LOG

MEMBER
-----------------------------------------------
G:\ORACLE_DATA\STANDBYBRS\STDY_REDO62.LOG
E:\ORACLE_DATA\STANDBYBRS\STDY_REDO71.LOG
F:\ORACLE_DATA\STANDBYBRS\STDY_REDO72.LOG
D:\ORACLE_DATA\STANDBYBRS\STDY_REDO81.LOG
E:\ORACLE_DATA\STANDBYBRS\STDY_REDO82.LOG

已选择16行。

时间: 2024-10-14 17:11:15

Oracle 11gR2 Duplicate target database for standby的相关文章

做dg备库执行duplicate target database for standby nofilenamecheck报RMAN-06023

RMAN duplicate for standby失败解决过程在用rman duplicate to standby 生成备库的时候总是不成功,多次尝试均是下面的错误:RMAN> duplicate target database for standby nofilenamecheck;Starting Duplicate Db at 16-JAN-2013 12:22:45using target database control file instead of recovery catal

使用duplicate target database ... from active database复制数据库

source db:ora11auxiliary db:dupdb 1.修改监听文件,静态注册监听 SID_LIST_ORA11 = (SID_LIST = (SID_DESC = (GLOBAL_DBNAME = ora11) (ORACLE_HOME = /u11/app/oracle/product/11.2.0/dbhome_1) (SID_NAME =ora11) ) (SID_DESC = (GLOBAL_DBNAME = dupdb) (ORACLE_HOME = /u11/app

关于Oracle 11gR2中的Database Smart Flash Cache特性以及该特性所适用的操作系统

参考自: How To Size the Database Smart Flash Cache (文档 ID 1317950.1) 首先是对Database Smart Flash Cache的介绍: The Database Smart Flash Cache is a new feature in Oracle Database 11g Release 2 (11.2). The Database Smart Flash Cache is a transparent extension of

Oracle 11g Data Guard 使用duplicate from active database 创建 standby database

用这种方式来搭建DG ,主库的停机时间很少,只需要重启一下,使参数生效.也可以用这种方法进行DB迁移.DG搭建好,然后把备库激活就可以了. 这样整个迁移中宕机时间也比较短. Oracle 11g的pyhsical standby 支持open read only 下的apply和Real-time query. 因此就有了physical standby 稳定和logical standby 的报表查询功能. Oracle: 11.2.0.1 OS: redhat 5.5 Primary IP:

oracle 11gR2 搭建dataguard

1.搭建环境 主库   oracle11gR2    备库 oracle11gR2 db_name orcl            orcl db_unique_name orcl       standby239 配置host文件 主库:primaryHost     备库:standbyHost 准备库都置于归档模式. 2.配置静态监听 主备库都配置 listener.ora SID_LIST_LISTENER = (SID_LIST = (SID_DESC = (SID_NAME = CL

【RMAN】RMAN-05001: auxiliary filename conflicts with the target database

oracle 11.2.0.4 运行以下脚本,使用活动数据库复制技术创建dataguard备库报错rman-005001: run{ duplicate target database for standby from active database spfile     set db_unique_name='dbkingstd'     set log_file_name_convert '/u01/app/oracle/oradata/dbking','/u01/app/oracle/or

ORACLE 11G 之DATAGUARD搭建物理standby

1 安装环境 在Primary库上安装数据库软件,并建监听和实例,在Standby库上安装数据库软件,并建监听,但不建实例. Primary库 Standby库 操作系统 CentOS release 6.4 64位 CentOS release 6.4 64位 IP/主机名 192.183.3.17/nn 192.183.3.145/kk 数据库软件版本 oracle 11.2.0.1.0 oracle 11.2.0.1.0 ORACLE_HOME /home/oracle/product /

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 11gR2 使用RMAN Duplicate复制数据库

Oracle 11gR2 使用RMAN Duplicate复制数据库  作者:吴伟龙 PrudentWoo QQ:286507175    前言:     上周刚做完一个项目,用户要求RAC的数据库能够自动备份到另外一个单节点上,单节点能够正常拿起来就能用.当时跟他们讨论的是用ADG来做,但通过描述后,用户觉得如果要人工干预的话太麻烦,它不想做任何的人工干预,实现数据自动到这台单机上来,那只是一台备用的数据库,没事的时候可以登录上去看看历史的数据情况. 这个时候我提出了11g的RMAN Dupl