Home Database Mysql Tutorial OracleDG之--构建PhysicalStandby

OracleDG之--构建PhysicalStandby

Jun 07, 2016 pm 02:55 PM
or Construct

Oracle DG之--构建Physical Standby 系统环境: 操作系统: RedHat EL4 Oracle: Oracle 10.2.0.1.0 650) this.width=650;" src="http://www.68idc.cn/help/uploads/allimg/151111/121R54538-0.jpg" title="dg2.png" alt="wKioL1R28C2B7wXmAACOWpabg-4498.jpg

Oracle DG之--构建Physical Standby


系统环境:

操作系统: RedHat EL4

Oracle:    Oracle 10.2.0.1.0

wKioL1R28C2B7wXmAACOWpabg-4498.jpg

                                  从以上图中所示:主库为bj(db_unique_name),备库为sh。


案例分析:

 本案例采用RMAN Duplicate方式建立standby database。

一、配置主备库初始化参数

主库的初始化参数:initbj.ora

[oracle@ocmtest dbs]$ more initbj.ora 
*.audit_file_dest='/u01/app/oracle/admin/bj/adump'
*.background_dump_dest='/u01/app/oracle/admin/bj/bdump'
*.compatible='10.2.0.1.0'
*.control_files='/u01/app/oracle/oradata/bj/control01.ctl','/u01/app/oracle/oradata/bj/control02.ctl','/u01/app/oracle/oradata/bj/control
03.ctl'
*.core_dump_dest='/u01/app/oracle/admin/bj/cdump'
*.db_block_size=8192
*.db_domain=''
*.db_file_multiblock_read_count=16
*.db_name='bj'
*.db_recovery_file_dest='/u01/app/oracle/flash_recovery_area'
*.db_recovery_file_dest_size=2147483648
*.dispatchers='(PROTOCOL=TCP) (SERVICE=bjXDB)'
*.job_queue_processes=10
*.open_cursors=300
*.pga_aggregate_target=68157440
*.processes=150
*.remote_login_passwordfile='EXCLUSIVE'
*.sga_target=205520896
*.undo_management='AUTO'
*.undo_tablespace='UNDOTBS1'
*.user_dump_dest='/u01/app/oracle/admin/bj/udump'
Copy after login

以下为DG配置参数:

DB_UNIQUE_NAME=bj
LOG_ARCHIVE_CONFIG='DG_CONFIG=(bj,sh)'

LOG_ARCHIVE_DEST_1='LOCATION=/u01/disk1/arch/bj/ VALID_FOR=(ALL_LOGFILES,ALL_ROLES) DB_UNIQUE_NAME=bj'    

LOG_ARCHIVE_DEST_2='SERVICE=sh LGWR ASYNC VALID_FOR=(ONLINE_LOGFILES,PRIMARY_ROLE) DB_UNIQUE_NAME=sh'    
  
LOG_ARCHIVE_DEST_STATE_1=ENABLE
LOG_ARCHIVE_DEST_STATE_2=ENABLE
REMOTE_LOGIN_PASSWORDFILE=EXCLUSIVE
LOG_ARCHIVE_MAX_PROCESSES=3
FAL_SERVER=sh
FAL_CLIENT=bj
DB_FILE_NAME_CONVERT='/u01/app/oracle/oradata/sh/','/u01/app/oracle/oradata/bj/'                            
LOG_FILE_NAME_CONVERT='/u01/app/oracle/oradata/sh/','/u01/app/oracle/oradata/bj/'                             
STANDBY_FILE_MANAGEMENT=AUTO
Copy after login

备库的初始化参数:initsh.ora

[oracle@ocmtest1 dbs]$ more initsh.ora 
*.audit_file_dest='/u01/app/oracle/admin/sh/adump'
*.background_dump_dest='/u01/app/oracle/admin/sh/bdump'
*.compatible='10.2.0.1.0'
*.control_file_record_keep_time=7
*.control_files='/u01/app/oracle/oradata/sh/control01.ctl','/u01/app/oracle/oradata/sh/control02.ctl','/u01/app/oracle/oradata/sh/control
03.ctl'
*.core_dump_dest='/u01/app/oracle/admin/sh/cdump'
*.db_block_size=8192
*.db_domain=''
*.db_file_multiblock_read_count=16
*.DB_FILE_NAME_CONVERT='/u01/app/oracle/oradata/bj/','/u01/app/oracle/oradata/sh/'
*.db_name='bj'
*.db_recovery_file_dest='/u01/app/oracle/flash_recovery_area'
*.db_recovery_file_dest_size=2147483648
*.open_cursors=300
*.pga_aggregate_target=68157440
*.processes=150
*.REMOTE_LOGIN_PASSWORDFILE='EXCLUSIVE'
*.sga_target=205520896
*.undo_management='AUTO'
*.undo_tablespace='UNDOTBS1'
*.user_dump_dest='/u01/app/oracle/admin/sh/udump'
Copy after login

以下为DG配置参数:

*.DB_UNIQUE_NAME='sh'
*.FAL_CLIENT='sh'
*.FAL_SERVER='bj'
*.job_queue_processes=10
*.LOG_ARCHIVE_CONFIG='DG_CONFIG=(bj,sh)'
*.LOG_ARCHIVE_DEST_1='LOCATION=/u01/disk1/arch/sh/ VALID_FOR=(ALL_LOGFILES,ALL_ROLES) DB_UNIQUE_NAME=sh'
*.LOG_ARCHIVE_DEST_2='SERVICE=bj LGWR ASYNC VALID_FOR=(ONLINE_LOGFILES,PRIMARY_ROLE) DB_UNIQUE_NAME=bj'
*.LOG_ARCHIVE_DEST_STATE_1='ENABLE'
*.LOG_ARCHIVE_DEST_STATE_2='ENABLE'
*.log_archive_format='arch_%t_%s_%r.log'
*.LOG_ARCHIVE_MAX_PROCESSES=3
*.LOG_FILE_NAME_CONVERT='/u01/app/oracle/oradata/bj/','/u01/app/oracle/oradata/sh/'
*.STANDBY_FILE_MANAGEMENT='AUTO'
Copy after login

二、在主库上建立standby 日志

   对于默认的最大性能的保护方式,可以不用建立standby redo logfiles;但建立standby redo logfiles可以更好的保存redo log;standby redo日志组组数应等于或多于redo log,日志的大小应该一致。
   
SQL> alter database add standby logfile group 4 ('/u01/app/oracle/oradata/bj/redo04.log') size 50m;

 SQL> alter database add standby logfile group 5 ('/u01/app/oracle/oradata/bj/redo05.log.rdo') size 50m;
 
 SQL> alter database add standby logfile group 6 ('/u01/app/oracle/oradata/bj/redo06.log') size 50m;
Copy after login

三、在备库上建立相应目录:

[oracle@ocmtest1 dbs]$mkdir -p /u01/app/oracle/admin/sh/adump
[oracle@ocmtest1 dbs]$mkdir -p /u01/app/oracle/admin/sh/udump
[oracle@ocmtest1 dbs]$mkdir -p /u01/app/oracle/admin/sh/bdump
[oracle@ocmtest1 dbs]$mkdir -p /u01/app/oracle/admin/sh/cdump
[oracle@ocmtest1 dbs]$mkdir -p /u01/app/oracle/oradata/sh
Copy after login

四、在主库生成备库的controlfile和备份


1、数据库在mount 状态下
06:57:41 SQL> alter database create standby controlfile as '/home/oracle/std_control01.ctl';

2、 将生成的控制文件,拷贝到备库相同的目录下
[oracle@ocmtest1 ~]$ scp  /home/oracle/std_control01.ctl 192.168.8.86:/home/oracle

对主库进行备份
[oracle@ocmtest bj]$ rman target /
Recovery Manager: Release 10.2.0.1.0 - Production on Wed Aug 31 10:55:55 2011
Copyright (c) 1982, 2005, Oracle.  All rights reserved.
connected to target database (not started)
RMAN> run {                                                                     
2>  startup force mount;                                                           
3>  backup database format='/u01/disk1/rman/bj/bj_%s.bak' plus archivelog;      
4> alter database open;                                                        
5> }
Copy after login


五、在备库上Duplicate Database(备库启动到弄mount)

1)在备库上建立/u01/disk1/rman/bj目录
   拷贝主库的备份到备库/u01/disk1/rman/bj目录(拷贝到相同的目录下)

[oracle@ocmtest bj]$ scp /u01/disk1/rman/bj/bj_*.bak 192.168.8.86:/u01/disk1/rman/bj

2)配置Oracle network

因为,备库启动到no mount 状态,拒绝用户远程联机,所以采用静态注册,如下所示备库listenter
[oracle@ocmtest1 admin]$ cat listener.ora
# listener.ora Network Configuration File: /u01/app/oracle/product/10.2.0/db_1/network/admin/listener.ora
# Generated by Oracle configuration tools.
SID_LIST_LISTENER =
  (SID_LIST =
    (SID_DESC =
      (SID_NAME = PLSExtProc)
      (ORACLE_HOME = /u01/app/oracle/product/10.2.0/db_1)
      (PROGRAM = extproc)
    )
   (SID_DESC =
      (GLOBAL_DBNAME = bj)
      (ORACLE_HOME = /u01/app/oracle/product/10.2.0/db_1)
      (SID_NAME = bj)
    )
  
)

LISTENER =
  (DESCRIPTION_LIST =
    (DESCRIPTION =
      (ADDRESS = (PROTOCOL = TCP)(HOST = ocmtest1.51CTO提醒您,请勿滥发广告!)(PORT = 1521))
      (ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC0))
    )
  )

如下所示:主库的tnsnames文件:
[oracle@ocmtest1 admin]$ 
[oracle@ocmtest admin]$ cat tnsnames.ora 
# tnsnames.ora Network Configuration File: /u01/app/oracle/product/10.2.0/db_1/network/admin/tnsnames.ora
# Generated by Oracle configuration tools.
BJ =
  (DESCRIPTION =
    (ADDRESS_LIST =
      (ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.8.84)(PORT = 1521))
    )
    (CONNECT_DATA =
      (SERVICE_NAME = bj)
    )
)
SH =
  (DESCRIPTION =
    (ADDRESS_LIST =
      (ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.8.86)(PORT = 1521))
    )
    (CONNECT_DATA =
      (SERVICE_NAME = sh)
       (UR=A)   ;添加此项连接到静态注册的备库
    )
)

测试连接备库
[oracle@ocmtest bj]$ sqlplus sys/oracle@sh as sysdba
SQL*Plus: Release 10.2.0.1.0 - Production on Wed Aug 31 11:19:32 2011
Copyright (c) 1982, 2005, Oracle.  All rights reserved.
Connected to:
Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - Production
With the Partitioning, OLAP and Data Mining options
SQL> exit                                                                                                                                
Disconnected from Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - Production
With the Partitioning, OLAP and Data Mining options

通过主库连接到备库,进行恢复(通过克隆方式建立备库)
[oracle@ocmtest bj]$ rman target /
Recovery Manager: Release 10.2.0.1.0 - Production on Wed Aug 31 11:19:36 2011
Copyright (c) 1982, 2005, Oracle.  All rights reserved.
connected to target database: BJ (DBID=1015723911)

RMAN> connect auxiliary sys/oracle@sh;                                                                                                 
connected to auxiliary database: BJ (not mounted)

RMAN> duplicate target database for standby;                                    
Starting Duplicate Db at 31-AUG-11
using target database control file instead of recovery catalog
allocated channel: ORA_AUX_DISK_1
channel ORA_AUX_DISK_1: sid=155 devtype=DISK
contents of Memory Script:
{
   restore clone standby controlfile;
   sql clone 'alter database mount standby database';
}
executing Memory Script
Starting restore at 31-AUG-11
using channel ORA_AUX_DISK_1
channel ORA_AUX_DISK_1: restoring control file
channel ORA_AUX_DISK_1: copied control file copy
input filename=/home/oracle/stand.ctl
output filename=/u01/app/oracle/oradata/sh/control01.ctl
output filename=/u01/app/oracle/oradata/sh/control02.ctl
output filename=/u01/app/oracle/oradata/sh/control03.ctl
Finished restore at 31-AUG-11
sql statement: alter database mount standby database
released channel: ORA_AUX_DISK_1
contents of Memory Script:
{
   set newname for tempfile  1 to 
 "/u01/app/oracle/oradata/sh/temp01.dbf";
   switch clone tempfile all;
   set newname for datafile  1 to 
 "/u01/app/oracle/oradata/sh/system01.dbf";
   set newname for datafile  2 to 
 "/u01/app/oracle/oradata/sh/undotbs01.dbf";
   set newname for datafile  3 to 
 "/u01/app/oracle/oradata/sh/sysaux01.dbf";
   set newname for datafile  4 to 
 "/u01/app/oracle/oradata/sh/users01.dbf";
   set newname for datafile  5 to 
 "/u01/app/oracle/oradata/sh/example01.dbf";
   restore
   check readonly
   clone database
   ;
}
executing Memory Script
executing command: SET NEWNAME
renamed temporary file 1 to /u01/app/oracle/oradata/sh/temp01.dbf in control file
executing command: SET NEWNAME
executing command: SET NEWNAME
executing command: SET NEWNAME
executing command: SET NEWNAME
executing command: SET NEWNAME
Starting restore at 31-AUG-11
allocated channel: ORA_AUX_DISK_1
channel ORA_AUX_DISK_1: sid=155 devtype=DISK
channel ORA_AUX_DISK_1: starting datafile backupset restore
channel ORA_AUX_DISK_1: specifying datafile(s) to restore from backup set
restoring datafile 00001 to /u01/app/oracle/oradata/sh/system01.dbf
restoring datafile 00002 to /u01/app/oracle/oradata/sh/undotbs01.dbf
restoring datafile 00003 to /u01/app/oracle/oradata/sh/sysaux01.dbf
restoring datafile 00004 to /u01/app/oracle/oradata/sh/users01.dbf
restoring datafile 00005 to /u01/app/oracle/oradata/sh/example01.dbf
channel ORA_AUX_DISK_1: reading from backup piece /u01/disk1/rman/bj/bj_2.bak
channel ORA_AUX_DISK_1: restored backup piece 1
piece handle=/u01/disk1/rman/bj/bj_2.bak tag=TAG20110831T105953
channel ORA_AUX_DISK_1: restore complete, elapsed time: 00:00:48
Finished restore at 31-AUG-11
contents of Memory Script:
{
   switch clone datafile all;
}
executing Memory Script
datafile 1 switched to datafile copy
input datafile copy recid=10 stamp=760621486 filename=/u01/app/oracle/oradata/sh/system01.dbf
datafile 2 switched to datafile copy
input datafile copy recid=11 stamp=760621487 filename=/u01/app/oracle/oradata/sh/undotbs01.dbf
datafile 3 switched to datafile copy
input datafile copy recid=12 stamp=760621487 filename=/u01/app/oracle/oradata/sh/sysaux01.dbf
datafile 4 switched to datafile copy
input datafile copy recid=13 stamp=760621487 filename=/u01/app/oracle/oradata/sh/users01.dbf
datafile 5 switched to datafile copy
input datafile copy recid=14 stamp=760621487 filename=/u01/app/oracle/oradata/sh/example01.dbf
Finished Duplicate Db at 31-AUG-11
Copy after login

---备库建立完毕,并启动到mount状态!


六、在备库上启动MRP进程

11:40:28 SQL> SELECT status from v$instance;                                                                                             
STATUS
------------
MOUNTED

11:45:40 SQL> alter database recover managed standby database disconnect from session;                                                   
Database altered.

告警日志:
alter database recover managed standby database disconnect from session
Wed Aug 31 11:46:00 2011
Attempt to start background Managed Standby Recovery process (sh)
MRP0 started with pid=22, OS id=14159
Wed Aug 31 11:46:01 2011
MRP0: Background Managed Standby Recovery process started (sh)
Managed Standby Recovery not using Real Time Apply
Wed Aug 31 11:46:06 2011
Errors in file /u01/app/oracle/admin/sh/bdump/sh_mrp0_14159.trc:
ORA-00313: open failed for members of log group 1 of thread 1
ORA-00312: online log 1 thread 1: '/u01/app/oracle/oradata/sh/redo01.log'
ORA-27037: unable to obtain file status
Linux Error: 2: No such file or directory
Additional information: 3
Wed Aug 31 11:46:06 2011
Errors in file /u01/app/oracle/admin/sh/bdump/sh_mrp0_14159.trc:
ORA-00313: open failed for members of log group 1 of thread 1
ORA-00312: online log 1 thread 1: '/u01/app/oracle/oradata/sh/redo01.log'
ORA-27037: unable to obtain file status
Linux Error: 2: No such file or directory
Additional information: 3
Clearing online redo logfile 1 /u01/app/oracle/oradata/sh/redo01.log
Clearing online log 1 of thread 1 sequence number 23
Wed Aug 31 11:46:06 2011
Errors in file /u01/app/oracle/admin/sh/bdump/sh_mrp0_14159.trc:
ORA-00313: open failed for members of log group 1 of thread 1
ORA-00312: online log 1 thread 1: '/u01/app/oracle/oradata/sh/redo01.log'
ORA-27037: unable to obtain file status
Linux Error: 2: No such file or directory
Additional information: 3
Wed Aug 31 11:46:07 2011
Completed: alter database recover managed standby database disconnect from session
Wed Aug 31 11:46:08 2011
Clearing online redo logfile 1 complete
Wed Aug 31 11:46:08 2011
Errors in file /u01/app/oracle/admin/sh/bdump/sh_mrp0_14159.trc:
ORA-00313: open failed for members of log group 2 of thread 1
ORA-00312: online log 2 thread 1: '/u01/app/oracle/oradata/sh/redo02.log'
ORA-27037: unable to obtain file status
Linux Error: 2: No such file or directory
Additional information: 3
Wed Aug 31 11:46:08 2011
Errors in file /u01/app/oracle/admin/sh/bdump/sh_mrp0_14159.trc:
ORA-00313: open failed for members of log group 2 of thread 1
ORA-00312: online log 2 thread 1: '/u01/app/oracle/oradata/sh/redo02.log'
ORA-27037: unable to obtain file status
Linux Error: 2: No such file or directory
Additional information: 3
Clearing online redo logfile 2 /u01/app/oracle/oradata/sh/redo02.log
Clearing online log 2 of thread 1 sequence number 21
Wed Aug 31 11:46:08 2011
Errors in file /u01/app/oracle/admin/sh/bdump/sh_mrp0_14159.trc:
ORA-00313: open failed for members of log group 2 of thread 1
ORA-00312: online log 2 thread 1: '/u01/app/oracle/oradata/sh/redo02.log'
ORA-27037: unable to obtain file status
Linux Error: 2: No such file or directory
Additional information: 3
Clearing online redo logfile 2 complete
Wed Aug 31 11:46:09 2011
Errors in file /u01/app/oracle/admin/sh/bdump/sh_mrp0_14159.trc:
ORA-00313: open failed for members of log group 3 of thread 1
ORA-00312: online log 3 thread 1: '/u01/app/oracle/oradata/sh/redo03.log'
ORA-27037: unable to obtain file status
Linux Error: 2: No such file or directory
Additional information: 3
Wed Aug 31 11:46:09 2011
Errors in file /u01/app/oracle/admin/sh/bdump/sh_mrp0_14159.trc:
ORA-00313: open failed for members of log group 3 of thread 1
ORA-00312: online log 3 thread 1: '/u01/app/oracle/oradata/sh/redo03.log'
ORA-27037: unable to obtain file status
Linux Error: 2: No such file or directory
Additional information: 3
Clearing online redo logfile 3 /u01/app/oracle/oradata/sh/redo03.log
Clearing online log 3 of thread 1 sequence number 22
Wed Aug 31 11:46:09 2011
Errors in file /u01/app/oracle/admin/sh/bdump/sh_mrp0_14159.trc:
ORA-00313: open failed for members of log group 3 of thread 1
ORA-00312: online log 3 thread 1: '/u01/app/oracle/oradata/sh/redo03.log'
ORA-27037: unable to obtain file status
Linux Error: 2: No such file or directory
Additional information: 3
Clearing online redo logfile 3 complete
Media Recovery Waiting for thread 1 sequence 23
Wed Aug 31 11:47:00 2011
Using STANDBY_ARCHIVE_DEST parameter default value as /u01/disk1/arch/sh/
Redo Shipping Client Connected as PUBLIC
-- Connected User is Valid
RFS[1]: Assigned to RFS process 14219
RFS[1]: Identified database type as 'physical standby'
Wed Aug 31 11:47:00 2011
RFS LogMiner: Client disabled from further notification
Wed Aug 31 11:47:01 2011
Redo Shipping Client Connected as PUBLIC
-- Connected User is Valid
RFS[2]: Assigned to RFS process 14221
RFS[2]: Identified database type as 'physical standby'
Wed Aug 31 11:47:01 2011
RFS[1]: Archived Log: '/u01/disk1/arch/sh/arch_1_7_760458507.log'
RFS[1]: Archived Log: '/u01/disk1/arch/sh/arch_1_8_760458507.log'
Wed Aug 31 11:47:01 2011
RFS[2]: Archived Log: '/u01/disk1/arch/sh/arch_1_6_760458507.log'
RFS[2]: Archived Log: '/u01/disk1/arch/sh/arch_1_10_760458507.log'
Wed Aug 31 11:47:01 2011
RFS[1]: Archived Log: '/u01/disk1/arch/sh/arch_1_9_760458507.log'
Wed Aug 31 11:47:02 2011
RFS[2]: Archived Log: '/u01/disk1/arch/sh/arch_1_11_760458507.log'
Wed Aug 31 11:47:02 2011
RFS[1]: Archived Log: '/u01/disk1/arch/sh/arch_1_12_760458507.log'
Wed Aug 31 11:47:02 2011
RFS[2]: Archived Log: '/u01/disk1/arch/sh/arch_1_13_760458507.log'
Wed Aug 31 11:47:02 2011
RFS[1]: Archived Log: '/u01/disk1/arch/sh/arch_1_14_760458507.log'
Wed Aug 31 11:47:02 2011
RFS[2]: Archived Log: '/u01/disk1/arch/sh/arch_1_15_760458507.log'
Wed Aug 31 11:47:02 2011
RFS[1]: Archived Log: '/u01/disk1/arch/sh/arch_1_16_760458507.log'
Wed Aug 31 11:47:03 2011
RFS[2]: Archived Log: '/u01/disk1/arch/sh/arch_1_17_760458507.log'
Wed Aug 31 11:47:03 2011
RFS[1]: Archived Log: '/u01/disk1/arch/sh/arch_1_18_760458507.log'
RFS[1]: Archived Log: '/u01/disk1/arch/sh/arch_1_19_760458507.log'
Wed Aug 31 11:47:03 2011
RFS[2]: Archived Log: '/u01/disk1/arch/sh/arch_1_20_760458507.log'
RFS[2]: Archived Log: '/u01/disk1/arch/sh/arch_1_22_760458507.log'
Wed Aug 31 11:47:04 2011
RFS[1]: Archived Log: '/u01/disk1/arch/sh/arch_1_21_760458507.log'
Wed Aug 31 11:47:04 2011
RFS[2]: Archived Log: '/u01/disk1/arch/sh/arch_1_24_760458507.log'
RFS[2]: Archived Log: '/u01/disk1/arch/sh/arch_1_25_760458507.log'
Wed Aug 31 11:47:05 2011
RFS[1]: Archived Log: '/u01/disk1/arch/sh/arch_1_23_760458507.log'
Wed Aug 31 11:47:05 2011
RFS[2]: Archived Log: '/u01/disk1/arch/sh/arch_1_26_760458507.log'
RFS[2]: Archived Log: '/u01/disk1/arch/sh/arch_1_27_760458507.log'
Wed Aug 31 11:47:05 2011
RFS[1]: Archived Log: '/u01/disk1/arch/sh/arch_1_28_760458507.log'
Wed Aug 31 11:47:05 2011
RFS[2]: Archived Log: '/u01/disk1/arch/sh/arch_1_29_760458507.log'
Wed Aug 31 11:47:05 2011
Media Recovery Log /u01/disk1/arch/sh/arch_1_23_760458507.log
Media Recovery Log /u01/disk1/arch/sh/arch_1_24_760458507.log
Media Recovery Log /u01/disk1/arch/sh/arch_1_25_760458507.log
Media Recovery Log /u01/disk1/arch/sh/arch_1_26_760458507.log
Media Recovery Log /u01/disk1/arch/sh/arch_1_27_760458507.log
Media Recovery Log /u01/disk1/arch/sh/arch_1_28_760458507.log
Media Recovery Log /u01/disk1/arch/sh/arch_1_29_760458507.log
Media Recovery Waiting for thread 1 sequence 30
Copy after login

七、在主库上切换日志测试数据同步

RMAN> sql'alter system switch logfile';                                                                                                
sql statement: alter system switch logfile

备库告警日志:
RFS[1]: No standby redo logfiles created
RFS[1]: Archived Log: '/u01/disk1/arch/sh/arch_1_30_760458507.log'
Wed Aug 31 11:48:06 2011
Redo Shipping Client Connected as PUBLIC
-- Connected User is Valid
RFS[3]: Assigned to RFS process 14234
RFS[3]: Identified database type as 'physical standby'
Primary database is in MAXIMUM PERFORMANCE mode
Primary database is in MAXIMUM PERFORMANCE mode
RFS[3]: No standby redo logfiles created
Wed Aug 31 11:48:08 2011
Media Recovery Log /u01/disk1/arch/sh/arch_1_30_760458507.log
Media Recovery Waiting for thread 1 sequence 31 (in transit)

---备库接收到归档日志,并对其做Media Recover。
Copy after login

八、查看数据库信息:

18:02:08 SYS@ bj >select name,database_role,protection_mode from v$database;
NAME      DATABASE_ROLE    PROTECTION_MODE
--------- ---------------- --------------------
BJ         PRIMARY          MAXIMUM PERFORMANCE

18:02:50 SYS@ sh >select name,database_role,protection_mode from v$database;
NAME      DATABASE_ROLE    PROTECTION_MODE
--------- ---------------- --------------------
BJ        PHYSICAL STANDBY MAXIMUM PERFORMANCE
Copy after login

   

----@此案例采用Oracle 10g的环境,对于备库在recover状态下,只能启动到mount状态,如果启动到open环境,则会停止recover,失去了数据保护的功能;对于Oracle 11g,Oracle启用了新的特性,“Active Standby”,可以将备库启动到open状态,并且可以继续recover,从而增强了备库的应用范围和备库的功能。



Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

Video Face Swap

Video Face Swap

Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Tools

Notepad++7.3.1

Notepad++7.3.1

Easy-to-use and free code editor

SublimeText3 Chinese version

SublimeText3 Chinese version

Chinese version, very easy to use

Zend Studio 13.0.1

Zend Studio 13.0.1

Powerful PHP integrated development environment

Dreamweaver CS6

Dreamweaver CS6

Visual web development tools

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)

Building a Custom WordPress User Flow, Part Three: Password Reset Building a Custom WordPress User Flow, Part Three: Password Reset Sep 03, 2023 pm 11:05 PM

In the first two tutorials in this series, we built custom pages for logging in and registering new users. Now, there's only one part of the login flow left to explore and replace: What happens if a user forgets their password and wants to reset their WordPress password? In this tutorial, we'll tackle the last step and complete the personalized login plugin we've built throughout the series. The password reset feature in WordPress more or less follows the standard method on websites today: the user initiates a reset by entering their username or email address and requesting WordPress to reset their password. Create a temporary password reset token and store it in user data. A link containing this token will be sent to the user's email address. User clicks on the link. In the heavy

Configuration guide for building Linux kernel using CMake Configuration guide for building Linux kernel using CMake Jul 06, 2023 pm 02:46 PM

Overview of the configuration guide for building the Linux kernel using CMake In Linux development, building and configuring the kernel is an important step. For most people, using Kconfig and Makefile is the most common configuration method. However, using CMake to build and configure the Linux kernel is also a flexible and powerful option. This article will introduce how to use CMake to build and configure the Linux kernel, with some code examples. Install CMake First, we need to install CMak

ChatGPT Java: How to build an intelligent music recommendation system ChatGPT Java: How to build an intelligent music recommendation system Oct 27, 2023 pm 01:55 PM

ChatGPTJava: How to build an intelligent music recommendation system, specific code examples are needed. Introduction: With the rapid development of the Internet, music has become an indispensable part of people's daily lives. As music platforms continue to emerge, users often face a common problem: how to find music that suits their tastes? In order to solve this problem, the intelligent music recommendation system came into being. This article will introduce how to use ChatGPTJava to build an intelligent music recommendation system and provide specific code examples. No.

Smooth build: How to correctly configure the Maven image address Smooth build: How to correctly configure the Maven image address Feb 20, 2024 pm 08:48 PM

Smooth build: How to correctly configure the Maven image address When using Maven to build a project, it is very important to configure the correct image address. Properly configuring the mirror address can speed up project construction and avoid problems such as network delays. This article will introduce how to correctly configure the Maven mirror address and give specific code examples. Why do you need to configure the Maven image address? Maven is a project management tool that can automatically build projects, manage dependencies, generate reports, etc. When building a project in Maven, usually

Optimize the Maven project packaging process and improve development efficiency Optimize the Maven project packaging process and improve development efficiency Feb 24, 2024 pm 02:15 PM

Maven project packaging step guide: Optimize the build process and improve development efficiency. As software development projects become more and more complex, the efficiency and speed of project construction have become important links in the development process that cannot be ignored. As a popular project management tool, Maven plays a key role in project construction. This guide will explore how to improve development efficiency by optimizing the packaging steps of Maven projects and provide specific code examples. 1. Confirm the project structure. Before starting to optimize the Maven project packaging step, you first need to confirm

How to build an intelligent voice assistant using Python How to build an intelligent voice assistant using Python Sep 09, 2023 pm 04:04 PM

How to use Python to build an intelligent voice assistant Introduction: In the era of rapid development of modern technology, people's demand for intelligent assistants is getting higher and higher. As one of the forms, smart voice assistants have been widely used in various devices such as mobile phones, computers, and smart speakers. This article will introduce how to use the Python programming language to build a simple intelligent voice assistant to help you implement your own personalized intelligent assistant from scratch. Preparation Before starting to build a voice assistant, we first need to prepare some necessary tools

Build browser-based applications with Golang Build browser-based applications with Golang Apr 08, 2024 am 09:24 AM

Build browser-based applications with Golang Golang combines with JavaScript to build dynamic front-end experiences. Install Golang: Visit https://golang.org/doc/install. Set up a Golang project: Create a file called main.go. Using GorillaWebToolkit: Add GorillaWebToolkit code to handle HTTP requests. Create HTML template: Create index.html in the templates subdirectory, which is the main template.

Build an online calculator using JavaScript Build an online calculator using JavaScript Aug 09, 2023 pm 03:46 PM

Building online calculators with JavaScript As the Internet develops, more and more tools and applications begin to appear online. Among them, calculator is one of the most widely used tools. This article explains how to build a simple online calculator using JavaScript and provides code examples. Before we get started, we need to know some basic HTML and CSS knowledge. The calculator interface can be built using HTML table elements and then styled using CSS. Here is a basic

See all articles