热门标签 | HotTags
当前位置:  开发笔记 > 数据库 > 正文

DuplicatingaDatabase

使用duplicate命令,可以创建一个完全独立的数据库拷贝,该命令执行过程中会自动为duplicated数据库分配一个新的dbid。其具体过程我们以同一台机器内部复制和两

使用duplicate命令,可以创建一个完全独立的数据库拷贝,该命令执行过程中会自动为duplicated数据库分配一个新的dbid。其具体过程我们以同一台机器内部复制和两



Starting Duplicate Db at 25-AUG-13

using target database control file instead of recovery catalog

allocated channel: ORA_AUX_DISK_1

channel ORA_AUX_DISK_1: SID=63 device type=DISK


contents of Memory Script:

{

sql clone "alter system set db_name =

''CRM'' comment=

''Modified by RMAN duplicate'' scope=spfile";

sql clone "alter system set db_unique_name =

''CRM'' comment=

''Modified by RMAN duplicate'' scope=spfile";

shutdown clone immediate;

startup clone force nomount

restore clone primary controlfile;

alter clone database mount;

}

executing Memory Script


sql statement: alter system set db_name = ''CRM'' comment= ''Modified by RMAN duplicate'' scope=spfile


sql statement: alter system set db_unique_name = ''CRM'' comment= ''Modified by RMAN duplicate'' scope=spfile

Oracle instance shut down


Oracle instance started


Total System Global Area 1252663296 bytes


Fixed Size 2226072 bytes

Variable Size 973080680 bytes

Database Buffers 268435456 bytes

Redo Buffers 8921088 bytes


Starting restore at 25-AUG-13

allocated channel: ORA_AUX_DISK_1

channel ORA_AUX_DISK_1: SID=63 device type=DISK


channel ORA_AUX_DISK_1: starting datafile backup set restore

channel ORA_AUX_DISK_1: restoring control file

channel ORA_AUX_DISK_1: reading from backup piece /backup/c-3599153036-20130824-01

channel ORA_AUX_DISK_1: piece handle=/backup/c-3599153036-20130824-01 tag=TAG20130824T233319

channel ORA_AUX_DISK_1: restored backup piece 1

channel ORA_AUX_DISK_1: restore complete, elapsed time: 00:00:03

output file name=/oracle/CRM2/control01.ctl

output file name=/oracle/CRM2/control02.ctl

Finished restore at 25-AUG-13


database mounted


contents of Memory Script:

{

set until scn 2892348;

set newname for datafile 1 to

"/oracle/CRM2/system01.dbf";

set newname for datafile 2 to

"/oracle/CRM2/sysaux01.dbf";

set newname for datafile 3 to

"/oracle/CRM2/zx.dbf";

set newname for datafile 4 to

"/oracle/CRM2/users01.dbf";

set newname for datafile 5 to

"/oracle/CRM2/pos.dbf";

set newname for datafile 6 to

"/oracle/CRM2/erp.dbf";

set newname for datafile 7 to

"/oracle/CRM2/user01.dbf";

set newname for datafile 8 to

"/oracle/CRM2/undotbs03.dbf";

restore

clone database

;

}

executing Memory Script


executing command: SET until clause


executing command: SET NEWNAME


executing command: SET NEWNAME


executing command: SET NEWNAME


executing command: SET NEWNAME


executing command: SET NEWNAME


executing command: SET NEWNAME


executing command: SET NEWNAME


executing command: SET NEWNAME


Starting restore at 25-AUG-13

using channel ORA_AUX_DISK_1


channel ORA_AUX_DISK_1: starting datafile backup set restore

channel ORA_AUX_DISK_1: specifying datafile(s) to restore from backup set

channel ORA_AUX_DISK_1: restoring datafile 00001 to /oracle/CRM2/system01.dbf

channel ORA_AUX_DISK_1: restoring datafile 00002 to /oracle/CRM2/sysaux01.dbf

channel ORA_AUX_DISK_1: restoring datafile 00003 to /oracle/CRM2/zx.dbf

channel ORA_AUX_DISK_1: restoring datafile 00004 to /oracle/CRM2/users01.dbf

channel ORA_AUX_DISK_1: restoring datafile 00005 to /oracle/CRM2/pos.dbf

channel ORA_AUX_DISK_1: restoring datafile 00006 to /oracle/CRM2/erp.dbf

channel ORA_AUX_DISK_1: restoring datafile 00007 to /oracle/CRM2/user01.dbf

channel ORA_AUX_DISK_1: restoring datafile 00008 to /oracle/CRM2/undotbs03.dbf

channel ORA_AUX_DISK_1: reading from backup piece /backup/0moi4s34_1_1

channel ORA_AUX_DISK_1: piece handle=/backup/0moi4s34_1_1 tag=TAG20130824T232939

channel ORA_AUX_DISK_1: restored backup piece 1

channel ORA_AUX_DISK_1: restore complete, elapsed time: 00:02:15

Finished restore at 25-AUG-13


contents of Memory Script:

{

switch clone datafile all;

}

executing Memory Script


datafile 1 switched to datafile copy

input datafile copy RECID=1 STAMP=824344808 file name=/oracle/CRM2/system01.dbf

datafile 2 switched to datafile copy

input datafile copy RECID=2 STAMP=824344809 file name=/oracle/CRM2/sysaux01.dbf

datafile 3 switched to datafile copy

input datafile copy RECID=3 STAMP=824344809 file name=/oracle/CRM2/zx.dbf

datafile 4 switched to datafile copy

input datafile copy RECID=4 STAMP=824344809 file name=/oracle/CRM2/users01.dbf

datafile 5 switched to datafile copy

input datafile copy RECID=5 STAMP=824344809 file name=/oracle/CRM2/pos.dbf

datafile 6 switched to datafile copy

input datafile copy RECID=6 STAMP=824344809 file name=/oracle/CRM2/erp.dbf

datafile 7 switched to datafile copy

input datafile copy RECID=7 STAMP=824344809 file name=/oracle/CRM2/user01.dbf

datafile 8 switched to datafile copy

input datafile copy RECID=8 STAMP=824344809 file name=/oracle/CRM2/undotbs03.dbf


contents of Memory Script:

{

set until scn 2892348;

recover

clone database

delete archivelog

;

}

executing Memory Script


executing command: SET until clause


Starting recover at 25-AUG-13

using channel ORA_AUX_DISK_1


starting media recovery


channel ORA_AUX_DISK_1: starting archived log restore to default destination

channel ORA_AUX_DISK_1: restoring archived log

archived log thread=1 sequence=15

channel ORA_AUX_DISK_1: reading from backup piece /backup/0noi4s9t_1_1

channel ORA_AUX_DISK_1: piece handle=/backup/0noi4s9t_1_1 tag=TAG20130824T233316

channel ORA_AUX_DISK_1: restored backup piece 1

channel ORA_AUX_DISK_1: restore complete, elapsed time: 00:00:01

archived log file name=/oracle/archive/1_15_823810820.dbf thread=1 sequence=15

channel clone_default: deleting archived log(s)

archived log file name=/oracle/archive/1_15_823810820.dbf RECID=57 STAMP=824344817

media recovery complete, elapsed time: 00:00:02

Finished recover at 25-AUG-13

Oracle instance started


Total System Global Area 1252663296 bytes


Fixed Size 2226072 bytes

Variable Size 973080680 bytes

Database Buffers 268435456 bytes

Redo Buffers 8921088 bytes


contents of Memory Script:

{

sql clone "alter system set db_name =

''CRM'' comment=

''Reset to original value by RMAN'' scope=spfile";

sql clone "alter system reset db_unique_name scope=spfile";

shutdown clone immediate;

startup clone nomount;

}

executing Memory Script


sql statement: alter system set db_name = ''CRM'' comment= ''Reset to original value by RMAN'' scope=spfile


sql statement: alter system reset db_unique_name scope=spfile


Oracle instance shut down


connected to auxiliary database (not started)

Oracle instance started


Total System Global Area 1252663296 bytes


Fixed Size 2226072 bytes

Variable Size 973080680 bytes

Database Buffers 268435456 bytes

Redo Buffers 8921088 bytes

sql statement: CREATE CONTROLFILE REUSE SET DATABASE "CRM" RESETLOGS ARCHIVELOG

MAXLOGFILES 16

MAXLOGMEMBERS 3

MAXDATAFILES 100

MAXINSTANCES 8

MAXLOGHISTORY 292

LOGFILE

GROUP 1 ( '/oracle/CRM2/redo01.log' ) SIZE 200 M REUSE,

GROUP 2 ( '/oracle/CRM2/redo02.log' ) SIZE 200 M REUSE,

GROUP 3 ( '/oracle/CRM2/redo03.log' ) SIZE 200 M REUSE,

GROUP 4 ( '/oracle/CRM2/redo02.dbf' ) SIZE 200 M REUSE

DATAFILE

'/oracle/CRM2/system01.dbf'

CHARACTER SET ZHS16GBK



contents of Memory Script:

{

catalog clone datafilecopy "/oracle/CRM2/sysaux01.dbf",

"/oracle/CRM2/zx.dbf",

"/oracle/CRM2/users01.dbf",

"/oracle/CRM2/pos.dbf",

"/oracle/CRM2/erp.dbf",

"/oracle/CRM2/user01.dbf",

"/oracle/CRM2/undotbs03.dbf";

switch clone datafile all;

}

executing Memory Script


cataloged datafile copy

datafile copy file name=/oracle/CRM2/sysaux01.dbf RECID=1 STAMP=824344852

cataloged datafile copy

datafile copy file name=/oracle/CRM2/zx.dbf RECID=2 STAMP=824344852

cataloged datafile copy

datafile copy file name=/oracle/CRM2/users01.dbf RECID=3 STAMP=824344852

cataloged datafile copy

datafile copy file name=/oracle/CRM2/pos.dbf RECID=4 STAMP=824344852

cataloged datafile copy

datafile copy file name=/oracle/CRM2/erp.dbf RECID=5 STAMP=824344852

cataloged datafile copy

datafile copy file name=/oracle/CRM2/user01.dbf RECID=6 STAMP=824344852

cataloged datafile copy

datafile copy file name=/oracle/CRM2/undotbs03.dbf RECID=7 STAMP=824344852


datafile 2 switched to datafile copy

input datafile copy RECID=1 STAMP=824344852 file name=/oracle/CRM2/sysaux01.dbf

datafile 3 switched to datafile copy

input datafile copy RECID=2 STAMP=824344852 file name=/oracle/CRM2/zx.dbf

datafile 4 switched to datafile copy

input datafile copy RECID=3 STAMP=824344852 file name=/oracle/CRM2/users01.dbf

datafile 5 switched to datafile copy

input datafile copy RECID=4 STAMP=824344852 file name=/oracle/CRM2/pos.dbf

datafile 6 switched to datafile copy

input datafile copy RECID=5 STAMP=824344852 file name=/oracle/CRM2/erp.dbf

datafile 7 switched to datafile copy

input datafile copy RECID=6 STAMP=824344852 file name=/oracle/CRM2/user01.dbf

datafile 8 switched to datafile copy

input datafile copy RECID=7 STAMP=824344852 file name=/oracle/CRM2/undotbs03.dbf


contents of Memory Script:

{

Alter clone database open resetlogs;

}

executing Memory Script


database opened

Finished Duplicate Db at 25-AUG-13


--------------------------------完---------------------------------------------

本文出自 “myblog” 博客,,请务必保留此出处

推荐阅读
  • 本文详细介绍了在ASP.NET中获取插入记录的ID的几种方法,包括使用SCOPE_IDENTITY()和IDENT_CURRENT()函数,以及通过ExecuteReader方法执行SQL语句获取ID的步骤。同时,还提供了使用这些方法的示例代码和注意事项。对于需要获取表中最后一个插入操作所产生的ID或马上使用刚插入的新记录ID的开发者来说,本文提供了一些有用的技巧和建议。 ... [详细]
  • ubuntu用sqoop将数据从hive导入mysql时,命令: ... [详细]
  • Postgresql备份和恢复的方法及命令行操作步骤
    本文介绍了使用Postgresql进行备份和恢复的方法及命令行操作步骤。通过使用pg_dump命令进行备份,pg_restore命令进行恢复,并设置-h localhost选项,可以完成数据的备份和恢复操作。此外,本文还提供了参考链接以获取更多详细信息。 ... [详细]
  • 本文介绍了如何使用php限制数据库插入的条数并显示每次插入数据库之间的数据数目,以及避免重复提交的方法。同时还介绍了如何限制某一个数据库用户的并发连接数,以及设置数据库的连接数和连接超时时间的方法。最后提供了一些关于浏览器在线用户数和数据库连接数量比例的参考值。 ... [详细]
  • 本文介绍了在Win10上安装WinPythonHadoop的详细步骤,包括安装Python环境、安装JDK8、安装pyspark、安装Hadoop和Spark、设置环境变量、下载winutils.exe等。同时提醒注意Hadoop版本与pyspark版本的一致性,并建议重启电脑以确保安装成功。 ... [详细]
  • HDFS2.x新特性
    一、集群间数据拷贝scp实现两个远程主机之间的文件复制scp-rhello.txtroothadoop103:useratguiguhello.txt推pushscp-rr ... [详细]
  • 仙贝旅行是日本最大的旅游服务平台之一,为广大用户提供优质的日本定制游服务。随着用户数量的增长,仙贝旅行决定与智齿科技合作,全面替换原有客服系统,打造全新的在线客服体系。该体系具备多渠道快速接入的能力,让仙贝旅行轻松与各个渠道的接入用户完成沟通。同时,机器人与人工协同发力,提升客户服务水平。 ... [详细]
  • 本文介绍了一些Java开发项目管理工具及其配置教程,包括团队协同工具worktil,版本管理工具GitLab,自动化构建工具Jenkins,项目管理工具Maven和Maven私服Nexus,以及Mybatis的安装和代码自动生成工具。提供了相关链接供读者参考。 ... [详细]
  • 本文由编程笔记#小编为大家整理,主要介绍了StartingzookeeperFAILEDTOSTART相关的知识,希望对你有一定的参考价值。下载路径:https://ar ... [详细]
  • 本文介绍了在Linux下安装和配置Kafka的方法,包括安装JDK、下载和解压Kafka、配置Kafka的参数,以及配置Kafka的日志目录、服务器IP和日志存放路径等。同时还提供了单机配置部署的方法和zookeeper地址和端口的配置。通过实操成功的案例,帮助读者快速完成Kafka的安装和配置。 ... [详细]
  • SAP羞辱国产软件商:技术停在10年前
    SAP中国研究院总裁芮祥麟表示,国产软件厂商过于热衷概念炒作,技术水平停留在10年前的客户端架构水平。他认为,国内厂商推出基于SOA的产品或转型SAAS模式是不可能的,研发新架构需要时间。当前最热门的概念是云计算,芮祥麟呼吁国产厂商应该潜心研发底层架构。 ... [详细]
  • IT方面的论坛太多了,有综合,有专业,有行业,在各个论坛里混了几年,体会颇深,以前是论坛哪里人多 ... [详细]
  • CEPH LIO iSCSI Gateway及其使用参考文档
    本文介绍了CEPH LIO iSCSI Gateway以及使用该网关的参考文档,包括Ceph Block Device、CEPH ISCSI GATEWAY、USING AN ISCSI GATEWAY等。同时提供了多个参考链接,详细介绍了CEPH LIO iSCSI Gateway的配置和使用方法。 ... [详细]
  • 本文讲述了孙悟空写给白骨精的信件引发的思考和反省。孙悟空在信中对自己的行为进行了反思,认识到自己胡闹的行为并没有给他带来实际的收获。他也揭示了西天取经的真相,认为这是玉皇、菩萨设下的一场陷阱。他还提到了师傅的虚伪和对自己的实心话,以及自己作为师傅准备提拔的对象而被派下来锻炼的经历。他认为路上的九九八十一难也都是菩萨算计好的,唐僧并没有真正的危险。最后,他提到了观音菩萨在关键时刻的指导。这封信件引发了孙悟空对自己行为的思考和反省,对西天取经的目的和自己的角色有了更深入的认识。 ... [详细]
  • Windows2003 IIS上设置301定向,实现不带www域名跳转带www域名的方法
    打开IIS,建一个网站,主机头用不带www的域名,随便指向一个目录。然后在这个网站上点右键,属性--主目录--重定向到URL如图ÿ ... [详细]
author-avatar
金婉山_461
这个家伙很懒,什么也没留下!
PHP1.CN | 中国最专业的PHP中文社区 | DevBox开发工具箱 | json解析格式化 |PHP资讯 | PHP教程 | 数据库技术 | 服务器技术 | 前端开发技术 | PHP框架 | 开发工具 | 在线工具
Copyright © 1998 - 2020 PHP1.CN. All Rights Reserved | 京公网安备 11010802041100号 | 京ICP备19059560号-4 | PHP1.CN 第一PHP社区 版权所有