Visit Counter

Sunday, May 27, 2012

Enable Archive Log Mode




SQL> conn sys/sy123@safi as sysdba

Connected.


SQL> create pfile from spfile;

File created.


SQL> alter system set log_archive_dest='/ora/archive1/' scope=spfile;

System altered.
 


SQL> shutdown immediate;

Database closed.

Database dismounted.

ORACLE instance shut down.



SQL> startup mount

ORACLE instance started.

Total System Global Area 352321536 bytes

Fixed Size 2040600 bytes

Variable Size 234888424 bytes

Database Buffers 109051904 bytes

Redo Buffers 6340608 bytes

Database mounted.



SQL> alter database archivelog;

Database altered.



SQL> alter database open;

Database altered.


SQL> alter system switch logfile;

System altered.


SQL> select name, log_mode from v$database;

NAME      LOG_MODE
--------- ------------
SAFI      ARCHIVELOG

ORACLE RMAN Restore Database from Tape


Enivorment:

Solaris 10 Sparc 64-bit
Oracle DB 10.2.0
Veritas Netbackup Client
  1. Install Veritas Netbackup Client Software for Solaris.
  2. Install Veritas Netbackup Database Agent Software.
  3. Configure Netbackup New client on Master Server.
  4. Installed Oracle DB 10g software only.


Restore SPFILE from Tape


$ sqlplus /nolog

SQL*Plus: Release 10.2.0.4.0 - Production on Sun Dec 12 15:14:53 2010

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

SQL> conn / as sysdba

Connected to an idle instance.

SQL> startup nomount pfile='/ora/crs/oracle/product/10/app/dbs/dummypfile.ora' ;

ORACLE instance started.

Total System Global Area 893386752 bytes

Fixed Size 2044744 bytes

Variable Size 226495672 bytes

Database Buffers 658505728 bytes

Redo Buffers 6340608 bytes

SQL> exit

$ pwd

/ora/crs/oracle/product/10/app/dbs

$ rman target / nocatalog

Recovery Manager: Release 10.2.0.4.0 - Production on Sun Dec 12 15:18:30 2010
Copyright (c) 1982, 2007, Oracle. All rights reserved.

connected to target database: sdb (not mounted)
using target database control file instead of recovery catalog

RMAN> set dbid=3389811866

executing command: SET DBID

NOTE: SPFILE TAG (c-3389811866-20101211-02)

Spfile data image tage u will get it through below command.


$cd /usr/openv/netbackup/bin

Below command show the images of control files.

$ ./bplist -C ora-rs -t 4 -l -R /


RMAN> run {

2> allocate channel ch00 type 'SBT_TAPE';
3> send 'NB_ORA_CLIENT=ora-rs';
4> restore spfile from 'c-3389811866-20101211-02';
5> release channel ch00;
6> }

allocated channel: ch00
channel ch00: sid=1986 devtype=SBT_TAPE

channel ch00: Veritas NetBackup for Oracle - Release 6.5 (2007072323)

sent command to channel: ch00

Starting restore at 12-DEC-10

channel ch00: autobackup found: c-3389811866-20101211-02

channel ch00: SPFILE restore from autobackup complete

Finished restore at 12-DEC-10

released channel: ch00

RMAN>exit

Monitor the restoring process through Veritas Netbackup GUI

# /usr/openv/java/jnbSA 


$cd /ora/crs/oracle/product/10/app/dbs

Create below directies.

adump
bdump
cdump
archive1
archive2
udump


$ vi spfilesdb.ora   (Change the below parameters)


audit_file_dest='/ora/app/oracle/admin/sdb/adump' (Created the directory adump)

background_dump_dest='/ora/app/oracle/admin/sdb/bdump' (Created the directory bdump)

core_dump_dest='/ora/app/oracle/admin/sdb/cdump' (Created the directory cdump)

log_archive_dest='/ora_dat/sdb/archive1' (Created the directory)

log_archive_duplex_dest='/ora_idx/sdb/archive2' (Created the directory)

user_dump_dest='/ora/app/oracle/admin/sdb/udump' (Directory Created)


$sqlplus /nolog

SQL> Connect / as sysdba

SQL> Startup nomount pfile='/ora/crs/oracle/product/10/app/dbs/spfilesdb.ora';


Control Files Restore from Tape

$cd /usr/openv/netbackup/bin
$ ./bplist -C ora-rs -t 4 -l -R /

$ rman target / nocatalog


RMAN> run {
2> allocate channel ch00 type 'sbt_tape';
3> send 'NB_ORA_CLIENT=ora-rs';
4> restore controlfile from 'cntrl_3235_1_716668933';
5> release channel ch00;
6> }



SQL> Startup mount pfile='/ora/crs/oracle/product/10/app/dbs/spfilesdb.ora';


Data Files Restore & Recover from Tape

$ rman target / nocatalog

RMAN> run {
2> allocate channel ch00 type 'sbt_tape';
3> send 'NB_ORA_CLIENT=ora-rs';
4> restore database;
5> recover database;
6> release channel ch00;
7> }


RMAN> alter database open resetlogs;