目标数据库:jadl0g 复制的结果数据库:d10g 注意:****目标库与clone结果库在同一台机子上**** 1.vi /u01/oracle/10g/network/admin/tnsnames.ora D10G =(DESCRIPTION =(ADDRESS = (PROTOCOL = TCP)(HOST = oracle.db.com)(PORT = 1521))(CONNECT_DATA =(SE
目标数据库:jadl0g
复制的结果数据库:d10g
注意:****目标库与clone结果库在同一台机子上****
1.vi /u01/oracle/10g/network/admin/tnsnames.ora
D10G = (DESCRIPTION = (ADDRESS = (PROTOCOL = TCP)(HOST = oracle.db.com)(PORT = 1521)) (CONNECT_DATA = (SERVER = DEDICATED) (SERVICE_NAME = d10g) ) (failover = on) )
2.vi /u01/oracle/10g/network/admin/listener.ora
SID_LIST_LISTENER = (SID_LIST = (SID_DESC = (GLOBAL_DBNAME=jadl10g) (SID_NAME = jadl10g) (ORACLE_HOME = /u01/oracle/10g) ) (SID_DESC = (GLOBAL_DBNAME=d10g) (SID_NAME = d10g) (ORACLE_HOME = /u01/oracle/10g) ) )
3.重启监听
lsnrctl stop lsnrctl start tnsping d10g tnsping jadl10g
4.创建密码文件和参数文件
[oracle@oracle ~]$ cd /u01/oracle/10g/dbs/ [oracle@oracle dbs]$ orapwd file=orapwd10g password=oracle [oracle@oracle dbs]$ strings spfilejadl10g.ora > initd10g.ora [oracle@oracle dbs]$ vi initd10g.ora :1,$ s/jadl10g/d10g/g---执行该命令 [oracle@oracle dbs]$ grep u01 initd10g.ora *.audit_file_dest='/u01/oracle/admin/d10g/adump' *.background_dump_dest='/u01/oracle/admin/d10g/bdump' *.control_files='/u01/oracle/oradata/d10g/control01.ctl','/u01/oracle/flash_recovery_area/d10g/control02.ctl'#Restore Controlfile *.core_dump_dest='/u01/oracle/admin/d10g/cdump' *.db_recovery_file_dest='/u01/oracle/flash_recovery_area' *.user_dump_dest='/u01/oracle/admin/d10g/udump' 5.创建相应的文件 [oracle@oracle dbs]$ mkdir /u01/oracle/admin/d10g/adump -p [oracle@oracle dbs]$ mkdir /u01/oracle/admin/d10g/bdump -p [oracle@oracle dbs]$ mkdir /u01/oracle/admin/d10g/cdump -p [oracle@oracle dbs]$ mkdir /u01/oracle/admin/d10g/udump -p [oracle@oracle dbs]$ mkdir /u01/oracle/oradata/d10g [oracle@oracle dbs]$ export ORACLE_SID=d10g [oracle@oracle dbs]$ rman target / Recovery Manager: Release 10.2.0.5.0 - Production on Fri Nov 7 12:59:20 2014 Copyright (c) 1982, 2007, Oracle. All rights reserved. connected to target database (not started) RMAN> startup nomount Oracle instance started Total System Global Area 599785472 bytes Fixed Size 2098112 bytes Variable Size 171969600 bytes Database Buffers 419430400 bytes Redo Buffers 6287360 bytes RMAN> exit Recovery Manager complete. [oracle@oracle dbs]$ sqlplus / as sysdba SQL*Plus: Release 10.2.0.5.0 - Production on Fri Nov 7 13:00:15 2014 Copyright (c) 1982, 2010, Oracle. All Rights Reserved. Connected to: Oracle Database 10g Enterprise Edition Release 10.2.0.5.0 - 64bit Production With the Partitioning, Oracle Label Security, OLAP, Data Mining Scoring Engine and Real Application Testing options SQL> create spfile from pfile; File created. SQL> shutdown ORA-01507: database not mounted ORACLE instance shut down. SQL> startup nomount ORACLE instance started. Total System Global Area 599785472 bytes Fixed Size 2098112 bytes Variable Size 171969600 bytes Database Buffers 419430400 bytes Redo Buffers 6287360 bytes SQL> exit Disconnected from Oracle Database 10g Enterprise Edition Release 10.2.0.5.0 - 64bit Production With the Partitioning, Oracle Label Security, OLAP, Data Mining Scoring Engine and Real Application Testing options **************************** [oracle@oracle dbs]$ rman target sys/oracle@jadl10g auxiliary sys/oracle@d10g Recovery Manager: Release 10.2.0.5.0 - Production on Fri Nov 7 13:26:11 2014 Copyright (c) 1982, 2007, Oracle. All rights reserved. RMAN-00571: =========================================================== RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS =============== RMAN-00571: =========================================================== RMAN-00554: initialization of internal recovery manager package failed RMAN-04005: error from target database: ORA-01031: insufficient privileges
这个错误是由于我的目标数据库没有密码文件造成的。
解决方法就是创建密码文件
[oracle@oracle dbs]$ orapwd file=orapwjadl10g password=oracle **************************** [oracle@oracle dbs]$ rman target sys/oracle@jadl10g auxiliary sys/oracle@d10g Recovery Manager: Release 10.2.0.5.0 - Production on Fri Nov 7 13:34:12 2014 Copyright (c) 1982, 2007, Oracle. All rights reserved. connected to target database: JADL10G (DBID=2011530396) connected to auxiliary database: D10G (not mounted) 执行如下命令(注意必须是远程和本地的顺序): RMAN> duplicate target database to "D10G" nofilenamecheck 2> db_file_name_convert('/u01/oracle/oradata/jadl10g/','/u01/oracle/oradata/d10g/') 3> logfile '/u01/oracle/oradata/d10g/redo01.log' size 10m, 4> '/u01/oracle/oradata/d10g/redo02.log' size 10m; Starting Duplicate Db at 07-NOV-14 using target database control file instead of recovery catalog allocated channel: ORA_AUX_DISK_1 channel ORA_AUX_DISK_1: sid=156 devtype=DISK contents of Memory Script: { set until scn 556591; set newname for datafile 1 to "/u01/oracle/oradata/d10g/system01.dbf"; set newname for datafile 2 to "/u01/oracle/oradata/d10g/undotbs01.dbf"; set newname for datafile 3 to "/u01/oracle/oradata/d10g/sysaux01.dbf"; set newname for datafile 4 to "/u01/oracle/oradata/d10g/users01.dbf"; set newname for datafile 5 to "/u01/oracle/oradata/d10g/example01.dbf"; restore check readonly 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 Starting restore at 07-NOV-14 using channel ORA_AUX_DISK_1 skipping datafile 1; alrea【本文来自鸿网互联 (http://www.68idc.cn)】dy restored to file /u01/oracle/oradata/d10g/system01.dbf skipping datafile 2; already restored to file /u01/oracle/oradata/d10g/undotbs01.dbf skipping datafile 3; already restored to file /u01/oracle/oradata/d10g/sysaux01.dbf skipping datafile 4; already restored to file /u01/oracle/oradata/d10g/users01.dbf skipping datafile 5; already restored to file /u01/oracle/oradata/d10g/example01.dbf restore not done; all files readonly, offline, or already restored Finished restore at 07-NOV-14 sql statement: CREATE CONTROLFILE REUSE SET DATABASE "D10G" RESETLOGS ARCHIVELOG MAXLOGFILES 16 MAXLOGMEMBERS 3 MAXDATAFILES 100 MAXINSTANCES 8 MAXLOGHISTORY 292 LOGFILE GROUP 1 '/u01/oracle/oradata/d10g/redo01.log' SIZE 10 M , GROUP 2 '/u01/oracle/oradata/d10g/redo02.log' SIZE 10 M DATAFILE '/u01/oracle/oradata/d10g/system01.dbf' CHARACTER SET AL32UTF8 contents of Memory Script: { switch clone datafile all; } executing Memory Script datafile 2 switched to datafile copy input datafile copy recid=1 stamp=863013896 filename=/u01/oracle/oradata/d10g/undotbs01.dbf datafile 3 switched to datafile copy input datafile copy recid=2 stamp=863013896 filename=/u01/oracle/oradata/d10g/sysaux01.dbf datafile 4 switched to datafile copy input datafile copy recid=3 stamp=863013896 filename=/u01/oracle/oradata/d10g/users01.dbf datafile 5 switched to datafile copy input datafile copy recid=4 stamp=863013896 filename=/u01/oracle/oradata/d10g/example01.dbf contents of Memory Script: { set until scn 556591; recover clone database delete archivelog ; } executing Memory Script executing command: SET until clause Starting recover at 07-NOV-14 using channel ORA_AUX_DISK_1 starting media recovery archive log thread 1 sequence 1 is already on disk as file /u01/oracle/flash_recovery_area/JADL10G/archivelog/2014_11_07/o1_mf_1_1_b5qkpgh1_.arc archive log thread 1 sequence 2 is already on disk as file /u01/oracle/flash_recovery_area/JADL10G/archivelog/2014_11_07/o1_mf_1_2_b5qkpk0o_.arc archive log thread 1 sequence 1 is already on disk as file /u01/oracle/flash_recovery_area/JADL10G/archivelog/2014_11_07/o1_mf_1_1_b5rqvjwq_.arc archive log thread 1 sequence 2 is already on disk as file /u01/oracle/flash_recovery_area/JADL10G/archivelog/2014_11_07/o1_mf_1_2_b5rqvmxf_.arc archive log filename=/u01/oracle/flash_recovery_area/JADL10G/archivelog/2014_11_07/o1_mf_1_1_b5qkpgh1_.arc thread=1 sequence=1 archive log filename=/u01/oracle/flash_recovery_area/JADL10G/archivelog/2014_11_07/o1_mf_1_2_b5qkpk0o_.arc thread=1 sequence=2 media recovery complete, elapsed time: 00:00:23 Finished recover at 07-NOV-14 contents of Memory Script: { shutdown clone; startup clone nomount ; } executing Memory Script database dismounted Oracle instance shut down connected to auxiliary database (not started) Oracle instance started Total System Global Area 599785472 bytes Fixed Size 2098112 bytes Variable Size 171969600 bytes Database Buffers 419430400 bytes Redo Buffers 6287360 bytes sql statement: CREATE CONTROLFILE REUSE SET DATABASE "D10G" RESETLOGS ARCHIVELOG MAXLOGFILES 16 MAXLOGMEMBERS 3 MAXDATAFILES 100 MAXINSTANCES 8 MAXLOGHISTORY 292 LOGFILE GROUP 1 '/u01/oracle/oradata/d10g/redo01.log' SIZE 10 M , GROUP 2 '/u01/oracle/oradata/d10g/redo02.log' SIZE 10 M DATAFILE '/u01/oracle/oradata/d10g/system01.dbf' CHARACTER SET AL32UTF8 contents of Memory Script: { set newname for tempfile 1 to "/u01/oracle/oradata/d10g/temp01.dbf"; switch clone tempfile all; catalog clone datafilecopy "/u01/oracle/oradata/d10g/undotbs01.dbf"; catalog clone datafilecopy "/u01/oracle/oradata/d10g/sysaux01.dbf"; catalog clone datafilecopy "/u01/oracle/oradata/d10g/users01.dbf"; catalog clone datafilecopy "/u01/oracle/oradata/d10g/example01.dbf"; switch clone datafile all; } executing Memory Script executing command: SET NEWNAME renamed temporary file 1 to /u01/oracle/oradata/d10g/temp01.dbf in control file cataloged datafile copy datafile copy filename=/u01/oracle/oradata/d10g/undotbs01.dbf recid=1 stamp=863013929 cataloged datafile copy datafile copy filename=/u01/oracle/oradata/d10g/sysaux01.dbf recid=2 stamp=863013929 cataloged datafile copy datafile copy filename=/u01/oracle/oradata/d10g/users01.dbf recid=3 stamp=863013929 cataloged datafile copy datafile copy filename=/u01/oracle/oradata/d10g/example01.dbf recid=4 stamp=863013929 datafile 2 switched to datafile copy input datafile copy recid=1 stamp=863013929 filename=/u01/oracle/oradata/d10g/undotbs01.dbf datafile 3 switched to datafile copy input datafile copy recid=2 stamp=863013929 filename=/u01/oracle/oradata/d10g/sysaux01.dbf datafile 4 switched to datafile copy input datafile copy recid=3 stamp=863013929 filename=/u01/oracle/oradata/d10g/users01.dbf datafile 5 switched to datafile copy input datafile copy recid=4 stamp=863013929 filename=/u01/oracle/oradata/d10g/example01.dbf contents of Memory Script: { Alter clone database open resetlogs; } executing Memory Script database opened Finished Duplicate Db at 07-NOV-14 RMAN> exit Recovery Manager complete. 验证是否clone成功: [oracle@oracle dbs]$ sqlplus / as sysdba SQL*Plus: Release 10.2.0.5.0 - Production on Fri Nov 7 14:21:20 2014 Copyright (c) 1982, 2010, Oracle. All Rights Reserved. Connected to: Oracle Database 10g Enterprise Edition Release 10.2.0.5.0 - 64bit Production With the Partitioning, Oracle Label Security, OLAP, Data Mining Scoring Engine and Real Application Testing options SQL> select instance_name from v$instance; INSTANCE_NAME ---------------- d10g
1.密码文件问题
2.网络问题
3.参数问题
4.rman语句 db_file_name_convert 在同一个服务器设置语法有问题
5.注意必须要有备份,远程的话需要copy备份到目标库

命名管道是一种在操作系统中相对比较低级的进程通信方式,它是一种以文件为中介的进程通信方式。在Go语言中,通过os包提供了对命名管道的支持。在本文中,我们将介绍如何在Go中使用命名管道来实现进程间通信。一、命名管道的概念命名管道是一种特殊的文件,可以被多个进程同时访问。在Linux系统中,命名管道是一种特殊的文件类型,它们存在于文件系统的某个位置上,并且可以在

在Go语言中,使用第三方库是非常方便的。许多优秀的第三方库和框架可以帮助我们快速地开发应用程序,同时也减少了我们自己编写代码的工作量。但是如何正确地使用第三方库,确保其稳定性和可靠性,是我们必须了解的一个问题。本文将从以下几个方面介绍如何使用第三方库,并结合具体例子进行讲解。一、第三方库的获取Go语言中获取第三方库有以下两种方式:1.使用goget命令首先

随着传统的多线程模型在高并发场景下的性能瓶颈,协程成为了PHP编程领域的热门话题。协程是一种轻量级的线程,能够在单线程中实现多任务的并发执行。在PHP的语言生态中,协程得到了广泛的应用,比如Swoole、Workerman等框架就提供了对协程的支持。那么,如何在PHP中使用协程呢?本文将介绍一些基本的使用方法以及常见的注意事项,帮助读者了解协程的运作原理,以

随着音频处理在各种应用场景中的普及,越来越多的程序员开始使用Go编写音频处理程序。Go语言作为一种现代化的编程语言,具有优秀的并发性和高效率的特点,使用它进行音频处理十分方便。本文将介绍如何在Go中使用音频处理技术,包括读取、写入、处理和分析音频数据等方面的内容。一、读取音频数据在Go中读取音频数据有多种方式。其中比较常用的是使用第三方库进行读取,比如go-

变量函数是指可以使用变量来调用函数的一种特殊语法。在PHP中,变量函数是非常有用的,因为它可以让我们更加灵活地使用函数。在本文中,我们将介绍如何在PHP中使用变量函数。定义变量函数在PHP中,变量函数的定义方式非常简单,只需要将要调用的函数名赋值给一个变量即可。例如,下面的代码定义了一个变量函数:$func='var_dump';这里将var_dump函

<p>Windows 系统上的 OneDrive 应用程序允许您将文件存储在高达 5 GB 的云上。OneDrive 应用程序中还有另一个功能,它允许用户选择一个选项,是将文件保留在系统空间上还是在线提供,而不占用您的系统存储空间。此功能称为按需文件。在这篇文章中,我们进一步探索了此功能,并解释了有关如何在 Windows 11 电脑上的 OneDrive 中按需使用文件的各种选项。</p><h2>如何使用 On

近年来,WebSocket技术已经成为了Web开发中不可或缺的一部分。WebSocket是一种在单个TCP连接上进行全双工通信的协议,它使得客户端和服务器之间的通信更加流畅和高效。如今,很多现代的Web应用程序都使用了WebSocket技术,例如实时聊天、在线游戏以及实时数据可视化等。Go语言作为一个现代的编程语言,自然也提供了很好的支持WebSock

数据聚合函数是一种用于处理数据库表中多行数据的函数。在PHP中使用数据聚合函数可以使得我们方便地进行数据分析和处理,例如求和、平均数、最大值、最小值等。下面将介绍如何在PHP中使用数据聚合函数。一、介绍常用的数据聚合函数COUNT():计算某一列的行数。SUM():计算某一列的总和。AVG():计算某一列的平均值。MAX():取出某一列的最大值。MIN():


Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

AI Hentai Generator
Generate AI Hentai for free.

Hot Article

Hot Tools

MantisBT
Mantis is an easy-to-deploy web-based defect tracking tool designed to aid in product defect tracking. It requires PHP, MySQL and a web server. Check out our demo and hosting services.

mPDF
mPDF is a PHP library that can generate PDF files from UTF-8 encoded HTML. The original author, Ian Back, wrote mPDF to output PDF files "on the fly" from his website and handle different languages. It is slower than original scripts like HTML2FPDF and produces larger files when using Unicode fonts, but supports CSS styles etc. and has a lot of enhancements. Supports almost all languages, including RTL (Arabic and Hebrew) and CJK (Chinese, Japanese and Korean). Supports nested block-level elements (such as P, DIV),

Zend Studio 13.0.1
Powerful PHP integrated development environment

Dreamweaver CS6
Visual web development tools

Safe Exam Browser
Safe Exam Browser is a secure browser environment for taking online exams securely. This software turns any computer into a secure workstation. It controls access to any utility and prevents students from using unauthorized resources.
