在同一个机器上复制数据库

php中文网
发布: 2016-06-07 17:09:14
原创
1286人浏览过

将IBS库复制为orcl1库。 在两个库上创建密码文件: set Oracle_sid=ibs orapwd file=F:\BBCLDB\ORCL1\PWDibs1.ora password=sys

将IBS库复制为orcl1库。

在两个库上创建密码文件:

set Oracle_sid=ibs

orapwd file=F:\BBCLDB\ORCL1\PWDibs1.ora password=system entries=30

set oracle_sid=orcl1

orapwd file=F:\BBCLDB\ORCL1\PWDorcl1.ora password=system entries=30

创建一个新的服务

oradim -NEW -SID orcl1

修改主库、辅助数据库的监听 tnsname.ora文件

IBS 的参数文件:

ibs.__db_cache_size=18253611008
ibs.__java_pool_size=134217728
ibs.__large_pool_size=134217728
ibs.__oracle_base='e:\app\Administrator'#ORACLE_BASE set from environment
ibs.__pga_aggregate_target=15971909632
ibs.__sga_target=22951231488
ibs.__shared_io_pool_size=0
ibs.__shared_pool_size=4026531840
ibs.__streams_pool_size=134217728
*.audit_file_dest='e:\app\Administrator\admin\IBS\adump'
*.audit_trail='db'
*.compatible='11.2.0.0.0'
*.control_files='F:\BBCLDB\IBS\IBS\control01.ctl','e:\app\Administrator\flash_recovery_area\IBS\control02.ctl'
*.db_block_size=8192
*.db_domain=''
*.db_name='IBS'
*.db_recovery_file_dest='e:\app\Administrator\flash_recovery_area'
*.db_recovery_file_dest_size=536870912000
*.diagnostic_dest='e:\app\Administrator'
*.dispatchers='(PROTOCOL=TCP) (SERVICE=IBSXDB)'
*.memory_target=8848692224
*.open_cursors=300
*.processes=150
*.remote_login_passwordfile='EXCLUSIVE'
*.undo_tablespace='UNDOTBS1'
*.log_archive_format='ARC%S_%R.%T'
*.log_file_name_convert='F:\BBCLDB\IBS\IBS','F:\BBCLDB\ORCL1'
*.db_file_name_convert='F:\BBCLDB\IBS\IBS','F:\BBCLDB\ORCL1'

orcl1的参数文件:

orcl1.__db_cache_size=25769803776
orcl1.__java_pool_size=134217728
orcl1.__large_pool_size=134217728
orcl1.__oracle_base='e:\app\Administrator'#ORACLE_BASE set from environment
orcl1.__pga_aggregate_target=31406948352
orcl1.__sga_target=30467424256
orcl1.__shared_io_pool_size=0
orcl1.__shared_pool_size=3758096384
orcl1.__streams_pool_size=268435456
*.audit_file_dest='e:\app\Administrator\admin\ORCL1\adump'
*.audit_trail='db'
*.compatible='11.2.0.0.0'
*.control_files='e:\app\Administrator\oradata\ORCL1\control01.ctl','e:\app\Administrator\flash_recovery_area\ORCL1\control02.ctl'
*.db_block_size=8192
*.db_domain=''
*.db_name='ORCL1'
*.db_recovery_file_dest='e:\app\Administrator\flash_recovery_area'
*.db_recovery_file_dest_size=4102029312
*.diagnostic_dest='e:\app\Administrator'
*.dispatchers='(PROTOCOL=TCP) (SERVICE=ORCL1XDB)'
*.memory_target=9842915328
*.open_cursors=300
*.processes=150
*.remote_login_passwordfile='EXCLUSIVE'
*.sec_case_sensitive_logon=FALSE
*.undo_tablespace='UNDOTBS1'
*.log_archive_format='ARC%S_%R.%T'
*.log_file_name_convert='F:\BBCLDB\IBS\IBS','F:\BBCLDB\ORCL1'
*.db_file_name_convert='F:\BBCLDB\IBS\IBS','F:\BBCLDB\ORCL1'

两个文件中主要是这三行要加上。

set oracle_sid=ibs

C:\Users\Administrator>rman target sys/system auxiliary sys/system@orcl1

Recovery Manager: Release 11.2.0.1.0 - Production on Fri Dec 30 18:09:41 2011

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

connected to target database: IBS (DBID=623540487)
connected to auxiliary database: ORCL1 (not mounted)

RMAN> DUPLICATE TARGET DATABASE TO orcl1 from active database nofilenamecheck;

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

contents of Memory Script:
{
   sql clone "alter system set  db_name =
 ''IBS'' comment=
 ''Modified by RMAN duplicate'' scope=spfile";
   sql clone "alter system set  db_unique_name =
 ''ORCL1'' comment=
 ''Modified by RMAN duplicate'' scope=spfile";
   shutdown clone immediate;
   startup clone force nomount
   backup as copy current controlfile auxiliary format  'E:\APP\ADMINISTRATOR\OR
ADATA\ORCL1\CONTROL01.CTL';
   restore clone controlfile to  'E:\APP\ADMINISTRATOR\FLASH_RECOVERY_AREA\ORCL1
\CONTROL02.CTL' from
 'E:\APP\ADMINISTRATOR\ORADATA\ORCL1\CONTROL01.CTL';
   alter clone database mount;
}
executing Memory Script

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

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

Oracle instance shut down

Oracle instance started

Total System Global Area    9820950528 bytes

Fixed Size                     2184112 bytes
Variable Size               5033167952 bytes
Database Buffers            4764729344 bytes
Redo Buffers                  20869120 bytes

Starting backup at 30-DEC-11
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=187 device type=DISK
channel ORA_DISK_1: starting datafile copy
copying current control file
output file name=E:\APP\ADMINISTRATOR\PRODUCT.2.0\DBHOME_1\DATABASE\SNCFIBS.O
RA tag=TAG20111230T181012 RECID=1 STAMP=771271813
channel ORA_DISK_1: datafile copy complete, elapsed time: 00:00:03
Finished backup at 30-DEC-11

I-Shop购物系统
I-Shop购物系统

部分功能简介:商品收藏夹功能热门商品最新商品分级价格功能自选风格打印结算页面内部短信箱商品评论增加上一商品,下一商品功能增强商家提示功能友情链接用户在线统计用户来访统计用户来访信息用户积分功能广告设置用户组分类邮件系统后台实现更新用户数据系统图片设置模板管理CSS风格管理申诉内容过滤功能用户注册过滤特征字符IP库管理及来访限制及管理压缩,恢复,备份数据库功能上传文件管理商品类别管理商品添加/修改/

I-Shop购物系统 0
查看详情 I-Shop购物系统

Starting restore at 30-DEC-11
allocated channel: ORA_AUX_DISK_1
channel ORA_AUX_DISK_1: SID=193 device type=DISK

channel ORA_AUX_DISK_1: copied control file copy
Finished restore at 30-DEC-11

database mounted

contents of Memory Script:
{
   set newname for datafile  1 to
 "F:\BBCLDB\ORCL1\SYSTEM01.DBF";
   set newname for datafile  2 to
 "F:\BBCLDB\ORCL1\SYSAUX01.DBF";
   set newname for datafile  3 to
 "F:\BBCLDB\ORCL1\UNDOTBS01.DBF";
   set newname for datafile  4 to
 "F:\BBCLDB\ORCL1\USERS01.DBF";
   set newname for datafile  5 to
 "F:\BBCLDB\ORCL1\CI_DATALRG01.DBF";
   set newname for datafile  6 to
 "F:\BBCLDB\ORCL1\DATAUSR01.DBF";
   set newname for datafile  7 to
 "F:\BBCLDB\ORCL1\DATALRG01.DBF";
   set newname for datafile  8 to
 "F:\BBCLDB\ORCL1\DATASML01.DBF";
   set newname for datafile  9 to
 "F:\BBCLDB\ORCL1\INDEXLRG01.DBF";
   set newname for datafile  10 to
 "F:\BBCLDB\ORCL1\INDEXSML.DBF";
   set newname for datafile  11 to
 "F:\BBCLDB\ORCL1\DATALRG02.DBF";
   set newname for datafile  12 to
 "F:\BBCLDB\ORCL1\DATALRG03.DBF";
   set newname for datafile  13 to
 "F:\BBCLDB\ORCL1\DATALRG04.DBF";
   set newname for datafile  14 to
 "F:\BBCLDB\ORCL1\DATALRG05.DBF";
   set newname for datafile  15 to
 "F:\BBCLDB\ORCL1\DATALRG06.DBF";
   set newname for datafile  16 to
 "F:\BBCLDB\ORCL1\DATALRG07.DBF";
   set newname for datafile  17 to
 "F:\BBCLDB\ORCL1\INDEXLRG02.DBF";
   set newname for datafile  18 to
 "F:\BBCLDB\ORCL1\INDEXLRG03.DBF";
   set newname for datafile  19 to
 "F:\BBCLDB\ORCL1\INDEXLRG04.DBF";
   set newname for datafile  20 to
 "F:\BBCLDB\ORCL1\INDEXLRG05.DBF";
   set newname for datafile  21 to
 "F:\BBCLDB\ORCL1\INDEXLRG06.DBF";
   set newname for datafile  22 to
 "F:\BBCLDB\ORCL1\INDEXLRG07.DBF";
   set newname for datafile  23 to
 "F:\BBCLDB\ORCL1\DATALRG08.DBF";
   backup as copy reuse
   datafile  1 auxiliary format
 "F:\BBCLDB\ORCL1\SYSTEM01.DBF"   datafile
 2 auxiliary format
 "F:\BBCLDB\ORCL1\SYSAUX01.DBF"   datafile
 3 auxiliary format
 "F:\BBCLDB\ORCL1\UNDOTBS01.DBF"   datafile
 4 auxiliary format
 "F:\BBCLDB\ORCL1\USERS01.DBF"   datafile
 5 auxiliary format
 "F:\BBCLDB\ORCL1\CI_DATALRG01.DBF"   datafile
 6 auxiliary format
 "F:\BBCLDB\ORCL1\DATAUSR01.DBF"   datafile
 7 auxiliary format
 "F:\BBCLDB\ORCL1\DATALRG01.DBF"   datafile
 8 auxiliary format
 "F:\BBCLDB\ORCL1\DATASML01.DBF"   datafile
 9 auxiliary format
 "F:\BBCLDB\ORCL1\INDEXLRG01.DBF"   datafile
 10 auxiliary format
 "F:\BBCLDB\ORCL1\INDEXSML.DBF"   datafile
 11 auxiliary format
 "F:\BBCLDB\ORCL1\DATALRG02.DBF"   datafile
 12 auxiliary format
 "F:\BBCLDB\ORCL1\DATALRG03.DBF"   datafile
 13 auxiliary format
 "F:\BBCLDB\ORCL1\DATALRG04.DBF"   datafile
 14 auxiliary format
 "F:\BBCLDB\ORCL1\DATALRG05.DBF"   datafile
 15 auxiliary format
 "F:\BBCLDB\ORCL1\DATALRG06.DBF"   datafile
 16 auxiliary format
 "F:\BBCLDB\ORCL1\DATALRG07.DBF"   datafile
 17 auxiliary format
 "F:\BBCLDB\ORCL1\INDEXLRG02.DBF"   datafile
 18 auxiliary format
 "F:\BBCLDB\ORCL1\INDEXLRG03.DBF"   datafile
 19 auxiliary format
 "F:\BBCLDB\ORCL1\INDEXLRG04.DBF"   datafile
 20 auxiliary format
 "F:\BBCLDB\ORCL1\INDEXLRG05.DBF"   datafile
 21 auxiliary format
 "F:\BBCLDB\ORCL1\INDEXLRG06.DBF"   datafile
 22 auxiliary format
 "F:\BBCLDB\ORCL1\INDEXLRG07.DBF"   datafile
 23 auxiliary format
 "F:\BBCLDB\ORCL1\DATALRG08.DBF"   ;
   sql 'alter system archive log current';
}
executing Memory Script

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

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

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 backup at 30-DEC-11
using channel ORA_DISK_1
channel ORA_DISK_1: starting datafile copy
input datafile file number=00007 name=F:\BBCLDB\IBS\IBS\DATALRG01.DBF

linux

相关标签:
最佳 Windows 性能的顶级免费优化软件
最佳 Windows 性能的顶级免费优化软件

每个人都需要一台速度更快、更稳定的 PC。随着时间的推移,垃圾文件、旧注册表数据和不必要的后台进程会占用资源并降低性能。幸运的是,许多工具可以让 Windows 保持平稳运行。

下载
来源:php中文网
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系admin@php.cn
最新问题
开源免费商场系统广告
热门教程
更多>
最新下载
更多>
网站特效
网站源码
网站素材
前端模板
关于我们 免责申明 举报中心 意见反馈 讲师合作 广告合作 最新更新
php中文网:公益在线php培训,帮助PHP学习者快速成长!
关注服务号 技术交流群
PHP中文网订阅号
每天精选资源文章推送

Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号