[20140420]使用dgmgrl管理dataguard(8).txt

简介: [20140420]使用dgmgrl管理dataguard(8).txt 参考链接: http://blog.itpub.net/267265/viewspace-1142649/ http://blog.

[20140420]使用dgmgrl管理dataguard(8).txt

参考链接:
http://blog.itpub.net/267265/viewspace-1142649/
http://blog.itpub.net/267265/viewspace-1143027/
http://blog.itpub.net/267265/viewspace-1143058/
http://blog.itpub.net/267265/viewspace-1143126/
http://blog.itpub.net/267265/viewspace-1143480/
http://blog.itpub.net/267265/viewspace-1144742/
http://blog.itpub.net/267265/viewspace-1145573/

-- 我的测试环境:primary的tnsnames别名test,standby主机的tnsnames别名testdg。数据库版本:

$ rldgmgrl
DGMGRL for Linux: Version 11.2.0.3.0 - 64bit Production

Copyright (c) 2000, 2009, Oracle. All rights reserved.

Welcome to DGMGRL, type "help" for information.
Connected.
DGMGRL> switchover to testdg;
Performing switchover NOW, please wait...
New primary database "testdg" is opening...
Operation requires shutdown of instance "test" on database "test"
Shutting down instance "test"...
ORA-24327: need explicit attach before authenticating a user

Warning: You are no longer connected to ORACLE.

Please complete the following steps to finish switchover:
        shut down instance "test" of database "test"
        start up instance "test" of database "test"


--更正上个星期测试的问题.
$ oerr ora 24327
24327, 00000, "need explicit attach before authenticating a user"
// *Cause:  A server context must be initialized before creating a session.
// *Action: Create and initialize a server handle.

实际上只要connect 连接数据库,在执行切换就没有问题,不管是连test还是testdg.好像是不支持这样外部认证(再切换时).

另外注意的问题,就是切换的主库并没有打开force logging功能,切记切换后要打开这个功能.或者先打开它.

SYS@testdg> select database_role,open_mode,protection_mode from v$database;
DATABASE_ROLE    OPEN_MODE            PROTECTION_MODE
---------------- -------------------- --------------------
PRIMARY          READ WRITE           MAXIMUM PERFORMANCE

SYS@testdg> select name,force_logging from v$database;
NAME                 FOR
-------------------- ---
TEST                 NO

--可以发现testdg并没有打开force_logging.必须执行alter database force logging;
--有点乱,重新测试看看:

$ alias rldgmgrl
alias rldgmgrl='/usr/local/bin/rlwrap -s 9999 -r -i -f /home/oracle11g/dgmgrl.txt dgmgrl /@test'

$ rldgmgrl
DGMGRL for Linux: Version 11.2.0.3.0 - 64bit Production

Copyright (c) 2000, 2009, Oracle. All rights reserved.

Welcome to DGMGRL, type "help" for information.
Connected.
DGMGRL> show configuration
Configuration - study
  Protection Mode: MaxPerformance
  Databases:
    testdg - Primary database
    test   - Physical standby database
Fast-Start Failover: DISABLED

Configuration Status:
SUCCESS

DGMGRL> connect sys/btbtms@testdg
Connected.
DGMGRL> switchover to test;
Performing switchover NOW, please wait...
New primary database "test" is opening...
Operation requires shutdown of instance "testdg" on database "testdg"
Shutting down instance "testdg"...
ORACLE instance shut down.
Operation requires startup of instance "testdg" on database "testdg"
Starting instance "testdg"...
ORACLE instance started.
Database mounted.
Switchover succeeded, new primary is "test"

DGMGRL> show configuration
Configuration - study
  Protection Mode: MaxPerformance
  Databases:
    test   - Primary database
    testdg - Physical standby database
Fast-Start Failover: DISABLED
Configuration Status:
SUCCESS

--可以发现并没有出现上面的ORA-24327错误.

SYS@testdg> select database_role,open_mode,protection_mode,force_logging from v$database;
DATABASE_ROLE    OPEN_MODE            PROTECTION_MODE      FOR
---------------- -------------------- -------------------- ---
PHYSICAL STANDBY MOUNTED              MAXIMUM PERFORMANCE  NO

--可以发现testdg的force_logging=NO.

DGMGRL> switchover to testdg;
Performing switchover NOW, please wait...
New primary database "testdg" is opening...
Operation requires shutdown of instance "test" on database "test"
Shutting down instance "test"...
ORACLE instance shut down.
Operation requires startup of instance "test" on database "test"
Starting instance "test"...
ORACLE instance started.
Database mounted.
Switchover succeeded, new primary is "testdg"

SYS@testdg> select database_role,open_mode,protection_mode,force_logging from v$database;
DATABASE_ROLE    OPEN_MODE            PROTECTION_MODE      FOR
---------------- -------------------- -------------------- ---
PRIMARY          READ WRITE           MAXIMUM PERFORMANCE  NO

--这样看来事先在安装好dg时就打开force logging.
alter database force logging;

目录
相关文章
|
Oracle 关系型数据库 数据库
|
SQL Oracle 关系型数据库
ORA-00257: archiver error --11GR2 RAC 设置归档路径和开启flashback
<p>ORA-00257: archiver error --11GR2 RAC 设置归档路径和开启flashback</p> <p><br></p> <p></p> <div id="content" class="bigfont mycontent" style="zoom:1; line-height:23px; font-size:14px; margin:18px 28px
1618 0
|
数据库 Go 测试技术
[20151109]使用dgmgrl管理dataguard(15)
[20151109]使用dgmgrl管理dataguard(15).txt 参考链接: http://blog.itpub.net/267265/viewspace-1142649/ http://blog.
1072 0
|
Oracle 关系型数据库 数据库
[20140519]使用dgmgrl配置dataguard.txt
[20140519]使用dgmgrl配置dataguard.txt --最近一段时间看了dgmgrl的使用文档,主要是了解一些细节,我也在生产系统使用dgmgrl来管理dataguard,我发现在10g下, --不是很好用,也许这个是国内许多人并没有使用它来管理。
806 0
|
Oracle 网络协议 关系型数据库
[20140418]使用dgmgrl管理dataguard(7).txt
[20140418]使用dgmgrl管理dataguard(7).txt 参考链接: http://blog.itpub.net/267265/viewspace-1142649/ http://blog.
887 0
|
Oracle 关系型数据库 测试技术
[20140420]使用dgmgrl管理dataguard(9).txt
[20140420]使用dgmgrl管理dataguard(9).txt 参考链接: http://blog.itpub.net/267265/viewspace-1142649/ http://blog.
857 0
|
Oracle 网络协议 关系型数据库
[20140418]使用dgmgrl管理dataguard(6).txt
[20140418]使用dgmgrl管理dataguard(6).txt 参考链接: http://blog.itpub.net/267265/viewspace-1142649/ http://blog.
1215 0