Oracle 11g DataGuard 双机实验(2)

ADR_BASE_LISTENER = /u01/app/oracle
6).配置tnsnames.ora文件
[oracle@rac1 admin]$ pwd
/u01/app/oracle/product/11.2.0/db_1/network/admin
orcl =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.20.234)(PORT = 1521))
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = orcl)
)
)

orcldg =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.20.235)(PORT = 1521))
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = orcldg)
)
)

EXTPROC_CONNECTION_DATA =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC0))
)
(CONNECT_DATA =
(SID = PLSExtProc)
(PRESENTATION = RO)
)
)
7).启动数据库,测试
[oracle@rac1 admin]$ tnsping orcl

TNS Ping Utility for Linux: Version 11.2.0.4.0 - Production on 17-NOV-2016 19:22:52

Copyright (c) 1997, 2013, Oracle. All rights reserved.

Used parameter files:


Used TNSNAMES adapter to resolve the alias
Attempting to contact (DESCRIPTION = (ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.50.241)(PORT = 1521)) (CONNECT_DATA = (SERVER = DEDICATED) (SERVICE_NAME = orcl)))
OK (0 msec)

alter database set standby database to maximize availability;
5.rman备份数据库,在闪回区中
backup database plus archivelog;
backup current controlfile for standby;

二.Standby数据库配置及相关操作

1.创建所需目录(注意OMF管理的文件)
show parameter dest
mkdir -p /u01/app/oracle/admin/orcl/adump
mkdir -p /u01/app/oracle/admin/orcl/dpdump
mkdir -p /u01/app/oracle/diag/rdbms/orcl/orcldg/trace
mkdir -p /u01/app/oracle/diag/rdbms/orcl/orcldg/cdump
mkdir -p /u01/app/oracle/flash_recovery_area
mkdir -p /u01/app/oracle/archivelog
mkdir -p /u01/app/oracle/archive_log
mkdir -p /u01/app/oracle/fast_recovery_area

2.复制数据文件到standby库对应的目录
从主数据库服务器上拷贝文件
1).拷贝闪回区内容
scp -r ./* 192.168.20.235:/u01/app/oracle/fast_recovery_area/

2).拷贝参数文件
scp ./* 192.168.20.235:/u01/app/oracle/product/11.2.0/dbhome_1/dbs

3).拷贝密码文件
[oracle@stuaapp01 dbs]$ scp orapworcl 192.168.20.235:/u01/app/oracle/product/11.2.0/dbhome_1/dbs/

4).拷贝监听文件和tns文件
scp *.ora 192.168.20.235:/u01/app/oracle/product/11.2.0/dbhome_1/network/admin/

3.修改相应配置

1).修改监听配置文件
[oracle@stuaapp02 admin]$ vi listener.ora

# listener.ora Network Configuration File: /u01/app/oracle/product/11.2.0/dbhome_1/network/admin/listener.ora
# Generated by Oracle configuration tools.

LISTENER =
(DESCRIPTION_LIST =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.20.235)(PORT = 1521))
(ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1521))
)
)

ADR_BASE_LISTENER = /u01/app/oracle

2).修改TNS配置文件


3).重启监听服务
lsnrctl stop
lsnrctl start

4).standby的初始化参数如下
orcl.__db_cache_size=327155712
orcl.__java_pool_size=4194304
orcl.__large_pool_size=8388608
orcl.__oracle_base='/u01/app/oracle'
#ORACLE_BASE set from environment
orcl.__pga_aggregate_target=318767104
orcl.__sga_target=469762048
orcl.__shared_io_pool_size=0
orcl.__shared_pool_size=121634816
orcl.__streams_pool_size=0
*.audit_file_dest='/u01/app/oracle/admin/orcl/adump'
*.audit_trail='db'
*.compatible='11.2.0.4.0'
*.control_files='/u01/app/oracle/oradata/orcl/control01.ctl','/u01/app/oracle/fast_recovery_area/orcl/control02.ctl'
*.db_block_size=8192
*.db_domain=''
*.db_name='orcl'
*.db_recovery_file_dest='/u01/app/oracle/fast_recovery_area'
*.db_recovery_file_dest_size=4385144832
*.diagnostic_dest='/u01/app/oracle'
*.dispatchers='(PROTOCOL=TCP) (SERVICE=orclXDB)'
*.log_archive_format='%t_%s_%r.dbf'
*.memory_target=786432000
*.open_cursors=300
*.processes=150
*.remote_login_passwordfile='EXCLUSIVE'
*.undo_tablespace='UNDOTBS1'
#################################################################
#Parameters for Standby Database.
#################################################################
*.DB_NAME='orcl'
*.DB_UNIQUE_NAME=orcldg
*.LOG_ARCHIVE_FORMAT=log%t_%s_%r.arc
*.LOG_ARCHIVE_CONFIG='DG_CONFIG=(orcl,orcldg)'
*.DB_FILE_NAME_CONVERT='/u01/app/oracle/oradata/orcl','/u01/app/oracle/oradata/orcldg'
*.LOG_FILE_NAME_CONVERT='/u01/app/oracle/oradata/orcl','/u01/app/oracle/oradata/orcldg'
*.STANDBY_ARCHIVE_DEST='/u01/app/oracle/archive_log'
*.FAL_SERVER=orcl
*.FAL_CLIENT=orcldg
*.STANDBY_FILE_MANAGEMENT=AUTO

内容版权声明:除非注明,否则皆为本站原创文章。

转载注明出处:https://www.heiqu.com/229de8bd452ca5d9c45546e2565c5fec.html