Manually Backup - Restore or Clone a Database to Another Node [ID 562556.1]
In this Document
Applies to:
Oracle Server - Enterprise Edition - Version 7.3.4.0 and laterInformation in this document applies to any platform.
Goal
This note gives a step by step guide about how to manually clone or restore the database to a different host.
Fix
1) Prerequisites
----------------
- The copy of the datafiles must be done with the database closed or the database must be in ARCHIVELOG mode.
To determine the Database is in Archivemode or Noarchivemode use:
2) Init
----------------------------------------------------
- You need to copy the init.ora or spfile file to the target host
and locate it in ORACLE_HOME\dbs
- Copy the
Controlfile(s),
all the Datafiles
all the Archivelogs generated,
to the target host.
# To copy the Controlfile,
- either do a clean shutdown the Database, then take a cold copy of the controlfile
- or if database is open and Online Backup is taken do:
-- Hint:
Do this to get a creation script. for the controlfile, in case needed.
The following statement writes a tracefile to the 'trace' directory containing 'Create Controlfile' Statements
.
SQL> alter database backup controlfile to trace ;
# To backup the Database if database is open then, you need to put all the tablespaces in BACKUP MODE,
before starting the copy of the database/datafiles :
SQL> select tablespace_name from dba_tablespaces;
SQL> ALTER TABLESPACE
.
> copy all the tablespace 'datafiles'
.
SQL> ALTER TABLESPACE
# ==> Do this copy for 'ALL THE TABLESPACES/Datafiles' in the Database !!
# Comment: Starting with Oracle 10g:
you can use the BEGIN BACKUP on 'database' level, instead of 'tablespace' level :
SQL> alter DATABASE begin backup;
.
> copy all the tablespace 'datafiles'
.
SQL> alter DATABASE end backup;
3) Set the oracle environment
-------------------------
C:\> sqlplus "sys/password as sysdba"
- Check the init
control_files =
background_dump_dest = bdump>
core_dump_dest = cdump>
user_dump_dest = udump>
log_archive_dest_1 =
4) Set up a password file for the duplicated database
5) If Windows Platform, create a new NT service for the 'cloned' duplicated database using oradim.
# or
C:\> oradim -new -sid -intpwd -maxusers 10 -startmode manual -pfile ''
6) Startup the database in mount status
-- Rename any of the datafiles to the new location, if necessary:
SQL> ALTER DATABASE RENAME FILE
'/FULL_PATH_OF_OLD_LOCATION/AND_DATAFILE_NAME.DBF'
TO
'/FULL_PATH_OF_NEW_LOCATION/AND_DATAFILE_NAME.DBF';
-- Rename the logfiles to the new location if necessary
SQL> alter database rename file '
7) Check that all the datafiles are in the right location and ONLINE:
8) Perform. incomplete recovery:
Forward the database applying archived redo log files until you decide
to stop recovery by typing 'CANCEL' at the prompt
(assuming that you have required archived redo log files in the log_archive_dest directory)
.
You may archive the source database redo log files and apply them at
the target database if required.
9) In Windows platforms, if you want that the database will start automatically then edit the registry:
go to
HKEY_LOCAL_MACHINE\SOFTWARE\ORACLE\HOMEX
.
change the key : ORA_
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/17252115/viewspace-753280/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- Cold backup and restore the entire databaseRESTDatabase
- HowTo Restore RMAN Disk backups of RAC Database to Single Instance On Another Node [ID 415579.1]RESTDatabase
- How to restore and recover a database from an RMAN backup_881395.1RESTDatabase
- Create database manuallyDatabase
- HowTo Restore RMAN Disk backups of RAC Database to Single Instance On Another NoRESTDatabase
- How to drop Oracle RAC database manually?OracleDatabase
- SQL Server Backup & RestoreSQLServerREST
- TFS Express backup and restoreExpressREST
- backup and restore tipsREST
- Oracle clone databaseOracleDatabase
- PL/SQL package SYS.DBMS_BACKUP_RESTORE version 19.16.00.00 in TARGET database isSQLPackageRESTDatabase
- Clone a database on the same serverDatabaseServer
- 通過dbms_backup_restore修改oracle的dbidRESTOracle
- backup or restore OLR in 11.2 Grid Infrastructure (Doc ID 1193643.1)RESTASTStruct
- DBMS_BACKUP_RESTORE.DBMS_BACKUP_RESTORE用於特殊情況下的恢復REST
- read only tablespace backup restoreREST
- RMAN restore validate database報ORA-19693RESTDatabase
- How a Clone Database Is Mounted (296)Database
- restore database check readonlyRESTDatabase
- 轉貼_RMAN-DBMS_BACKUP_RESTOREREST
- RMAN backup validate database on databases in noarchivelog modeDatabaseHive
- 【MOS】How to backup or restore OLR in 11.2/12c Grid InfrastructureRESTASTStruct
- RMAN : Consistent Backup, Restore and Recovery using RMAN (Doc ID 162855.1)REST
- How to Move or Copy a Tablespace to Another Database (61)Database
- oracle full database backupOracleDatabase
- Rman backup standby databaseDatabase
- Cold Database backup scriptDatabase
- Oracle rac使用nid和dbms_backup_restore包修改dbid和dbnameOracleREST
- oracle database backup and recovery user's guide part IVOracleDatabaseGUIIDE
- oracle database backup and recovery user's guide part IIIOracleDatabaseGUIIDE
- How to Create or Remove Restore Point on Standby database (文件 ID 1672977.1)REMRESTDatabase
- How To Restore Archivelogs That Belongs To Another Incarnation_1326236.1RESTHive
- rman backup database force 功能Database
- oracle database backup and recovery user's guide part VII & VIIIOracleDatabaseGUIIDE
- oracle database backup and recovery user's guide part V & VIOracleDatabaseGUIIDE
- oracle database backup and recovery user's guide part I & IIOracleDatabaseGUIIDE
- RMAN10g: backup copy of database (Doc ID 266980.1)Database
- db2備份恢復(backup restore)DB2REST