search
HomeDatabaseMysql TutorialOracleDG之--构建PhysicalStandby

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'

以下为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

备库的初始化参数: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'

以下为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'

二、在主库上建立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;

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

[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

四、在主库生成备库的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> }


五、在备库上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

---备库建立完毕,并启动到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

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

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。

八、查看数据库信息:

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

   

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



Statement
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
VUE3入门教程:使用Webpack进行打包和构建VUE3入门教程:使用Webpack进行打包和构建Jun 15, 2023 pm 06:17 PM

Vue是一款优秀的JavaScript框架,它可以帮助我们快速构建交互性强、高效性好的Web应用程序。Vue3是Vue的最新版本,它引入了很多新的特性和功能。Webpack是目前最流行的JavaScript模块打包器和构建工具之一,它可以帮助我们管理项目中的各种资源。本文就为大家介绍如何使用Webpack打包和构建Vue3应用程序。1.安装Webpack

使用CMake构建Linux内核的配置指南使用CMake构建Linux内核的配置指南Jul 06, 2023 pm 02:46 PM

使用CMake构建Linux内核的配置指南概述在Linux开发中,构建和配置内核是一个重要的环节。对于大多数人来说,使用Kconfig和Makefile是最常见的配置方式。然而,使用CMake来构建和配置Linux内核也是一个灵活且强大的选择。本文将介绍如何使用CMake来构建和配置Linux内核,并附上一些代码示例。安装CMake首先,我们需要安装CMak

如何使用Golang构建Web应用程序如何使用Golang构建Web应用程序Jun 24, 2023 pm 02:46 PM

在当前的互联网时代,Web应用程序已成为了人们日常生活中不可或缺的一部分,而且在各种应用场景下都有广泛的应用。无论是电商网站、社交媒体、在线教育平台,还是各种SaaS应用程序,都离不开Web应用程序。随着技术的不断更新迭代,Golang越来越受到Web应用程序开发者的喜爱,下面我们就快速了解如何使用Golang构建Web应用程序。一、为什么使用Golang?

CakePHP中间件:快速构建可扩展的Web应用程序CakePHP中间件:快速构建可扩展的Web应用程序Jul 28, 2023 am 11:33 AM

CakePHP中间件:快速构建可扩展的Web应用程序概述:CakePHP是一个流行的PHP框架,被广泛应用于Web应用程序的开发。其提供了许多功能强大的工具和功能,其中包括中间件。中间件可以帮助我们快速构建和扩展Web应用程序,提高代码的可读性和可维护性。什么是中间件:中间件是在请求被派发给控制器之前或之后执行的一系列操作。它们可以完成许多任务,如身份验证、

如何使用PHP构建智能医疗系统如何使用PHP构建智能医疗系统Jun 11, 2023 pm 05:32 PM

在当今科技迅猛发展的时代,智慧医疗逐渐成为医疗行业的新趋势,而医疗健康的数据化和智能化,更是将如何使用PHP构建智能医疗系统变得尤为重要。本文将介绍PHP如何应用于医疗系统的开发,并结合实例详细探讨。一、智能医疗系统的功能特点首先了解智能医疗系统的主要功能特点,有助于我们更加清晰的构建医疗系统。智能医疗系统的主要特点包括:1、大数据分析预测功能:通过对医学数

使用JavaScript构建在线计算器使用JavaScript构建在线计算器Aug 09, 2023 pm 03:46 PM

使用JavaScript构建在线计算器随着互联网的发展,越来越多的工具和应用开始以在线形式出现。其中,计算器是一类被广泛使用的工具之一。本文将介绍如何使用JavaScript构建一个简单的在线计算器,并提供代码示例。在开始之前,我们需要了解一些基本的HTML和CSS知识。计算器的界面可以使用HTML的表格元素来构建,然后用CSS进行样式设计。以下是一个基本的

在PHP中构建物业管理系统在PHP中构建物业管理系统Jun 11, 2023 am 10:34 AM

随着城市化进程的不断加快和人民生活水平的不断提高,物业管理行业也逐渐成为一个重要的领域。目前,物业管理系统已经成为了物业公司必备的工具,它可以帮助物业公司提高管理效率,优化服务质量,提升客户满意度。本文将介绍在PHP中构建物业管理系统的相关知识。一、物业管理系统的基本功能1.物业收费管理物业收费管理是物业管理系统的核心功能之一,它涉及到物业管理公司对于物业费

基于Swoole构建实时股票交易系统基于Swoole构建实时股票交易系统Aug 08, 2023 am 09:01 AM

基于Swoole构建实时股票交易系统随着互联网技术的发展,股票交易成为了越来越多个人投资者和机构投资者的选择。为了更好地满足投资者的需求,提供更实时、高效的股票交易服务,我们可以借助Swoole这个高性能的PHP扩展来构建一个实时股票交易系统。Swoole是一个基于C语言扩展开发的PHP网络通信框架,它提供了异步、并发、高性能的网络编程特性。使用Swoole

See all articles

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

AI Hentai Generator

AI Hentai Generator

Generate AI Hentai for free.

Hot Article

Hot Tools

EditPlus Chinese cracked version

EditPlus Chinese cracked version

Small size, syntax highlighting, does not support code prompt function

Safe Exam Browser

Safe Exam Browser

Safe Exam Browser is a secure browser environment for taking online exams securely. This software turns any computer into a secure workstation. It controls access to any utility and prevents students from using unauthorized resources.

SAP NetWeaver Server Adapter for Eclipse

SAP NetWeaver Server Adapter for Eclipse

Integrate Eclipse with SAP NetWeaver application server.

ZendStudio 13.5.1 Mac

ZendStudio 13.5.1 Mac

Powerful PHP integrated development environment

VSCode Windows 64-bit Download

VSCode Windows 64-bit Download

A free and powerful IDE editor launched by Microsoft