?????????????????????????
????????????????????е??????????±?????????????standby??
????Backup current ontrolfile for standby format ‘/u03/webdb_rman/ctl.standby’;
?????????????????????????
????restore database;
???????????????standby logfile
????ALTER DATABASE ADD STANDBY LOGFILE group 21 ('+VG2/webdb/standby_redo21.log')  SIZE 52428800 reuse;
????ALTER DATABASE ADD STANDBY LOGFILE group 22 ('+VG2/webdb/standby_redo22.log')  SIZE 52428800 reuse;
????ALTER DATABASE ADD STANDBY LOGFILE group 23 ('+VG2/webdb/standby_redo23.log')  SIZE 52428800 reuse;
????ALTER DATABASE ADD STANDBY LOGFILE group 24 ('+VG2/webdb/standby_redo24.log')  SIZE 52428800 reuse;
????ALTER DATABASE ADD STANDBY LOGFILE group 25 ('+VG2/webdb/standby_redo25.log')  SIZE 52428800 reuse;
????ALTER DATABASE ADD STANDBY LOGFILE group 26 ('+VG2/webdb/standby_redo26.log')  SIZE 52428800 reuse;
????ALTER DATABASE ADD STANDBY LOGFILE group 27 ('+VG2/webdb/standby_redo27.log')  SIZE 52428800 reuse;
????ALTER DATABASE ADD STANDBY LOGFILE group 28 ('+VG2/webdb/standby_redo28.log')  SIZE 52428800 reuse;
????ALTER DATABASE ADD STANDBY LOGFILE group 29 ('+VG2/webdb/standby_redo29.log')  SIZE 52428800 reuse;
????ALTER DATABASE ADD STANDBY LOGFILE group 30 ('+VG2/webdb/standby_redo30.log')  SIZE 52428800 reuse;
????ALTER DATABASE ADD STANDBY LOGFILE group 31 ('+VG2/webdb/standby_redo31.log')  SIZE 52428800 reuse;
?????????????????????
????recover database;
????/u03/webdb_rman@db3=>webdb$rman target /
????Recovery Manager: Release 10.2.0.4.0 - Production on Mon May 14 10:08:06 2012
????Copyright (c) 1982?? 2007?? Oracle.  All rights reserved.
????connected to target database: WEBDB (DBID=2446281945?? not open)
????RMAN> recover database;
????Starting recover at 14-MAY-12
????using target database control file instead of recovery catalog
????allocated channel: ORA_DISK_1
????channel ORA_DISK_1: sid=4384 devtype=DISK
????starting media recovery
????????????????????
???????????????????
????startup nomount;
????alter database mount standby database;
????alter database recover managed standby database using current logfile disconnect from session;
???????????????????????????
????????????sqlplus?????????SQL
????select protection_mode??protection_level from v$database;
?????????????????е??????μ??????????????
????SQL> select protection_mode??protection_level from v$database;
????PROTECTION_MODE      PROTECTION_LEVEL
????-------------------- --------------------
????MAXIMUM AVAILABILITY MAXIMUM AVAILABILITY
???????protection_level?????RESYNCHRONIZATION?????????
????SQL> select protection_mode??protection_level from v$database;
????PROTECTION_MODE      PROTECTION_LEVEL
????-------------------- --------------------
????MAXIMUM AVAILABILITY RESYNCHRONIZATION
????????DATAGUARD???????????????????????????????????????
??????????????? standby
????????????????????????????????????
??????????????????$ORACLE_HOME/dbs???£???????????????????????webreader????????????????????????
???????????orapwwebreader??orapwwebdb???????
????????????????initwebreader.ora??initwebdb.ora???????Щ??????????????????????????г?????Щ??
/u01/app/oracle/product/10.2.0/db/dbs@db3=>webreader$more initwebreader.ora
*.audit_file_dest='/u01/app/oracle/admin/webreader/adump'
*.background_dump_dest='/u01/app/oracle/admin/webreader/bdump'
*.core_dump_dest='/u01/app/oracle/admin/webreader/cdump'
*.user_dump_dest='/u01/app/oracle/admin/webreader/udump'
*.db_name='webreader'
*.db_unique_name='webdg'
*.fal_client='webdb_reader'
*.fal_server='webdb_primary'
*.log_archive_config='dg_config=(webdb??webdg)'
*.log_archive_dest_1='location=+VG2/ valid_for=(all_logfiles??all_roles) db_unique_name=webdg'
????????????????tnsname???
??????????????????$ORACLE_HOME/network/admin/tnsnames.ora?????????????μ????webdb_reader??
????WEBDB_READER =
????(DESCRIPTION =
????(ADDRESS_LIST =
????(ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.65.3)(PORT = 1521))
????)
????(CONNECT_DATA =
????(SERVICE_NAME = webreader)
????)
????)
????????????????????
??????????????????$ORACLE_HOME/network/admin/listener.ora????У??????????webreader??????????
/u01/app/oracle/product/10.2.0/db/network/admin@db3=>webreader$more listener.ora
# listener.ora Network Configuration File: /u01/app/oracle/product/10.2.0/db/network/admin/listener.ora
# Generated by Oracle configuration tools.
SID_LIST_LISTENER =
(SID_LIST =
(SID_DESC =
(SID_NAME = webdb)
(ORACLE_HOME = /u01/app/oracle/product/10.2.0/db)
)
(SID_DESC =
(SID_NAME = webdg)
(ORACLE_HOME = /u01/app/oracle/product/10.2.0/db)
)
(SID_DESC =
(SID_NAME = webreader)
(ORACLE_HOME = /u01/app/oracle/product/10.2.0/db)
)
)
LISTENER =
(DESCRIPTION_LIST =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = db3)(PORT = 1521))
)
)
????????????????????????
????alter database recover managed standby database cancel ;
???????????????logical standby?????????
????EXECUTE DBMS_LOGSTDBY.BUILD;
???????????????г?????????????????????????У??????????? alter database recover to logical standby webreader; ?????????
???????
?????ù???????????primary ????????????(supplemental logging)????(???δ??????)??
?????ù?????????????????????????????????????н???????????У?????ù?????????????Щ??????
?????ù????????????????????????????????????????oracle ?????????UNDO_RETENTION ?????????????
?????л?????Standby????Standby
????????????????logical standby?????????????webreader??
????alter database recover to logical standby webreader;
???????
????????????????????г?????????????????
???????????????????????
??????в?????hang??????????????????sys??????£????????????????μ??????????
?????????????а???standby???????????????????????????????????????????????????????У???????????????????????????????????????????????????????????С?
????????????й???????????????
????SQL> alter database recover managed standby database cancel ;
????Database altered.
????SQL> alter database recover to logical standby webreader;
????alter database recover to logical standby webreader
????*
????ERROR at line 1:
????ORA-16254: change db_name to WEBREADER in the client-side parameter file (pfile)
????ORA-17503: ksfdopn:2 Failed to open file +VG1/webdb/temp01.dbf
????ORA-15173: entry 'temp01.dbf' does not exist in directory 'webdb'
???????????в???????????ɡ?????????????????á?
/u01/home/oracle@db3=>webdb$export ORACLE_SID=webreader
/u01/home/oracle@db3=>webreader$sqlplus / as sysdba
SQL*Plus: Release 10.2.0.4.0 - Production on Mon May 14 10:55:53 2012
Copyright (c) 1982?? 2007?? Oracle.  All Rights Reserved.
Connected to an idle instance.
SQL> startup open
ORACLE instance started.
Total System Global Area 5.1540E+10 bytes
Fixed Size                  2179936 bytes
Variable Size            6425676960 bytes
Database Buffers         4.5097E+10 bytes
Redo Buffers               14594048 bytes
Database mounted.
ORA-01589: must use RESETLOGS or NORESETLOGS option for database open
SQL> alter database open resetlogs;
Database altered.
?????????????????????
????????????????????????????????????????????????????????У?????????????к?????
????alter tablespace temp add tempfile '+VG2/webdb/temp02.dbf' size 10240M;
??????????????log_archive_dest_2??????
??????????standby???£??????????service??????webdb_standby????????????standby???£?????????????webdb_reader??
????alter system set log_archive_dest_2='service=webdb_reader lgwr sync affirm  valid_for=(online_logfiles??primary_role) db_unique_name=webdg';