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 [email protected]:/oradata/netdata/
scp -r /oradata/netdata/*.dbf [email protected]:c
拷贝admin目录
scp -r /u01/app/oracle/admin/* [email protected]:/u01/app/oracle/admin/
拷贝参数文件
scp -r /oradata/control01.ctl [email protected]:/oradata/control01.ctl
scp -r /oradata/control01.ctl [email protected]:/oradata/control02.ctl
scp -r /oradata/control01.ctl [email protected]:/oradata/recovery_area/control03.ctl
注意一定要copy全不然启动备库会报错的
拷贝密码文件
scp -r $ORACLE_HOME/dbs/orapwnetdata [email protected]:/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;

时间: 2024-10-07 06:13:14

Oracle 11.2.4.0 ACTIVE DATAGUARD 单实例安装(COPY创建备库)的相关文章

Linux平台oracle 11g单实例 安装部署配置 快速参考

1.重建主机的Oracle用户 组 统一规范 uid gid 以保证共享存储挂接或其他需求的权限规范 userdel -r oracle groupadd -g 500 oinstall groupadd -g 501 dba useradd -g oinstall -G dba -u 500 oracle #id oracle uid=500(oracle) gid=500(oinstall) 组=500(oinstall),501(dba) 2.安装好Oracle 需要的rpm包.安装rpm

mysql5.6.40单实例安装二进制快捷安装

mysql5.6.40单实例安装二进制快捷安装 近期因不同环境需要不同版本的mysql实例,故为了方便操作,特此记录下来,方便自己查找. # 1.1.Centos最小化安装推荐常用依赖包 yum clean all yum -y update yum -y install gcc-c++ gd libxml2-devel libjpeg-devel libpng-devel net-snmp-devel wget telnet vim zip unzip yum -y install curl-

mysql单实例安装配置指南

1.操作系统:CentOS 2.数据库: mysql-5.1.73.tar.gz 3.任务:单实例安装配置指南 提示:下载数据库有两种方式:一种是官网,另一种途径是国内镜象网站:国内镜象下载资源的速度比官网要快,例如,我们这次下载的就是国内搜狐镜象: http://mirrors.sohu.com/mysql/MySQL-5.1/ http://mirrors.sohu.com/ 整个安装过程: [[email protected] tools]#wget http://mirrors.sohu

redis 单实例安装

单实例安装 近些年,由于内存技术的提升.造价的下降,越来越多企业的服务器内存已增加到几百G.这样的内存容量给了内存数据库一个良好的发展环境. 而使用Redis是内存数据库的一股清流,渐有洪大之势.下面就来接触下redis.从安装开始. 1.1 安装 1.1.1 安装 从redis 官网下载:http://download.redis.io/releases/redis-stable.tar.gz 也可以在http://download.redis.io/releases/ 上查找自己想要的版本.

redis3.2.10单实例安装测试

redis3.2.10单实例安装测试 主要是实际使用环境中使用,为了方便快速部署,特意记录如下: # root用户 yum -y install make gcc-c++ cmake bison-devel ncurses-devel readline-devel libaio-devel perl libaio wget lrzsz vim mkdir -p /data useradd -d /data/redis -m redis mkdir -p /data/redis/applicati

virtualbox+oracle linux 6.3 下安装oracle 11.2.3.0

闲来无事,今天在虚拟机下安装了oracle11g的单实例,特此记录分享下! 用到的软件:VirtualBox-4.0.8-71778-Win.exe     oracle linux 6.3(V33411-01.iso) oracle11g(p10404530_112030_Linux-x86-64_1of7.zip, p10404530_112030_Linux-x86-64_2of7.zip) 一.安装linux. 虚拟机配置的是:1g内存,30g硬盘,一块网卡(host-only模式) 检

Oracle 11g 两个节点RAC 搭建单实例DG详细步骤以及注意事项

环境介绍: OS: 都是 [[email protected] ~]# uname -a Linux java3 2.6.18-308.el5 #1 SMP Tue Feb 21 20:06:06 EST 2012 x86_64 x86_64 x86_64 GNU/Linux 主库:  数据库版本:11.2.0.3.0  两个节点的RAC  节点一:192.168.15.26  节点二:192.168.15.27 standby 数据库版本:  11.2.0.3.0      IP 192.16

linux 6.4 平台下 Oracle 12c 单实例 安装手册

一.准备工作 1.1 安装需要的RPM 包 binutils-2.20.51.0.2-5.11.el6 (x86_64) glibc-2.12-1.7.el6 (x86_64) libgcc-4.4.4-13.el6 (x86_64) libstdc++-4.4.4-13.el6 (x86_64) libaio-0.3.107-10.el6 (x86_64) libXext-1.1 (x86_64) libXtst-1.0.99.2 (x86_64) libX11-1.3 (x86_64) li

单实例安装oracle12c

安装部署12c 1.官网下载12cr2的安装包 2.系统环境要求RHEL6或者以上,Oracle Enterprise Linux也可以. 3.使用图形方式安装部署,给出基本的步骤和错误总结 4.安装成功的基本检查.安装环境:操作系统 CentOS6.6 64位(基本安装包,不安装图形桌面)主机名 12c IP地址 192.168.56.8 实例名(sid) testsid 数据库名 test(db_name) (test.localdomain(global database name)) O