在 Oracle 10g Release 2 中编辑控制文件

发布于 2024-10-22 09:54:56 字数 628 浏览 3 评论 0原文

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

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

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

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

简而言之,我需要将上述路径更改

/home/oracle/oradata/ccisv2/

为新路径,

/home2/oracle/oradata/ccisv2/

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

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

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

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/

to a new path

/home2/oracle/oradata/ccisv2/

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

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...

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

南烟 2024-10-29 09:54:56

您需要安装数据库(而不是打开它)并重新创建控制文件,在此过程中重命名数据文件(请参阅 CREATE CONTROLFILE 命令):

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;

所有数据库文件都需要在控制文件中重新标识其新位置。

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.

↙温凉少女 2024-10-29 09:54:56

最简单的方法是将数据文件重命名到新位置:

startup mount;
alter database rename file '/home/oracle/oradata/ccisv2/system01.dbf' to '/home2/oracle/oradata/ccisv2/system01.dbf';

并对所有文件执行此操作。
通常我们会使用 rman 复制并使用 file_name 转换来为我们完成此操作。
重新创建控制文件也是一种选择,重命名文件更容易。

Easiest is to just rename the datafiles to the new locations:

startup mount;
alter database rename file '/home/oracle/oradata/ccisv2/system01.dbf' to '/home2/oracle/oradata/ccisv2/system01.dbf';

and do this for all your files.
Normally we would use rman duplicate and use the file_name convert to do this for us.
re-creating the controlfile is also an option, renaming the files is easier.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文