Machine A:
Select instance_name from V$instance;
Select name from V$database;
Select name from V$datafile;
Query log mode:
Archive log list;
Shutdown immediate;
startup Mount;
Change Log to archive mode:
ALTER DATABASE Archivelog;
ALTER DATABASE open;
Alter system archive log current;
Select name from V$archived_log;
To turn on control file tracking:
ALTER DATABASE backup Controlfile to trace;
To view the location of the trace file:
Show Parameter User_dump_dest
Cmd:
Set ORACLE_SID=ORCL
Rman Target SYS/ABC
Host "MD C:\back";
Run
{
Backup database;
Format ' C:\back\%d_%s_%T_full.bak ';
}
Select File#,name from V$datafile;
Transfer the following file to Machine B:
C:\back
D:\oracle\product\10.2.0\admin\orcl
CREATE controlfile SET DATABASE "ORCL" Resetlogs Archivelog
Maxlogfiles 16
Maxlogmembers 3
Maxdatafiles 100
Maxinstances 8
Maxloghistory 292
LOGFILE
GROUP 1 ' E:\ORACLE\PRODUCT\10.2.0\ORADATA\ORCL\REDO01. LOG ' SIZE 50M,
GROUP 2 ' E:\ORACLE\PRODUCT\10.2.0\ORADATA\ORCL\REDO02. LOG ' SIZE 50M,
GROUP 3 ' E:\ORACLE\PRODUCT\10.2.0\ORADATA\ORCL\REDO03. LOG ' SIZE 50M
--STANDBY LOGFILE
DataFile
' E:\ORACLE\PRODUCT\10.2.0\ORADATA\ORCL\SYSTEM01. DBF ',
' E:\ORACLE\PRODUCT\10.2.0\ORADATA\ORCL\UNDOTBS01. DBF ',
' E:\ORACLE\PRODUCT\10.2.0\ORADATA\ORCL\SYSAUX01. DBF ',
' E:\ORACLE\PRODUCT\10.2.0\ORADATA\ORCL\USERS01. DBF ',
' E:\ORACLE\PRODUCT\10.2.0\ORADATA\ORCL\XM '
CHARACTER SET ZHS16GBK
Machine B:
Create a directory to restore Oracle
E:\oracle\product\10.2.0\oradata\orcl
E:\oracle\product\10.2.0\admin
E:\oracle\product\10.2.0\falsh_recovery_area
Put the received folder ORCL into E:\oracle\product\10.2.0\admin
Copy
E:\oracle\product\10.2.0\admin\orcl\pfile the parameter file to your own real database Db_1\database folder, and renamed to Initorcl.ora
Open Initorcl.ora
Change the path inside to the location of the real Oracle database
D:\ replaced by e:\
CMD1:
Set ORACLE_SID=ORCL
Oracle ORCL
Wait until the prompt Ctrl + C
CMD2:
Set ORACLE_SID=ORCL
Sqlplus/as SYSDBA
Startup Nomount;
CMD3:
Set ORACLE_SID=ORCL
Rman Target SYS/ABC
Restore Controlfile from ' C:\back\ORCL_2_20090414_FULL. BAK ';
CMD2:
ALTER DATABASE Mount;
CMD3:
run{
Set newname for datafile 1 to ' E:\oracle\product\10.2.0\oradata\orcl\SYSTEM01. DBF ';
Set newname for datafile 2 to ' E:\oracle\product\10.2.0\oradata\orcl\UNDOTBS01. DBF ';
Set newname for DataFile 3 to ' E:\oracle\product\10.2.0\oradata\orcl\SYSAUX01. DBF ';
Set newname for datafile 4 to ' E:\oracle\product\10.2.0\oradata\orcl\USERS01. DBF ';
Set newname for datafile 5 to ' E:\oracle\product\10.2.0\oradata\orcl\XM ';
Restore database;
Switch datafile all;
}
CMD2:
Select name from V$database;
Shutdown immediate;
startup Mount;
ALTER DATABASE backup Controlfile to trace;
Locate the trace file:
Redo control File: Change the path inside to the correct path:
D:\ changed to E:\
Shutdown immediate;
Startup Nomount;
Execute the statement that generated the control file; The file for execution must first delete the. ctl files
ALTER DATABASE open resetlogs;
Select name from V$database;
Select member from V$logfile;
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.