当前位置:  数据库>oracle

Oracle 10g Physical DataGuard 详细搭建过程

    来源: 互联网  发布时间:2017-06-01

    本文导语: primary 环境DB version:Oracle10.2.0.4IP:192.168.1.7hostname:vzwcdb_name:dbserverdb_unique_name:dbserverservice_name:dbserverinstance_name:ORCL standby 环境DB version:oracle10.2.0.4IP:192.168.1.6hostname:dgstbdb_name:dbserverdb_unique_name:standbyservice_name:standbyinstance_name:standby ********...

primary 环境
DB version:Oracle10.2.0.4
IP:192.168.1.7
hostname:vzwc
db_name:dbserver
db_unique_name:dbserver
service_name:dbserver
instance_name:ORCL

standby 环境
DB version:oracle10.2.0.4
IP:192.168.1.6
hostname:dgstb
db_name:dbserver
db_unique_name:standby
service_name:standby
instance_name:standby


*********************************************
配置primary


--开启force logging和归档,设置归档目录
SQL> startup mount
ORACLE instance started.


Total System Global Area  612368384 bytes
Fixed Size                  2085872 bytes
Variable Size            167775248 bytes
Database Buffers          436207616 bytes
Redo Buffers                6299648 bytes
Database mounted.
SQL> alter database force logging;


Database altered.


SQL> alter database archivelog;


Database altered.


SQL> alter database open;


Database altered.


SQL> alter system set log_archive_dest_1='location=/arch';


System altered.


--创建standby controlfile和pfile,并且连口令文件一起传到standby端
SQL> alter database create standby controlfile as '/u01/app/oracle/standby.ctl';


Database altered.


SQL> create pfile='/u01/app/oracle/init.ora' from spfile;


File created.


SQL> !scp /u01/app/oracle/*.ctl oracle@192.168.1.6:/u01/app/oracle
The authenticity of host '192.168.1.6 (192.168.1.6)' can't be established.
RSA key fingerprint is 9c:7e:6b:4f:ad:6a:bd:2e:b0:34:ef:5c:a5:ff:69:1f.
Are you sure you want to continue connecting (yes/no)? yes
Warning: Permanently added '192.168.1.6' (RSA) to the list of known hosts.
oracle@192.168.1.6's password:
standby.ctl                                                                                                                                                                                        100% 7152KB  7.0MB/s  00:00   


SQL> !scp /u01/app/oracle/*.ora oracle@192.168.1.6:/u01/app/oracle
oracle@192.168.1.6's password:
init.ora                                                                                                                                                                                          100% 1225    1.2KB/s  00:00   


SQL> !scp $ORACLE_HOME/dbs/orapwORCL oracle@192.168.1.6:/u01/app/oracle
oracle@192.168.1.6's password:
orapwORCL                                                                                                                                                                                          100% 2048    2.0KB/s  00:00   
                 


********************************************* 
配置standby


--rename pfile和口令文件
[oracle@dgstb ~]$ cd $ORACLE_HOME/dbs
[oracle@dgstb dbs]$ mv /u01/app/oracle/orapwORCL orapwstandby
[oracle@dgstb dbs]$ mv /u01/app/oracle/init.ora initstandby.ora


--配置standby环境变量
alias ls="ls -FA"
export ORACLE_BASE=/u01/app/oracle
export ORACLE_HOME=$ORACLE_BASE/product/10.2.0/db_1
export ORACLE_PATH=$ORACLE_BASE/common/oracle/sql:.:$ORACLE_HOME/rdbms/admin
export ORACLE_SID=standby
export PATH=.:${JAVA_HOME}/bin:${PATH}:$HOME/bin:$ORACLE_HOME/bin
export PATH=${PATH}:/usr/bin:/bin:/usr/bin/X11:/usr/local/bin
export PATH=${PATH}:$ORACLE_BASE/common/oracle/bin
export ORACLE_TERM=xterm
export TNS_ADMIN=$ORACLE_HOME/network/admin
export ORA_NLS10=$ORACLE_HOME/nls/data
export LD_LIBRARY_PATH=$ORACLE_HOME/lib
export LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:$ORACLE_HOME/oracm/lib
export LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:/lib:/usr/lib:/usr/local/lib
export CLASSPATH=$ORACLE_HOME/JRE
export CLASSPATH=${CLASSPATH}:$ORACLE_HOME/jlib
export CLASSPATH=${CLASSPATH}:$ORACLE_HOME/rdbms/jlib
export CLASSPATH=${CLASSPATH}:$ORACLE_HOME/network/jlib
export THREADS_FLAG=native
export TEMP=/tmp
export TMPDIR=/tmp
alias sqlplus="rlwrap sqlplus"
alias rman="rlwrap rman"
alias base="cd $ORACLE_BASE"
alias home="cd $ORACLE_HOME"


--创建相应目录,配置standby pfile,db_name不用改要和primary一致,添加备库必要参数
[oracle@dgstb oracle]$ pwd
/u01/app/oracle
[oracle@dgstb oracle]$ mkdir -p admin/standby/{a,b,c,u}dump
[oracle@dgstb oracle]$ mkdir -p oradata/standby
[oracle@dgstb oracle]$ ls admin/standby
adump/  bdump/  cdump/  udump/
[oracle@dgstb dbs]$ cat initstandby.ora
*.audit_file_dest='/u01/app/oracle/admin/standby/adump'
*.background_dump_dest='/u01/app/oracle/admin/standby/bdump'
*.compatible='10.2.0.3.0'
*.control_files='/u01/app/oracle/standby.ctl'
*.core_dump_dest='/u01/app/oracle/admin/standby/cdump'
*.db_block_size=8192
*.db_domain=''
*.db_file_multiblock_read_count=16
*.db_name='dbserver'
*.dispatchers='(PROTOCOL=TCP) (SERVICE=ORCLXDB)'
*.job_queue_processes=10
*.log_archive_format='ARC%S_%R.%T'
*.nls_language='SIMPLIFIED CHINESE'
*.nls_territory='CHINA'
*.open_cursors=300
*.pga_aggregate_target=203423744
*.processes=500
*.remote_login_passwordfile='EXCLUSIVE'
*.sessions=555
*.sga_target=612368384
*.undo_management='AUTO'
*.undo_tablespace='UNDOTBS1'
*.user_dump_dest='/u01/app/oracle/admin/standby/udump'
##以下是standby添加参数
*.db_unique_name='standby'
*.db_file_name_convert='/u01/app/oracle/oradata/dbserver','/u01/app/oracle/oradata/standby'
*.log_file_name_convert='/u01/app/oracle/oradata/dbserver','/u01/app/oracle/oradata/standby'
*.log_archive_config='dg_config=(dbserver,standby)'
*.log_archive_dest_1='location=/arch valid_for=(all_logfiles,all_roles) db_unique_name=standby'
*.log_archive_dest_2='service=dbserver lgwr async valid_for=(online_logfiles,primary_role) db_unique_name=dbserver'
*.log_archive_dest_state_1=enable
*.log_archive_dest_state_2=enable
*.log_archive_max_processes=10
*.fal_server=dbserver
*.fal_client=standby
*.standby_file_management=auto


--配置静态监听和服务名
[oracle@dgstb admin]$ cat listener.ora
# listener.ora Network Configuration File: /u01/app/oracle/product/10.2.0/db_1/network/admin/listener.ora
# Generated by Oracle configuration tools.


SID_LIST_LISTENER =
  (SID_LIST =
    (SID_DESC =
      (GLOBAL_DBNAME = standby)
      (ORACLE_HOME = /u01/app/oracle/product/10.2.0/db_1)
      (SID_NAME = standby)
    )
  )


LISTENER =
  (DESCRIPTION =
    (ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.1.6)(PORT = 1521))
  )


[oracle@dgstb admin]$ cat tnsnames.ora
# tnsnames.ora Network Configuration File: /u01/app/oracle/product/10.2.0/db_1/network/admin/tnsnames.ora
# Generated by Oracle configuration tools.


STANDBY =
  (DESCRIPTION =
    (ADDRESS_LIST =
      (ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.1.6)(PORT = 1521))
    )
    (CONNECT_DATA =
      (SERVICE_NAME = standby)
    )
  )


DBSERVER =
  (DESCRIPTION =
    (ADDRESS_LIST =
      (ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.1.7)(PORT = 1521))
    )
    (CONNECT_DATA =
      (SERVICE_NAME = dbserver)
    )
  )
 
 
--启动监听
[oracle@dgstb admin]$ lsnrctl start


LSNRCTL for Linux: Version 10.2.0.4.0 - Production on 13-FEB-2014 22:58:13


Copyright (c) 1991, 2007, Oracle.  All rights reserved.


Starting /u01/app/oracle/product/10.2.0/db_1/bin/tnslsnr: please wait...


TNSLSNR for Linux: Version 10.2.0.4.0 - Production
System parameter file is /u01/app/oracle/product/10.2.0/db_1/network/admin/listener.ora
Log messages written to /u01/app/oracle/product/10.2.0/db_1/network/log/listener.log
Listening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=192.168.1.6)(PORT=1521)))


Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=192.168.1.6)(PORT=1521)))
STATUS of the LISTENER
------------------------
Alias                    LISTENER
Version                  TNSLSNR for Linux: Version 10.2.0.4.0 - Production
Start Date                13-FEB-2014 22:58:13
Uptime                    0 days 0 hr. 0 min. 0 sec
Trace Level              off
Security                  ON: Local OS Authentication
SNMP                      OFF
Listener Parameter File  /u01/app/oracle/product/10.2.0/db_1/network/admin/listener.ora
Listener Log File        /u01/app/oracle/product/10.2.0/db_1/network/log/listener.log
Listening Endpoints Summary...
  (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=192.168.1.6)(PORT=1521)))
Services Summary...
Service "standby" has 1 instance(s).
  Instance "standby", status UNKNOWN, has 1 handler(s) for this service...
The command completed successfully
[oracle@dgstb admin]$ sqlplus system@dbserver


SQL*Plus: Release 10.2.0.4.0 - Production on Thu Feb 13 22:58:28 2014


Copyright (c) 1982, 2007, Oracle.  All Rights Reserved.


Enter password:


Connected to:
Oracle Database 10g Enterprise Edition Release 10.2.0.4.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options


SQL>


    
 
 
 
本站(WWW.)旨在分享和传播互联网科技相关的资讯和技术,将尽最大努力为读者提供更好的信息聚合和浏览方式。
本站(WWW.)站内文章除注明原创外,均为转载、整理或搜集自网络。欢迎任何形式的转载,转载请注明出处。












  • 相关文章推荐
  • Oracle 12c发布简单介绍及官方下载地址
  • 在linux下安装oracle,如何设置让oracle自动启动!也就是让oracle那个服务自动启动,不是手动的
  • oracle 11g最新版官方下载地址
  • 请问su oracle 和su - oracle有什么不同?
  • Oracle 数据库(oracle Database)Select 多表关联查询方式
  • 虚拟机装Oracle R12与Oracle10g
  • Oracle数据库(Oracle Database)体系结构及基本组成介绍
  • Oracle 数据库开发工具 Oracle SQL Developer
  • 如何设置让Oracle SQL Developer显示的时间包含时分秒
  • Oracle EBS R12 支持 Oracle Database 11g
  • Oracle 10g和Oracle 11g网格技术介绍
  • SCO unix下安装oracle,但没有光盘,请大家推荐一个oracle下载站点(unix版本的)。谢谢!!!!
  • oracle中如何把表中具有相同值列的多行数据合并成一行
  • 请问大家用oracle数据库, 用import oracle.*;下的东西么? 还是用标准库?
  • Oracle 数据库(oracle Database)性能调优技术详解
  • Linux /$ORACLE_HOME $ORACLE_HOME
  • ORACLE日期相关操作
  • Linux系统下Oracle的启动与Oracle监听的启动
  • ORACLE数据库常用字段数据类型介绍
  • 请问在solaris下安装ORACLE,用root用户和用oracle用户安装有什么区别么?
  • Oracle 12c的九大最新技术特性介绍
  • 网间Oracle的连接,远程连接Oracle服务器??


  • 站内导航:


    特别声明:169IT网站部分信息来自互联网,如果侵犯您的权利,请及时告知,本站将立即删除!

    ©2012-2021,