大鲨鱼o0O

保持理智,冷静分析,懂得择决,默默前行

深厚的内功远远大于精妙的招式


oracle搭建DG

如果安装了GI的话,
那么listener监听是由grid用户接管的,所以配置listener监听只能在grid用户下的listener而不是oracle用户下的
对于tnsname配置则不变,依然是在oracle用户下的tnsname

主库主机上的 主库ip解析,备库ip解析

主库主机上的主机名

主库主机上oracle用户的环境变量

注意ORACLE_HOME路径是否一致 可以要通过. . . 查看

$ echo $ORACLE_HOME 

设置主库主机上的glogin.sql文件

设置主库的listener.ora

设置主库的tnsname.ora

修改主库的参数文件(新增的参数信息来自官方文档)

主库slow的listener状态,启动listener之后没有显示,可以重启库,再lsnrctl status试试

备库主机上的 备库p地址解析 主库ip地址解析

备库主机上的主机名

备库主机上的oracle用户的环境变量

设置备库主库上的glogin.sql文件

设置备库上的listener.ora

设置备库上的tnsname.ora

把主库刚刚修改过的参数文件和密码文件scp复制过来

修改刚从主库scp过来的参数文件为备库的参数文件

依照刚修改的参数文件中的路径,创建几个文件路径,并修改属主属组

###主库slow的listener状态,启动listener之后没有显示,可以重启库,再lsnrctl status试试

在主库的oracle用户下rman连接

执行duplicate开始复制

复制过程中的代示信息

以下是执行过程中的显示信息

[oracle@slow dbs]$ rman target sys/oracle@slow auxiliary sys/oracle@gotime

Recovery Manager: Release 11.2.0.4.0 - Production on Mon Dec 25 01:32:53 2017

Copyright (c) 1982, 2011, Oracle and/or its affiliates.  All rights reserved.

connected to target database: SLOW (DBID=1147482511)
connected to auxiliary database: SLOW (not mounted)

RMAN> duplicate target database for standby from active database;

Starting Duplicate Db at 25-DEC-17
using target database control file instead of recovery catalog
allocated channel: ORA_AUX_DISK_1
channel ORA_AUX_DISK_1: SID=20 device type=DISK

contents of Memory Script:
{
   backup as copy reuse
   targetfile  '/u01/app/oracle/product/11.2.0/dbhome_1/dbs/orapwslow' auxiliary format 
 '/u01/app/oracle/product/11.2.0/dbhome_1/dbs/orapwgotime'   ;
}
executing Memory Script

Starting backup at 25-DEC-17
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=36 device type=DISK
Finished backup at 25-DEC-17

contents of Memory Script:
{
   backup as copy current controlfile for standby auxiliary format  '/u01/app/oracle/oradata/gotime/control01.ctl';
}
executing Memory Script

Starting backup at 25-DEC-17
using channel ORA_DISK_1
channel ORA_DISK_1: starting datafile copy
copying standby control file
output file name=/u01/app/oracle/product/11.2.0/dbhome_1/dbs/snapcf_slow.f tag=TAG20171225T013758 RECID=1 STAMP=963625079
channel ORA_DISK_1: datafile copy complete, elapsed time: 00:00:01
Finished backup at 25-DEC-17

contents of Memory Script:
{
   sql clone 'alter database mount standby database';
}
executing Memory Script

sql statement: alter database mount standby database

contents of Memory Script:
{
   set newname for tempfile  1 to 
 "/u01/app/oracle/oradata/gotime/temp01.dbf";
   switch clone tempfile all;
   set newname for datafile  1 to 
 "/u01/app/oracle/oradata/gotime/system01.dbf";
   set newname for datafile  2 to 
 "/u01/app/oracle/oradata/gotime/sysaux01.dbf";
   set newname for datafile  3 to 
 "/u01/app/oracle/oradata/gotime/undotbs01.dbf";
   set newname for datafile  4 to 
 "/u01/app/oracle/oradata/gotime/users01.dbf";
   backup as copy reuse
   datafile  1 auxiliary format 
 "/u01/app/oracle/oradata/gotime/system01.dbf"   datafile 
 2 auxiliary format 
 "/u01/app/oracle/oradata/gotime/sysaux01.dbf"   datafile 
 3 auxiliary format 
 "/u01/app/oracle/oradata/gotime/undotbs01.dbf"   datafile 
 4 auxiliary format 
 "/u01/app/oracle/oradata/gotime/users01.dbf"   ;
   sql 'alter system archive log current';
}
executing Memory Script

executing command: SET NEWNAME

renamed tempfile 1 to /u01/app/oracle/oradata/gotime/temp01.dbf in control file

executing command: SET NEWNAME

executing command: SET NEWNAME

executing command: SET NEWNAME

executing command: SET NEWNAME

Starting backup at 25-DEC-17
using channel ORA_DISK_1
channel ORA_DISK_1: starting datafile copy
input datafile file number=00004 name=/u01/app/oracle/oradata/slow/users01.dbf
output file name=/u01/app/oracle/oradata/gotime/users01.dbf tag=TAG20171225T013805
channel ORA_DISK_1: datafile copy complete, elapsed time: 00:00:15
channel ORA_DISK_1: starting datafile copy
input datafile file number=00001 name=/u01/app/oracle/oradata/slow/system01.dbf
output file name=/u01/app/oracle/oradata/gotime/system01.dbf tag=TAG20171225T013805
channel ORA_DISK_1: datafile copy complete, elapsed time: 00:00:15
channel ORA_DISK_1: starting datafile copy
input datafile file number=00002 name=/u01/app/oracle/oradata/slow/sysaux01.dbf
output file name=/u01/app/oracle/oradata/gotime/sysaux01.dbf tag=TAG20171225T013805
channel ORA_DISK_1: datafile copy complete, elapsed time: 00:00:15
channel ORA_DISK_1: starting datafile copy
input datafile file number=00003 name=/u01/app/oracle/oradata/slow/undotbs01.dbf
output file name=/u01/app/oracle/oradata/gotime/undotbs01.dbf tag=TAG20171225T013805
channel ORA_DISK_1: datafile copy complete, elapsed time: 00:00:07
Finished backup at 25-DEC-17

sql statement: alter system archive log current

contents of Memory Script:
{
   switch clone datafile all;
}
executing Memory Script

datafile 1 switched to datafile copy
input datafile copy RECID=1 STAMP=964738592 file name=/u01/app/oracle/oradata/gotime/system01.dbf
datafile 2 switched to datafile copy
input datafile copy RECID=2 STAMP=964738592 file name=/u01/app/oracle/oradata/gotime/sysaux01.dbf
datafile 3 switched to datafile copy
input datafile copy RECID=3 STAMP=964738592 file name=/u01/app/oracle/oradata/gotime/undotbs01.dbf
datafile 4 switched to datafile copy
input datafile copy RECID=4 STAMP=964738592 file name=/u01/app/oracle/oradata/gotime/users01.dbf
Finished Duplicate Db at 25-DEC-17

RMAN> 

打赏一个呗

取消

感谢您的支持,我会继续努力的!

扫码支持
扫码支持
扫码打赏,你说多少就多少

打开支付宝扫一扫,即可进行扫码打赏哦

....