【使用rman复制数据库10g--clone-1】
目标数据库: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备份到目标库

熱AI工具

Undresser.AI Undress
人工智慧驅動的應用程序,用於創建逼真的裸體照片

AI Clothes Remover
用於從照片中去除衣服的線上人工智慧工具。

Undress AI Tool
免費脫衣圖片

Clothoff.io
AI脫衣器

Video Face Swap
使用我們完全免費的人工智慧換臉工具,輕鬆在任何影片中換臉!

熱門文章

熱工具

記事本++7.3.1
好用且免費的程式碼編輯器

SublimeText3漢化版
中文版,非常好用

禪工作室 13.0.1
強大的PHP整合開發環境

Dreamweaver CS6
視覺化網頁開發工具

SublimeText3 Mac版
神級程式碼編輯軟體(SublimeText3)

MetaMask(中文也叫小狐狸錢包)是一款免費的、廣受好評的加密錢包軟體。目前,BTCC已支援綁定MetaMask錢包,綁定後可使用MetaMask錢包進行快速登錄,儲值、買幣等,且首次綁定還可獲得20USDT體驗金。在BTCCMetaMask錢包教學中,我們將詳細介紹如何註冊和使用MetaMask,以及如何在BTCC綁定並使用小狐狸錢包。 MetaMask錢包是什麼? MetaMask小狐狸錢包擁有超過3,000萬用戶,是當今最受歡迎的加密貨幣錢包之一。它可免費使用,可作為擴充功能安裝在網絡

蘋果公司最新發布的iOS18、iPadOS18以及macOSSequoia系統為Photos應用程式增添了一項重要功能,旨在幫助用戶輕鬆恢復因各種原因遺失或損壞的照片和影片。這項新功能在Photos應用的"工具"部分引入了一個名為"已恢復"的相冊,當用戶設備中存在未納入其照片庫的圖片或影片時,該相冊將自動顯示。 "已恢復"相簿的出現為因資料庫損壞、相機應用未正確保存至照片庫或第三方應用管理照片庫時照片和視頻丟失提供了解決方案。使用者只需簡單幾步

PHP處理資料庫連線報錯,可以使用下列步驟:使用mysqli_connect_errno()取得錯誤代碼。使用mysqli_connect_error()取得錯誤訊息。透過擷取並記錄這些錯誤訊息,可以輕鬆識別並解決資料庫連接問題,確保應用程式的順暢運作。

如何在PHP中使用MySQLi建立資料庫連線:包含MySQLi擴充(require_once)建立連線函數(functionconnect_to_db)呼叫連線函數($conn=connect_to_db())執行查詢($result=$conn->query())關閉連線( $conn->close())

BitgetLaunchpool是一個為所有加密貨幣愛好者而設計的動態平台。 BitgetLaunchpool以其獨特的產品脫穎而出。在這裡,您可以質押您的代幣來解鎖更多獎勵,包括空投、高額回報,以及專屬早期參與者的豐厚獎金池。什麼是BitgetLaunchpool? BitgetLaunchpool是一個加密貨幣平台,可以透過使用者友善的條款和條件來質押和賺取代幣。透過在Launchpool中投入BGB或其他代幣,用戶有機會獲得免費空投、收益和參與豐厚的獎金池。質押資產的收益在T+1小時內計算,獎勵按

可以透過使用gjson函式庫或json.Unmarshal函數將JSON資料儲存到MySQL資料庫中。 gjson函式庫提供了方便的方法來解析JSON字段,而json.Unmarshal函數需要一個目標類型指標來解組JSON資料。這兩種方法都需要準備SQL語句和執行插入操作來將資料持久化到資料庫中。

在Golang中使用資料庫回呼函數可以實現:在指定資料庫操作完成後執行自訂程式碼。透過單獨的函數新增自訂行為,無需編寫額外程式碼。回調函數可用於插入、更新、刪除和查詢操作。必須使用sql.Exec、sql.QueryRow或sql.Query函數才能使用回呼函數。

透過Go標準庫database/sql包,可以連接到MySQL、PostgreSQL或SQLite等遠端資料庫:建立包含資料庫連接資訊的連接字串。使用sql.Open()函數開啟資料庫連線。執行SQL查詢和插入操作等資料庫操作。使用defer關閉資料庫連線以釋放資源。
