RAC to 单机dg 部署

举报
snowofsummer 发表于 2021/08/18 17:16:06 2021/08/18
【摘要】 1,编写pfile*.audit_file_dest='/oracle/app/oracle/admin/nc6xdg/adump'*.audit_trail='NONE'*.cluster_database=FALSE*.compatible='11.2.0.4.0'*.control_files='/oradata/nc6x/control01.ctl','/oradata/nc6x/c...

1,编写pfile

*.audit_file_dest='/oracle/app/oracle/admin/nc6xdg/adump'
*.audit_trail='NONE'
*.cluster_database=FALSE
*.compatible='11.2.0.4.0'
*.control_files='/oradata/nc6x/control01.ctl','/oradata/nc6x/control02.ctl'#Restore Controlfile
*.db_block_size=8192
*.db_create_file_dest='/oradata/nc6x'
*.db_create_online_log_dest_1='/oradata/nc6x'
*.db_domain=''
*.db_file_name_convert='+DATA/nc6x/','/oradata/nc6x/'
*.db_name='nc6x'
*.db_unique_name='nc6xdg01'
*.deferred_segment_creation=FALSE
*.diagnostic_dest='/oracle/app/oracle'
*.dispatchers='(PROTOCOL=TCP) (SERVICE=nc6xdgXDB)'
*.event='28401 TRACE NAME CONTEXT FOREVER, LEVEL 1','60025 trace name context forever','10943 trace name context level 2097152','10949 trace name context forever,level 1'
*.fal_client='nc6xdg01'
*.fal_server='nc6x1','nc6x2'
*.log_archive_config='DG_CONFIG=(nc6x,nc6xdg,nc6xdg01)'
*.log_archive_dest_1='LOCATION=/oradata/nc6x_arch VALID_FOR=(ALL_LOGFILES,ALL_ROLES) DB_UNIQUE_NAME=nc6xdg01'
*.log_archive_format='%t_%s_%r.dbf'
*.log_archive_max_processes=6
*.log_buffer=268435456
*.log_file_name_convert='+ARCH/nc6x/','/oradata/nc6x/','+DATA/nc6x/','/oradata/nc6x/'
*.open_cursors=2000
*.open_links=10
*.open_links_per_instance=10
*.parallel_max_servers=64
*.pga_aggregate_target=32212254720
*.processes=1000
*.remote_login_passwordfile='exclusive'
*.resource_limit=TRUE
*.resource_manager_plan='force:'
*.result_cache_max_size=0
*.sec_case_sensitive_logon=FALSE
*.sessions=1105
*.sga_max_size=6442450944
*.sga_target=6442450944
*.standby_file_management='AUTO'
*.undo_retention=8100
nc6x1.undo_tablespace='UNDOTBS1'
nc6x2.undo_tablespace='UNDOTBS2'
*.use_indirect_data_buffers=FALSE

2,密码文件和相关目录

orapwd file=$ORACLE_HOME/dbs/orapwnc6xdg01 password=oracle entries=30;

mkdir -p /oracle/app/oracle/admin/nc6xdg/adump

mkdir -p /oracle/app/oracle/diag

mkdir -p /oradata/nc6x/datafile

mkdir -p /oradata/nc6x/onlinelog

mkdir -p /oradata/nc6x/tempfile

3启动备数据库监听(备数据库执行

#备机配置静态监听。否则rman duplicate可能会报错。
listener.ora
LISTENER =
  (DESCRIPTION_LIST =
    (DESCRIPTION =
      (ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.1.207)(PORT = 1521))
    )
  )
SID_LIST_LISTENER =
  (SID_LIST =
    (SID_DESC =
      (GLOBAL_DBNAME = nc6xdg01)
      (ORACLE_HOME = /u01/app/db)
      (SID_NAME = nc6xdg01)
    )
  )
#启动备机监听
lsnrctl start

4,启动数据库到nomount状态(备数据库执行

su - oracle
export ORACLE_SID=nc6xdg01
sqlplus / as sysdba
startup nomount;
Create spfile from pfile;

5,配置主备数据库tnsnames.ora(主备)

#rac01节点
NC6X1 =
  (DESCRIPTION =
    (ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.1.212)(PORT = 1521))
    (CONNECT_DATA =
      (SERVER = DEDICATED)
      (SERVICE_NAME = nc6x)
      (INSTANCE_NAME = nc6x1)
    )
  )
#rac02节点
NC6X2 =
  (DESCRIPTION =
    (ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.1.213)(PORT = 1521))
    (CONNECT_DATA =
      (SERVER = DEDICATED)
      (SERVICE_NAME = nc6x)
      (INSTANCE_NAME = nc6x2)
    )
  )
#dg备机节点
NC6XDG01 =
  (DESCRIPTION =
    (ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.1.207)(PORT = 1521))
    (CONNECT_DATA =
      (SERVER = DEDICATED)
        (UR=A)
      (SERVICE_NAME = nc6xdg01)
    )
  )

6,执行数据库克隆操作(备数据库执行

#nx6x1主数据库,nx6xdg01备机
rman target sys/oracle@NC6X1 auxiliary sys/oracle@nc6xdg01
duplicate target database for standby from active database;

7,启动备数据库恢复模式(备数据库执行)

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

8主数据库开启日志传输到备库(主数据库执行)

#LOG_ARCHIVE_CONFIG,specifies the unique database names (DB_UNIQUE_NAME) for each database in the Data Guard configuration.

alter system set log_archive_config='dg_config=(nc6x,nc6xdg,nc6xdg01)';
alter system set log_archive_dest_2='service=nc6xdg01 valid_for=(online_logfiles,primary_role) db_unique_name=nc6xdg01';

9检查数据库同步状态

 SELECT SEQUENCE#, REGISTRAR, FIRST_TIME, NEXT_TIME, APPLIED

     FROM V$ARCHIVED_LOG ORDER BY SEQUENCE#;

【版权声明】本文为华为云社区用户原创内容,转载时必须标注文章的来源(华为云社区)、文章链接、文章作者等基本信息, 否则作者和本社区有权追究责任。如果您发现本社区中有涉嫌抄袭的内容,欢迎发送邮件进行举报,并提供相关证据,一经查实,本社区将立刻删除涉嫌侵权内容,举报邮箱: cloudbbs@huaweicloud.com
  • 点赞
  • 收藏
  • 关注作者

评论(0

0/1000
抱歉,系统识别当前为高风险访问,暂不支持该操作

全部回复

上滑加载中

设置昵称

在此一键设置昵称,即可参与社区互动!

*长度不超过10个汉字或20个英文字符,设置后3个月内不可修改。

*长度不超过10个汉字或20个英文字符,设置后3个月内不可修改。