热门标签 | 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的开发者来说,本文提供了一些有用的技巧和建议。 ... [详细]
  • 一、Hadoop来历Hadoop的思想来源于Google在做搜索引擎的时候出现一个很大的问题就是这么多网页我如何才能以最快的速度来搜索到,由于这个问题Google发明 ... [详细]
  • ubuntu用sqoop将数据从hive导入mysql时,命令: ... [详细]
  • 本文介绍了在SQL中查询分组后每组行数的统计方法。通过使用count()函数和GROUP BY子句可以统计每组的行数,但是如何统计所有组的行数呢?本文提供了一种实现方法,并给出了相应的SQL查询语句。 ... [详细]
  • GetWindowLong函数
    今天在看一个代码里头写了GetWindowLong(hwnd,0),我当时就有点费解,靠,上网搜索函数原型说明,死活找不到第 ... [详细]
  • 如何去除Win7快捷方式的箭头
    本文介绍了如何去除Win7快捷方式的箭头的方法,通过生成一个透明的ico图标并将其命名为Empty.ico,将图标复制到windows目录下,并导入注册表,即可去除箭头。这样做可以改善默认快捷方式的外观,提升桌面整洁度。 ... [详细]
  • android listview OnItemClickListener失效原因
    最近在做listview时发现OnItemClickListener失效的问题,经过查找发现是因为button的原因。不仅listitem中存在button会影响OnItemClickListener事件的失效,还会导致单击后listview每个item的背景改变,使得item中的所有有关焦点的事件都失效。本文给出了一个范例来说明这种情况,并提供了解决方法。 ... [详细]
  • Windows下配置PHP5.6的方法及注意事项
    本文介绍了在Windows系统下配置PHP5.6的步骤及注意事项,包括下载PHP5.6、解压并配置IIS、添加模块映射、测试等。同时提供了一些常见问题的解决方法,如下载缺失的msvcr110.dll文件等。通过本文的指导,读者可以轻松地在Windows系统下配置PHP5.6,并解决一些常见的配置问题。 ... [详细]
  • 本文介绍了在Win10上安装WinPythonHadoop的详细步骤,包括安装Python环境、安装JDK8、安装pyspark、安装Hadoop和Spark、设置环境变量、下载winutils.exe等。同时提醒注意Hadoop版本与pyspark版本的一致性,并建议重启电脑以确保安装成功。 ... [详细]
  • 使用在线工具jsonschema2pojo根据json生成java对象
    本文介绍了使用在线工具jsonschema2pojo根据json生成java对象的方法。通过该工具,用户只需将json字符串复制到输入框中,即可自动将其转换成java对象。该工具还能解析列表式的json数据,并将嵌套在内层的对象也解析出来。本文以请求github的api为例,展示了使用该工具的步骤和效果。 ... [详细]
  • 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的安装和配置。 ... [详细]
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社区 版权所有