Your Ad Here
首页 | 编程语言 | 网站建设 | 游戏天堂 | 冲浪宝典 | 网络安全 | 操作系统 | 软件时空 | 硬件指南 | 病毒相关 | IT 认证
软讯网络 > 冲浪宝典 > 网络资源 > 使用Data Guard Migrating to RAC
【标  题】:使用Data Guard Migrating to RAC
【关键字】:Data,Guard,Migrating,to,RAC
【来  源】:http://www.cublog.cn/u/21174/showart.php?id=170648

使用Data Guard Migrating to RAC

Your Ad Here
Configure the Primary Database for Data Guard
1.. Enable archiving.
If the primary database is not currently in archivelog mode perform the following steps to enable archiving:
        SQL> shutdown immediate;
        SQL> startup mount;
        SQL> alter database archivelog;
        SQL> alter database open;
2. Create a password file on the primary database.
   To support 10g log transport authentication it is mandatory that every database in a Data Guard configuration
    utilize a password file. In addition, the sys password must be the same within in the password file for each
    database.If the primary database does not currently have a password file use the following steps to create one:
        $cd $ORACLE_HOME/dbs
        $orapwd file=orapwOrlando password=oracle entries=5 force=y
   After creating the password file you must take the database to the mount state and set the following parameter:
         SQL> alter system set remote_login_passwordfile=exclusive scope=spfile;
3. Enable force logging.
   It is a best practice to place the primary database in force logging mode so that all operation are captured in
   the redo stream. To place the primary database in force logging mode issue the following SQL:
      
        SQL> alter database force logging;
4. Configure the Primary Database Initialization Parameters.
       #### Primary Role Parameters ####
         db_unique_name=MTS10_hasunclu1
        service_names=MTS10
        db_file_recovery_dest=’/u03/oracle/10/flash_recovery_area’
        log_archive_config='dg_config=(MTS10_hasunclu1,MTS10_stella)'
        log_archive_dest_2='service=stella1/MTS101
        valid_for=(online_logfiles,primary_role)
        db_unique_name=MTS10_stella'
        log_archive_dest_state_2=defer
        #### Standby Role Parameters ####
        db_file_name_convert=('+DATA/mts10/datafile/','/u03/oracle/10/oradata/MTS10/')
        log_file_name_convert=('+DATA/mts10/onlinelog/','/u03/oracle/10/oradata/MTS10/')
        standby_file_management=AUTO
        fal_server=’stella1/MTS101’,’stella2/MTS102’
        fal_client=’hasunclu1/MTS10
       
Prepare for RAC conversion:
 
  1. Add additional threads of redo and standby redo logs.
      Each instance in a RAC database must have it’s own thread of redo. Prior to creating the RAC standby and prior
      to switchover we must create the additional threads of redo.
        SQL> alter database
           2 add logfile thread 2
           3 group 4 ('/u03/oracle/10/oradata/MTS10/redo2_01.log’) size 10M,
           4 group 5 ('/u03/oracle/10/oradata/MTS10/redo2_02.log’) size 10M,
           5 group 6 ('/u03/oracle/10/oradata/MTS10/redo2_03.log') size 10M;
 
        SQL> alter database enable public thread 2;
  2. Add an undo tablespace for each instance.
       Each instance in a RAC database must have it’s own undo tablespace. Using the following syntax to create a undo
       tablespace for each instance that you will have:
        SQL> create undo tablespace "undotbs2" datafile
           2 '/u03/oracle/10/oradata/MTS10/undotsb2.dbf' size 200m;
  3. Run catclust.sql
      To create RAC specific views in preparation for switchover run the catclust.sql script located in
      $ORACLE_HOME/rdbms/admin on the primary database:
        SQL>@?/rdbms/admin/catclust.sql
 
 Create the Standby
 
1 Create standby initialization parameter files for each instance of the standby RAC database.
     On the primary database create a text initialization parameter file from the spfile:
       SQL> create pfile from spfile;
    Edit the text initialization parameter file to include instance specific parameters as such:
        #### Primary Role Parameters ####
 
        *.control_files=’+DATA/mts10_stella/controlfile/control01.ctl’
        *.db_create_file_dest='+DATA’
        *.db_recovery_file_dest='+DATA'
        *.cluster_database=true
        MTS101.instance_name=MTS101
        MTS102.instance_name=MTS102
        MTS101.instance_number=1
        MTS102.instance_number=2
        MTS101.thread=1
        MTS102.thread=2
        MTS101.undo_tablespace=UNDOTBS1
        MTS102.undo_tablespace=UNDOTBS2
        *.db_unique_name=MTS10_stella
        *.service_names=MTS101, MTS10
        *.db_recovery_file_dest=’+DATA’
        *.log_archive_config='dg_config=(MTS10_hasunclu1,MTS10_stella)’
        *.log_archive_dest_2='service=hasunclu1/MTS10 valid_for=(online_logfiles,primary_role)
          #### Standby Role Parameters ####
 
        *.db_file_name_convert=(‘/u03/oracle/10/oradata/mts10/’,'+data/mts10/datafile/')
        *.log_file_name_convert=('/u03/oracle/10/oradata/mts10/','+data/mts10/onlinelog/')
        *.standby_file_management=auto
        *.fal_server=’hasunclu1/MTS10’
        MTS101.fal_client=’stella1/MTS101’
        MTS102.fal_server=’hasunclu1/MTS10’
        MTS102.fal_client=’stella1/MTS102’
 
   Transfer the modified init.ora to the ORACLE_HOME/dbs directory on each node. Rename the init.ora’s to the match the
   ORACLE_SID.
  2. On each standby host, create a password file.
        $ orapwd file=orapwMTS101 password=oracle
        $ orapwd file=orapwMTS102 password=oracle
 
3. After setting up the appropriate environment variables, start the standby database instance without mounting the
control file.
        SQL> startup nomount pfile=?/dbs/initMTS10.ora
 
4. Perform an RMAN backup of the primary database placing the backup pieces in a location that is accessible from both
the primary host as well as the standby hosts.
        RMAN> backup device type disk format '/u01/home/mtsmith/%U' database plus archivelog;
        RMAN> backup device type disk format '/u01/home/mtsmith/%U'current controlfile for standby;
 5. Duplicate the primary database as a standby into the ASM diskgroup. From the standby host on which the standby instance
  is in nomounted:
 
        $ rman target sys/oracle@hasunclu1/MTS10 auxiliary /
         RMAN> duplicate target database for standby;
 6. Define the new physical RAC standby using srvctl.
     As the Oracle user on the standby host:
 
        srvctl add database -d MTS10_stella -o /u03/app/oracle/product/10.1.0/db -r PHYSICAL_STANDBY
        srvctl add instance -d MTS10_stella -i MTS101 -n stella1
        srvctl add instance -d MTS10_stella -i MTS102 -n stella2
        srvctl add service -d MTS10_stella -s MTS10 -r MTS101,MTS102
 As root on the standby host:
 
        srvctl add nodeapps -n stella1 -o /u03/app/oracle/product/10.1.0/db -A 138.1.138.8/255.255.252.0
 7. On the primary database enable the previously deferred remote destination.
        SQL> alter system set log_archive_dest_state_2=enable scope=both;
 8. Place the standby in managed recovery.
        SQL> recover managed standby database disconnect;
 9. Validate that the standby is correctly applying redo from the primary.
    On the standby database, query the V$ARCHIVED_LOG view to identify existing archived redo logs. For example:
   
 Perform the Switchover
 
1. On the standby RAC cluster shutdown all instance but one. In the one remaining standby instance start managed recovery:
        SQL> recover managed standby database disconnect;
 
2. On the primary database issue the commit switchover to standby command.
        SQL> alter database commit to switchover to standby;
 
Note: If the status returns SESSIONS_ACTIVE then you should issue the switchover command using the WITH SESSION SHUTDOWN
clause.
 
3. Shutdown and restart the former primary as a standby
        SQL> shutdown immediate
        SQL> startup mount
 
4. Verify that the physical standby can be converted to the new primary:
      
        SQL> select switchover_status from v$database;
 
Note: If the status returns SESSIONS_ACTIVE then you should issue the switchover command using the WITH SESSION SHUTDOWN
clause.
5. Convert the physical standby to the new primary:
        SQL> alter database commit to switchover to primary;
6. Shutdown and startup the new primary.
        SQL> shutdown immediate
        SQL> startup
7. Startup the remaining RAC instances on the new primary.
8. Using srvctl change the database role from PHYSICAL_STANDBY to PRIMARY.
 
        srvctl modify database -d MTS10_stella -r PRIMARY
       
Bookmarks

 
        SQL> select sequence#, first_time, next_time
          2  from v$archived_log order by sequence#;
 
On the primary database, archive the current log using the following SQL statement:
 
        SQL> alter system archive log current;
 
On the standby database, query the V$ARCHIVED_LOG view to verify the redY.ass=MsoNormal>
        SQL> select tablespace_name         2>  where contents = 'TEMPORARY';
 
For each tablespace identified above, add a new temporary file to the standby database.
 
        SQL> alter tablespace temp add tempfile size 40m;
 
 
 
 
 
 
 
       
 

 
ORACLE数据库SGA和PGA调的太大造成DB无法启动:【上一篇】
RAC10g PRKR-1001,PRKR-1007错误解决:【下一篇】
【相关文章】
  • ORACLE数据库SGA和PGA调的太大造成DB无法启动
  • 面向 Java 开发人员的 Ajax使用 Google Web Toolkit 开发 Ajax zz
  • inutoc命令
  • top安装方法
  • Linux _Oracle_HOWTO
  • Globus Toolkit 4.0.1 安装指南
  • (06-09-13)我的kernle+busybox+toolchain系统
  • Oracle 常用函数
  • 在jsp中使用FCKeditor的一个错误
  • JS控件autocomplete(自动完成)演示及下载
  • 【随机文章】
  • 新Orcas语言特性:Lambda表达式
  • Openbsd Upgrade Guide: 4.0 to 4.1
  • 嵌入式系统下Microwindows的实现
  • proftp+mysql+php实现
  • JavaScript实例 图片下拉选择器的制作
  • [原创]Linux环境汇编语言编程初步——使用gdb调试程序
  • 什么才是提高ASP性能的最佳选择(续)
  • MySQL创始人的一封公开信
  • 用PS制作小巧精致的像素按钮
  • 常用的60个linux命令
  • 【相关评论】
    没有相关评论
    【发表评论】
    姓名:
    邮件:
    随机码*
    评论*
          
    |  首 页  |  版权声明  |  联系我们   |  网站地图  |
    CopyRight © 2004-2007 bbb软讯网络 All Rigths Reserved.