3.设置唯一名字,把主库
SQL>alter system set db_unique_name=pridb scope=spfile;
4.配置log_archive_config
SQL>alter system set log_archive_config='dg_config=(pridb,auxdb)';
5.设置归档目标地
SQL>alter system set log_archive_dest_1='LOCATION=USE_DB_RECOVERY_FILE_DEST valid_for=(all_logfiles,all_roles) db_unique_name=pridb' scope=spfile;
SQL>alter system set log_archive_dest_2='service=auxdb lgwr async valid_for=(online_logfiles,primary_role) db_unique_name=auxdb';
6.设置提取服务器
SQL>alter system set fal_server=auxdb;
SQL>alter system set fal_client=pridb;
sql>create spfile from pfile='/home/oracle/initstddb.ora';
4.创建口令文件
[oracle@dbserver dbs]$ pwd
/u01/app/oracle/product/12.1.0/dbhome_1/dbs
[oracle@dbserver dbs]$ cp orapworcl orapwstddb
5.使用spfile启动到nomount;
sql>startup nomount;
SQL> show parameter spfile
NAME TYPE VALUE
------------------------------------ ----------- ------------------------------
spfile string /u01/app/oracle/product/12.1.0
/dbhome_1/dbs/spfilestddb.ora
SQL>
6.添加静态监听
$ORACLE_HOME/network/admin/listener.ora
SID_LIST_LISTENER =
(SID_LIST =
(SID_DESC =
(GLOBAL_DBNAME = auxdb)
(ORACLE_HOME = /u01/app/oracle/product/12.1.0/dbhome_1)
(SID_NAME = auxdb)
)
(SID_DESC =
(GLOBAL_DBNAME = stddb)
(ORACLE_HOME = /u01/app/oracle/product/12.1.0/dbhome_1)
(SID_NAME = stddb)
)
)
7.加载监听配置
lsnrctl reload
8.验证监听神效
LSNRCTL> status
Service "PRIDB" has 1 instance(s).
Instance "orcl", status READY, has 1 handler(s) for this service...
Service "auxdb" has 2 instance(s).
Instance "auxdb", status UNKNOWN, has 1 handler(s) for this service...
Instance "auxdb", status READY, has 1 handler(s) for this service...
Service "stddb" has 2 instance(s).
Instance "stddb", status UNKNOWN, has 1 handler(s) for this service...
Instance "stddb", status BLOCKED, has 1 handler(s) for this service...
The command completed successfully
9.建立到新备库连接串
$ORACLE_HOME/network/admin/tnsnames.ora