Oracle 11.2.4.0 ACTIVE DATAGUARD 单实例安装(COPY创建备库)
Oracle 11.2.4.0 ADG 单实例安装(COPY创建备库)
规划:
主:
OS: Linux Centos 6.5 X64
hostname:ORA11G-DG1
ipaddress:192.168.213.199
db_unique_name=netdata_pd
db_name=netdata
备:
OS: Linux Centos 6.5 X64
hostname:ORA11G-DG2
ipaddress:192.168.213.200
db_unique_name=netdata_sd
db_name=netdata
注OS平台一致
1.主库安装oracle软件(参照文档)
2.创建监听,可以用netca,也可以直接用文件创建
listener.ora如下
LISTENER =
(DESCRIPTION_LIST =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = ORA11G-DG1)(PORT = 51518))
(ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC51518))
)
)
SID_LIST_LISTENER =
(SID_LIST =
(SID_DESC =
(GLOBAL_DBNAME = netdata)
(SID_NAME = netdata)
)
)
ADR_BASE_LISTENER = /u01/app/oracle
2.主库dbca建库,注意生产环境的一些参数SGA,PGA,PROCESS,归档位置,open_cursor,flash_recovery位置等等,如果要使用EM开始的时候需要建端口1521监听
3.主库tnames.ora配置
NETDATA_SD =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.213.200)(PORT = 51518))
)
(CONNECT_DATA =
(SERVICE_NAME = netdata)
)
)
NETDATA_PD =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.213.199)(PORT = 51518))
)
(CONNECT_DATA =
(SERVICE_NAME = netdata)
)
)
4.备库安装oracle软件仅安装软件(请参照之前安装软件)
5.备库配置listener.ora,tnames.ora
listener.ora如下:
LISTENER =
(DESCRIPTION_LIST =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = ORA11G-DG2)(PORT = 51518))
(ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC51518))
)
)
SID_LIST_LISTENER =
(SID_LIST =
(SID_DESC =
(SID_NAME = PLSExtProc)
(ORACLE_HOME = /u01/app/oracle/product/11.2.0/dbhome_1)
(PROGRAM = extproc)
)
(SID_DESC =
(GLOBAL_DBNAME = netdata)
(ORACLE_HOME = /u01/app/oracle/product/11.2.0/dbhome_1)
(SID_NAME = netdata)
)
)
ADR_BASE_LISTENER = /u01/app/oracle
tnames.ora如下:
NETDATA_SD =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.213.200)(PORT = 51518))
)
(CONNECT_DATA =
(SERVICE_NAME = netdata)
)
)
NETDATA_PD =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.213.199)(PORT = 51518))
)
(CONNECT_DATA =
(SERVICE_NAME = netdata)
)
)
6.主库参数文件配置
主库强制forceloing
SQL> ALTER DATABASE FROCE LOGGING;
SQL> select FORCE_LOGGING from v$database;
YES
参数文件配置
alter system set DB_UNIQUE_NAME=netdata_pd scope=spfile;
alter system set LOG_ARCHIVE_CONFIG='DG_CONFIG=(netdata_pd,netdata_sd)' scope=both;
alter system set LOG_ARCHIVE_DEST_1='LOCATION=/oradata/archive VALID_FOR=(ALL_LOGFILES,ALL_ROLES) DB_UNIQUE_NAME=netdata_pd' scope=both;
alter system set LOG_ARCHIVE_DEST_2='SERVICE=netdata_sd LGWR SYNC AFFIRM VALID_FOR=(ONLINE_LOGFILES,PRIMARY_ROLE) DB_UNIQUE_NAME=netdata_sd';
alter system set standby_file_management='AUTO' sid='*' scope=both;
alter system set fal_client='netdata_pd';
alter system set fal_server='netdata_sd';
alter system set db_file_name_convert='/oradata/netdata','/oradata/netdata' SCOPE=SPFILE;
alter SYSTEM SET log_file_name_convert='/oradata/netdata','/oradata/netdata' SCOPE=SPFILE;
7.为备库创建参数文件
create pfile='/oradata/standby.ora' from spfile
编辑standby.ora
修改
*.db_unique_name='NETDATA_PD'
*.log_archive_config='DG_CONFIG=(netdata_pd,netdata_sd)'
*.log_archive_dest_1='LOCATION=/oradata/archive
VALID_FOR=(ALL_LOGFILES,ALL_ROLES)
DB_UNIQUE_NAME=netdata_pd'
*.log_archive_dest_2='SERVICE=netdata_sd ASYNC
VALID_FOR=(ONLINE_LOGFILES,PRIMARY_ROLE)
DB_UNIQUE_NAME=netdata_sd'
*.fal_client='NETDATA_PD'
*.fal_server='NETDATA_SD'
*.log_file_name_convert='/oradata/netdata','/oradata/netdata'
*.standby_file_management='AUTO'
*.db_file_name_convert='/oradata/netdata','/oradata/netdata'
8.为备库创建控制文件
alter database create standby controlfile as '/oradata/control01.ctl';
9.关闭主库将数据文件,参数文件,密码文件($ORACLE_HOME/dbs/orapwnetdata linux为orapw$ORACLE_SID),admin文件
注:备库创建所需要目录 用oracle用户创建
--数据文件目录
mkdir -p /oradata/netdata
--recovery目录
mkdir -p /oradata/recovery_area
--归档目录
mkdir -p /oradata/archive
--admin目录
mkdir -p /u01/app/oracle/admin/
拷贝数据文件及redo文件
scp -r /oradata/netdata/*.log oracle@192.168.213.200:/oradata/netdata/
scp -r /oradata/netdata/*.dbf oracle@192.168.213.200:c
拷贝admin目录
scp -r /u01/app/oracle/admin/* oracle@192.168.213.200:/u01/app/oracle/admin/
拷贝参数文件
scp -r /oradata/control01.ctl oracle@192.168.213.200:/oradata/control01.ctl
scp -r /oradata/control01.ctl oracle@192.168.213.200:/oradata/control02.ctl
scp -r /oradata/control01.ctl oracle@192.168.213.200:/oradata/recovery_area/control03.ctl
注意一定要copy全不然启动备库会报错的
拷贝密码文件
scp -r $ORACLE_HOME/dbs/orapwnetdata oracle@192.168.213.200:/u01/app/oracle/product/11.2.0/dbhome_1/dbs/orapwnetdata
10.为主备库创建standbylog
主:
startup
ALTER DATABASE ADD STANDBY LOGFILE group 4('/oradata/netdata/stredo01.log') SIZE 50M;
ALTER DATABASE ADD STANDBY LOGFILE group 5('/oradata/netdata/stredo02.log') SIZE 50M;
ALTER DATABASE ADD STANDBY LOGFILE group 6('/oradata/netdata/stredo03.log') SIZE 50M;
ALTER DATABASE ADD STANDBY LOGFILE group 7('/oradata/netdata/stredo04.log') SIZE 50M;
注意这里大小要跟redolog一致,比redolog多一组
备:
sqlplus /nolog
create spfile from pfile='/oradata/netdata/standby.ora';
startup mount;
ALTER DATABASE ADD STANDBY LOGFILE group 4('/oradata/netdata/stredo01.log') SIZE 50M;
ALTER DATABASE ADD STANDBY LOGFILE group 5('/oradata/netdata/stredo02.log') SIZE 50M;
ALTER DATABASE ADD STANDBY LOGFILE group 6('/oradata/netdata/stredo03.log') SIZE 50M;
ALTER DATABASE ADD STANDBY LOGFILE group 7('/oradata/netdata/stredo04.log') SIZE 50M;
11.检验主库是否同步
备操作:
shutdown immediate;
startup nomount;
alter database mount standby database;
alter database recover managed standby database disconnect from session;
检验主备是否一致
archive log list;
col name format A50;
col dest_name format A40
col error format A20
set line 200;
select name,sequence#,applied from v$archived_log a where a.sequence#=(select max(sequence#) from v$archived_log);
col dest_name format A40
select dest_name,status,error from v$archive_dest where rownum<3;
启动ADG:
alter database recover managed standby database cancel;
alter database open read only;
alter database recover managed standby database using current logfile disconnect from session;
Oracle 11.2.4.0 ACTIVE DATAGUARD 单实例安装(COPY创建备库)的更多相关文章
- Oracle Grid control 11g及Active DataGuard 11g安装部署
Oracle Grid control 11g及Active DataGuard 11g安装部署(一) 原贴 http://blog.csdn.net/lichangzai/article/detai ...
- Linux平台Oracle 12.1.0.2 单实例安装部署
主题:Linux平台Oracle 12.1.0.2 单实例安装部署 环境:RHEL 6.5 + Oracle 12.1.0.2 需求:安装部署OEM 13.2需要Oracle 12.1.0.2版本作为 ...
- DataGuard 单实例到RAC搭建
背景简介: 本文为针对一次windows平台RAC数据库迁移至Linux平台RAC的笔记,基本步骤为: 1.搭建windows RAC到Linux 单实例数据库的DataGuard 2.做switch ...
- mysql5.6.40单实例安装二进制快捷安装
mysql5.6.40单实例安装二进制快捷安装 近期因不同环境需要不同版本的mysql实例,故为了方便操作,特此记录下来,方便自己查找. # 1.1.Centos最小化安装推荐常用依赖包 yum cl ...
- redis3.2.10单实例安装测试
redis3.2.10单实例安装测试 主要是实际使用环境中使用,为了方便快速部署,特意记录如下: # root用户 yum -y install make gcc-c++ cmake bison-de ...
- redis 单实例安装
单实例安装 近些年,由于内存技术的提升.造价的下降,越来越多企业的服务器内存已增加到几百G.这样的内存容量给了内存数据库一个良好的发展环境. 而使用Redis是内存数据库的一股清流,渐有洪大之势.下面 ...
- ElasticSearch_学习_01_单实例安装与分布式安装
一.前言 二.下载 1.下载地址 https://www.elastic.co/downloads/past-releases 三.单实例安装 直接解压,window下运行 elasticsearch ...
- Spring源码窥探之:单实例Bean的创建过程
finishBeanFactoryInitialization(beanFactory);初始化剩下的所有的单实例(非懒加载)Bean(Instantiate all remaining (non-l ...
- Linux 6.5(oracle 11.2.0.4)单实例ASM安装
Linux 6.5(oracle 11.2.0.4) 1.解析主机.配置网络等 /etc/hosts /etc/sysconfig/network /etc/init.d/NetworkManager ...
随机推荐
- 【转】以 java 为例,总结下 appium 里的一方法的使用心得
转自:http://testerhome.com/topics/1043 1.关于没有name,没有ID的元素的定位---通用篇解题思路:因为没有name,id:其实剩下的选择已不多,要么xpath, ...
- KSImageNamed 安装后无效解决方法
UIImage的imageNamed提供文件名自动补全功能.使用[UIImage imageNamed:@"xxx"]时,该插件会扫描整个workspace中的图片文件.若安装后无 ...
- 使用cordova插件barcodescanner遇到的坑
最近接手了一个app任务,由于不懂android和ios,只想简单点写代码,所以,最终采用了基于H5的web框架:ionic + cordova(也叫phonegap)来开发.app的设计中有一个扫描 ...
- 转~~~ DIV+CSS实现三角形提示框
<!DOCTYPE html> <html> <head> <meta charset="UTF-8"> <link rel= ...
- hdu1024 dp
题意:求一个序列中的最大 m 段和,m 段不能交叉. dp[i][0/1][j] 表示已经取完第 i 个物品,第 i 个物品取或不取,取到第 j 个子段. 用vis[i][0/1][j] 表示该 dp ...
- About SQLite
About SQLite See Also... Features When to use SQLite Frequently Asked Questions Well-known Users Boo ...
- 【OPENGL】第二篇 HELLO OPENGL(续)
上一次我们在这里分析了OpenGL的例子,但是最后还少分析最重要的部分:着色器相关的代码.因此这一次作为前一篇文章的续集. 上一篇文章的地址 http://www.cnblogs.com/MyGame ...
- DB2 claim与drain
DB2使用claim & drain来控制SQL与utility对数据库对象的访问. claim说明有对象正在访问或是将要访问该对象,而drain则是在对象上面加一个drain lock,等所 ...
- VS高效开发快捷键
Ctrl + Tab 标签切换 Ctrl + '-'向后导航 Ctrl + Shift+'-'向前导航 Ctrl +Shift +空格 提示函数参数 Ctrl +F4 退出本标签 Ctrl+F 查找 ...
- undefined reference to `dlopen'
g++ -O0 -g3 -I. -Ithird/json -Ithird/core/include -Ithird/vite/include -Ithird/openfst-1.2.10/src/in ...