LISTNER,TNS 全部配齐
给STDB添加口令文件
orapwd
/u01/app/oracle/product/11.2.0/dbhome_1/dbs
orapwd file=orapwSTDB password=oracle
P:
ALTER DATABASE FORCE LOGGING;
alter database add standby logfile '/u01/app/oracle/oradata/PROD1/st001.log' size 60M;
alter database add standby logfile '/u01/app/oracle/oradata/PROD1/st002.log' size 60M;
alter database add standby logfile '/u01/app/oracle/oradata/PROD1/st003.log' size 60M;
mkdir arc1
ssh edsir1p8 mkdir arc1
alter system set log_archive_dest_1='location=/home/oracle/arc1'
alter system set log_archive_dest_2='service=STDB LGWR SYNC'
ssh edsir1p8 mkdir -p /u01/app/oracle/oradata/STDB
create pfile from spfile;
alter system set db_file_name_convert='/u01/app/oracle/oradata/STDB','/u01/app/oracle/oradata/PROD1' scope=spfile;
alter system set log_file_name_convert='/u01/app/oracle/oradata/STDB','/u01/app/oracle/oradata/PROD1' scope=spfile;
alter system set standby_file_management=AUTO;
-------------------------------------------------------------------------------------------------------------------------------------------------------------
*.control_files='/u01/app/oracle/oradata/STDB/control01.ctl','/u01/app/oracle/oradata/STDB/control02.ctl'
*.db_file_name_convert='/u01/app/oracle/oradata/PROD1','/u01/app/oracle/oradata/STDB'
*.log_archive_dest_1='location=/home/oracle/arc1'
*.log_file_name_convert='/u01/app/oracle/oradata/PROD1','/u01/app/oracle/oradata/STDB'
db_unique_name=STDB
sqlplus sys/oracle@stdb as sysdba
startup pfile='/home/oracle/initSTDB.ora';
create spfile from memory;
startup force;
----------------------------------------------------------------------------------------------------
primary
alter system switch logfile;
rman target sys/oracle@prod1 auxiliary sys/oracle@stdb
duplicate target database for standby from active database
-------------------------------------------------------
standby
SQL> alter system set db_recovery_file_dest_size=4G;
System altered.
SQL> alter system set db_recovery_file_dest='/home/oracle/flashback';
System altered.
SQL> alter database flashback on;
ALTER DATABASE RECOVER MANAGED STANDBY DATABASE DISCONNECT FROM SESSION;
---------------------------------------------------------------------------------
alter system set dg_broker_start=TRUE;
alter system set dg_broker_start=TRUE;
dgmgrl sys/oracle@prod1
help create
CREATE CONFIGURATION C1 AS PRIMARY DATABASE IS PROD1 CONNECT IDENTIFIER IS PROD1;
ADD DATABASE STDB AS CONNECT IDENTIFIER IS STDB;
SHOW DATABASE VERBOSE PROD1 ;
EDIT DATABASE STDB SET PROPERTY LogXptMode=SYNC;
EDIT DATABASE PROD1 SET PROPERTY LogXptMode=SYNC;
EDIT CONFIGURATION SET PROTECTION MODE AS MaxAvailability
------------------------------------------------------
EDIT DATABASE PROD1 SET PROPERTY FastStartFailoverTarget=STDB
EDIT DATABASE STDB SET PROPERTY FastStartFailoverTarget=PROD1;
ENABLE FAST_START FAILOVER ;
给STDB添加口令文件
orapwd
/u01/app/oracle/product/11.2.0/dbhome_1/dbs
orapwd file=orapwSTDB password=oracle
P:
ALTER DATABASE FORCE LOGGING;
alter database add standby logfile '/u01/app/oracle/oradata/PROD1/st001.log' size 60M;
alter database add standby logfile '/u01/app/oracle/oradata/PROD1/st002.log' size 60M;
alter database add standby logfile '/u01/app/oracle/oradata/PROD1/st003.log' size 60M;
mkdir arc1
ssh edsir1p8 mkdir arc1
alter system set log_archive_dest_1='location=/home/oracle/arc1'
alter system set log_archive_dest_2='service=STDB LGWR SYNC'
ssh edsir1p8 mkdir -p /u01/app/oracle/oradata/STDB
create pfile from spfile;
alter system set db_file_name_convert='/u01/app/oracle/oradata/STDB','/u01/app/oracle/oradata/PROD1' scope=spfile;
alter system set log_file_name_convert='/u01/app/oracle/oradata/STDB','/u01/app/oracle/oradata/PROD1' scope=spfile;
alter system set standby_file_management=AUTO;
-------------------------------------------------------------------------------------------------------------------------------------------------------------
*.control_files='/u01/app/oracle/oradata/STDB/control01.ctl','/u01/app/oracle/oradata/STDB/control02.ctl'
*.db_file_name_convert='/u01/app/oracle/oradata/PROD1','/u01/app/oracle/oradata/STDB'
*.log_archive_dest_1='location=/home/oracle/arc1'
*.log_file_name_convert='/u01/app/oracle/oradata/PROD1','/u01/app/oracle/oradata/STDB'
db_unique_name=STDB
sqlplus sys/oracle@stdb as sysdba
startup pfile='/home/oracle/initSTDB.ora';
create spfile from memory;
startup force;
----------------------------------------------------------------------------------------------------
primary
alter system switch logfile;
rman target sys/oracle@prod1 auxiliary sys/oracle@stdb
duplicate target database for standby from active database
-------------------------------------------------------
standby
SQL> alter system set db_recovery_file_dest_size=4G;
System altered.
SQL> alter system set db_recovery_file_dest='/home/oracle/flashback';
System altered.
SQL> alter database flashback on;
ALTER DATABASE RECOVER MANAGED STANDBY DATABASE DISCONNECT FROM SESSION;
---------------------------------------------------------------------------------
alter system set dg_broker_start=TRUE;
alter system set dg_broker_start=TRUE;
dgmgrl sys/oracle@prod1
help create
CREATE CONFIGURATION C1 AS PRIMARY DATABASE IS PROD1 CONNECT IDENTIFIER IS PROD1;
ADD DATABASE STDB AS CONNECT IDENTIFIER IS STDB;
SHOW DATABASE VERBOSE PROD1 ;
EDIT DATABASE STDB SET PROPERTY LogXptMode=SYNC;
EDIT DATABASE PROD1 SET PROPERTY LogXptMode=SYNC;
EDIT CONFIGURATION SET PROTECTION MODE AS MaxAvailability
------------------------------------------------------
EDIT DATABASE PROD1 SET PROPERTY FastStartFailoverTarget=STDB
EDIT DATABASE STDB SET PROPERTY FastStartFailoverTarget=PROD1;
ENABLE FAST_START FAILOVER ;