首页 > 数据库 >rac数据库,数据文件误添加到本地文件系统,被删除。恢复被删除的数据文件 并将数据文件路径改存储到ASM存储

rac数据库,数据文件误添加到本地文件系统,被删除。恢复被删除的数据文件 并将数据文件路径改存储到ASM存储

时间:2022-10-08 11:46:35浏览次数:54  
标签:insert datafile 数据文件 删除 into 存储 shanxia01 _%

恢复被删除的数据文件 并将数据文件路径改存储到ASM存储

create tablespace shanxia01 datafile '/home/oracle/shanxia01.dbf' size 50M;
create user shanxia01 identified by shanxia01 default tablespace shanxia01;
grant dba to shanxia01;
conn shanxia01/shanxia01
create table shanxia01 (id number(10),name varchar2(10));
insert into shanxia01 values(1,'shanxia01');
insert into shanxia01 values(2,'shanxia02');
insert into shanxia01 values(3,'shanxia03');
insert into shanxia01 values(4,'shanxia04');
insert into shanxia01 values(5,'shanxia05');
commit;
create table shanxia02 as select * from shanxia01;
select * from shanxia01;
select * from shanxia02;
alter system checkpoint;

alter system switch logfile;
alter system switch logfile;

 


backup tag shanxia4full format '/soft/20221004/shanxia04_full_fghsdb_%s_%p_%t' (database);
backup tag shanxia4ctl format '/soft/20221004/shanxia04_controlfile_fghsdb_%s_%p_%t' (current controlfile);
backup tag shanxia4pfile format '/soft/20221004/shanxia04_spfile_fghsdb_%s_%p_%t' (spfile);
backup archivelog all format '/soft/20221004/shanxia04_archivelog_%s_%p_%t' delete input;

rm -rf /home/oracle/shanxia01.dbf
alter database datafile '/home/oracle/shanxia01.dbf' offline;
restore datafile 6;
recover datafile 6;


backup as copy datafile 6 format '+DGSYSTEM';
switch datafile '/home/oracle/shanxia01.dbf' to copy;
SQL> recover datafile 6;
alter database datafile 6 online;

conn shanxia01/shanxia01

select name from v$datafile;
insert into shanxia01 values(6,'shanxia06');
commit;
select * from shanxia01;

rm -rf /home/oracle/shanxia01.dbf

标签:insert,datafile,数据文件,删除,into,存储,shanxia01,_%
From: https://www.cnblogs.com/shanxia0812/p/16768440.html

相关文章