Le but est de transferer des datafafiles d un diskgroup a un autre .
select file_id,tablespace_name, file_name,bytes/1024/1024,AUTOEXTENSIBLE,MAXBYTES/1024/1024 "Max Mo" from sys.dba_data_files where tablespace_name in ('RADAIR_PRD_FQ');
create or replace directory src as '+DATARAD/radprd/datafile';
create or replace directory dest as '+DATARAD_OCR/radprd/datafile';
alter database backup controlfile to trace as '/tmp/BFradair_prd.txt';
alter tablespace RADAIR_PRD_FQ offline;
exec DBMS_FILE_TRANSFER.COPY_FILE('SRC','radair_prd_fq_01.dbf','DEST','radair_prd_fq_01.dbf');
exec DBMS_FILE_TRANSFER.COPY_FILE('SRC','radair_prd_fq_02.dbf','DEST','radair_prd_fq_02.dbf');
alter database rename file '+DATARAD/radprd/datafile/radair_prd_fq_01.dbf' to '+DATARAD_OCR/radprd/datafile/radair_prd_fq_01.dbf';
alter database rename file '+DATARAD/radprd/datafile/radair_prd_fq_02.dbf' to '+DATARAD_OCR/radprd/datafile/radair_prd_fq_02.dbf';
alter tablespace RADAIR_PRD_FQ online;
alter database backup controlfile to trace as '/tmp/AFradair_prd.txt';
select file_id,tablespace_name, file_name,bytes/1024/1024,AUTOEXTENSIBLE,MAXBYTES/1024/1024 "Max Mo" from sys.dba_data_files where tablespace_name in ('RADAIR_PRD_FQ');
AS grid user
ALTER DISKGROUP DATARAD DROP FILE '+DATARAD/radprd/datafile/radair_prd_fq_01.dbf';
ALTER DISKGROUP DATARAD DROP FILE '+DATARAD/radprd/datafile/radair_prd_fq_02.dbf';
backup rman
Aucun commentaire:
Enregistrer un commentaire