`
njliuqi
  • 浏览: 10344 次
  • 性别: Icon_minigender_1
  • 来自: 北京
最近访客 更多访客>>
社区版块
存档分类
最新评论

oracle dataguard install

阅读更多
############################
station 1(primary database)
#############################
IPADDR:192.168.1.4
ORACLE_HOME=/u01/oracle/product/10.2.0/db_1
ORACLE_SID=primary
db_unique_name=primary

############################
station 2(standby database)
###########################
IPADDR:192.168.1.8
ORACLE_HOME=/u01/oracle/product/10.2.0/db1
db_unique_name=standby


[主库部分]
#主库安装instance(archive log mode),备库只安装软件
#SQL>ALTER DATABASE FORCE LOGGING;
#创建密码文件,如果有就不用创建了
[ORACLE]#orpwd file=orapw$ORACLE_SID password=oracle entries=5


#主库生成pfile
SQL>create pfile from spfile;

#主库修改pfile文件
log_archive_dest_1='LOCATION=/u01/archive'
log_archive_dest_state_1=enable
log_archive_dest_2='SERVICE=standby'
log_archive_dest_state_2=enable
log_archive_start=true
#Specify the Oracle Net service name
fal_server=standby
fal_client=primary
db_unique_name=primary

SQL>create spfile from pfile;

#主库中创建备库control file
SQL>shutdown immediate
SQL>startup mount;
SQL>alter database create standby controlfile as
    '/u01/oradata/primary/standby.ctl'
SQL>alter database open;
SQL>shutdown immediate

#copy 主库的数据到备库中
1.oradata/*(data file,control file, redo file)
scp -r /u01/oradata 192.168.1.4:/u01/oradata

2.admin/*(bdump,cdump,adump)
scp -r /u01/admin 192.168.1.4:/u01

3.dbs/*(listener.ora initprimary.ora)


#备库中删除主库拷贝过来的控制文件
#将之前生成的standby.ctl 复制成三份控制文件保存

[备库部分]
#修改备库的pfile文件
log_archive_dest_1='LOCATION=/u01/archive'
log_archive_dest_state_1=enable
log_archive_dest_2='SERVICE=primary'
log_archive_dest_state_2=enable
log_archive_start=true
#此处的fal_server,fal_client的值是tnsnames.ora文件里面的值
fal_server=primary
fal_client=standby
db_unique_name=standby


测试
#启动主库
#启动备库listener

SQL>create spfile from pfile;
SQL>startup nomount;
SQL>alter database mount standby database;
SQL>select name,database_role from v$database;
NAME      DATABASE_ROLE
--------- ----------------
PRIMARY   PHYSICAL STANDBY

SQL>alter database recover managed standby database disconnect from session;

SQL>select sequence#,first_time,next_time from v$archived_log order by sequence#;

SQL>select sequence#,applied from v$archived_log order by sequence#;


################
primary database
listener.ora
#################
SID_LIST_LISTENER =
  (SID_LIST =
    (SID_DESC =
      (SID_NAME = PLSExtProc)
      (ORACLE_HOME = /u01/oracle/product/10.2.0/db_1)
      (PROGRAM = extproc)
    )
    (SID_DESC =
      (SID_NAME = primary)
      (ORACLE_HOME = /u01/oracle/product/10.2.0/db_1)
      (SERVICE_NAME = primary)
    )
  )

LISTENER01 =
  (DESCRIPTION_LIST =
    (DESCRIPTION =
      (ADDRESS = (PROTOCOL = TCP)(HOST = primary)(PORT = 1521))
      (ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC0))
    )
  )
LISTENER02 =
  (DESCRIPTION_LIST =
    (DESCRIPTION =
      (ADDRESS = (PROTOCOL = TCP)(HOST = standby)(PORT = 1521))
      (ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC0))
    )
  )


################
primary database
tnsnames.ora
#################
PRIMARY =
  (DESCRIPTION =
    (ADDRESS_LIST =
      (ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.1.4)(PORT = 1521))
    )
    (CONNECT_DATA =
      (SERVICE_NAME = primary)
    )
  )

STANDBY =
  (DESCRIPTION =
    (ADDRESS_LIST =
       (ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.1.8)(PORT = 1521))
    )
   (CONNECT_DATA =
      (SERVICE_NAME = primary)
   )
)

EXTPROC_CONNECTION_DATA =
  (DESCRIPTION =
    (ADDRESS_LIST =
      (ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC0))
    )
    (CONNECT_DATA =
      (SID = PLSExtProc)
      (PRESENTATION = RO)
    )
  )

#######################
standby database
listener.ora
#######################
SID_LIST_LISTENER =
  (SID_LIST =
    (SID_DESC =
      (SID_NAME = PLSExtProc)
      (ORACLE_HOME = /u01/oracle/product/10.2.0/db_1)
      (PROGRAM = extproc)
    )
    (SID_DESC =
      (SID_NAME = primary)
      (ORACLE_HOME = /u01/oracle/product/10.2.0/db_1)
      (SERVICE_NAME = primary)
    )
  )

LISTENER01 =
  (DESCRIPTION_LIST =
    (DESCRIPTION =
      (ADDRESS = (PROTOCOL = TCP)(HOST = primary)(PORT = 1521))
      (ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC0))
    )
  )
LISTENER02 =
  (DESCRIPTION_LIST =
    (DESCRIPTION =
      (ADDRESS = (PROTOCOL = TCP)(HOST = standby)(PORT = 1521))
      (ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC0))
    )
  )

################
primary database
tnsnames.ora
#################

PRIMARY =
  (DESCRIPTION =
    (ADDRESS_LIST =
      (ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.1.4)(PORT = 1521))
    )
    (CONNECT_DATA =
      (SERVICE_NAME = primary)
    )
  )

STANDBY =
  (DESCRIPTION =
    (ADDRESS_LIST =
      (ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.1.4)(PORT = 1521))
    )
    (CONNECT_DATA =
      (SERVICE_NAME = primary)
    )
  )

EXTPROC_CONNECTION_DATA =
  (DESCRIPTION =
    (ADDRESS_LIST =
      (ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC0))
    )
    (CONNECT_DATA =
      (SID = PLSExtProc)
      (PRESENTATION = RO)
    )
  )

分享到:
评论

相关推荐

    oracle 10g dataguard install in centos5

    Oracle Data Guard 是Oracle数据库系统中的一种高可用性和灾难恢复解决方案,...详细步骤可参考相关教程,如《一步一步学Dataguard》。通过正确配置和管理,Data Guard可以为企业提供强大的数据保护和灾难恢复能力。

    oracle dataguard 快速搭建物理备库

    ### Oracle Dataguard 快速搭建物理备库 Oracle Dataguard 技术为数据库提供了高可用性和灾难恢复的能力,其通过在生产数据库(主库)与备用数据库(备库)之间实现数据复制来保障数据的安全性和连续性。本文将详细...

    Dataguard 环境搭建 Oracle linux5

    使用`yum install`命令安装兼容库、开发工具、sysstat、unixODBC和相关开发库。 3. **调整共享内存大小**: 默认的 `/dev/shm` 可能不足1GB,需要修改 `/etc/fstab` 文件,添加 `size=1024m` 参数,然后重新挂载...

    进阶一步一步在Linux上部署Oracle 11.2.0.3 RAC+Dataguard

    Install Oracle 11gR2(11.2.0.3.0) RAC +Active Dataguard on Oracle Enterprise Linux(OEL5.5 X86_64) 本文档用于详细记录在 OEL 5.5 X86_64 位系统上安装配置 Oracle 11gR2(11.2.0.3.0)RAC 的步骤、RAC 数据库的...

    [手工整理]208个Oracle安装文档,包含各个平台各个版本的单实例RAC以及DataGuard(1).xlsx

    34 ADG step by step install oracle10gR2 for windows dataguard 35 ADG 某儿童医院_灾备切换演练_实施方案 36 ADG 在Docker上搭建Oracle 11G DG 37 ADG 主rac + 备rac 部署_blog版 38 DG Centos6.10部署...

    Oracle_DataGuard数据备份方案详解.txt

    # ./runInstaller -silent -responseFile /tmp/installoracle.rsp ``` - **配置密码文件**: ```bash # cd $ORACLE_HOME/dbs/ # orapwd file=orapwSID password=123456 force=y ``` - **修改初始化参数文件*...

    Step by step dataguard on Redhat

    在IT领域,尤其是在数据库管理与高可用性方案中,Oracle DataGuard是一项被广泛采用的技术,它为数据库提供了灾难恢复和数据保护的能力。本文将详细解析如何在Redhat系统上逐步设置Oracle DataGuard,以创建一个物理...

    ORACLE10G Dataguard配置

    这些软件包包括`binutils`、`compat-db`、`gcc`等,如果缺少任何包,需要通过`yum install`或`rpm -i`命令进行安装。 3. **内核参数调整**: - 对于Oracle数据库,内核参数的优化至关重要。在`/etc/sysctl.conf`...

    ORACLE10G INSTALL FOR LINUX5.txt

    Oracle10g在Linux5上的安装过程涉及到多个关键步骤,包括系统配置、软件安装、环境设置等。在安装前,需要确保操作系统环境满足Oracle10g的安装要求,例如系统需要安装telnet和vftp,且telnet默认是禁用的。在系统...

    Oracle10Dataguard升级步骤[文].pdf

    - 停止监听器(lsnrctl stop)和服务管理器(emctl stop dbconsole),并进入安装目录执行升级脚本(./runInstall –ignoresysprereqs)。 - 完成后执行 `root.sh` 脚本来应用必要的系统级更新。 3. **修改参数**...

    DataGuard环境搭建详细步骤(单实例)

    yum install binutils compat-libstdc++-33 elfutils-libelf elfutils-libelf-devel elfutils-libelf-devel-static gcc gcc-c++ glibc glibc-common glibc-devel glibc-headers ksh kernel-headers libaio libaio-...

    oracle数据库健康检查及调优脚本

    参加oracle原厂培训,老师给的,很好用,介绍给大家 Produces an HTML report with a list of observations based on health-checks performed in and around a SQL statement that may be performing poorly. ...

    [三思笔记]一步一步学RMAN.pdf

    RMAN(Recovery Manager)是Oracle数据库管理系统中的一项重要工具,用于实现数据库的备份、恢复和灾难恢复等功能。它能够有效地保护数据库免受物理损坏或逻辑错误的影响,确保数据的安全性和可靠性。 #### 二、...

Global site tag (gtag.js) - Google Analytics