??
--------
?????,??standby?????mount??????????REDO??,??standby????????????????????,???????read-only???open????,????ACTIVE DATA GUARD,????standby?????????(read-only)??(????????),????standby???????????(read-write)?
?????,?????????????Real Application Testing(RAT)??????????,?????????standby??????snapshot standby?????????,??snapshot standby??????????,???????????(read-write)??????snapshot standby??????????????,?????????,??????????,????????,?????????snapshot standby?????standby???,?????????
??
---------
1.??standby??????
SQL> Alter system set db_recovery_file_dest_size=500M;
System altered.
SQL> Alter system set db_recovery_file_dest='/u01/app/oracle/snapshot_standby';
System altered.
2.??standby??????
SQL> alter database recover managed standby database cancel;
Database altered.
3.??standby???snapshot standby,??open snapshot standby
SQL> alter database convert to snapshot standby;
Database altered.
SQL> alter database open;
Database altered.
??snapshot standby??????SNAPSHOT STANDBY,open???READ WRITE:
SQL> select DATABASE_ROLE,name,OPEN_MODE from v$database;
DATABASE_ROLE NAME OPEN_MODE
---------------- --------- --------------------
SNAPSHOT STANDBY FSDB READ WRITE
4.?snapshot standby???????????Real Application Testing(RAT)?????????
5.?????,??snapshot standby???physical standby,??????????
SQL> shutdown immediate;
Database closed.
Database dismounted.
ORACLE instance shut down.
SQL> startup mount;
ORACLE instance started.
Database mounted.
SQL> ALTER DATABASE CONVERT TO PHYSICAL STANDBY;
Database altered.
SQL> shutdown immediate;
ORA-01507: database not mounted
ORACLE instance shut down.
SQL> startup mount;
ORACLE instance started.
Database mounted.
SQL>ALTER DATABASE RECOVER MANAGED STANDBY DATABASE DISCONNECT FROM SESSION;
Database altered.
5.?????standby?,???????PHYSICAL STANDBY,open???MOUNTED
SQL> select DATABASE_ROLE,name,OPEN_MODE from v$database;
DATABASE_ROLE NAME OPEN_MODE
---------------- --------- --------------------
PHYSICAL STANDBY FSDB MOUNTED
6.???????????????
????:
SQL> select ads.dest_id,max(sequence#) "Current Sequence",
max(log_sequence) "Last Archived"
from v$archived_log al, v$archive_dest ad, v$archive_dest_status ads
where ad.dest_id=al.dest_id
and al.dest_id=ads.dest_id
and al.resetlogs_change#=(select max(resetlogs_change#) from v$archived_log )
group by ads.dest_id;
DEST_ID Current Sequence Last Archived
---------- ---------------- -------------
1 361 361
2 361 362
--????
SQL> select al.thrd "Thread", almax "Last Seq Received", lhmax "Last Seq Applied"
from (select thread# thrd, max(sequence#) almax
from v$archived_log
where resetlogs_change#=(select resetlogs_change# from v$database)
group by thread#) al,
(select thread# thrd, max(sequence#) lhmax
from v$log_history
where resetlogs_change#=(select resetlogs_change# from v$database)
group by thread#) lh
where al.thrd = lh.thrd;
Thread Last Seq Received Last Seq Applied
---------- ----------------- ----------------
1 361 361
??????????,???blog,???????????,??"??:Data Guard - Snapshot Standby Database??"