Create "StartupFile" in the Oracle

StartupFile is a SQL script that allows you to recreate the Controlfile of the database and run it.

The generated script contains only the section " NORESETLOGS case "

A similar script can be obtained by running the command:

alter database backup controlfile to trace as '<FilePath>';



Requests used to generate the file

select min(group#) as min1, max(group#) as max1

  from v$logfile;

select lf.GROUP#,
       lf.member "member",
       l.BYTES/1024/1024||'M' "size"
  from v$logfile lf,
       v$log l
where l.GROUP#=lf.GROUP#
   and lf.type ='ONLINE' 
order by lf.GROUP#;

select file_name from dba_data_files;

select value 
  from nls_database_parameters 

select file_name, 
       increment_by * (select value

                         from v$parameter

                        where name ='db_block_size') "INCR",
       round(maxbytes/1024/1024) "MAX"  
  from dba_temp_files  
where status='ONLINE';

select sys_context('USERENV','DB_UNIQUE_NAME') "Name",
       sys_context('USERENV','SERVER_HOST') "Host" from dual;