Friday, 17 June 2011

RMAN incremental backups

Microsoft Windows [Version 6.0.6001]
Copyright (c) 2006 Microsoft Corporation.  All rights reserved.

C:\Windows\System32>set ORACLE_SID=NEW1

C:\Windows\System32>set PATH=%ORACLE_HOME%\BIN;%PATH%

C:\Windows\System32>sqlplus / as sysdba

SQL*Plus: Release 10.2.0.1.0 - Production on Thu Jun 16 23:58:05 2011

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

Connected to an idle instance.

SQL> startup
ORACLE instance started.

Total System Global Area  293601280 bytes
Fixed Size                  1248600 bytes
Variable Size              96469672 bytes
Database Buffers          188743680 bytes
Redo Buffers                7139328 bytes
Database mounted.
Database opened.
SQL> exit
Disconnected from Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - Production
With the Partitioning, OLAP and Data Mining options

C:\Windows\System32>rman target sys/sys@new1 catalog rman/rman@rman01

Recovery Manager: Release 10.2.0.1.0 - Production on Thu Jun 16 23:59:20 2011

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

connected to target database: NEW1 (DBID=1583816731)
connected to recovery catalog database

RMAN>


RMAN> show all;

RMAN configuration parameters are:
CONFIGURE RETENTION POLICY TO REDUNDANCY 2;
CONFIGURE BACKUP OPTIMIZATION OFF; # default
CONFIGURE DEFAULT DEVICE TYPE TO DISK; # default
CONFIGURE CONTROLFILE AUTOBACKUP OFF; # default
CONFIGURE CONTROLFILE AUTOBACKUP FORMAT FOR DEVICE TYPE DISK TO "F:\oracle\tmp\control%F";
CONFIGURE DEVICE TYPE DISK PARALLELISM 3 BACKUP TYPE TO COMPRESSED BACKUPSET;
CONFIGURE DATAFILE BACKUP COPIES FOR DEVICE TYPE DISK TO 1; # default
CONFIGURE ARCHIVELOG BACKUP COPIES FOR DEVICE TYPE DISK TO 1; # default
CONFIGURE CHANNEL DEVICE TYPE DISK MAXPIECESIZE 500 M FORMAT   "F:\oracle\tmp\%d_%s.dbf";
CONFIGURE MAXSETSIZE TO UNLIMITED; # default
CONFIGURE ENCRYPTION FOR DATABASE OFF; # default
CONFIGURE ENCRYPTION ALGORITHM 'AES128'; # default
CONFIGURE ARCHIVELOG DELETION POLICY TO NONE; # default
CONFIGURE SNAPSHOT CONTROLFILE NAME TO 'C:\ORACLE\PRODUCT\10.2.0\DB_1\DATABASE\SNCFNEW1.ORA'; # default

RMAN> CONFIGURE CHANNEL 1 DEVICE TYPE DISK MAXPIECESIZE 500 M FORMAT   "F:\oracle\tmp\%d_%s.dbf";

new RMAN configuration parameters:
CONFIGURE CHANNEL 1 DEVICE TYPE DISK MAXPIECESIZE 500 M FORMAT   "F:\oracle\tmp\%d_%s.dbf";
new RMAN configuration parameters are successfully stored
starting full resync of recovery catalog
full resync complete

RMAN> show all;

RMAN configuration parameters are:
CONFIGURE RETENTION POLICY TO REDUNDANCY 2;
CONFIGURE BACKUP OPTIMIZATION OFF; # default
CONFIGURE DEFAULT DEVICE TYPE TO DISK; # default
CONFIGURE CONTROLFILE AUTOBACKUP OFF; # default
CONFIGURE CONTROLFILE AUTOBACKUP FORMAT FOR DEVICE TYPE DISK TO "F:\oracle\tmp\control%F";
CONFIGURE DEVICE TYPE DISK PARALLELISM 3 BACKUP TYPE TO COMPRESSED BACKUPSET;
CONFIGURE DATAFILE BACKUP COPIES FOR DEVICE TYPE DISK TO 1; # default
CONFIGURE ARCHIVELOG BACKUP COPIES FOR DEVICE TYPE DISK TO 1; # default
CONFIGURE CHANNEL DEVICE TYPE DISK MAXPIECESIZE 500 M FORMAT   "F:\oracle\tmp\%d_%s.dbf";
CONFIGURE CHANNEL 1 DEVICE TYPE DISK MAXPIECESIZE 500 M FORMAT   "F:\oracle\tmp\%d_%s.dbf";
CONFIGURE MAXSETSIZE TO UNLIMITED; # default
CONFIGURE ENCRYPTION FOR DATABASE OFF; # default
CONFIGURE ENCRYPTION ALGORITHM 'AES128'; # default
CONFIGURE ARCHIVELOG DELETION POLICY TO NONE; # default
CONFIGURE SNAPSHOT CONTROLFILE NAME TO 'C:\ORACLE\PRODUCT\10.2.0\DB_1\DATABASE\SNCFNEW1.ORA'; # default

RMAN> CONFIGURE CHANNEL 1 DEVICE TYPE DISK MAXPIECESIZE = 500 M FORMAT   "F:\oracle\tmp\%d_%s.dbf";

starting full resync of recovery catalog
full resync complete
old RMAN configuration parameters:
CONFIGURE CHANNEL 1 DEVICE TYPE DISK MAXPIECESIZE 500 M FORMAT   "F:\oracle\tmp\%d_%s.dbf";
new RMAN configuration parameters:
CONFIGURE CHANNEL 1 DEVICE TYPE DISK MAXPIECESIZE 500 M FORMAT   "F:\oracle\tmp\%d_%s.dbf";
new RMAN configuration parameters are successfully stored
starting full resync of recovery catalog
full resync complete

RMAN> CONFIGURE CHANNEL 1 DEVICE TYPE DISK MAXPIECESIZE = 500 M FORMAT   "F:\oracle\tmp\%d_%s.dbf";

old RMAN configuration parameters:
CONFIGURE CHANNEL 1 DEVICE TYPE DISK MAXPIECESIZE 500 M FORMAT   "F:\oracle\tmp\%d_%s.dbf";
new RMAN configuration parameters:
CONFIGURE CHANNEL 1 DEVICE TYPE DISK MAXPIECESIZE 500 M FORMAT   "F:\oracle\tmp\%d_%s.dbf";
new RMAN configuration parameters are successfully stored
starting full resync of recovery catalog
full resync complete

RMAN> show all;

RMAN configuration parameters are:
CONFIGURE RETENTION POLICY TO REDUNDANCY 2;
CONFIGURE BACKUP OPTIMIZATION OFF; # default
CONFIGURE DEFAULT DEVICE TYPE TO DISK; # default
CONFIGURE CONTROLFILE AUTOBACKUP OFF; # default
CONFIGURE CONTROLFILE AUTOBACKUP FORMAT FOR DEVICE TYPE DISK TO "F:\oracle\tmp\control%F";
CONFIGURE DEVICE TYPE DISK PARALLELISM 3 BACKUP TYPE TO COMPRESSED BACKUPSET;
CONFIGURE DATAFILE BACKUP COPIES FOR DEVICE TYPE DISK TO 1; # default
CONFIGURE ARCHIVELOG BACKUP COPIES FOR DEVICE TYPE DISK TO 1; # default
CONFIGURE CHANNEL DEVICE TYPE DISK MAXPIECESIZE 500 M FORMAT   "F:\oracle\tmp\%d_%s.dbf";
CONFIGURE CHANNEL 1 DEVICE TYPE DISK MAXPIECESIZE 500 M FORMAT   "F:\oracle\tmp\%d_%s.dbf";
CONFIGURE MAXSETSIZE TO UNLIMITED; # default
CONFIGURE ENCRYPTION FOR DATABASE OFF; # default
CONFIGURE ENCRYPTION ALGORITHM 'AES128'; # default
CONFIGURE ARCHIVELOG DELETION POLICY TO NONE; # default
CONFIGURE SNAPSHOT CONTROLFILE NAME TO 'C:\ORACLE\PRODUCT\10.2.0\DB_1\DATABASE\SNCFNEW1.ORA'; # default


RMAN>

SQL> alter database enable block change tracking using file 'F:\oracle\admin\NEW1\pfile\bct.i';

Database altered.


RMAN> backup as compressed backupset incremental level 0 database;

Starting backup at 17-JUN-11
using channel ORA_DISK_1
using channel ORA_DISK_2
using channel ORA_DISK_3
channel ORA_DISK_1: starting compressed incremental level 0 datafile backupset
channel ORA_DISK_1: specifying datafile(s) in backupset
input datafile fno=00001 name=F:\ORACLE\ORADATA\NEW1\SYSTEM.DBF
channel ORA_DISK_1: starting piece 1 at 17-JUN-11
channel ORA_DISK_2: starting compressed incremental level 0 datafile backupset
channel ORA_DISK_2: specifying datafile(s) in backupset
input datafile fno=00003 name=F:\ORACLE\ORADATA\NEW1\SYSAUX.DBF
channel ORA_DISK_2: starting piece 1 at 17-JUN-11
channel ORA_DISK_3: starting compressed incremental level 0 datafile backupset
channel ORA_DISK_3: specifying datafile(s) in backupset
input datafile fno=00002 name=F:\ORACLE\ORADATA\NEW1\UNDO.DBF
channel ORA_DISK_3: starting piece 1 at 17-JUN-11
channel ORA_DISK_2: finished piece 1 at 17-JUN-11
piece handle=F:\ORACLE\TMP\NEW1_216.DBF tag=TAG20110617T002416 comment=NONE
channel ORA_DISK_2: backup set complete, elapsed time: 00:00:35
channel ORA_DISK_2: starting compressed incremental level 0 datafile backupset
channel ORA_DISK_2: specifying datafile(s) in backupset
including current control file in backupset
channel ORA_DISK_2: starting piece 1 at 17-JUN-11
channel ORA_DISK_3: finished piece 1 at 17-JUN-11
piece handle=F:\ORACLE\TMP\NEW1_217.DBF tag=TAG20110617T002416 comment=NONE
channel ORA_DISK_3: backup set complete, elapsed time: 00:00:41
channel ORA_DISK_1: finished piece 1 at 17-JUN-11
piece handle=F:\ORACLE\TMP\NEW1_215.DBF tag=TAG20110617T002416 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:41
channel ORA_DISK_2: finished piece 1 at 17-JUN-11
piece handle=F:\ORACLE\TMP\NEW1_218.DBF tag=TAG20110617T002416 comment=NONE
channel ORA_DISK_2: backup set complete, elapsed time: 00:00:02
Finished backup at 17-JUN-11

RMAN> backup as compressed backupset incremental level 1 cumulative database;

Starting backup at 17-JUN-11
using channel ORA_DISK_1
using channel ORA_DISK_2
using channel ORA_DISK_3
channel ORA_DISK_1: starting compressed incremental level 1 datafile backupset
channel ORA_DISK_1: specifying datafile(s) in backupset
input datafile fno=00001 name=F:\ORACLE\ORADATA\NEW1\SYSTEM.DBF
channel ORA_DISK_1: starting piece 1 at 17-JUN-11
channel ORA_DISK_2: starting compressed incremental level 1 datafile backupset
channel ORA_DISK_2: specifying datafile(s) in backupset
input datafile fno=00003 name=F:\ORACLE\ORADATA\NEW1\SYSAUX.DBF
channel ORA_DISK_2: starting piece 1 at 17-JUN-11
channel ORA_DISK_3: starting compressed incremental level 1 datafile backupset
channel ORA_DISK_3: specifying datafile(s) in backupset
input datafile fno=00002 name=F:\ORACLE\ORADATA\NEW1\UNDO.DBF
channel ORA_DISK_3: starting piece 1 at 17-JUN-11
channel ORA_DISK_1: finished piece 1 at 17-JUN-11
piece handle=F:\ORACLE\TMP\NEW1_219.DBF tag=TAG20110617T002507 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:02
channel ORA_DISK_1: starting compressed incremental level 1 datafile backupset
channel ORA_DISK_1: specifying datafile(s) in backupset
including current control file in backupset
channel ORA_DISK_1: starting piece 1 at 17-JUN-11
channel ORA_DISK_2: finished piece 1 at 17-JUN-11
piece handle=F:\ORACLE\TMP\NEW1_220.DBF tag=TAG20110617T002507 comment=NONE
channel ORA_DISK_2: backup set complete, elapsed time: 00:00:03
channel ORA_DISK_3: finished piece 1 at 17-JUN-11
piece handle=F:\ORACLE\TMP\NEW1_221.DBF tag=TAG20110617T002507 comment=NONE
channel ORA_DISK_3: backup set complete, elapsed time: 00:00:02
channel ORA_DISK_1: finished piece 1 at 17-JUN-11
piece handle=F:\ORACLE\TMP\NEW1_222.DBF tag=TAG20110617T002507 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:02
Finished backup at 17-JUN-11

RMAN> backup as compressed backupset incremental level 1 database;

Starting backup at 17-JUN-11
using channel ORA_DISK_1
using channel ORA_DISK_2
using channel ORA_DISK_3
channel ORA_DISK_1: starting compressed incremental level 1 datafile backupset
channel ORA_DISK_1: specifying datafile(s) in backupset
input datafile fno=00001 name=F:\ORACLE\ORADATA\NEW1\SYSTEM.DBF
channel ORA_DISK_1: starting piece 1 at 17-JUN-11
channel ORA_DISK_2: starting compressed incremental level 1 datafile backupset
channel ORA_DISK_2: specifying datafile(s) in backupset
input datafile fno=00003 name=F:\ORACLE\ORADATA\NEW1\SYSAUX.DBF
channel ORA_DISK_2: starting piece 1 at 17-JUN-11
channel ORA_DISK_3: starting compressed incremental level 1 datafile backupset
channel ORA_DISK_3: specifying datafile(s) in backupset
input datafile fno=00002 name=F:\ORACLE\ORADATA\NEW1\UNDO.DBF
channel ORA_DISK_3: starting piece 1 at 17-JUN-11
channel ORA_DISK_1: finished piece 1 at 17-JUN-11
piece handle=F:\ORACLE\TMP\NEW1_223.DBF tag=TAG20110617T002518 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:02
channel ORA_DISK_1: starting compressed incremental level 1 datafile backupset
channel ORA_DISK_1: specifying datafile(s) in backupset
including current control file in backupset
channel ORA_DISK_1: starting piece 1 at 17-JUN-11
channel ORA_DISK_2: finished piece 1 at 17-JUN-11
piece handle=F:\ORACLE\TMP\NEW1_224.DBF tag=TAG20110617T002518 comment=NONE
channel ORA_DISK_2: backup set complete, elapsed time: 00:00:03
channel ORA_DISK_3: finished piece 1 at 17-JUN-11
piece handle=F:\ORACLE\TMP\NEW1_225.DBF tag=TAG20110617T002518 comment=NONE
channel ORA_DISK_3: backup set complete, elapsed time: 00:00:02
channel ORA_DISK_1: finished piece 1 at 17-JUN-11
piece handle=F:\ORACLE\TMP\NEW1_226.DBF tag=TAG20110617T002518 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:02
Finished backup at 17-JUN-11





























RMAN Configurations 1

RMAN> show all;

RMAN configuration parameters are:
CONFIGURE RETENTION POLICY TO REDUNDANCY 2;
CONFIGURE BACKUP OPTIMIZATION OFF; # default
CONFIGURE DEFAULT DEVICE TYPE TO DISK; # default
CONFIGURE CONTROLFILE AUTOBACKUP OFF; # default
CONFIGURE CONTROLFILE AUTOBACKUP FORMAT FOR DEVICE TYPE DISK TO "F:\oracle\tmp\control%F";
CONFIGURE DEVICE TYPE DISK PARALLELISM 3 BACKUP TYPE TO COMPRESSED BACKUPSET;
CONFIGURE DATAFILE BACKUP COPIES FOR DEVICE TYPE DISK TO 1; # default
CONFIGURE ARCHIVELOG BACKUP COPIES FOR DEVICE TYPE DISK TO 1; # default
CONFIGURE CHANNEL 2 DEVICE TYPE DISK MAXPIECESIZE 500 M FORMAT   "F:\oracle\tmp\%d_%s.dbf";
CONFIGURE MAXSETSIZE TO UNLIMITED; # default
CONFIGURE ENCRYPTION FOR DATABASE OFF; # default
CONFIGURE ENCRYPTION ALGORITHM 'AES128'; # default
CONFIGURE ARCHIVELOG DELETION POLICY TO NONE; # default
CONFIGURE SNAPSHOT CONTROLFILE NAME TO 'C:\ORACLE\PRODUCT\10.2.0\DB_1\DATABASE\SNCFNEW1.ORA'; # default

Wednesday, 1 June 2011

How to take RMAN backups to some other location (Not in FRA)

Below is the method I use :

RMAN> run{
2> delete noprompt backup;
3> backup as compressed backupset database format 'F:\oracle\oradata\LSTDBY\bkp\full_bkp_%U';
4> backup as compressed backupset archivelog all format 'F:\oracle\oradata\LSTDBY\bkp\%d_%s_%p_%U.arc' delete all input;
5> backup as copy current controlfile format 'F:\oracle\oradata\LSTDBY\bkp\control.bkp';
6> }

using channel ORA_DISK_1

List of Backup Pieces
BP Key  BS Key  Pc# Cp# Status      Device Type Piece Name
------- ------- --- --- ----------- ----------- ----------
29      29      1   1   AVAILABLE   DISK        F:\ORACLE\ORADATA\LSTDBY\BKP\NEW1_98_1_32MDP7JA_1_1.ARC
deleted backup piece
backup piece handle=F:\ORACLE\ORADATA\LSTDBY\BKP\NEW1_98_1_32MDP7JA_1_1.ARC recid=29 stamp=752655980
Deleted 1 objects


Starting backup at 01-JUN-11
using channel ORA_DISK_1
channel ORA_DISK_1: starting compressed full datafile backupset
channel ORA_DISK_1: specifying datafile(s) in backupset
input datafile fno=00001 name=F:\ORACLE\ORADATA\STDBY1\SYSTEM.DBF
input datafile fno=00003 name=F:\ORACLE\ORADATA\STDBY1\SYSAUX.DBF
input datafile fno=00002 name=F:\ORACLE\ORADATA\STDBY1\UNDO.DBF
channel ORA_DISK_1: starting piece 1 at 01-JUN-11
channel ORA_DISK_1: finished piece 1 at 01-JUN-11
piece handle=F:\ORACLE\ORADATA\LSTDBY\BKP\FULL_BKP_33MDP7L0_1_1 tag=TAG20110601T070711 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:45
channel ORA_DISK_1: starting compressed full datafile backupset
channel ORA_DISK_1: specifying datafile(s) in backupset
including current control file in backupset
including current SPFILE in backupset
channel ORA_DISK_1: starting piece 1 at 01-JUN-11
channel ORA_DISK_1: finished piece 1 at 01-JUN-11
piece handle=F:\ORACLE\ORADATA\LSTDBY\BKP\FULL_BKP_34MDP7MD_1_1 tag=TAG20110601T070711 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:03
Finished backup at 01-JUN-11

Starting backup at 01-JUN-11
using channel ORA_DISK_1
channel ORA_DISK_1: starting compressed archive log backupset
channel ORA_DISK_1: specifying archive log(s) in backup set
input archive log thread=1 sequence=93 recid=1 stamp=752203699
input archive log thread=1 sequence=94 recid=4 stamp=752203700
input archive log thread=1 sequence=95 recid=5 stamp=752203700
input archive log thread=1 sequence=96 recid=2 stamp=752203699
input archive log thread=1 sequence=97 recid=3 stamp=752203700
input archive log thread=1 sequence=98 recid=6 stamp=752203704
input archive log thread=1 sequence=99 recid=8 stamp=752203705
input archive log thread=1 sequence=100 recid=7 stamp=752203705
input archive log thread=1 sequence=101 recid=14 stamp=752203760
input archive log thread=1 sequence=102 recid=10 stamp=752203759
input archive log thread=1 sequence=103 recid=13 stamp=752203760
input archive log thread=1 sequence=104 recid=12 stamp=752203760
input archive log thread=1 sequence=105 recid=11 stamp=752203759
input archive log thread=1 sequence=106 recid=9 stamp=752203706
input archive log thread=1 sequence=107 recid=15 stamp=752203829
input archive log thread=1 sequence=108 recid=16 stamp=752206375
input archive log thread=1 sequence=109 recid=17 stamp=752206379
input archive log thread=1 sequence=110 recid=18 stamp=752208664
input archive log thread=1 sequence=111 recid=19 stamp=752231644
input archive log thread=1 sequence=112 recid=20 stamp=752241984
input archive log thread=1 sequence=113 recid=21 stamp=752241988
input archive log thread=1 sequence=114 recid=22 stamp=752284429
input archive log thread=1 sequence=115 recid=23 stamp=752284430
input archive log thread=1 sequence=116 recid=24 stamp=752284437
input archive log thread=1 sequence=117 recid=25 stamp=752306407
input archive log thread=1 sequence=118 recid=26 stamp=752320462
input archive log thread=1 sequence=119 recid=27 stamp=752320469
input archive log thread=1 sequence=120 recid=28 stamp=752348736
input archive log thread=1 sequence=121 recid=29 stamp=752360623
input archive log thread=1 sequence=122 recid=30 stamp=752629379
input archive log thread=1 sequence=123 recid=31 stamp=752629381
input archive log thread=1 sequence=124 recid=32 stamp=752629382
input archive log thread=1 sequence=125 recid=33 stamp=752632827
input archive log thread=1 sequence=126 recid=34 stamp=752632833
input archive log thread=1 sequence=127 recid=35 stamp=752633148
input archive log thread=1 sequence=128 recid=36 stamp=752633378
input archive log thread=1 sequence=129 recid=38 stamp=752636349
input archive log thread=1 sequence=130 recid=37 stamp=752636348
input archive log thread=1 sequence=131 recid=39 stamp=752636349
input archive log thread=1 sequence=132 recid=40 stamp=752636411
input archive log thread=1 sequence=133 recid=42 stamp=752654062
input archive log thread=1 sequence=134 recid=41 stamp=752654061
input archive log thread=1 sequence=135 recid=43 stamp=752654112
channel ORA_DISK_1: starting piece 1 at 01-JUN-11
channel ORA_DISK_1: finished piece 1 at 01-JUN-11
piece handle=F:\ORACLE\ORADATA\LSTDBY\BKP\NEW1_101_1_35MDP7MI_1_1.ARC tag=TAG20110601T070801 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:09
channel ORA_DISK_1: deleting archive log(s)
archive log filename=F:\ORACLE\ARCH\STDBY1\1_93_751864795.ARC recid=1 stamp=752203699
archive log filename=F:\ORACLE\ARCH\STDBY1\1_94_751864795.ARC recid=4 stamp=752203700
archive log filename=F:\ORACLE\ARCH\STDBY1\1_95_751864795.ARC recid=5 stamp=752203700
archive log filename=F:\ORACLE\ARCH\STDBY1\1_96_751864795.ARC recid=2 stamp=752203699
archive log filename=F:\ORACLE\ARCH\STDBY1\1_97_751864795.ARC recid=3 stamp=752203700
archive log filename=F:\ORACLE\ARCH\STDBY1\1_98_751864795.ARC recid=6 stamp=752203704
archive log filename=F:\ORACLE\ARCH\STDBY1\1_99_751864795.ARC recid=8 stamp=752203705
archive log filename=F:\ORACLE\ARCH\STDBY1\1_100_751864795.ARC recid=7 stamp=752203705
archive log filename=F:\ORACLE\ARCH\STDBY1\1_101_751864795.ARC recid=14 stamp=752203760
archive log filename=F:\ORACLE\ARCH\STDBY1\1_102_751864795.ARC recid=10 stamp=752203759
archive log filename=F:\ORACLE\ARCH\STDBY1\1_103_751864795.ARC recid=13 stamp=752203760
archive log filename=F:\ORACLE\ARCH\STDBY1\1_104_751864795.ARC recid=12 stamp=752203760
archive log filename=F:\ORACLE\ARCH\STDBY1\1_105_751864795.ARC recid=11 stamp=752203759
archive log filename=F:\ORACLE\ARCH\STDBY1\1_106_751864795.ARC recid=9 stamp=752203706
archive log filename=F:\ORACLE\ARCH\STDBY1\1_107_751864795.ARC recid=15 stamp=752203829
archive log filename=F:\ORACLE\ARCH\STDBY1\1_108_751864795.ARC recid=16 stamp=752206375
archive log filename=F:\ORACLE\ARCH\STDBY1\1_109_751864795.ARC recid=17 stamp=752206379
archive log filename=F:\ORACLE\ARCH\STDBY1\1_110_751864795.ARC recid=18 stamp=752208664
archive log filename=F:\ORACLE\ARCH\STDBY1\1_111_751864795.ARC recid=19 stamp=752231644
archive log filename=F:\ORACLE\ARCH\STDBY1\1_112_751864795.ARC recid=20 stamp=752241984
archive log filename=F:\ORACLE\ARCH\STDBY1\1_113_751864795.ARC recid=21 stamp=752241988
archive log filename=F:\ORACLE\ARCH\STDBY1\1_114_751864795.ARC recid=22 stamp=752284429
archive log filename=F:\ORACLE\ARCH\STDBY1\1_115_751864795.ARC recid=23 stamp=752284430
archive log filename=F:\ORACLE\ARCH\STDBY1\1_116_751864795.ARC recid=24 stamp=752284437
archive log filename=F:\ORACLE\ARCH\STDBY1\1_117_751864795.ARC recid=25 stamp=752306407
archive log filename=F:\ORACLE\ARCH\STDBY1\1_118_751864795.ARC recid=26 stamp=752320462
archive log filename=F:\ORACLE\ARCH\STDBY1\1_119_751864795.ARC recid=27 stamp=752320469
archive log filename=F:\ORACLE\ARCH\STDBY1\1_120_751864795.ARC recid=28 stamp=752348736
archive log filename=F:\ORACLE\ARCH\STDBY1\1_121_751864795.ARC recid=29 stamp=752360623
archive log filename=F:\ORACLE\ARCH\STDBY1\1_122_751864795.ARC recid=30 stamp=752629379
archive log filename=F:\ORACLE\ARCH\STDBY1\1_123_751864795.ARC recid=31 stamp=752629381
archive log filename=F:\ORACLE\ARCH\STDBY1\1_124_751864795.ARC recid=32 stamp=752629382
archive log filename=F:\ORACLE\ARCH\STDBY1\1_125_751864795.ARC recid=33 stamp=752632827
archive log filename=F:\ORACLE\ARCH\STDBY1\1_126_751864795.ARC recid=34 stamp=752632833
archive log filename=F:\ORACLE\ARCH\STDBY1\1_127_751864795.ARC recid=35 stamp=752633148
archive log filename=F:\ORACLE\ARCH\STDBY1\1_128_751864795.ARC recid=36 stamp=752633378
archive log filename=F:\ORACLE\ARCH\STDBY1\1_129_751864795.ARC recid=38 stamp=752636349
archive log filename=F:\ORACLE\ARCH\STDBY1\1_130_751864795.ARC recid=37 stamp=752636348
archive log filename=F:\ORACLE\ARCH\STDBY1\1_131_751864795.ARC recid=39 stamp=752636349
archive log filename=F:\ORACLE\ARCH\STDBY1\1_132_751864795.ARC recid=40 stamp=752636411
archive log filename=F:\ORACLE\ARCH\STDBY1\1_133_751864795.ARC recid=42 stamp=752654062
archive log filename=F:\ORACLE\ARCH\STDBY1\1_134_751864795.ARC recid=41 stamp=752654061
archive log filename=F:\ORACLE\ARCH\STDBY1\1_135_751864795.ARC recid=43 stamp=752654112
Finished backup at 01-JUN-11

Starting backup at 01-JUN-11
using channel ORA_DISK_1
channel ORA_DISK_1: starting datafile copy
copying current control file
output filename=F:\ORACLE\ORADATA\LSTDBY\BKP\CONTROL.BKP tag=TAG20110601T070814 recid=24 stamp=752656096
channel ORA_DISK_1: datafile copy complete, elapsed time: 00:00:03
Finished backup at 01-JUN-11

RMAN>



Saturday, 28 May 2011

How to create an Oracle 10g database manually on windows

Ok Guys, This is  how I create an Oracle 10g database manually on Windows :

*******************************************************************
set ORACLE_SID=NEW1
set PATH=%ORACLE_HOME%\BIN;%PATH%

mkdir F:\oracle\admin\%ORACLE_SID%\bdump
mkdir F:\oracle\admin\%ORACLE_SID%\cdump
mkdir F:\oracle\admin\%ORACLE_SID%\adump
mkdir F:\oracle\admin\%ORACLE_SID%\udump
mkdir F:\oracle\admin\%ORACLE_SID%\pfile
mkdir F:\oracle\oradata\%ORACLE_SID%
mkdir F:\oracle\arch\%ORACLE_SID%

REM copy C:\oracle\product\10.2.0\db_1\database\initorcl.ora  C:\oracle\product\10.2.0\db_1\database\init%ORACLE_SID%.ora
REM You need to copy pfile from sample or any other pfile and make changes in some init parameters like :
REM udump,bdump,cdump,adump,control_files,db_name,db_block_size
REM

In your pfile (init%ORACLE_SID%.ora), make basic modifications like below :

new1.__db_cache_size=188743680
new1.__java_pool_size=4194304
new1.__large_pool_size=4194304
new1.__shared_pool_size=88080384
new1.__streams_pool_size=0
*.audit_file_dest='F:\oracle\admin\NEW1\adump'
*.background_dump_dest='F:\oracle\admin\NEW1\bdump'
*.compatible='10.2.0.1.0'
*.control_files='F:\oracle\oradata\NEW1\control01.ctl','F:\oracle\oradata\NEW1\control02.ctl','F:\oracle\oradata\NEW1\control03.ctl'
*.core_dump_dest='F:\oracle\admin\NEW1\cdump'
*.db_block_size=8192
*.db_domain=''
*.db_file_multiblock_read_count=16
*.db_name='NEW1'
*.dispatchers='(PROTOCOL=TCP) (SERVICE=NEW1XDB)'
*.job_queue_processes=10
*.open_cursors=300
*.pga_aggregate_target=96468992
*.processes=150
*.remote_login_passwordfile='EXCLUSIVE'
*.sga_target=290455552
*.undo_management='AUTO'
*.undo_tablespace='UNDO'
*.user_dump_dest='F:\oracle\admin\NEW1\udump'

oradim -new -sid %ORACLE_SID% -intpwd sys -startmode M -PFILE C:\oracle\product\10.2.0\db_1\database\init%ORACLE_SID%.ora

sqlplus / as sysdba @F:\oracle\admin\NEW1\cr8db.sql

And in  cr8db.sql, I have actual database creation script :

startup nomount pfile='C:\oracle\product\10.2.0\db_1\database\init%ORACLE_SID%.ora';

create spfile from pfile='C:\oracle\product\10.2.0\db_1\database\init%ORACLE_SID%.ora';

shut

startup nomount

-- You need to edit the database creation script to locate data files as per business requirement

create database NEW1
  logfile   group 1 ('F:\oracle\oradata\%ORACLE_SID%\redo1.log') size 10M,
            group 2 ('F:\oracle\oradata\%ORACLE_SID%\redo2.log') size 10M,
            group 3 ('F:\oracle\oradata\%ORACLE_SID%\redo3.log') size 10M
  character set          WE8ISO8859P1
  national character set utf8
  datafile 'F:\oracle\oradata\%ORACLE_SID%\system.dbf'
            size 500M
            autoextend on
            next 10M maxsize unlimited
            extent management local
  sysaux datafile 'F:\oracle\oradata\%ORACLE_SID%\sysaux.dbf'
            size 400M
            autoextend on
            next 10M
            maxsize unlimited
  undo tablespace undo
            datafile 'F:\oracle\oradata\%ORACLE_SID%\undo.dbf'
            size 50M
  default temporary tablespace temp
            tempfile 'F:\oracle\oradata\%ORACLE_SID%\temp.dbf'
            size 10M;


connect /as sysdba




spool dictionary.out

@%ORACLE_HOME%\rdbms\admin\catalog.sql
@%ORACLE_HOME%\rdbms\admin\catblock.sql
@%ORACLE_HOME%\rdbms\admin\catproc.sql
@%ORACLE_HOME%\rdbms\admin\catoctk.sql
@%ORACLE_HOME%\rdbms\admin\owminst.plb
@%ORACLE_HOME%\javavm\install\initjvm.sql
@%ORACLE_HOME%\xdk\admin\initxml.sql
@%ORACLE_HOME%\xdk\admin\xmlja.sql
@%ORACLE_HOME%\rdbms\admin\catjava.sql
@%ORACLE_HOME%\rdbms\admin\catexf.sql

connect SYSTEM/manager
spool sqlplus.log@%ORACLE_HOME%\sqlplus\admin\pupbld.sql

@%ORACLE_HOME%\sqlplus\admin\help\hlpbld.sql helpus.sql
spool off ;

spool off;



conn / as sysdba

shut immediate

startup
****************************************************************************


Here we are, the database is created and ready for you.


Thanks,
Shekhar

My Oracle DBA Blog

Hi Guys,

I will be sharing my Oracle DBA experience and knowledge here.
But whatever contents or my experience notes I am mentioning here are purely related to my own experience only, in case if you would like to test these on your systems then it will be whole and sole on your own responsibility only.

Thanks,
Shekhar