Oracle 11g Database Migration

Source: Internet
Author: User

In some scenarios, we need to migrate the database due to problems such as server replacement, or hard drive corruption.

Oracle database has a variety of backup methods, if you can stop, it is recommended to use cold, the best way to migrate data files directly, so that the efficiency will be relatively high.

Because both hosts are Windows Server, in order to facilitate the direct use of the way to copy files, for special reasons, the pre-migration data directory and the migrated data directory is inconsistent.

The sql> startuporacle routine has been started. Total System Global area 1071333376 bytesfixed size 1334380 bytesvariable size 301990804 byte Sdatabase buffers 754974720 Bytesredo buffers 13033472 bytes database loaded. ORA-01157: Unable to identify/lock data file 1-see DBWR trace file ORA-01110: Data file 1: ' D:\APP\ADMINISTRATOR\ORADATA\AGRISK\SYSTEM01. DBF '

To view the file path:

Sql> select name from V$controlfile;
NAME---------------------------------------------------------F:\APP\ADMINISTRATOR\ORADATA\AGRISK\CONTROL01. Ctlf:\app\administrator\oradata\agrisk\control02. Ctlf:\app\administrator\oradata\agrisk\control03. Ctl
Sql> select name from V$datafile;
NAME---------------------------------------------------------D:\APP\ADMINISTRATOR\ORADATA\AGRISK\SYSTEM01. dbfd:\app\administrator\oradata\agrisk\sysaux01. Dbfd:\app\administrator\oradata\agrisk\undotbs01. Dbfd:\app\administrator\oradata\agrisk\users01. Dbfd:\app\administrator\oradata\agrisk\agrisk. Dbf
Sql> select name from V$tempfile;
NAME---------------------------------------------------------D:\APP\ADMINISTRATOR\ORADATA\AGRISK\TEMP01. Dbfd:\app\administrator\oradata\agrisk\agrisk_temp. Dbf
Sql> Select member from V$logfile;
MEMBER---------------------------------------------------------D:\APP\ADMINISTRATOR\ORADATA\AGRISK\REDO03. Logd:\app\administrator\oradata\agrisk\redo02. Logd:\app\administrator\oradata\agrisk\redo01. LOG

In addition to the path of the control file is normal, the other file path needs to be modified, the original D disk to the F-disk:

sql> alter database rename file  ' D:\APP\ADMINISTRATOR\ORADATA\AGRISK\SYSTEM01. DBF '  to  ' F:\APP\ADMINISTRATOR\ORADATA\AGRISK\SYSTEM01. DBF '; the database has changed. sql> alter database rename file  ' D:\APP\ADMINISTRATOR\ORADATA\AGRISK\SYSAUX01. DBF '  to  ' F:\APP\ADMINISTRATOR\ORADATA\AGRISK\SYSAUX01. DBF '; the database has changed. sql> alter database rename file  ' D:\APP\ADMINISTRATOR\ORADATA\AGRISK\UNDOTBS01. DBF '  to  ' F:\APP\ADMINISTRATOR\ORADATA\AGRISK\UNDOTBS01. DBF '; the database has changed. sql> alter database rename file  ' D:\APP\ADMINISTRATOR\ORADATA\AGRISK\USERS01. DBF '  to  ' F:\APP\ADMINISTRATOR\ORADATA\AGRISK\USERS01. DBF '; the database has changed. sql> alter database rename file  ' D:\APP\ADMINISTRATOR\ORADATA\AGRISK\AGRISK. DBF '  to  ' F:\APP\ADMINISTRATOR\ORADATA\AGRISK\AGRISK. DBF '; the database has changed. sql> alter database rename file  ' D:\APP\ADMINISTRATOR\ORADATA\AGRISk\temp01. DBF '  to  ' F:\APP\ADMINISTRATOR\ORADATA\AGRISK\TEMP01. DBF '; the database has changed. sql> alter database rename file  ' D:\APP\ADMINISTRATOR\ORADATA\AGRISK\AGRISK_TEMP. DBF '  to  ' F:\APP\ADMINISTRATOR\ORADATA\AGRISK\AGRISK_TEMP. DBF '; the database has changed. sql> alter database rename file  ' D:\APP\ADMINISTRATOR\ORADATA\AGRISK\REDO01. LOG '  to  ' F:\APP\ADMINISTRATOR\ORADATA\AGRISK\REDO01. LOG '; the database has changed. sql> alter database rename file  ' D:\APP\ADMINISTRATOR\ORADATA\AGRISK\REDO02. LOG '  to  ' F:\APP\ADMINISTRATOR\ORADATA\AGRISK\REDO02. LOG '; the database has changed. sql> alter database rename file  ' D:\APP\ADMINISTRATOR\ORADATA\AGRISK\REDO03. LOG '  to  ' F:\APP\ADMINISTRATOR\ORADATA\AGRISK\REDO03. LOG '; the database has changed.


After confirming the success of the modification, start the database:

sql> ALTER DATABASE open;


To restart the database:

sql> shutdown immediate; The database is closed. The database has been uninstalled. The ORACLE routine has been closed.
The sql> startuporacle routine has been started. Total System Global area 1071333376 bytesfixed size 1334380 bytesvariable size 301990804 byte Sdatabase buffers 754974720 Bytesredo buffers 13033472 bytes database loaded. The database is already open.



This article is from the "Trying" blog, make sure to keep this source http://tryingstuff.blog.51cto.com/4603492/1952754

Oracle 11g Database Migration

Related Article

Contact Us

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.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.