Home Database Mysql Tutorial 迁移数据库的文件到不同路径

迁移数据库的文件到不同路径

Jun 07, 2016 pm 03:41 PM
No different database document path migrate

导读: 迁移数据库的文件到不同路径 1.选择迁移的数据文件: D:/ORACLE/ORADATA/SUN/TEST.ORA http://www.sosdb.com/jdul/dispbbs.asp?boardID=1ID=219page=3 create table name (name varchar2(10)) tablespace test; (1) No Archive Mode (A)迁移数据文件 1

导读:
  迁移数据库的文件到不同路径
<p><font>1.选择迁移的数据文件: <br>D:/ORACLE/ORADATA/SUN/TEST.ORA </font><br><br>http://www.sosdb.com/jdul/dispbbs.asp?boardID=1&ID=219&page=3 </p><br><p>create table name <br>(name varchar2(10)) <br>tablespace test; </p><br><p>(1) No Archive Mode </p><br><p>(A)迁移数据文件 <br>1.看表所在的表空间与数据文件: <br>select d.name , t.name <br>from <br>v$datafile d , v$tablespace t <br>where <br>d.ts#=t.ts#; </p><br><p>2.alter tablespace test offline; <br>move D:/ORACLE/ORADATA/SUN/TEST.ORA D:/oracle/move/TEST.ORA </p><br><p>3. <br>alter database rename file 'D:/ORACLE/ORADATA/SUN/TEST.ORA' to 'D:/oracle/move/TEST.ORA'; </p><br><p>4.alter tablespace test online; </p><br><p>5.迁移成功。 </p><br><p>(B)迁移redolog 文件 <br>1.查看Redolog 的文件的位置所在。 <br>select member from v$logfile; </p><br><p>2.选择要迁移的Redolog的位置, 查看Redolog 位置的状态. <br>select g.member, v.status from <br>v$log v , v$logfile g <br>where <br>v.GROUP#=g.GROUP#; </p><br><p>3.如果日志的状态为CURRENT, 切换日志. <br>alter system switch logfile; </p><br><p>4.移动日志文件的位置 <br>move D:/ORACLE/ORADATA/SUN/REDO03.LOG D:/oracle/move/REDO03.LOG </p><br><p>5.数据字典的更名 <br>alter database rename file 'D:/ORACLE/ORADATA/SUN/REDO03.LOG' to 'D:/oracle/move/REDO03.LOG'; </p><br><p>6.进行切换日志的测试. <br>alter system switch logfile; </p><br><p>7.测试成功. </p><br><p>(2) Archive log Model </p><br><p>SQL> startup mount <br>更改数据库为Archive log 模式 <br>SQL> alter database archivelog <br>SQL> archive log start <br>打开数据库 <br>SQL> alter database open </p><br><p>(C)迁移数据文件 <br>1.看表所在的表空间与数据文件: <br>select d.name , t.name <br>from <br>v$datafile d , v$tablespace t <br>where <br>d.ts#=t.ts#; </p><br><p>2.alter tablespace test offline; <br>move D:/ORACLE/ORADATA/SUN/TEST.ORA D:/oracle/move/TEST.ORA </p><br><p>3. <br>alter database rename file 'D:/ORACLE/ORADATA/SUN/TEST.ORA' to 'D:/oracle/move/TEST.ORA'; </p><br><p>4.恢复数据文件 <br>如果数据库文件的状态是 Recover 执行如下语句 (OFFLINE) 不执行 <br>rocover datafile 'D:/oracle/move/TEST.ORA'; </p><br><p>5.上线 <br>alter tablespace test online; </p><br><p>datafile级的为 <br>alter database datafile db1 offline; <br>move db1 db2 <br>alter database rename file db1 to db2 <br>rocover datafile db2; <br>alter database datafile db2 online; </p><br><p><br>(D)Relolog的迁移 <br>1.查看Redolog 的文件的位置所在。 <br>select member from v$logfile; </p><br><p>2.选择要迁移的Redolog的位置, 查看Redolog 位置的状态. <br>select g.member, v.status from <br>v$log v , v$logfile g <br>where <br>v.GROUP#=g.GROUP#; </p><br><p>3.如果日志的状态为CURRENT, 切换日志. <br>alter system switch logfile; </p><br><p>4.移动日志文件的位置 <br>move D:/ORACLE/ORADATA/SUN/REDO03.LOG D:/oracle/move/REDO03.LOG </p><br><p>5.数据字典的更名 <br>alter database rename file 'D:/ORACLE/ORADATA/SUN/REDO03.LOG' to 'D:/oracle/move/REDO03.LOG'; </p><br><p>6.进行切换日志的测试. <br>alter system switch logfile; </p><br><p>7.测试成功.</p><p> </p>
Copy after login
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

Video Face Swap

Video Face Swap

Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Tools

Notepad++7.3.1

Notepad++7.3.1

Easy-to-use and free code editor

SublimeText3 Chinese version

SublimeText3 Chinese version

Chinese version, very easy to use

Zend Studio 13.0.1

Zend Studio 13.0.1

Powerful PHP integrated development environment

Dreamweaver CS6

Dreamweaver CS6

Visual web development tools

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)

iOS 18 adds a new 'Recovered' album function to retrieve lost or damaged photos iOS 18 adds a new 'Recovered' album function to retrieve lost or damaged photos Jul 18, 2024 am 05:48 AM

Apple's latest releases of iOS18, iPadOS18 and macOS Sequoia systems have added an important feature to the Photos application, designed to help users easily recover photos and videos lost or damaged due to various reasons. The new feature introduces an album called "Recovered" in the Tools section of the Photos app that will automatically appear when a user has pictures or videos on their device that are not part of their photo library. The emergence of the "Recovered" album provides a solution for photos and videos lost due to database corruption, the camera application not saving to the photo library correctly, or a third-party application managing the photo library. Users only need a few simple steps

How does Hibernate implement polymorphic mapping? How does Hibernate implement polymorphic mapping? Apr 17, 2024 pm 12:09 PM

Hibernate polymorphic mapping can map inherited classes to the database and provides the following mapping types: joined-subclass: Create a separate table for the subclass, including all columns of the parent class. table-per-class: Create a separate table for subclasses, containing only subclass-specific columns. union-subclass: similar to joined-subclass, but the parent class table unions all subclass columns.

Detailed tutorial on establishing a database connection using MySQLi in PHP Detailed tutorial on establishing a database connection using MySQLi in PHP Jun 04, 2024 pm 01:42 PM

How to use MySQLi to establish a database connection in PHP: Include MySQLi extension (require_once) Create connection function (functionconnect_to_db) Call connection function ($conn=connect_to_db()) Execute query ($result=$conn->query()) Close connection ( $conn->close())

Full analysis of Go language file renaming operation Full analysis of Go language file renaming operation Apr 08, 2024 pm 03:30 PM

The os.Rename function is used in Go language to rename files. The syntax is: funcRename(oldpath,newpathstring)error. This function renames the file specified by oldpath to the file specified by newpath. Examples include simple renaming, moving files to different directories, and ignoring error handling. The Rename function performs an atomic operation and may only update directory entries when the two files are in the same directory. Renames may fail across volumes or while a file is in use.

Cloud Modernization with C++: Migrating Legacy Applications to the Cloud Cloud Modernization with C++: Migrating Legacy Applications to the Cloud Jun 01, 2024 am 09:21 AM

The best way to move legacy C++ applications to the cloud: Re-platform: Move the application code to a cloud-native platform (such as Kubernetes) and leverage cloud services. Cloudization: Deploy applications on cloud platforms and utilize cloud services without code refactoring.

How to handle database connection errors in PHP How to handle database connection errors in PHP Jun 05, 2024 pm 02:16 PM

To handle database connection errors in PHP, you can use the following steps: Use mysqli_connect_errno() to obtain the error code. Use mysqli_connect_error() to get the error message. By capturing and logging these error messages, database connection issues can be easily identified and resolved, ensuring the smooth running of your application.

An in-depth analysis of how HTML reads the database An in-depth analysis of how HTML reads the database Apr 09, 2024 pm 12:36 PM

HTML cannot read the database directly, but it can be achieved through JavaScript and AJAX. The steps include establishing a database connection, sending a query, processing the response, and updating the page. This article provides a practical example of using JavaScript, AJAX and PHP to read data from a MySQL database, showing how to dynamically display query results in an HTML page. This example uses XMLHttpRequest to establish a database connection, send a query and process the response, thereby filling data into page elements and realizing the function of HTML reading the database.

How to transfer WeChat chat history to another mobile phone How to transfer WeChat chat history to another mobile phone May 08, 2024 am 11:20 AM

1. On the old device, click "Me" → "Settings" → "Chat" → "Chat History Migration and Backup" → "Migrate". 2. Select the target platform device to be migrated, select the chat records to be migrated, and click "Start". 3. Log in with the same WeChat account on the new device and scan the QR code to start chat record migration.

See all articles