- SQL>create pfile=’/home/oracle/product/10.2initapril.ora’ from spfile;
- db_unique_name=mustang
- log_archive_config='DG_CONFIG=(mustang,standby)'
- log_archive_dest_2='service=standby arch async valid_for=(online_logfiles,primary_role)
- db_unique_name=standby'
- log_archive_dest_1='location=/home/oracle/archive valid_for=(all_logfiles,all_roles)
- db_unique_name=mustang'
- log_archive_dest_state_1=enable
- log_archive_dest_state_2=enable
- log_archive_format=%t_%s_%r.arc
- log_archive_max_processes=30
- fal_server=standby
- fal_client=mustang
- db_file_name_convert='standby','mustang'
- log_file_name_convert='/home/oracle/','/home/oracle/standby/'
- standby_file_management=auto
- SQL>create spfile=’/home/oracle/product/10.2.0/db_1/dbs/spfileapril.ora’ from pfile=’
- /home/oracle/product/10.2.0/db_1/dbs/initapril.ora’;
- SQL>create pfile=’ /home/oracle/product/10.2.0/db_1/dbs/initstandby.ora’ from spfile;
- standby.__db_cache_size=213909504
- standby.__large_pool_size=4194304
- *.control_files='/home/oracle/standby/standby.ctl'
- *.db_file_multiblock_read_count=8
- *.db_file_name_convert='standby','mustang'
- *.db_files=80
- *.db_name='mustang'
- *.db_unique_name='standby'
- *.fal_client='standby'
- *.fal_server='mustang'
- *.global_names=TRUE
- *.instance_name='standby'
- *.log_archive_config='DG_CONFIG=(mustang,standby)'
- *.log_archive_dest_1='location=/home/oracle/standby/archive'
- *.log_archive_dest_2='service=mustang arch async valid_for=(online_logfiles,primary_role)
- db_unique_name=mustang'
- *.log_archive_dest_state_1='enable'
- *.log_archive_dest_state_2='enable'
- *.log_archive_format='%t_%s_%r.arc'
- *.log_archive_max_processes=30
- *.log_buffer=32768
- *.log_checkpoint_interval=10000
- *.log_file_name_convert='/home/oracle/','/home/oracle/standby/'
- *.max_dump_file_size='10240'
- *.parallel_max_servers=5
- *.processes=50
- *.service_names='standby'
- *.sga_max_size=300M
- *.sga_target=300M
- *.standby_file_management='auto'
- *.undo_management='auto'
- *.undo_tablespace='undotbs'
- SQL>create spfile=’/home/oracle/product/10.2.0/db_1/dbs/spfilestandby.ora’ from pfile=’
- /home/oracle/product/10.2.0/db_1/dbs/initstandby.ora’;
- [oracle@localhost dbs]$orapwd file=’ /home/oracle/product/10.2.0/db_1/dbs/orapwstandby’ password=oracle entries=10
- SQL>alter database create standby controlfile as ‘/home/oracle/standby.ctl’;
- mkdir standby
- cd standby
- mkdir archive
- mkdir bdump
- mkdir udump
- [oracle@localhost dbs]$orapwd file=’ /home/oracle/product/10.2.0/db_1/dbs/orapwstandby’ password=oracle entries=10
- april=
- (DESCRIPTION=
- (ADDRESS=(PROTOCOL=TCP)(HOST=localhost.localdomain)(PORT=1521))
- (CONNECT_DATA=
- (SERVER=DEDICATED)
- (SERVICE_NAME=mustang)
- )
- )
- standby=
- (DESCRIPTION=
- (ADDRESS=(PROTOCOL=TCP)(HOST=localhost.localdomain)(PORT=1522))
- (CONNECT_DATA=
- (SERVER=DEDICATED)
- (SERVICE_NAME=standby)
- )
- )
- SID_LIST_LISTENER =
- (SID_LIST =
- (SID_DESC =
- (GLOBAL_DBNAME = mustang)
- (ORACLE_HOME = /home/oracle/product/10.2.0/db_1)
- (SID_NAME = april)
- )
- (SID_DESC =
- (GLOBAL_DBNAME = standby)
- (ORACLE_HOME = /home/oracle/product/10.2.0/db_1)
- (SID_NAME = standby)
- )
- )
- LISTENER =
- (DESCRIPTION_LIST =
- (DESCRIPTION =
- (ADDRESS = (PROTOCOL = TCP)(HOST = localhost.localdomain)(PORT = 1521))
- )
- (DESCRIPTION =
- (ADDRESS = (PROTOCOL = TCP)(HOST = localhost.localdomain)(PORT = 1522))
- )
- )
- TRACE_LEVEL_LISTENER = USER
- [oracle@localhost admin]$ lsnrctl start
- [oracle@localhost admin]$ tnsping standby
- [oracle@localhost admin]$ tnsping april
- [oracle@localhost mustang]$cp /home/oracle/mustang/*.dbf /home/oracle/standby
- [oracle@localhost mustang]$cp /home/oracle/standby.ctl /home/oracle/standby/
- export ORACLE_SID=april
- [oracle@localhost admin]$ sqlplus sys/oracle@april as sysdba
- SQL>alter database archivelog;
- SQL>alter database force logging;
- export ORACLE_SID=standby
- [oracle@localhost admin]$ sqlplus sys/oracle@standby as sysdba
- SQL>alter database recover managed standby database disconnect from session:
- SQL>select sequence#,first_time,next_time from v$archived_log order by sequence#;
- SQL>select sequence#,first_time,next_time from v$archived_log order by sequence#;
- SQL>alter system switch logfile;
- SQL>select sequence#,first_time,next_time from v$archived_log order by sequence#;
- SQL>select sequence#,first_time,next_time from v$archived_log order by sequence#;
- SQL>select switchover_status,database_role from v$database;