Dataguard配置Step by Step

原创 2004年08月16日 22:33:00
link:
 
1.主节点备份并生成备用数据库控制文件

设置主节点为force Logging模式(为了双向切换,建议备用节点也设置为force logging模式)
ALTER DATABASE FORCE LOGGING;

设置主节点为归档模式

登陆主节点,进行数据库备份,并生成备用数据库控制文件


Last login: Mon Aug  9 16:46:47 2004 from 172.16.32.65
[root@standby root]# su - oracle
[oracle@standby oracle]$ sqlplus "/ as sysdba"

SQL*Plus: Release 9.2.0.4.0 - Production on Mon Aug 16 10:16:18 2004

Copyright (c) 1982, 2002, Oracle Corporation.  All rights reserved.

Connected to an idle instance.

SQL> startup
ORACLE instance started.

Total System Global Area  135337420 bytes
Fixed Size                   452044 bytes
Variable Size             109051904 bytes
Database Buffers           25165824 bytes
Redo Buffers                 667648 bytes
Database mounted.
Database opened.

SQL> select name from v$datafile;

NAME
------------------------------------------------------------
/opt/oracle/oradata/primary/system01.dbf
/opt/oracle/oradata/primary/undotbs01.dbf
/opt/oracle/oradata/primary/users01.dbf


SQL> shutdown immediate
Database closed.
Database dismounted.
ORACLE instance shut down.
SQL> exit
Disconnected from Oracle9i Enterprise Edition Release 9.2.0.4.0 - Production
With the Partitioning option
JServer Release 9.2.0.4.0 - Production
[oracle@standby oracle]$ ls
admin  dictionary.ora  jre  oradata  oraInventory  oui  product  soft

[oracle@standby oracle]$ tar -cvf oradata.tar oradata
oradata/
oradata/primary/
oradata/primary/archive/
oradata/primary/control01.ctl
oradata/primary/control02.ctl
oradata/primary/control03.ctl
oradata/primary/redo01.log
oradata/primary/redo02.log
oradata/primary/redo03.log
oradata/primary/system01.dbf
oradata/primary/undotbs01.dbf
oradata/primary/temp01.dbf
oradata/primary/users01.dbf

[oracle@standby oracle]$ ls -l *.tar
-rw-r--r--    1 oracle   dba      576512000 Aug 16 10:22 oradata.tar
[oracle@standby oracle]$ id
uid=800(oracle) gid=800(dba) groups=800(dba)
[oracle@standby oracle]$ hostname
standby
[oracle@standby oracle]$ sqlplus "/ as sysdba"

SQL*Plus: Release 9.2.0.4.0 - Production on Mon Aug 16 10:27:54 2004

Copyright (c) 1982, 2002, Oracle Corporation.  All rights reserved.

Connected to an idle instance.

SQL> startup
ORACLE instance started.

Total System Global Area  135337420 bytes
Fixed Size                   452044 bytes
Variable Size             109051904 bytes
Database Buffers           25165824 bytes
Redo Buffers                 667648 bytes
Database mounted.
Database opened.
SQL> archive log list;
Database log mode              Archive Mode
Automatic archival             Enabled
Archive destination            /opt/oracle/oradata/primary/archive
Oldest online log sequence     88
Next log sequence to archive   90
Current log sequence           90
SQL> alter database create standby controlfile as '/opt/oracle/stdcotrl.ctl';

Database altered.

SQL> !
ls[oracle@standby oracle]$ ls
admin  dictionary.ora  jre  oradata  oradata.tar  oraInventory  oui  product  soft  stdcotrl.ctl


 

2.从主节点创建pfile文件

 

SQL> create pfile from spfile;

File created.

SQL> !

[oracle@standby oracle]$ cd $ORACLE_HOME/dbs
[oracle@standby dbs]$ ls
initdw.ora init.ora initprimary.ora lkPRIMARY orapwprimary spfileprimary.ora sqlnet.log

 

3.登陆备用节点,ftp获得数据库文件、备用控制文件及参数文件

 

 

 

4.配置主节点监听器及tnsnames.ora文件
配置后如下:

 

					
[oracle@standby oracle]$ cd /opt/oracle/product/9.2.0/network/admin/
[oracle@standby admin]$ cat listener.ora 
# LISTENER.ORA Network Configuration File: /opt/oracle/product/9.2.0/network/admin/listener.ora
# Generated by Oracle configuration tools.

LISTENER =
  (DESCRIPTION_LIST =
    (DESCRIPTION =
      (ADDRESS_LIST =
        (ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC))
      )
      (ADDRESS_LIST =
        (ADDRESS = (PROTOCOL = TCP)(HOST = standby)(PORT = 1521))
      )
    )
  )

SID_LIST_LISTENER =
  (SID_LIST =
    (SID_DESC =
      (SID_NAME = PLSExtProc)
      (ORACLE_HOME = /opt/oracle/product/9.2.0)
      (PROGRAM = extproc)
    )
    (SID_DESC =
      (GLOBAL_DBNAME = primary)
      (ORACLE_HOME = /opt/oracle/product/9.2.0)
      (SID_NAME = primary)
    )
  )

[oracle@standby admin]$ cat tnsnames.ora 
# TNSNAMES.ORA Network Configuration File: /opt/oracle/product/9.2.0/network/admin/tnsnames.ora
# Generated by Oracle configuration tools.

STANDBY =
  (DESCRIPTION =
    (ADDRESS_LIST =
      (ADDRESS = (PROTOCOL = TCP)(HOST = 172.16.33.46)(PORT = 1521))
    )
    (CONNECT_DATA =
      (SERVER = DEDICATED)
      (SERVICE_NAME = primary)
    )
  )
PRIMARY =
  (DESCRIPTION =
    (ADDRESS_LIST =
      (ADDRESS = (PROTOCOL = TCP)(HOST = 172.16.33.58)(PORT = 1521))
    )
    (CONNECT_DATA =
      (SERVER = DEDICATED)
      (SERVICE_NAME = primary)
    )
  )

[oracle@standby admin]$ lsnrctl start

LSNRCTL for Linux: Version 9.2.0.4.0 - Production on 16-AUG-2004 10:46:31

Copyright (c) 1991, 2002, Oracle Corporation.  All rights reserved.

Starting /opt/oracle/product/9.2.0/bin/tnslsnr: please wait...

TNSLSNR for Linux: Version 9.2.0.4.0 - Production
System parameter file is /opt/oracle/product/9.2.0/network/admin/listener.ora
Log messages written to /opt/oracle/product/9.2.0/network/log/listener.log
Listening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC)))
Listening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=standby)(PORT=1521)))

Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=IPC)(KEY=EXTPROC)))
STATUS of the LISTENER
------------------------
Alias                     LISTENER
Version                   TNSLSNR for Linux: Version 9.2.0.4.0 - Production
Start Date                16-AUG-2004 10:46:31
Uptime                    0 days 0 hr. 0 min. 0 sec
Trace Level               off
Security                  OFF
SNMP                      OFF
Listener Parameter File   /opt/oracle/product/9.2.0/network/admin/listener.ora
Listener Log File         /opt/oracle/product/9.2.0/network/log/listener.log
Listening Endpoints Summary...
  (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC)))
  (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=standby)(PORT=1521)))
Services Summary...
Service "PLSExtProc" has 1 instance(s).
  Instance "PLSExtProc", status UNKNOWN, has 1 handler(s) for this service...
Service "primary" has 1 instance(s).
  Instance "primary", status UNKNOWN, has 1 handler(s) for this service...
The command completed successfully					
					

 

5.配置备用数据库监听器及tnsnames.ora文件

配置后文件如下:

 

 

6.在主备节点用tnsping测试网络连通性

 

 

7.启动备用数据库

 


SQL*Plus: Release 9.2.0.4.0 - Production on Mon Aug 16 11:09:40 2004

Copyright (c) 1982, 2002, Oracle Corporation. All rights reserved.

Connected to an idle instance.

SQL> startup nomount;
ORACLE instance started.

Total System Global Area 135337420 bytes
Fixed Size 452044 bytes
Variable Size 109051904 bytes
Database Buffers 25165824 bytes
Redo Buffers 667648 bytes
SQL> alter database mount standby database;

Database altered.

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

Database altered.


8.在主节点设置归档路径

 


System altered.

SQL> alter system switch logfile;

System altered.

SQL> /

System altered.

SQL>

在备用节点观察日志

[oracle@eygle bdump]$ tail -f alert_primary.log
MRP0: Background Managed Standby Recovery process started
Starting datafile 1 recovery in thread 1 sequence 90
Datafile 1: '/opt/oracle/oradata/primary/system01.dbf'
Starting datafile 2 recovery in thread 1 sequence 90
Datafile 2: '/opt/oracle/oradata/primary/undotbs01.dbf'
Starting datafile 3 recovery in thread 1 sequence 90
Datafile 3: '/opt/oracle/oradata/primary/users01.dbf'
Media Recovery Waiting for thread 1 seq# 90
Mon Aug 16 11:10:50 2004
Completed: alter database recover managed standby database di
Mon Aug 16 11:13:34 2004
Media Recovery Log /opt/oracle/oradata/primary/stdarch/1_90.dbf
Media Recovery Waiting for thread 1 seq# 91
Media Recovery Log /opt/oracle/oradata/primary/stdarch/1_91.dbf
Media Recovery Waiting for thread 1 seq# 92
Mon Aug 16 12:09:38 2004
Media Recovery Log /opt/oracle/oradata/primary/stdarch/1_92.dbf

 

9.在主节点进行同样的配置,以便切换后继续日志传递

 


SQL> alter system set standby_archive_dest='/opt/oracle/oradata/primary/stdarch';

System altered.

 

10.停止主数据库,启用备用数据库

 

 

11.进行数据修改

 

 

12.把数据库切换回到主节点

 

 

完成自由切换

二维图像中Mat::setp、Mat::step1理解

一、前言        Mat中的step为构成图像的层次,考虑到Mat多应用于二维图像,本文讨论二维图像step的含义和应用。二维图像数据存储示意图如下:                      ...
  • AP1005834
  • AP1005834
  • 2017年02月01日 19:55
  • 715

Step.js 使用教程(附源码解析)

Step.js(https://github.com/creationix/step)是控制流程工具(大小仅 150 行代码),解决回调嵌套层次过多等问题。适用于读文件、查询数据库等回调函数相互依赖,...
  • zhangxin09
  • zhangxin09
  • 2013年10月25日 15:18
  • 8478

高次同余笔记(一):baby-step-giant-step算法

我们来看这个方程: a,b,p为常数且在int内。、p是质数。 这个怎么搞? 首先x的取值肯定在0到p-1之间。 暴搜?肯定超时啊。 优化暴搜?用meet-in-the-middle? ...
  • Quack_quack
  • Quack_quack
  • 2015年11月17日 00:35
  • 945

机器学习--线性回归R语言

回归分析就是利用样本,产生拟合方程,从而进行预测。简而言之,就是你用你手头上的数据进行模型的训练,然后用你得到的模型对于新数据进行预测。一元线性回归:例子:y...
  • dingchenxixi
  • dingchenxixi
  • 2016年01月20日 16:23
  • 3937

【Caffe细致入微】Solver_Step

void Solver::Step(int iters) 简单的说,这个函数就是核心的优化方法,不断通过前向和反向传播来更新参数的过程。 【重要变量】 int average_loss...
  • u012816621
  • u012816621
  • 2016年12月30日 11:47
  • 2179

稀疏表示step by step

稀疏表示step by step(1) 声明:本人属于绝对的新手,刚刚接触“稀疏表示”这个领域。之所以写下以下的若干个连载,是鼓励自己不要急功近利,而要步步为赢!所以下文肯定有所纰漏,敬请指出,我们...
  • LanQiuChaoRen
  • LanQiuChaoRen
  • 2014年07月28日 17:33
  • 629

稀疏表示step by step

声明:本人属于绝对的新手,刚刚接触“稀疏表示”这个领域。之所以写下以下的若干个连载,是鼓励自己不要急功近利,而要步步为赢!所以下文肯定有所纰漏,敬请指出,我们共同进步! 踏入“稀疏表达”(Spa...
  • wulinxianglian
  • wulinxianglian
  • 2014年02月10日 17:17
  • 505

稀疏表示step by step

声明:本人属于绝对的新手,刚刚接触“稀疏表示”这个领域。之所以写下以下的若干个连载,是鼓励自己不要急功近利,而要步步为赢!所以下文肯定有所纰漏,敬请指出,我们共同进步! 踏入“稀疏表达”(Spar...
  • zzq060143
  • zzq060143
  • 2017年11月02日 14:47
  • 67

深入理解CSS3 Animation 帧动画(step详解)

By Aaron: CSS3我在5年之前就有用了,包括公司项目都一直在很前沿的技术。 最近在写慕课网的七夕主题,用了大量的CSS3动画,但是真的沉淀下来仔细的去深入CSS3动画的各个属性发现还...
  • Christine95
  • Christine95
  • 2016年01月06日 18:58
  • 6290

【opengl】【step by step】一————三角形

今天学如何用opengl绘制一个三角形,直接贴代码:
  • H1051760124
  • H1051760124
  • 2014年12月05日 10:51
  • 566
内容举报
返回顶部
收藏助手
不良信息举报
您举报文章:Dataguard配置Step by Step
举报原因:
原因补充:

(最多只允许输入30个字)