Search This Blog

Total Pageviews

Wednesday, 7 October 2009

Startup Oracle 10g and 11g Database In Archivelog Mode and flashback mode



Startup Oracle 10g and 11g Database In Archivelog Mode and flashback mode
.

In this case "orcl " is the instance name .

-bash-3.00$ sqlplus / as sysdba

SQL*Plus: Release 10.2.0.4.0 - Production on Wed Oct 7 09:45:59 2009

Copyright (c) 1982, 2007, Oracle. All Rights Reserved.

Connected to an idle instance.

SYS AS SYSDBA>!echo $ORACLE_SID
orcl

sql> create pfile='/tmp/init_orcl.txt' from spfile ;

sql> shutdown immediate;

Then edit this file vi /tmp/init_orcl.txt

==============================================

*.log_archive_format="log%r_%t_%s.arc"
-- <<<<< Oracle 10g and above this parameter must with %r %t %s these value

*.log_archive_dest_1='LOCATION="/opt/oracle/archive'

*.db_recovery_file_dest='/opt/oracle/flash_recovery_area'

*.db_recovery_file_dest_size="2G"

*.db_flashback_retention_target="1440"


===============================================

LOG_ARCHIVE_FORMAT must be in the format: %s,%t,%r.

%s log sequence number

%S log sequence number, zero filled

%t Thread number

%T Thread number, zero filled

%a activation ID

%d database ID


%r resetlogs ID that ensures unique names are constructed for the archived log files across multiple incarnations of the database



SQL> startup mount pfile='/tmp/init_orcl.txt' ;
ORACLE instance started.

Total System Global Area 2634022912 bytes
Fixed Size 2042912 bytes
Variable Size 385881056 bytes
Database Buffers 2231369728 bytes
Redo Buffers 14729216 bytes
Database mounted.

sql> alter database archivelog;
Database altered.

sql>alter database flashback on;
Database altered.

sql> alter database open;
Database altered.

SYS AS SYSDBA>archive log list
Database log mode Archive Mode
Automatic archival Enabled
Archive destination /opt/oracle/archive
Oldest online log sequence 205
Next log sequence to archive 207
Current log sequence 207

sql> alter system switch logfile;

System altered.

SQL> alter system switch logfile;

System altered.


bash-3.00$ cd /opt/oracle/archive/
bash-3.00$ ls -lt
-rw-r----- 1 oracle dba 1024 Oct 7 09:47 log699206679_1_206.arc
-rw-r----- 1 oracle dba 138240 Oct 7 09:47 log699206679_1_205.arc

to check flash back file

db_recovery_file_dest='/opt/oracle/flash_recovery_area
go to

cd /opt/oracle/flash_recovery_area/

then you will see ORCL dir then flashback dir
$cd ORCL
then
$cd flashback

finally

$pwd

/opt/oracle/flash_recovery_area/ORCL/flashback

-bash-3.00$ ls -lt
total 31152
-rw-r----- 1 oracle dba 15941632 Oct 7 09:49 o1_mf_5drnyvfc_.flb

then create spfile

sql> create spfile from pfile='/tmp/init_orcl.txt' ;

File created.

Oracle DBA

anuj blog Archive