rac库数据文件创建在os本地的解决办法

  • 时间:
  • 浏览:1
  • 来源:uu快3规律_uu快3下载地址_窍门

按照影响程度大小,方案A须要down库,方案B须要offline tablespace,方案C只需offline datafile即可。综合来看,下面的Testcase_C_2的最好的方法来的最简单。影响也最小。

Testcase_A_2_b:(用rman的copy)

srvctl stop database -d ora11g

RMAN> startup mount

RMAN> copy datafile 7 to '+DATA';

RMAN> switch datafile 7 to copy;

RMAN> alter database open;

srvctl stop instance -d ora11g -i ora11g1

srvctl start database -d ora11g

方案C:

Testcase_C_1:(用create datafile as)

SQL> alter database datafile 7 offline;

SQL> alter database create datafile '/tmp/test.dbf' as '+DATA';

SQL> recover datafile 7;

auto

SQL> alter database datafile 7 online;

另外,邮件中方案C提到的,offline drop的最好的方法,还是不建议采用,可能性offline drop却说 我标记了一下数据文件,在控制文件中,还是会看多这人文件的信息。除非重建控制文件可能性drop整个tablespace。

方案A:

Testcase_A_1: (用ASM的cp)

srvctl stop database -d ora11g

ASMCMD> cp /tmp/test.dbf test01.dbf

SQL> startup mount

SQL> alter database rename file '/tmp/test.dbf' to '+DATA/ora11g/datafile/test01.dbf';

SQL> alter database open;

srvctl stop instance -d ora11g -i ora11g1

srvctl start database -d ora11g

Testcase_A_2_c:(用rman的copy+sqlplus的rename)

srvctl stop database -d ora11g

RMAN> startup mount

RMAN> copy datafile 7 to '+DATA';

SQL> alter database rename file '/tmp/test.dbf' to '+DATA/ora11g/datafile/TEST.272.921855725';

SQL> alter database open;

srvctl stop instance -d ora11g -i ora11g1

srvctl start database -d ora11g

Testcase_C_2:(用rman的copy)

SQL> alter database datafile 7 offline;

RMAN> copy datafile 7 to '+DATA';

RMAN> switch datafile 7 to copy;

RMAN> recover datafile 7;

SQL> alter database datafile 7 online;

Testcase_B_2: (用rman的copy)

SQL> alter tablespace test offline;

RMAN> copy datafile 7 to '+DATA';

RMAN> switch datafile 7 to copy;

SQL> alter tablespace test online;

(具体的测试日志,见附件)

方案B:

Testcase_B_1(用asm的cp)

SQL> alter tablespace test offline;

ASMCMD> cp /tmp/test.dbf test.dbf

SQL> alter database rename file '/tmp/test.dbf' to '+data/ora11g/datafile/test.dbf';

SQL> alter tablespace test online;

Testcase_A_2_a:(用rman的backup as copy)

srvctl stop database -d ora11g

RMAN> startup mount

RMAN> backup as copy datafile 7 format '+DATA';

RMAN> SWITCH DATAFILE 7 to COPY;

SQL> alter database open;

srvctl stop instance -d ora11g -i ora11g1

srvctl start database -d ora11g

另外,recover datafile的然后,不建议使用SQL> alter database recover datafile 7。可能性会挂住。

SQL> alter database recover datafile 7;

alter database recover datafile 7

*

ERROR at line 1:

ORA-00279: change 4025242 generated at 09/06/2016 15:28:47 needed for thread 1

ORA-00289: suggestion :

+FRA/ora11g/archivelog/2016_09_06/thread_1_seq_669.669.921857351

ORA-0023000: change 4025242 for thread 1 is in sequence #669

建议使用: