分享更有价值
被信任是一种快乐

如何备份克隆数据库

文章页正文上

这篇文章主要介绍如何备份克隆数据库,文中介绍的非常详细,具有一定的参考价值,感兴趣的小伙伴们一定要看完!
—基于备份克隆

1、创建pfile
create pfile from spfile
添加
log_archive_dest
compatible=

2、创建密码文件及文件夹

orapwd file=D:appproduct11.2.0dbhome_1databasePWDGTJ.ora password=GTJ entries=4

3、listener.ora、tnsnames.ora创建本地命名一定要在目标数据库以及辅助数据库创建

4、注册新实例

oradim –new –sid GTJ –intpwd GTJ

5、创建spfile

create spfile from pfile=’D:appproduct11.2.0dbhome_1databaseinitgtj.ora’

STARTUP NOMOUNT FORCE PFILE=’D:appproduct11.2.0dbhome_1databaseinitgtj.ora’

alter system set compatible=’11.2.0.4.0′ scope=spfile;

DUPLICATE TARGET DATABASE
FOR STANDBY
FROM ACTIVE DATABASE
PASSWORD FILE
SPFILE
PARAMETER_VALUE_CONVERT ‘/disk1’, ‘/disk2’
SET DB_FILE_NAME_CONVERT ‘/disk1′,’/disk2’
SET LOG_FILE_NAME_CONVERT ‘/disk1′,’/disk2’
SET DB_UNIQUE_NAME ‘dup1’
SET SGA_MAX_SIZE 200M
SET SGA_TARGET 125M;

6、连接rman
目标数据库以及辅助数据库都要创建
rman AUXILIARY sys/gtj@gtjtest

7、克隆数据库
—————–运行成功————————————————————-
RUN{
SET NEWNAME FOR DATABASE TO ‘D:APPORADATAGTJ%b’;
DUPLICATE DATABASE TO ‘GTJ’ BACKUP LOCATION ‘D:appflash_recovery_areaorclORCLBACKUPSET2017_08_09’ NOFILENAM免费主机域名ECHECK;
}
rman nocatalog
connect target sys/oracle@zz
connect AUXILIARY sys/gtj@gtjtest
rman target sys/oracle@zz AUXILIARY sys/gtj@gtjtest
run{

SET NEWNAME FOR DATABASE TO ‘D:APPORADATAGTJ%b’;

duplicate target database to GTJ FROM ACTIVE DATABASE
logfile
group 1 (‘D:APPORADATAGTJREDO01.LOG’) size 10m,
group 2 (‘D:APPORADATAGTJREDO02.LOG’) size 10m,
group 3 (‘D:APPORADATAGTJREDO03.LOG’) size 10m;

}
————————参考———————————————————–
RUN{
DUPLICATE DATABASE ORCL TO ‘GTJ’ BACKUP LOCATION ‘D:appflash_recovery_areaorclORCLBACKUPSET2017_08_09’
SET DB_FILE_NAME_CONVERT (‘D:APPORADATAORCL’,’D:APPORADATAGTJ’)
SET LOG_FILE_NAME_CONVERT (‘D:APPORADATAORCL’,’D:APPORADATAGTJ’);
}

DUPLICATE DATABASE TO GTJ
UNTIL TIME “TO_DATE(’08/09/2017 19:00:00′, ‘MM/DD/YYYY HH24:MI:SS’)”
BACKUP LOCATION ‘D:appflash_recovery_areaorclORCLBACKUPSET2017_08_09’
NOFILENAMECHECK;

alter system set db_recovery_file_dest=’D:appflash_recovery_area’

RUN
{
ALLOCATE AUXILIARY CHANNEL newdb DEVICE TYPE sbt;
DUPLICATE TARGET DATABASE TO newdb
PFILE ?/dbs/initNEWDB.ora
UNTIL TIME ‘SYSDATE-1’ # specifies incomplete recovery
SKIP TABLESPACE example, history # skip desired tablespaces
DB_FILE_NAME_CONVERT (‘/h2/oracle/dbs/trgt/’,’/h3/oracle/oradata/newd免费主机域名b/’)
LOGFILE
GROUP 1 (‘/h3/oradata/newdb/redo01_1.f’,
‘/h3/oradata/newdb/redo01_2.f’) SIZE 4M,
GROUP 2 (‘/h3/oradata/newdb/redo02_1.f’,
‘/h3/oradata/newdb/redo02_2.f’) SIZE 4M,
GROUP 3 (‘/h3/oradata/newdb/redo03_1.f’,
‘/h3/oradata/newdb/redo03_2.f’) SIZE 4M REUSE;
}

RUN
{
SET NEWNAME FOR DATABASE TO ‘/oradata1/%b’;
DUPLICATE TARGET DATABASE TO dupdb
LOGFILE
GROUP 1 (‘/duplogs/redo01a.log’,
‘/duplogs/redo01b.log’) SIZE 4M REUSE,
GROUP 2 (‘/duplogs/redo02a.log’,
‘/duplogs/redo02b.log’) SIZE 4M REUSE;
}

DUPLICATE DATABASE TO GTJ
UNTIL TIME “TO_DATE(’08/09/2017 19:00:00′, ‘MM/DD/YYYY HH24:MI:SS’)”
BACKUP LOCATION ‘D:appflash_recovery_areaorclORCLBACKUPSET2017_08_09’
NOFILENAMECHECK;

DUPLICATE DATABASE ‘PROD’ dbid 8675309 to ‘TEST’
UNTIL TIME “to_date(’11/01/2007′, ‘MM/DD/YYYY’)”
BACKUP LOCATION ‘/backups’ NOFILENAMECHECK
PFILE=’?/dbs/inittest.ora’ db_file_name_convert=’prod’,’test’;
以上是“如何备份克隆数据库”这篇文章的所有内容,感谢各位的阅读!希望分享的内容对大家有帮助,更多相关知识,欢迎关注云技术行业资讯频道!

相关推荐: SQL中like的写法是怎样的

本篇内容主要讲解“SQL中like的写法是怎样的”,感兴趣的朋友不妨来看看。本文介绍的方法操作简单快捷,实用性强。下面就让小编来带大家学习“SQL中like的写法是怎样的”吧!某交易系统,监控告警有长SQL产生,脚本查询大于5分钟的长SQL。脚本内容如下:SQ…

文章页内容下
赞(0) 打赏
版权声明:本站采用知识共享、学习交流,不允许用于商业用途;文章由发布者自行承担一切责任,与本站无关。
文章页正文下
文章页评论上

云服务器、web空间可免费试用

宝塔面板主机、支持php,mysql等,SSL部署;安全高速企业专供99.999%稳定,另有高防主机、不限制内容等类型,具体可咨询QQ:360163164,Tel同微信:18905205712

主机选购导航云服务器试用

登录

找回密码

注册