在 Oracle 10g 第 2 版中编辑控制文件 [英] Edit the control file in Oracle 10g Release 2

查看:91
本文介绍了在 Oracle 10g 第 2 版中编辑控制文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我尝试将一个 oracle 数据库服务器克隆到另一个 oracle 数据库服务器.完成克隆后,当我尝试通过启动 SQL Plus 连接到数据库时我收到以下错误:

I tried to clone an oracle database server to another oracle database server. After I completed the cloning, when I tried connecting to the database by starting SQL Plus I got the following errors:

ORA-01157: cannot identify/lock data file 1 - see DBWR trace file
ORA-01110: data file 1: '/home/oracle/oradata/ccisv2/system01.dbf'

我发现在克隆原始数据库位置的控制文件时也被克隆了.

I found that while cloning the control file of the original database location also got cloned.

现在在新服务器中,我的数据文件位于不同的位置.这在控制文件中没有受到影响,这就是错误的原因.

Now in the new server I have the data files located at a different location. and that is not affected in the control file, which is the reason for the error.

总之我需要改变上面的路径

In short I need to change the above path

/home/oracle/oradata/ccisv2/

到新路径

/home2/oracle/oradata/ccisv2/

我不确定如何更改控制文件和编辑数据文件位置的路径.

I am not sure how can I change the control file and edit the path of the data file location.

无法更改数据文件的位置,因为我的空间较少/home/oracle/oradata/..

Changing of the location of datafiles is not possible as I have less space in /home/oracle/oradata/..

有人可以帮我解决这个问题吗...

Can some one help me with this one...

推荐答案

您需要挂载数据库(而不是打开它)并重新创建控制文件,重命名进程中的数据文件(请参阅创建控制文件命令):

You'll need to mount the database (not open it) and re-create the controlfile, renaming the data files in the process (see the CREATE CONTROLFILE command):

STARTUP MOUNT;
CREATE CONTROLFILE REUSE SET DATABASE "ORCL" RESETLOGS 
    MAXLOGFILES NN
    MAXLOGMEMBERS N
    MAXDATAFILES 254
    MAXINSTANCES 1
    MAXLOGHISTORY 1815
LOGFILE
  GROUP 1 '/home2/oracle/oradata/ccisv2/REDO01.LOG'  SIZE 56M,
  GROUP 2 '/home2/oracle/oradata/ccisv2/REDO02.LOG'  SIZE 56M,
  GROUP 3 '/home2/oracle/oradata/ccisv2/REDO03.LOG'  SIZE 56M
DATAFILE
  '/home2/oracle/oradata/ccisv2/SYSTEM.DBF',
  '/home2/oracle/oradata/ccisv2/USERS.DBF',
  '/home2/oracle/oradata/ccisv2/sysaux.DBF',
  '/home2/oracle/oradata/ccisv2/TOOLS.DBF',
etc...
CHARACTER SET WE8ISO8859P1;

ALTER DATABASE OPEN RESETLOGS;

QUIT;

您的所有数据库文件都需要在控制文件中使用它们的新位置重新标识.

All of your database files need to be re-identified in the controlfile with their new location.

这篇关于在 Oracle 10g 第 2 版中编辑控制文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆