Recreate Database Using Only Datafile and Logfile

SQL> ALTER DATABASE BACKUP CONTROLFILE TO TRACE;


C:\> orapwd file=C:\oracle\product\10.2.0\db_1\database\PWDdba71.ora password=sys entries=10

 C:\>oradim -new -sid dba71 -intpwd sys -maxusers 10 -startmode auto -pfile C:\oracle\product\10.2.0\admin\dba71\pfile\init.ora

 C:\>set oracle_home=C:\oracle\product\10.2.0\db_1

 C:\>set oracle_sid=dba71

 C:\>sqlplus/nolog

 SQL*Plus: Release 10.2.0.1.0 - Production on Fri Jul 30 09:15:02 2010

 Copyright (c) 1982, 2005, Oracle.  All rights reserved.

 

SQL> conn sys/sys as sysdba

Connected to an idle instance.

 

SQL> startup nomount pfile='C:\oracle\product\10.2.0\admin\dba71\pfile\init.ora;

ORACLE instance started.

Total System Global Area  167772160 bytes

Fixed Size                  1247876 bytes

Variable Size              62915964 bytes

Database Buffers           96468992 bytes

Redo Buffers                7139328 bytes

 

SQL> CREATE CONTROLFILE  REUSE SET DATABASE "dba71" RESETLOGS ARCHIVELOG

MAXLOGFILES 16

MAXLOGMEMBERS 3

MAXDATAFILES 100

MAXINSTANCES 8

MAXLOGHISTORY 292

LOGFILE

GROUP 1 'C:\ORACLE\PRODUCT\10.2.0\ORADATA\DBA71\REDO01.LOG'  SIZE 50M,

GROUP 2 'C:\ORACLE\PRODUCT\10.2.0\ORADATA\DBA71\REDO02.LOG'  SIZE 50M,

GROUP 3 'C:\ORACLE\PRODUCT\10.2.0\ORADATA\DBA71\REDO03.LOG'  SIZE 50M

DATAFILE

'C:\ORACLE\PRODUCT\10.2.0\ORADATA\DBA71\SYSTEM01.DBF',

'C:\ORACLE\PRODUCT\10.2.0\ORADATA\DBA71\UNDOTBS01.DBF',

'C:\ORACLE\PRODUCT\10.2.0\ORADATA\DBA71\SYSAUX01.DBF',

'C:\ORACLE\PRODUCT\10.2.0\ORADATA\DBA71\USERS01.DBF',

'C:\ORACLE\PRODUCT\10.2.0\ORADATA\DBA71\TEST02.DBF',

'C:\ORACLE\PRODUCT\10.2.0\ORADATA\DBA71\CHECK01.DBF',

'C:\ORACLE\PRODUCT\10.2.0\ORADATA\DBA71\PART_1.DBF',

'C:\ORACLE\PRODUCT\10.2.0\ORADATA\DBA71\PART_2.DBF',

'C:\ORACLE\PRODUCT\10.2.0\ORADATA\DBA71\PART_3.DBF',

'C:\ORACLE\PRODUCT\10.2.0\ORADATA\DBA71\PART_4.DBF',

'C:\ORACLE\PRODUCT\10.2.0\ORADATA\DBA71\ROW_CHAIN_01.DBF'

CHARACTER SET WE8MSWIN1252;

 

[NOTE-IF you want to set new name of database then use following command:

CREATE CONTROLFILE  SET DATABASE "dba51" RESETLOGS ARCHIVELOG]


SQL> alter database open resetlogs;

Database altered.

Comments