Chinaunix首页 | 论坛 | 博客
  • 博客访问: 5725065
  • 博文数量: 745
  • 博客积分: 10075
  • 博客等级: 上将
  • 技术积分: 7716
  • 用 户 组: 普通用户
  • 注册时间: 2005-04-29 12:09
文章分类

全部博文(745)

文章存档

2019年(1)

2016年(1)

2010年(31)

2009年(88)

2008年(129)

2007年(155)

2006年(197)

2005年(143)

分类: Oracle

2009-09-15 00:21:53

闲话不提,下面直入正题,看备节点建功立业:
1,以修改之后的参数文件为优秀代表,启动备节点数据库到nomount模式下:
SQL> startup nomount pfile='/arch/initstandby.ora';
ORACLE instance started.
Total System Global Area 1073741824 bytes
Fixed Size                  1999192 bytes
Variable Size             264244904 bytes
Database Buffers          805306368 bytes
Redo Buffers                2191360 bytes
 
2,创建服务器参数文件并关闭数据库:
SQL> create spfile from pfile='/arch/initstandby.ora';
File created.
SQL> shutdown immediate;
ORA-01507: database not mounted

ORACLE instance shut down.
3,启动修改后的监听(只需要修改其中的IP地址即可):
$ lsnrctl start
LSNRCTL for HPUX: Version 10.2.0.1.0 - Production on 11-SEP-2009 15:54:36
Copyright (c) 1991, 2005, Oracle.  All rights reserved.
Starting /home/db/oracle/10g/bin/tnslsnr: please wait...
TNSLSNR for HPUX: Version 10.2.0.1.0 - Production
System parameter file is /home/db/oracle/10g/network/admin/listener.ora
Log messages written to /home/db/oracle/10g/network/log/listener.log
Listening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=128.199.36.53)(PORT=1521)))
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=128.199.36.53)(PORT=1521)))
STATUS of the LISTENER
------------------------
Alias                     LISTENER
Version                   TNSLSNR for HPUX: Version 10.2.0.1.0 - Production
Start Date                11-SEP-2009 15:54:36
Uptime                    0 days 0 hr. 0 min. 0 sec
Trace Level               off
Security                  ON: Local OS Authentication
SNMP                      OFF
Listener Parameter File   /home/db/oracle/10g/network/admin/listener.ora
Listener Log File         /home/db/oracle/10g/network/log/listener.log
Listening Endpoints Summary...
  (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=128.199.36.53)(PORT=1521)))
Services Summary...
Service "PLSExtProc" has 1 instance(s).
  Instance "PLSExtProc", status UNKNOWN, has 1 handler(s) for this service...
Service "ora" has 1 instance(s).
  Instance "ora", status UNKNOWN, has 1 handler(s) for this service...
The command completed successfully
 
4,启动数据库到mount下:
$ sqlplus "/ as sysdba"
SQL*Plus: Release 10.2.0.1.0 - Production on Fri Sep 11 15:54:55 2009
Copyright (c) 1982, 2005, Oracle.  All rights reserved.
Connected to an idle instance.
SQL> startup mount;
ORACLE instance started.
Total System Global Area 1073741824 bytes
Fixed Size                  1999192 bytes
Variable Size             264244904 bytes
Database Buffers          805306368 bytes
Redo Buffers                2191360 bytes
Database mounted.
 
5,测试以网络方式注册数据库没有问题:
$ sqlplus as sysdba
SQL*Plus: Release 10.2.0.1.0 - Production on Fri Sep 11 15:01:20 2009
Copyright (c) 1982, 2005, Oracle.  All rights reserved.

Connected to:
Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - 64bit Production
With the Partitioning, OLAP and Data Mining options
SQL>
 
6,启动主节点数据库:
$ sqlplus "/ as sysdba"
SQL*Plus: Release 10.2.0.1.0 - Production on Fri Sep 11 15:59:29 2009
Copyright (c) 1982, 2005, Oracle.  All rights reserved.

Connected to:
Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - 64bit Production
With the Partitioning, OLAP and Data Mining options
SQL> alter database open;
Database altered.
 
7,重新关闭备节点数据库并以standby方式启动到mount状态下:
SQL> startup nomount
ORACLE instance started.
Total System Global Area 1073741824 bytes
Fixed Size                  1999192 bytes
Variable Size             264244904 bytes
Database Buffers          805306368 bytes
Redo Buffers                2191360 bytes
SQL> alter database mount standby database;
Database altered.
 
8,将备节点更改到接受主节点redo日志模式下:
SQL> alter database recover managed standby database disconnect from session;
Database altered.
 
9,查看切换状态:
SQL> select switchover_status from v$database;
SWITCHOVER_STATUS
--------------------
TO PRIMARY
如果显示为TO PRIMARY,表示一切正常。
 
到此为止,备节点革命过程完毕,和主节点遥相呼应,要想完全接收主节点redo日志,就需要主节点做出一些动作了,连同主备切换放到下篇再说。
 
阅读(1799) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~