Sunday, 25 November 2012

Oracle 11g single instance archivelog mode on ASM



Oracle 11g- Single instance  archivelog mode on ASM 



Oracle 11gR2 archivelog mode on ASM
Oracle 11gR2 archivelog mode

ASMCMD> lsdg
State    Type    Rebal  Sector  Block       AU  Total_MB  Free_MB  Req_mir_free_MB  Usable_file_MB  Offline_disks  Voting_files  Name
MOUNTED  NORMAL  N         512   4096  1048576      9216     5657              896            2380              0             N  DATA/
MOUNTED  EXTERN  N         512   4096  1048576      9216     8988                0            8988              0             N  FRA/


ASMCMD> cd FRA

ASMCMD> mkdir Archive

ASMCMD> ls -lt
Type       Redund  Striped  Time             Sys  Name
                                             Y    ONLINELOG/
                                             N    Archive/
                                             Y    AUTOBACKUP/
                                             N    redo03b.log => +FRA/ORCL/ONLINELOG/group_3.257.741266861
                                             N    redo02b.log => +FRA/ORCL/ONLINELOG/group_2.258.741267209
                                             N    redo01b.log => +FRA/ORCL/ONLINELOG/group_1.256.741266959

ASMCMD> pwd
+FRA/ORCL/Archive


[oracle@oel5u4-orcl ~] . oraenv
ORACLE_SID = [orcl] ?
The Oracle base for ORACLE_HOME=/u01/app/oracle/product/11.2.0/dbhome_1 is /u01/app/oracle

sqlplus / as sysdba

SQL*Plus: Release 11.2.0.1.0 Production on Sat Nov 24 19:43:11 2012

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


Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - Production
With the Partitioning, Automatic Storage Management, OLAP, Data Mining
and Real Application Testing options


SQL> alter system set LOG_ARCHIVE_FORMAT ='Log%s_%t_%r.Arc' scope=spfile;
System altered.

SQL> alter system set log_archive_dest_1='location=+FRA/ORCL/Archive' SCOPE=SPFILE;
System altered.

SQL> alter system set log_archive_start=TRUE SCOPE=SPFILE;  --- no need in Oracle 11gr2
System altered.

SQL> alter system reset log_archive_start scope=spfile sid='*';
System altered.

SQL> shutdown immediate ;
Database closed.
Database dismounted.
ORACLE instance shut down.

SQL> startup mount;
ORACLE instance started.

Total System Global Area  472887296 bytes
Fixed Size                  1337296 bytes
Variable Size             360712240 bytes
Database Buffers          104857600 bytes
Redo Buffers                5980160 bytes
Database mounted.

SQL> alter database archivelog;
Database altered.

SQL> archive log list
Database log mode              Archive Mode
Automatic archival             Enabled
Archive destination            +FRA/orcl/archive
Oldest online log sequence     32
Next log sequence to archive   34
Current log sequence           34

SQL> alter database open ;
Database altered.

SQL> alter system switch logfile;
System altered.

SQL> /
System altered.
SQL> /
System altered.


SQL> exit
Disconnected from Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - Production
With the Partitioning, Automatic Storage Management, OLAP, Data Mining
and Real Application Testing options

[oracle@oel5u4-orcl ~] . oraenv
ORACLE_SID = [orcl] ? +ASM
The Oracle base for ORACLE_HOME=/u01/app/oracle/product/11.2.0/grid is /u01/app/oracle

[oracle@oel5u4-+ASM ~] asmcmd -p
ASMCMD [+] > cd FRA
ASMCMD [+FRA] > ls -lt
Type  Redund  Striped  Time             Sys  Name
                                        Y    ORCL/
ASMCMD [+FRA] > cd ORCL
ASMCMD [+FRA/ORCL] > cd Archive
ASMCMD [+FRA/ORCL/Archive] > ls -lt
Type        Redund  Striped  Time             Sys  Name
                                              N    log36_1_731227289.arc => +FRA/ORCL/ARCHIVELOG/2012_11_24/thread_1_seq_36.262.800222675
                                              N    log35_1_731227289.arc => +FRA/ORCL/ARCHIVELOG/2012_11_24/thread_1_seq_35.261.800222653
                                              N    log34_1_731227289.arc => +FRA/ORCL/ARCHIVELOG/2012_11_24/thread_1_seq_34.260.800222627
ASMCMD [+FRA/ORCL/Archive] >


5 comments:

  1. -bash-3.2$ cat initvihaan.ora
    vihaan.__db_cache_size=415236096
    vihaan.__java_pool_size=4194304
    vihaan.__large_pool_size=8388608
    vihaan.__oracle_base='/u01/app/oracle'#ORACLE_BASE set from environment
    vihaan.__pga_aggregate_target=314572800
    vihaan.__sga_target=591396864
    vihaan.__shared_io_pool_size=0
    vihaan.__shared_pool_size=150994944
    vihaan.__streams_pool_size=0
    *.audit_file_dest='/u01/app/oracle/admin/vihaan/adump'
    *.audit_trail='db'
    *.compatible='11.2.0.4.0'
    *.control_files='+DATA/vihaan/control01.ctl','+DATA/vihaan/control02.ctl'
    *.db_block_size=8192
    *.db_domain=''
    *.db_name='vihaan'
    *.diagnostic_dest='/u01/app/oracle'
    *.dispatchers='(PROTOCOL=TCP) (SERVICE=vihaanXDB)'
    *.memory_target=905969664
    *.open_cursors=300
    *.processes=150
    *.remote_login_passwordfile='EXCLUSIVE'
    *.undo_tablespace='UNDOTBS1'
    *.db_recovery_file_dest_size=2147483648
    *.db_recovery_file_dest='+RECOVERY'
    *.log_archive_dest_1='location=+RECOVERY'
    *.log_archive_format='Log%s_%t_%r.Arc'

    ReplyDelete
  2. SQL> alter system set log_archive_dest_1='location=+DATA' SCOPE=SPFILE;

    SQL> shutdown immediate ;
    Database closed.
    Database dismounted.
    ORACLE instance shut down.


    SQL> startup mount ;

    SQL> alter database archivelog;

    Database altered.

    SQL> alter database open ;

    SQL> archive log list ;
    Database log mode Archive Mode
    Automatic archival Enabled
    Archive destination +DATA
    Oldest online log sequence 63
    Next log sequence to archive 65
    Current log sequence 65

    ReplyDelete
  3. -bash-3.2$ !sql
    sqlplus / as sysdba

    SQL*Plus: Release 11.2.0.4.0 Production on Sun Mar 20 14:39:27 2016

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


    Connected to:
    Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production
    With the Partitioning, OLAP, Data Mining and Real Application Testing options


    SQL> alter system set LOG_ARCHIVE_FORMAT ='Log%s_%t_%r.Arc' scope=spfile;

    System altered.

    SQL> alter system set log_archive_dest_1='location=/u01/app/oracle/Archive' 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 680607744 bytes
    Fixed Size 2256352 bytes
    Variable Size 457179680 bytes
    Database Buffers 218103808 bytes
    Redo Buffers 3067904 bytes
    Database mounted.
    SQL> alter database archivelog;

    Database altered.

    SQL> alter database open ;

    Database altered.


    SQL> archive log list
    Database log mode Archive Mode
    Automatic archival Enabled
    Archive destination /u01/app/oracle/Archive
    Oldest online log sequence 1
    Next log sequence to archive 3
    Current log sequence 3

    ReplyDelete
  4. The following variables can be used in the format:

    %s log sequence number
    %S log sequence number, zero filled
    %tthread number
    %Tthread 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.

    ReplyDelete
  5. for disk group

    select listagg (name, ' | ') within group (order by name) " DiskGroupName" from v$asm_diskgroup;

    DiskGroupName
    --------------------------------------------------------------------------------
    DATA | LOG |

    ReplyDelete