分类: Oracle
2014-04-13 18:44:25
Oracle Database 11g DataGuard On Windows 2008 Using VirtualBox.pdf
经实践该文档可靠,终于找到windows下的方法了,哈哈
有些文本粘不出来,附上
startup mount
alter database archivelog;
alter system set log_archive_dest_1='location=d:\oracle_arch' scope=both;
alter database force logging;
*.db_unique_name='db1'
*.log_archive_format=log_%t_%s_%r.arc
*.log_archive_config='DG_CONFIG=(db1,db2)'
*.log_archive_dest_1='location=d:\oracle_arch valid_for=(all_logfiles,all_roles) db_unique_name=db1'
*.log_archive_dest_2='service=db2 lgwr sync valid_for=(online_logfiles,primary_role) db_unique_name=db2'
*.log_archive_dest_state_1=enable
*.log_archive_dest_state_2=enable
*.FAL_SERVER=db2
*.FAL_CLIENT=db1
*.STANDBY_FILE_MANAGEMENT=AUTO
*.service_names='DB1'
startup pfile='D:\app\Administrator\product\11.2.0\dbhome_1\database\INITorcl.ORA'
alter system set memory_target=16G scope=spfile;
alter system set sga_target=0 scope=spfile;
alter system set pga_aggregate_target=0 scope=spfile;
alter system set memory_max_target=26G scope=spfile;
alter database add standby logfile group 4 ('d:\app\Administrator\oradata\orcl\redo04.log') size 50m;
alter database add standby logfile group 5 ('d:\app\Administrator\oradata\orcl\redo05.log') size 50m;
alter database add standby logfile group 6 ('d:\app\Administrator\oradata\orcl\redo06.log') size 50m;
alter database add standby logfile group 7 ('d:\app\Administrator\oradata\orcl\redo07.log') size 50m;
MD D:\app\Administrator\oradata
MD D:\app\Administrator\oradata\orcl
MD D:\app\Administrator\diag\rdbms\orcl
MD D:\app\Administrator\diag\rdbms\orcl\orcl
MD D:\app\Administrator\diag\rdbms\orcl\orcl\alert
MD D:\app\Administrator\diag\rdbms\orcl\orcl\cdump
MD D:\app\Administrator\diag\rdbms\orcl\orcl\hm
MD D:\app\Administrator\diag\rdbms\orcl\orcl\incident
MD D:\app\Administrator\diag\rdbms\orcl\orcl\incpkg
MD D:\app\Administrator\diag\rdbms\orcl\orcl\ir
MD D:\app\Administrator\diag\rdbms\orcl\orcl\lck
MD D:\app\Administrator\diag\rdbms\orcl\orcl\metadata
MD D:\app\Administrator\diag\rdbms\orcl\orcl\stage
MD D:\app\Administrator\diag\rdbms\orcl\orcl\sweep
MD D:\app\Administrator\diag\rdbms\orcl\orcl\trace
MD D:\app\Administrator\flash_recovery_area\orcl
MD D:\app\Administrator\flash_recovery_area\orcl\ARCHIVELOG
MD D:\app\Administrator\flash_recovery_area\orcl\AUTOBACKUP
MD D:\app\Administrator\flash_recovery_area\orcl\ONLINELOG
oradim -new -sid orcl -startmode auto
startup pfile='D:\app\Administrator\product\11.2.0\dbhome_1\database\INITorcl.ORA' mount
create spfile from pfile;
startup mount
alter database recover managed standby database disconnect from session;shutdown immediate
alter database recover managed standby database disconnect from session;
SELECT DEST_ID "ID", STATUS "DB_status", DESTINATION "Archive_dest", ERROR "Error" FROM V$ARCHIVE_DEST WHERE DEST_ID <=5;
alter system archive log current;
alter system switch logfile;