当前位置:   article > 正文

Oracle Dataguard部署

oracle dataguard部署

这是我搭建的一个生产项目
部署环境

Data Guard 环境:
操作系统: redhat 6.5

Primary数据库:
IP地址:172.16.212.135
数据库SID:orcl
DB_UNIQUE_NAME:orcl_pd

Standby数据库:
IP地址:172.16.212.136
数据库SID:orcl
DB_UNIQUE_NAME:orcl_st
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12

一、Primary 端的配置

1.主库设置为force logging模式
SQL> alter database force logging;


2.主库设为归档模式
mkdir -p /usr/local/archivelog
chown oracle.oinstall /usr/local/archivelog
SQL> archive log list
SQL> alter system set log_archive_format='orcl_%t_%s_%r.log' scope=spfile;
SQL> alter system set log_archive_dest_1='location=/usr/local/archivelog'  scope=spfile;
SQL> shutdown immediate;
SQL> startup mount;
SQL> alter database archivelog;
SQL> alter database open;
SQL> archive log list;


3.添加redo log file
添加一个新的Standby Redologs组(注意组号不要与当前存在的Online Redologs组重复),并为该组指定一个成员:
SQL> alter database add standby logfile group 4 ('/usr/local/oracle/oradata/orcl/redo04.log') size 50m; 
SQL> alter database add standby logfile group 5 ('/usr/local/oracle/oradata/orcl/redo05.log') size 50m; 
SQL> alter database add standby logfile group 6 ('/usr/local/oracle/oradata/orcl/redo06.log') size 50m; 
SQL> alter database add standby logfile group 7 ('/usr/local/oracle/oradata/orcl/redo07.log') size 50m;
SQL> select * from v$logfile order by 1;


4.修改listener.ora 和tnsnames.ora 文件
Listener.ora 文件:
--
SID_LIST_LISTENER =
  (SID_LIST =
    (SID_DESC =
      (SID_NAME = PLSExtProc)
      (ORACLE_HOME = /usr/local/oracle/product/11.2.0/db_1)
      (PROGRAM = extproc)
    )
   (SID_DESC =
     (GLOBAL_DBNAME = orcl)
     (ORACLE_HOME = /usr/local/oracle/product/11.2.0/db_1)
     (SID_NAME = orcl)
    )
  )

LISTENER =
  (DESCRIPTION_LIST =
    (DESCRIPTION =
      (ADDRESS = (PROTOCOL = TCP)(HOST = bbdb1)(PORT = 1521))
      (ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1521))
    )
  )

Tnsnames.ora 文件
--
ORCL_PD =
  (DESCRIPTION =
    (ADDRESS_LIST =
      (ADDRESS = (PROTOCOL = TCP)(HOST = 172.16.212.135)(PORT = 1521))
    )
    (CONNECT_DATA =
      (SERVICE_NAME = orcl)
    )
  )

ORCL_ST =
  (DESCRIPTION =
    (ADDRESS_LIST =
      (ADDRESS = (PROTOCOL = TCP)(HOST = 172.16.212.136)(PORT = 1521))
    )
    (CONNECT_DATA =
      (SERVICE_NAME = orcl)
    )
  )


5.创建备库的密码文件和控制文件
standby控制文件:
SQL> alter database create standby controlfile as '/tmp/control01.ctl';

密码文件:
[oracle@localhost dbs]$ orapwd file=/usr/local/oracle/product/11.2.0/db_1/dbs/orapworcl password=admin
如果已经存在,就不用创建了。缺省情况下,win下口令文件的格式是pwdsid.ora,unix下的格式是orapwSID(大小写敏感)


6.修改初始化参数文件
SQL> create pfile='/tmp/orcl.pfile' from spfile;

在orcl.pfile添加如下内容:
####主库参数调整如下######
orcl.__db_cache_size=2902458368
orcl.__java_pool_size=16777216
orcl.__large_pool_size=16777216
orcl.__oracle_base='/usr/local/oracle'#ORACLE_BASE set from environment
orcl.__pga_aggregate_target=22682796032
orcl.__sga_target=4294967296
orcl.__shared_io_pool_size=0
orcl.__shared_pool_size=1308622848
orcl.__streams_pool_size=16777216
*.audit_file_dest='/usr/local/oracle/admin/orcl/adump'
*.audit_trail='db'
*.compatible='11.2.0.0.0'
*.control_files='/usr/local/oracle/oradata/orcl/control01.ctl','/usr/local/oracle/fast_recovery_area/orcl/control02.ctl'
*.cursor_sharing='SIMILAR'
*.db_block_size=8192
*.db_domain=''
*.db_name='orcl'
*.db_recovery_file_dest='/usr/local/oracle/fast_recovery_area'
*.db_recovery_file_dest_size=4322230272
*.diagnostic_dest='/usr/local/oracle'
*.dispatchers='(PROTOCOL=TCP) (SERVICE=orclXDB)'
*.log_buffer=5242880
*.O7_DICTIONARY_ACCESSIBILITY=TRUE
*.open_cursors=2000
*.optimizer_index_caching=8
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15
  • 16
  • 17
  • 18
  • 19
  • 20
  • 21
  • 22
  • 23
  • 24
  • 25
  • 26
  • 27
  • 28
  • 29
  • 30
  • 31
  • 32
  • 33
  • 34
  • 35
  • 36
  • 37
  • 38
  • 39
  • 40
  • 41
  • 42
  • 43
  • 44
  • 45
  • 46
  • 47
  • 48
  • 49
  • 50
  • 51
  • 52
  • 53
  • 54
  • 55
  • 56
  • 57
  • 58
  • 59
  • 60
  • 61
  • 62
  • 63
  • 64
  • 65
  • 66
  • 67
  • 68
  • 69
  • 70
  • 71
  • 72
  • 73
  • 74
  • 75
  • 76
  • 77
  • 78
  • 79
  • 80
  • 81
  • 82
  • 83
  • 84
  • 85
  • 86
  • 87
  • 88
  • 89
  • 90
  • 91
  • 92
  • 93
  • 94
  • 95
  • 96
  • 97
  • 98
  • 99
  • 100
  • 101
  • 102
  • 103
  • 104
  • 105
  • 106
  • 107
  • 108
  • 109
  • 110
  • 111
  • 112
  • 113
本文内容由网友自发贡献,转载请注明出处:【wpsshop博客】
推荐阅读
相关标签
  

闽ICP备14008679号