Home Database Mysql Tutorial oracle冷备份迁移数据库到其他机器步骤

oracle冷备份迁移数据库到其他机器步骤

Jun 07, 2016 pm 04:20 PM
oracle backup database machine step migrate

步骤很简单:关源库-拷贝到目标机器-启动到mount状态重命名-open数据库 登录源数据库所在主机 建立映射目录 192.168.1.2oradata 映射为 z: 盘 映射完毕后检查是否允许写入文件 需要注意关闭目标数据库位置服务器的防火墙 搜集源库信息 实例名、版本、块大

  步骤很简单:关源库->拷贝到目标机器->启动到mount状态重命名->open数据库

  登录源数据库所在主机

  建立映射目录 192.168.1.2oradata 映射为 z: 盘

  映射完毕后检查是否允许写入文件

  需要注意关闭目标数据库位置服务器的防火墙

  搜集源库信息

  实例名、版本、块大小、表空间、数据文件

  select * from v$instance;

  select * from v$database;

  select * from v$tablespace;

  select * from v$datafile;

  在源库上整理需拷贝的文件

  执行文件cp.sql,其内容如下:

  set linesize 130 pagesize 2000

  set trimspool on

  set echo off

  set verify off

  set timing off

  set feedback off

  set head off

  set echo off

  spool cpfile.bat

  select 'copy '||name||' z:orcl'|| substr(name, instr(name, '', -1) + 1) cmd from v$controlfile

  union all

  select 'copy '||member||' z:orcl'|| substr(member, instr(member, '', -1) + 1) cmd from v$logfile

  union all

  select 'copy '||name||' z:orcl'|| substr(name, instr(name, '', -1) + 1) cmd from v$datafile

  union all

  select 'copy '||name||' z:orcl'|| substr(name, instr(name, '', -1) + 1) cmd from v$tempfile

  union all

  select 'copy '||value||' z:orcl'|| substr(value, instr(value, '', -1) + 1) cmd from v$parameter where;

  spool off

  生成改名脚本

  执行文件ren.sql ,,其内容如下:

  set linesize 130 pagesize 2000

  set trimspool on

  set echo off

  set verify off

  set timing off

  set feedback off

  set head off

  set echo off

  spool renfile.sql

  select 'ALTER DATABASE RENAME FILE '''||member||''' to ''d:oradataorcl'|| substr(member, instr(member, '', -1) + 1)||'''; ' cmd from v$logfile

  union all

  select 'ALTER DATABASE RENAME FILE '''||name||''' to ''d:oradataorcl'|| substr(name, instr(name, '', -1) + 1)||'''; ' cmd from v$datafile

  union all

  select 'ALTER DATABASE RENAME FILE '''||name||''' to ''d:oradataorcl'|| substr(name, instr(name, '', -1) + 1)||'''; ' cmd from v$tempfile;

  spool off

  create pfile from spfile;

  关闭源库

  host lsnrctl stop

  shutdown immediate

  将windows服务设置为手工启动(关键!!! 防止万一复制出现问题还可以重新复制一致的文件)

  拷贝控制文件、日志文件、数据文件,

  host cpfile.bat

  startup

  host lsnrctl start

  拷贝pfile、 tnsname.ora、 口令文件、renfile.sql

  在目标数据库修改参数文件中的控制文件内容

  配置启动参数文件pfile,修改控制文件位置及路径信息

  启动到mount状态

  sqlplus "/as sysdba"

  startup mount pfile=?/database/initorcl.ora

  修改文件位置

  SQL> @renfile.sql

  打开数据库

  create spfile from pfile;

  host lsnrctl start

  检查临时文件是否有

  连接测试

  参考命令:

  oradim -NEW -SID test -STARTMODE manual -PFILE "D:Oracleadmintestpfileinittest.ora"

  ALTER DATABASE RENAME FILE 'c:oracleproductoradataexample.dbf'

  TO 'c:oracleproductoradatademos.dbf'

  修改日志组位置

  ALTER DATBASE [database}

  RENAME FILE 'filename’[,'filename']…

  TO 'filename']…

  创建日志组

  ALTER DATABASE ADD LOGFILE GROUP 3

  ('$HOME/ORADATA/u01/log3a.rdo',

  '$HOME/ORADATA/u02/log3b.rdo')

  SIZE 1M;

  添加成员

  ALTER DATABASE ADD LOGFILE MEMBER

  '$HOME/ORADATA/u04/log1c.rdo' TO GROUP 1,

  '$HOME/ORADATA/u04/log2c.rdo' TO GROUP 2,

  '$HOME/ORADATA/u04/log3c.rdo' TO GROUP 3;

  删除日志组

  ALTER DATABASE DROP LOGFILE GROUP 3;

  删除成员

  ALTER DATABASE DROP LOGFILE MEMBER '$HOME/ORADATA/u04/log3c.rdo';

  清除日志

  ALTER DATABASE CLEAR LOGFILE '$HOME/ORADATA/u01/log2a.rdo';

  增加临时文件

  ALTER TABLESPACE temp ADD TEMPFILE '/oradata/temp03.dbf' SIZE 100M;

  删除临时文件:

  ALTER DATABASE TEMPFILE '/oradata/temp02.dbf' DROP INCLUDING DATAFILES;

  250数据库 245G 拷贝时间需要 9 小时

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

AI Hentai Generator

AI Hentai Generator

Generate AI Hentai for free.

Hot Article

R.E.P.O. Energy Crystals Explained and What They Do (Yellow Crystal)
2 weeks ago By 尊渡假赌尊渡假赌尊渡假赌
Repo: How To Revive Teammates
1 months ago By 尊渡假赌尊渡假赌尊渡假赌
Hello Kitty Island Adventure: How To Get Giant Seeds
4 weeks ago By 尊渡假赌尊渡假赌尊渡假赌

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)

This Apple ID is not yet in use in the iTunes Store: Fix This Apple ID is not yet in use in the iTunes Store: Fix Jun 10, 2024 pm 05:42 PM

When logging into iTunesStore using AppleID, this error saying "This AppleID has not been used in iTunesStore" may be thrown on the screen. There are no error messages to worry about, you can fix them by following these solution sets. Fix 1 – Change Shipping Address The main reason why this prompt appears in iTunes Store is that you don’t have the correct address in your AppleID profile. Step 1 – First, open iPhone Settings on your iPhone. Step 2 – AppleID should be on top of all other settings. So, open it. Step 3 – Once there, open the “Payment & Shipping” option. Step 4 – Verify your access using Face ID. step

Steps to upgrade to the latest version of WeChat (Easily master the upgrade method to the latest version of WeChat) Steps to upgrade to the latest version of WeChat (Easily master the upgrade method to the latest version of WeChat) Jun 01, 2024 pm 10:24 PM

WeChat is one of the social media platforms in China that continuously launches new versions to provide a better user experience. Upgrading WeChat to the latest version is very important to keep in touch with family and colleagues, to stay in touch with friends, and to keep abreast of the latest developments. 1. Understand the features and improvements of the latest version. It is very important to understand the features and improvements of the latest version before upgrading WeChat. For performance improvements and bug fixes, you can learn about the various new features brought by the new version by checking the update notes on the WeChat official website or app store. 2. Check the current WeChat version We need to check the WeChat version currently installed on the mobile phone before upgrading WeChat. Click to open the WeChat application "Me" and then select the menu "About" where you can see the current WeChat version number. 3. Open the app

Shazam app not working in iPhone: Fix Shazam app not working in iPhone: Fix Jun 08, 2024 pm 12:36 PM

Having issues with the Shazam app on iPhone? Shazam helps you find songs by listening to them. However, if Shazam isn't working properly or doesn't recognize the song, you'll have to troubleshoot it manually. Repairing the Shazam app won't take long. So, without wasting any more time, follow the steps below to resolve issues with Shazam app. Fix 1 – Disable Bold Text Feature Bold text on iPhone may be the reason why Shazam is not working properly. Step 1 – You can only do this from your iPhone settings. So, open it. Step 2 – Next, open the “Display & Brightness” settings there. Step 3 – If you find that “Bold Text” is enabled

How long will Oracle database logs be kept? How long will Oracle database logs be kept? May 10, 2024 am 03:27 AM

The retention period of Oracle database logs depends on the log type and configuration, including: Redo logs: determined by the maximum size configured with the "LOG_ARCHIVE_DEST" parameter. Archived redo logs: Determined by the maximum size configured by the "DB_RECOVERY_FILE_DEST_SIZE" parameter. Online redo logs: not archived, lost when the database is restarted, and the retention period is consistent with the instance running time. Audit log: Configured by the "AUDIT_TRAIL" parameter, retained for 30 days by default.

WiFi calling not working on iPhone: Fix WiFi calling not working on iPhone: Fix Jun 03, 2024 am 11:16 AM

Can't enable Wi-Fi calling on iPhone? Call quality is improved and you can communicate even from remote locations where cellular networks are not as strong. Wi-Fi Calling also improves standard call and video call quality. So, if you can't use Wi-Fi calling on your phone, these solutions might help you fix the problem. Fix 1 – Enable Wi-Fi Calling Manually You must enable the Wi-Fi Calling feature in your iPhone settings. Step 1 – For this, you have to open Settings. Step 2 – Next, just scroll down to find and open the “Phone” settings Step 3 – In the phone settings, scroll down and open the “Wi-Fi Calling” setting. Step 4 – In the Wi-Fi Calling page, change “This iPhone

How to use MySQL backup and restore in PHP? How to use MySQL backup and restore in PHP? Jun 03, 2024 pm 12:19 PM

Backing up and restoring a MySQL database in PHP can be achieved by following these steps: Back up the database: Use the mysqldump command to dump the database into a SQL file. Restore database: Use the mysql command to restore the database from SQL files.

How much memory does oracle require? How much memory does oracle require? May 10, 2024 am 04:12 AM

The amount of memory required by Oracle depends on database size, activity level, and required performance level: for storing data buffers, index buffers, executing SQL statements, and managing the data dictionary cache. The exact amount is affected by database size, activity level, and required performance level. Best practices include setting the appropriate SGA size, sizing SGA components, using AMM, and monitoring memory usage.

Clear gray Safari history in iPhone: Fixes Clear gray Safari history in iPhone: Fixes Jun 08, 2024 pm 06:44 PM

Is the Clear History button gray in Safari on iPhone? If this is the case, you won't be able to clear history in Safari at all. Stored cookies and website data may cause unsolicited events in your browser. However, if you follow the steps below, you can easily resolve the issue and delete stored user history from Safari. Fix 1 – Disable Content Restrictions Content restrictions on iPhone may limit the correct use of Safari browser. Step 1 – Open iPhone settings. Step 2 – Next, go to Screen Time settings. Step 3 – In Screen Time settings, turn on Content & Privacy Restrictions

See all articles