示例在同一台机器上RMAN克隆数据库

1.查看主库ZDJS并使用RMAM进行备份

[[email protected] ~]$ sqlplus ‘/as sysdba‘

SQL*Plus: Release 10.2.0.1.0 - Production on Wed Jan 14 14:13:14 2015

Copyright (c) 1982, 2005, Oracle.  All rights reserved.

Connected to an idle instance.

SQL> startup
ORACLE instance started.

Total System Global Area  608174080 bytes
Fixed Size                  1220820 bytes
Variable Size             159387436 bytes
Database Buffers          440401920 bytes
Redo Buffers                7163904 bytes
Database mounted.
Database opened.
SQL> show parameter name

NAME                                 TYPE        VALUE
------------------------------------ ----------- ------------------------------
db_file_name_convert                 string
db_name                              string      ZDJS
db_unique_name                       string      ZDJS
global_names                         boolean     FALSE
instance_name                        string      ZDJS
lock_name_space                      string
log_file_name_convert                string
service_names                        string      ZDJS
[[email protected] ~]$ rman target /

Recovery Manager: Release 10.2.0.1.0 - Production on Wed Jan 14 14:26:58 2015

Copyright (c) 1982, 2005, Oracle.  All rights reserved.

connected to target database: ZDJS (DBID=3486931402)

RMAN> run {
2> allocate channel c1 type disk;
3> allocate channel c2 type disk;
4> backup full database format ‘/u01/rman_bak/%d_%s_%t.bak‘;
5> backup archivelog all format ‘/u01/rman_bak/arch_%s.bak‘;
6> backup current controlfile format ‘/u01/rman_bak/ctl_%s.bak‘;
7> }

using target database control file instead of recovery catalog
allocated channel: c1
channel c1: sid=143 devtype=DISK

allocated channel: c2
channel c2: sid=142 devtype=DISK

Starting backup at 14-JAN-15
channel c1: starting full datafile backupset
channel c1: specifying datafile(s) in backupset
input datafile fno=00001 name=/u02/app/oradata/ZDJS/system01.dbf
input datafile fno=00006 name=/u02/app/oradata/ZDJS/plat01.dbf
input datafile fno=00008 name=/u02/app/oradata/ZDJS/rlsm01.dbf
input datafile fno=00002 name=/u02/app/oradata/ZDJS/undotbs01.dbf
input datafile fno=00004 name=/u02/app/oradata/ZDJS/users01.dbf
channel c1: starting piece 1 at 14-JAN-15
channel c2: starting full datafile backupset
channel c2: specifying datafile(s) in backupset
input datafile fno=00003 name=/u02/app/oradata/ZDJS/sysaux01.dbf
input datafile fno=00010 name=/u02/app/oradata/ZDJS/qhrlst01.dbf
input datafile fno=00005 name=/u02/app/oradata/ZDJS/example01.dbf
input datafile fno=00007 name=/u02/app/oradata/ZDJS/rlst01.dbf
input datafile fno=00009 name=/u02/app/oradata/ZDJS/rlsc01.dbf
channel c2: starting piece 1 at 14-JAN-15
channel c1: finished piece 1 at 14-JAN-15
piece handle=/u01/rman_bak/ZDJS_6_868976951.bak tag=TAG20150114T142911 comment=NONE
channel c1: backup set complete, elapsed time: 00:01:07
channel c1: starting full datafile backupset
channel c1: specifying datafile(s) in backupset
including current control file in backupset
channel c1: starting piece 1 at 14-JAN-15
channel c1: finished piece 1 at 14-JAN-15
piece handle=/u01/rman_bak/ZDJS_8_868977018.bak tag=TAG20150114T142911 comment=NONE
channel c1: backup set complete, elapsed time: 00:00:03
channel c1: starting full datafile backupset
channel c1: specifying datafile(s) in backupset
including current SPFILE in backupset
channel c1: starting piece 1 at 14-JAN-15
channel c1: finished piece 1 at 14-JAN-15
piece handle=/u01/rman_bak/ZDJS_9_868977021.bak tag=TAG20150114T142911 comment=NONE
channel c1: backup set complete, elapsed time: 00:00:02
channel c2: finished piece 1 at 14-JAN-15
piece handle=/u01/rman_bak/ZDJS_7_868976952.bak tag=TAG20150114T142911 comment=NONE
channel c2: backup set complete, elapsed time: 00:01:18
Finished backup at 14-JAN-15

Starting backup at 14-JAN-15
current log archived
channel c1: starting archive log backupset
channel c1: specifying archive log(s) in backup set
input archive log thread=1 sequence=49 recid=1 stamp=868977033
channel c1: starting piece 1 at 14-JAN-15
channel c1: finished piece 1 at 14-JAN-15
piece handle=/u01/rman_bak/arch_10.bak tag=TAG20150114T143033 comment=NONE
channel c1: backup set complete, elapsed time: 00:00:03
Finished backup at 14-JAN-15

Starting backup at 14-JAN-15
channel c1: starting full datafile backupset
channel c1: specifying datafile(s) in backupset
including current control file in backupset
channel c1: starting piece 1 at 14-JAN-15
channel c1: finished piece 1 at 14-JAN-15
piece handle=/u01/rman_bak/ctl_11.bak tag=TAG20150114T143038 comment=NONE
channel c1: backup set complete, elapsed time: 00:00:02
Finished backup at 14-JAN-15
released channel: c1
released channel: c2
SQL> col file_name for a50
SQL> select file_id,file_name,tablespace_name from dba_data_files;

   FILE_ID FILE_NAME                                          TABLESPACE_NAME
---------- -------------------------------------------------- ------------------------------
         4 /u02/app/oradata/ZDJS/users01.dbf                  USERS
         3 /u02/app/oradata/ZDJS/sysaux01.dbf                 SYSAUX
         2 /u02/app/oradata/ZDJS/undotbs01.dbf                UNDOTBS1
         1 /u02/app/oradata/ZDJS/system01.dbf                 SYSTEM
         5 /u02/app/oradata/ZDJS/example01.dbf                EXAMPLE
         6 /u02/app/oradata/ZDJS/plat01.dbf                   PLAT
         7 /u02/app/oradata/ZDJS/rlst01.dbf                   RLST
         8 /u02/app/oradata/ZDJS/rlsm01.dbf                   RLSM
         9 /u02/app/oradata/ZDJS/rlsc01.dbf                   RLSC
        10 /u02/app/oradata/ZDJS/qhrlst01.dbf                 QHRLST

10 rows selected.

2.建立pfile文件

SQL> create pfile from spfile;

File created.

3.建立克隆库的目录

[[email protected] oradata]$ mkdir -p $ORACLE_BASE/admin/clonedb/{a,b,c,u}dump
[[email protected] oradata]$ mkdir -p $ORACLE_BASE/oradata/clonedb/

4.将主库pfile拷贝生成克隆库的pfile,并生成克隆库的口令文件

##红字部分是修改的部分,蓝字部分是需要增加的

[[email protected] dbs]$ cp initZDJS.ora initclonedb.ora
[[email protected] dbs]$ vi initclonedb.ora
[[email protected] dbs]$ cat initclonedb.ora
*.audit_file_dest=‘/u02/app/admin/clonedb/adump‘
*.background_dump_dest=‘/u02/app/admin/clonedb/bdump‘
*.compatible=‘10.2.0.1.0‘
*.control_files=‘/u02/app/oradata/clonedb/control01.ctl‘,‘/u02/app/oradata/clonedb/control02.ctl‘,‘/u02/app/oradata/clonedb/control03.ctl‘
*.core_dump_dest=‘/u02/app/admin/clonedb/cdump‘
*.db_block_size=8192
*.db_domain=‘‘
*.db_file_multiblock_read_count=16
*.db_name=‘clonedb‘
*.dispatchers=‘(PROTOCOL=TCP) (SERVICE=ZDJSXDB)‘
*.job_queue_processes=10
*.log_archive_dest_1=‘location=/u01/clonedb_arch‘
*.open_cursors=300
*.pga_aggregate_target=201326592
*.processes=150
*.remote_login_passwordfile=‘EXCLUSIVE‘
*.sga_target=605028352
*.undo_management=‘AUTO‘
*.undo_tablespace=‘UNDOTBS1‘
*.user_dump_dest=‘/u02/app/admin/clonedb/udump‘
db_file_name_convert=("/u02/app/oradata/ZDJS","/u02/app/oradata/clonedb")
log_file_name_convert=("/u02/app/oradata/ZDJS","/u02/app/oradata/clonedb")
时间: 2024-10-10 08:21:17

示例在同一台机器上RMAN克隆数据库的相关文章

如何确定Hadoop守护进程分别会在哪台机器上运行

经过一段时间的配置,Hadoop环境总算运行起来了,但是呢,为何主节点就没有跑tasktracker和datanode进程,slave节点也没有跑secondary进程,Hadoop是如何控制的呢? 经过看权威指南(267页)和跟群里同学讨论,还有自己测试,最终确定: tasktracker和datanode这两个守护进程 —— 只会在conf/slaves文件里指定的那些节点上运行 secondarynamenode 这个守护进程 —— 只会在conf/masters文件里指定的那个节点上运行

如何在一台机器上配置多个git的rsa

如何在一台机器上配置多个git的rsa 问题的提出 很多时候,我们一台机器上要使用多个git库,比如 github, csdn 以及 自己公司的.那么 rsa就要有多份.那么该如何让这些共同存在呢? 原理就是:建立多个不同的rsa 然后 在ssh config中分别不同的配置. 具体步骤 1 建立rsa ssh-keygen -t rsa -C "你的邮箱地址" 执行完这条命令之后, 会弹出如下提示: Enter file in which to save the key (/User

在一台机器上搭建多个redis实例

默认Redis程序安装在/usr/local/redis目录下: 配置文件:/usr/local/redis/redis.conf,该配置文件中配置的端口为默认端口:6379: Redis的启动命令路径:/usr/local/bin/redis-server. 可以指定端口启动多个Redis进程. #/usr/local/bin/redis-server --port 6380 &    #启动6380端口的redis实例. ====================以下每个进程对应一个配置文件(

一台机器上运行多个ActiveMq

由于业务需要一台机器上运行多个ActiveMq,这里主要说一下有什么地方不重复: 1.brokerName名称不能重复 2.端口号不能重复uri = tcp://localhost:50509 3.kahadb路径不能重复 4.管理端口不能重复contextPort = 2019 jmxServiceUrl = service:jmx:rmi:///jndi/rmi://localhost:2019/jmxrmi

在同一台机器上启动多个tomcat服务

一台机器上启动多个tomcat服务应用,能够让我们更好的测试下自己的分布式应用,下面简单介绍下如何在一台机器上开启多个tomcat应用,其实会弄两个,之后的多个都是一样的了 找到电脑上的tomcat安装目录,复制一份,出现两份tomcat,为了区别给复制的一份起一个特别的名称apache-tomcat-6.0.35-8090 进入apache-tomcat-6.0.35-8090目录中,进入conf目录下找到server.xml需要进行多个地方修改 conf目录下修改sever.xml 主要修改

解决mysql跟php不在同一台机器上,编译安装php服务报错问题:configure: error: Cannot find MySQL header files under /application/mysql.

在编译安装php服务时报错: configure: error: Cannot find MySQL header files under /application/mysql. Note that the MySQL client library is not bundled anymore! 前边搭建lnmp环境时,是把mysql和php安装在了同一台机器上,编译php的时候,需要通过参数 --with-mysql来指定mysql的安装路径,但在生产环境中,通常php和mysql是不在同一台

同一台机器上有多个Python版本?

有关Python网站上的官方文档,如何在Linux上的同一台机器上安装和运行多个版本的Python? 我可以找到大量的博客帖子和答案,但我想知道是否有“标准”官方方式这样做? 或者这完全取决于操作系统? 解决方案 我认为它是完全独立的.只需安装它们,然后你就可以使用命令/usr/bin/python2.5和/usr/bin/python2.6.链接/usr/bin/python到您要用作默认值的链接. 无论如何,所有库都在单独的文件夹中(以版本命名). 如果要手动编译版本,请参阅Python源代

shell远程操作另外一台机器上数据

shell远程操作另外一台机器上的数据,有两种方式: 1 .配置免密登陆,2.使用sshpass 当前存在两台虚拟机,ip地址分别为:192.168.3.32 192.168.3.33 一.免密登陆操作另外一台机器 1.生成秘钥 两台机器上都做如下操作,三次输入,直接摁回车 [[email protected] work]# ssh-keygen -t rsa Generating public/private rsa key pair. Enter file in which to save

-Oracle 11gR2通过RMAN克隆数据库

Oracle Study之--Oracle 11gR2通过RMAN克隆数据库 Purpose of Database Duplication A duplicate database is useful for a variety of purposes, most of which involve testing. You can perform the following tasks in a duplicate database: Test backup and recovery proc