Database Clone by rebuilding control file.
前面我們用了rman 裡的duplicate方法去在本機clone個db, 這裡我們用CREATE CONTROLFILE 方法在另一臺伺服器上Clone. 缺點是用這個方法clone, 需要shutdown 原資料庫,傳輸datafile到另臺伺服器。
1- tar $ORACLE_HOME for 10.2.0 and 11.1.0 on ora6
tar –cvf
2- scp them to srv7 (if the file is too large, may face File is too large issue. use ulimit –a to see the limitation).
scp jxiaos@EAP-SRV6:/u01/app/oracle/product/ora11g.tar /u01
scp jxiaos@EAP-SRV6:/u04/oradata/OLD_DB/*.* /u04/oradata/CLONEDDB/
[oracle@EAP-SRV7] :/u01 > scp jxiaos@EAP-SRV6:/u01/app/oracle/product/ora11g.tar /u01/
jxiaos@EAP-SRV6's password:
ora11g.tar 1% 198MB 30.3MB/s 07:24 ETA
cp ~.profile to srv7
3- untar and relink
tar –xvf
export ORACLE_HOME=/u01/app/oracle/product/10.2.0
cd $ORACLE_HOME/oui/bin
$ORACLE_HOME/oui/bin/runInstaller -silent -clone ORACLE_BASE="/u01/app/oracle" ORACLE_HOME="/u01/app/oracle/product/10.2.0" ORACLE_HOME_NAME="OraClient10g_home1" -invPtrLoc="/etc"
export ORACLE_HOME=/u01/app/oracle/product/11.1.0
cd $ORACLE_HOME/oui/bin
./runInstaller -clone -silent -jreloc /usr/java5_64/jre -ignorePreReq ORACLE_HOME="/u01/app/oracle/product/11.1.0" ORACLE_HOME_NAME="OraDb11g_home1" ORACLE_BASE="/u01/app/oracle"
4-
Create cre_ctl.sql (create control file)
alter database backup controlfile to trace;
get the statement in /u01/app/oracle/admin/diag/rdbms/OLD_DB/OLD_DB/trace/OLD_DB_vktm_20775158.trc
--修改REUSE to SET,因為我們要不同的資料庫名。
CREATE CONTROLFILE SET DATABASE "CLONEDDB" RESETLOGS NOARCHIVELOG
MAXLOGFILES 20
MAXLOGMEMBERS 3
MAXDATAFILES 1000
MAXINSTANCES 1
MAXLOGHISTORY 584
LOGFILE
GROUP 1 '/u02/oradata/CLONEDDB/CLONEDDB_redo01m1.log' SIZE 200M,
GROUP 2 '/u02/oradata/CLONEDDB/CLONEDDB_redo02m1.log' SIZE 200M,
GROUP 3 '/u02/oradata/CLONEDDB/CLONEDDB_redo03m1.log' SIZE 200M,
GROUP 4 '/u02/oradata/CLONEDDB/CLONEDDB_redo04m1.log' SIZE 200M,
GROUP 5 '/u02/oradata/CLONEDDB/CLONEDDB_redo05m1.log' SIZE 200M,
GROUP 6 '/u02/oradata/CLONEDDB/CLONEDDB_redo06m1.log' SIZE 200M,
GROUP 7 '/u02/oradata/CLONEDDB/CLONEDDB_redo07m1.log' SIZE 200M,
GROUP 8 '/u02/oradata/CLONEDDB/CLONEDDB_redo08m1.log' SIZE 200M
-- STANDBY LOGFILE
DATAFILE
'/u04/oradata/CLONEDDB/CLONEDDB_system01.dbf',
'/u04/oradata/CLONEDDB/CLONEDDB_sysaux01.dbf',
'/u04/oradata/CLONEDDB/CLONEDDB_undotbs1.dbf',
'/u04/oradata/CLONEDDB/CLONEDDB_cists01.dbf',
'/u04/oradata/CLONEDDB/CLONEDDB_tools01.dbf',
'/u04/oradata/CLONEDDB/CLONEDDB_tivoliorts01.dbf',
'/u04/oradata/CLONEDDB/CLONEDDB_cists03.dbf',
'/u04/oradata/CLONEDDB/CLONEDDB_cists04.dbf',
......
CHARACTER SET WE8ISO8859P1
;
Shutdown db OLD_DB
scp ~oracle/admin/OLD_DB/cre_ctl.sql to srv7
scp /u04/oradata/OLD_DB/* to srv7
(the oradata is very large, use nohup scp jxiaos@EAP-SRV6:/u04/oradata/OLD_DB/*.* /u04/oradata/CLONEDDB &
scp initCLONEDDB.ora
********************************************************************
1. nohup scp jxiaos@EAP-SRV6:/u04/oradata/OLD_DB/*.* /u04/oradata/CLONEDDB
2.輸入密碼
3.按Ctrl+z掛起當前程式
4.使用命令bg讓掛起的程式繼續執行 退出系統後,這種方法好像不行。 使用這種方法:echo "/pathname/script.sh"|at now
********************************************************************
5 create
/u01/app/oracle/admin/CLONEDDB/pfile/initCLONEDDB.ora
cd $ORACLE_HOME/dbs
ln -s /u01/app/oracle/admin/CLONEDDB/pfile/initCLONEDDB.ora .
~admin/CLONEDDB,/.. and CLONEDDB/adump,pfile,rman (diag will be created automatically after lsnrctl start once)
u*/oradata/CLONEDDB
/var/opt/oracle/oratab, -> CLONEDDB:/u01/app/oracle/product/11.1.0:Y
.profile
/opt/bin/oraenv and dbhome
/var/opt/oracle/*
ln -s /var/opt/oracle/listener.ora .
ln -s /var/opt/oracle/tnsnames.ora .
6 startup nomount
@cre_ctl.sql
7 Open resetlogs: alter database open resetlogs;
8 Change dbid ;
startup mount
nid target=/ (this command not on sqlplus)
startup mount;
alter database open resetlogs;
select dbid, name from v$database;
SQL> select dbid, name from v$database;
DBID NAME
---------- ---------
4134645123 CLONEDDB
9. add temp file:
alter tablespace TEMP add tempfile '/u04/oradata/CLONEDDB/CLONEDDB_temp01.dbf' size 4096M REUSE;
10 - start listener
11- copy dba directory to srv7 and configure cron (not done it yet)
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/14377/viewspace-1060424/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- Oracle clone databaseOracleDatabase
- Clone a database on the same serverDatabaseServer
- How a Clone Database Is Mounted (296)Database
- Manually Backup - Restore or Clone a Database to Another Node [ID 562556.1]RESTDatabase
- Oracle 12Cr2 Using CloneDB to clone a databaseOracleDatabase
- Troubleshooting Database Control Startup IssuesDatabase
- recover database using backup control fileDatabase
- 【EM】重新建立EM Database ControlDatabase
- 對Database control 做金鑰管理Database
- ENTERPRISE MANAGER 12C DATABASE AS A SERVICE (DBaaS) SNAP CLONEDatabase
- 企業管理器(OEM)介紹: Grid Control 和 Database ControlDatabase
- 安裝oracle 10g EM database controlOracle 10gDatabase
- 10.2.0.4 DBCA problem :Error securing Database Control,...ErrorDatabase
- 如何通過emca來修改Database Control HTTP 埠DatabaseHTTP
- 重新建立Grid Control的Repository DatabaseDatabase
- How To Drop, Create And Recreate DB Control In A 10g DatabaseDatabase
- clone database using RMAN without new incarnation (with NORESETLOGS)_1608236.1Database
- PHP中 new clone __clone區別PHP
- 【樹形dp】poj 1947 Rebuilding RoadsRebuild
- ORA-01103: database name 'ORCLDG' in control file is not 'ORCL'Database
- ftp_rawlist: Unable to create temporary file.FTP
- VMware vmdk錯誤: Failed to lock the file.AI
- jQuery clone()jQuery
- sourcetree github clone 報錯 hg clone fails with “repository not found“GithubAI
- POJ 1947 Rebuilding Roads(基礎的樹形dp)Rebuild
- 主機名改名後oracle database control 無法啟動的問題OracleDatabase
- SSH 方式 Git cloneGit
- js2-cloneJS
- java的 clone方法Java
- 克隆(clone) ORACLE HOMEOracle
- Oracle軟體cloneOracle
- java clone機制Java
- Clone (克隆) ORACLE HOMEOracle
- 2 Day DBA-開始資料庫管理-建立Database Control管理使用者資料庫Database
- js deep clone 深克隆JS
- github clone 指定的tagGithub
- Linux Clone函式Linux函式
- A example that using JQuery clonejQuery