Saturday, 3 November 2012

Controlfile create script

Control file creation script  can be extracted in many ways

1. alter database backup controlfile to trace;

2. dbms_resotre.restoreControlfile

3. using views

select ' CREATE CONTROLFILE REUSE DATABASE "ORCL" RESETLOGS  ARCHIVELOG ' from dual
/
Select ' MAXDATAFILES ' || records_total from v$controlfile_record_section where type = 'DATAFILE'
/
Select ' MAXLOGHISTORY ' || records_total  from v$controlfile_record_section where type = 'LOG HISTORY'
/
Select ' MAXINSTANCES ' || records_total  from v$controlfile_record_section where type = 'DATABASE'
/
Select ' MAXLOGFILES ' || records_total  from v$controlfile_record_section where type = 'REDO LOG'
/
Select ' MAXLOGMEMBERS ' || dimlm from x$kccdi/
select ' LOGFILE ' from dual
/
select ' GROUP ' || group# || ' ''' ||  member ||'''' from v$logfile
/
select ' datafile ' from dual
/
select ' ''' || file_name ||'''' from dba_data_files
/
select ' alter tablespace ' || tablespace_name || ' add tempfile ' || file_name || ' ; ' from dba_temp_files;
/

No comments:

Post a Comment

ZFS

Public Cloud tools comparison