rac添加静态监听
[grid@rac1 admin]$ lsnrctl status listener
[grid@rac1 admin]$ srvctl config network
[grid@rac1 admin]$ srvctl add listener -l dg_ls -o $ORACLE_HOME -p 1522 -k 1
注:-k 填入方才获得的network number,-p填入端口号,-l填入监听名,-o 填入GI HOME路径
启动刚刚配置的静态监听dg_ls
[grid@rac1 admin]$ srvctl start listener -l dg_ls
[grid@rac1 admin]$ head -1 listener.ora 将监听注册进配置文件
[grid@rac1 admin]$ head -1 endpoints_listener.ora 将监听注册进host监听配置文件
grid用户下,修改listener.ora文件
SID_LIST_DG_LS =
(SID_LIST =
(SID_DESC =
(GLOBAL_DBNAME = orcl_std)
(ORACLE_HOME = /u01/app/oracle/product/dbhome_1)
(SID_NAME = orcl1)
)
)
SID_LIST_DG_LS =
(SID_LIST =
(SID_DESC =
(GLOBAL_DBNAME = orcl_std)
(ORACLE_HOME = /u01/app/oracle/product/dbhome_1)
(SID_NAME = orcl2)
)
)
静态监听在oracle用户下是看不见的,只有grid的用户下可以看见,但是只要tnsname.ora和listener文件配置正确,在oracle用户下是可以连接sqlplus sys/oracle@orcl_std as sysdba来远程登陆oracle的
修改tnsnames.ora
[oracle@vd01db02 admin]$ cd $ORACLE_HOME/network/admin
[oracle@vd01db02 admin]$ ls
samples shrept.lst tnsnames.ora
[oracle@vd01db02 admin]$ cat tnsnames.ora
# tnsnames.ora Network Configuration File: /u01/app/oracle/product/dbhome_1/network/admin/tnsnames.ora
# Generated by Oracle configuration tools.
ORCL =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = vd01-scan)(PORT = 1521))
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = orcl)
)
)
ORCL_PRI =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = vd01-scan)(PORT = 1521))
(ADDRESS = (PROTOCOL = TCP)(HOST = 10.10.1.165)(PORT = 1521))
(ADDRESS = (PROTOCOL = TCP)(HOST = 10.10.1.166)(PORT = 1521))
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = orcl)
)
)
ORCL_STD =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = 10.10.1.34)(PORT = 1522))
(ADDRESS = (PROTOCOL = TCP)(HOST = 10.10.1.35)(PORT = 1522))
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = orcl)
)
)
SQL> create pfile='/u01/app/oracle/product/dbhome_1/dbs/orclpfile.ora' from spfile;
File created.
主库参数修改:
alter system set log_archive_dest_1='location=/u01/app/oracle/arch/orcl valid_for=(all_logfiles,all_roles) db_unique_name=orcl' scope=spfile;
alter system set log_archive_dest_2='service=orcl_std lgwr async valid_for=(online_logfiles,primary_role) db_unique_name=orcl_std' scope=spfile;
alter system set log_archive_dest_state_1='enable';
alter system set log_archive_dest_state_2='enable';
alter system set fal_server='orcl_std';
alter system set fal_client='orcl_pri';
scope=spfile
scope=spfile
alter system set standby_file_management=auto;
alter system set log_archive_max_processes=30;
alter system set db_file_name_convert='+DATA/ORCL_STD','+DATA/ORCL' scope=spfile;
alter system set log_file_name_convert='+DATA/ORCL_STD','+DATA/ORCL' scope=spfile;
ALTER SYSTEM SET db_file_name_convert='+DATA/ORCL','+DATA/ORCL_STD' scope=spfile;
ALTER SYSTEM SET log_file_name_convert='+DATA/ORCL','+DATA/ORCL_STD'scope=spfile;
添加standby redo
select group#,thread#,sequence#,archived,status from v$standby_log;
备库修改参数:
orcl2.__data_transfer_cache_size=0
orcl1.__data_transfer_cache_size=0
orcl2.__db_cache_size=154081951744
orcl1.__db_cache_size=154081951744
orcl2.__java_pool_size=3758096384
orcl1.__java_pool_size=3758096384
orcl2.__large_pool_size=4294967296
orcl1.__large_pool_size=4294967296
orcl1.__oracle_base='/u01/app/oracle'#ORACLE_BASE set from environment
orcl2.__oracle_base='/u01/app/oracle'#ORACLE_BASE set from environment
orcl2.__pga_aggregate_target=61203283968
orcl1.__pga_aggregate_target=61203283968
orcl2.__sga_target=182536110080
orcl1.__sga_target=182536110080
orcl2.__shared_io_pool_size=536870912
orcl1.__shared_io_pool_size=536870912
orcl2.__shared_pool_size=19327352832
orcl1.__shared_pool_size=19327352832
orcl2.__streams_pool_size=0
orcl1.__streams_pool_size=0
*.audit_file_dest='/u01/app/oracle/admin/orcl/adump'
*.audit_trail='db'
*.cluster_database=true
*.compatible='12.1.0.2.0'
*.control_files='+DATA/ORCL_STD/CONTROLFILE/current.257.1091808365'
*.db_block_size=8192
*.db_create_file_dest='+DATA'
*.db_domain=''
*.db_file_name_convert='+DATA/ORCL','+DATA/ORCL'
*.db_name='orcl'
*.db_unique_name='orcl_std'
*.diagnostic_dest='/u01/app/oracle'
*.dispatchers='(PROTOCOL=TCP) (SERVICE=orclXDB)'
*.fal_client='orcl_std'
*.fal_server='orcl_pri'
orcl1.instance_number=1
orcl2.instance_number=2
*.log_archive_dest_1='location=/u01/app/oracle/arch/orcl valid_for=(all_logfiles,all_roles) db_unique_name=orcl_std'
*.log_archive_dest_2='service=orcl_pri lgwr async valid_for=(online_logfiles,primary_role) db_unique_name=orcl'
*.log_archive_dest_state_1='enable'
*.log_archive_dest_state_2='enable'
*.log_archive_max_processes=30
*.log_file_name_convert='+DATA','+DATA'
*.open_cursors=300
*.pga_aggregate_target=3072m
*.processes=5000
*.remote_login_passwordfile='exclusive'
*.sga_target=10240m
*.standby_file_management='AUTO'
orcl2.thread=2
orcl1.thread=1
orcl1.undo_tablespace='UNDOTBS1'
orcl2.undo_tablespace='UNDOTBS2'
ALTER SYSTEM SET db_file_name_convert='+DATA/ORCL','+DATA/ORCL_STD' scope=spfile;
ALTER SYSTEM SET log_file_name_convert='+DATA/ORCL','+DATA/ORCL_STD'scope=spfile;
alter system set remote_listener='vd03-scan:1521';
alter system set local_listener='(ADDRESS=(PROTOCOL=TCP)(HOST=192.168.1.42)(PORT=1521))' sid='orcl1';
alter system set local_listener='(ADDRESS=(PROTOCOL=TCP)(HOST=192.168.1.43)(PORT=1521))' sid='orcl2';
rman target sys/oracle@orcl_pri auxiliary sys/oracle@orcl_std
duplicate target database for standby from active database dorecover nofilenamecheck;
alter database recover managed standby database cancel;
alter database recover managed standby database disconnect;
alter database recover managed standby database using current logfile disconnect from session;
select process,status,thread#,sequence# from v$managed_standby;