Oracle通过rman进行克隆

一. 安装规划 IP   ROLE  
192.168.1.235   克隆对象  
192.168.1.221   克隆库  
二. 备库创建相应的dump文件夹

# 在主库查询对应的dump目录 select name, value from v$parameter where name in ('audit_file_dest', 'background_dump_dest', 'control_files', 'core_dump_dest', 'user_dump_dest', 'db_recovery_file_dest' ) ORDER BY name ASC; # 备库用Oracle用户执行创建目录 mkdir -p $value

. 创建实例密钥文件

主库生成密钥文件

orapwd FILE=/u01/app/oracle/dbs/orapwora235 password=li0924 entries=5;

将密钥文件传输到备库

scp /u01/app/oracle/dbs/orapwora235 oracle@192.168.1.221:/u01/app/oracle/dbs

. 创建参数文件

主库通过spfile生成pfile文件

create pfile from spfile;

复制参数文件到Standby库

scp /u01/app/oracle/dbs/initora235.ora oracle@192.168.1.221:/u01/app/oracle/dbs

将Standby端启动到nomount状态

[oracle@oracle221 ~]$ sqlplus / as sysdba SQL*Plus: Release 11.2.0.4.0 Production on Thu Aug 9 22:56:49 2018 Copyright (c) 1982, 2013, Oracle. All rights reserved. Connected to an idle instance. SQL> startup nomount pfile='/u01/app/oracle/dbs/initora235.ora'; ORACLE instance started. Total System Global Area 780824576 bytes Fixed Size 2257312 bytes Variable Size 511708768 bytes Database Buffers 264241152 bytes Redo Buffers 2617344 bytes

五. 配置主备库的监听文件和网络文件

  设置Primary库和Standby库的service_name

SQL> show parameter service_name; NAME TYPE VALUE ------------------------------------ ----------- --------------- service_names string lottu SQL> alter system set service_names='db_primary' scope=both; System altered. SQL> show parameter service_name; NAME TYPE VALUE ------------------------------------ ----------- ---------------- service_names string db_primary

  备库的service_name设置为db_standby;需要到参数文件修改。

*.service_names='db_standby'

Primary库配置listener.ora

内容版权声明:除非注明,否则皆为本站原创文章。

转载注明出处:https://www.heiqu.com/c0be451f3b76a8a3d6c1dccc0ca26127.html