Showing posts with label ASM. Show all posts
Showing posts with label ASM. Show all posts

Thursday, December 15, 2016

ACFS-03171: Insufficient contiguous free ASM Diskgroup space

Cause : 

1. Check if there are available space exist in your disk group.
2. Check re balance process are running or not.

Solution:

1. If disk space are not available reduce the size or add new LUN in your disk group.
2. If re balance process are running wait to complete the process.

erpdcdb01 acfsutil size +300G /backup
acfsutil size: ACFS-03171: Insufficient contiguous free ASM Diskgroup space.  Check the ASM alert log.
erpdcdb01 asmcmd
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  EXTERN  Y         512   4096  8388608   2150400   317160                0          317160              0             N  BACKUP/
MOUNTED  EXTERN  N         512   4096  4194304   3686400  1456524                0         1456524              0             N  DATA/
MOUNTED  EXTERN  N         512   4096  4194304   1228800  1043700                0         1043700              0             N  FRA/
MOUNTED  HIGH    N         512   4096  4194304     25600    24212            10240            4657              0             Y  OCR_VOT/
MOUNTED  EXTERN  N         512   4096  1048576    204800   177992                0          177992              0             N  REDO/
ASMCMD> exit
erpdcdb01


erpdcdb01 sqlplus "/as sysasm"

SQL*Plus: Release 11.2.0.4.0 Production on Thu Dec 15 20:00:30 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 Real Application Clusters and Automatic Storage Management options

SQL> select * from v$asm_operation;

GROUP_NUMBER OPERA STAT      POWER     ACTUAL      SOFAR   EST_WORK   EST_RATE
------------ ----- ---- ---------- ---------- ---------- ---------- ----------
EST_MINUTES ERROR_CODE
----------- --------------------------------------------
           1 REBAL RUN           1          1      15841      32731        837
         20


SQL> exit
Disconnected from Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production
With the Real Application Clusters and Automatic Storage Management options
erpdcdb01

Tuesday, December 6, 2016

How to perform Backup and Restore of ASM Metadata

[grid@erpdcdb01 ~]$ asmcmd
ASMCMD> md_backup /u01/Stage/asmbackup/asmmetadata.backup -G RMAN_BKP
Disk group metadata to be backed up: RMAN_BKP
Current alias directory path: ASM
Current alias directory path: SBLCBS/BACKUPSET
Current alias directory path: SBLCBS/BACKUPSET/2016_11_29
Current alias directory path: SBLCBS/BACKUPSET/2016_12_06
Current alias directory path: SBLCBS
Current alias directory path: ASM/DUMPSET
ASMCMD> exit
[grid@erpdcdb01 ~]$
[grid@erpdcdb01 ~]$ srvctl status diskgroup -g RMAN_BKP
Disk Group RMAN_BKP is running on erpdcdb01,erpdcdb02
[grid@erpdcdb01 ~]$ srvctl stop diskgroup -g RMAN_BKP -f
[grid@erpdcdb01 ~]$ srvctl status diskgroup -g RMAN_BKP
Disk Group RMAN_BKP is not running
[grid@erpdcdb01 ~]$ srvctl remove  diskgroup -g RMAN_BKP -f
[grid@erpdcdb01 ~]$ srvctl status diskgroup -g RMAN_BKP
PRCA-1000 : ASM Disk Group RMAN_BKP does not exist
PRCR-1001 : Resource ora.RMAN_BKP.dg does not exist
[grid@erpdcdb01 ~]$ asmcmd lsdg -g
Inst_ID  State    Type    Rebal  Sector  Block       AU  Total_MB  Free_MB  Req_mir_free_MB  Usable_file_MB  Offline_disks  Voting_files  Name
      2  MOUNTED  EXTERN  N         512   4096  1048576    322553   288859                0          288859              0             N  DATA/
      1  MOUNTED  EXTERN  N         512   4096  1048576    322553   288859                0          288859              0             N  DATA/
      2  MOUNTED  EXTERN  N         512   4096  1048576     92158    61454                0           61454              0             N  FRA/
      1  MOUNTED  EXTERN  N         512   4096  1048576     92158    61454                0           61454              0             N  FRA/
      2  MOUNTED  NORMAL  N         512   4096  1048576     12285    11359             4095            3632              0             Y  OCR/
      1  MOUNTED  NORMAL  N         512   4096  1048576     12285    11359             4095            3632              0             Y  OCR/
[grid@erpdcdb01 ~]$
[grid@erpdcdb01 ~]$ sqlplus "/as sysasm"

SQL*Plus: Release 11.2.0.4.0 Production on Tue Dec 6 07:57:24 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 Real Application Clusters and Automatic Storage Management options

SQL> # drop diskgroup RMAN_BKP FORCE INCLUDING CONTENTS;
Don't perform this in production. It will drop data from your diskgroup.

Diskgroup dropped.

SQL> exit
Disconnected from Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production
With the Real Application Clusters and Automatic Storage Management options
[grid@erpdcdb01 ~]$
[grid@erpdcdb01 ~]$ asmcmd
ASMCMD> md_restore /u01/Stage/asmbackup/asmmetadata.backup  --full
Current Diskgroup metadata being restored: RMAN_BKP
Diskgroup RMAN_BKP created!
System template AUTOBACKUP modified!
System template DATAFILE modified!
System template DUMPSET modified!
System template OCRFILE modified!
System template PARAMETERFILE modified!
System template ASMPARAMETERFILE modified!
System template CHANGETRACKING modified!
System template ONLINELOG modified!
System template CONTROLFILE modified!
System template BACKUPSET modified!
System template XTRANSPORT modified!
System template FLASHBACK modified!
System template DATAGUARDCONFIG modified!
System template TEMPFILE modified!
System template FLASHFILE modified!
System template XTRANSPORT BACKUPSET modified!
System template ARCHIVELOG modified!
Directory +RMAN_BKP/SBLCBS re-created!
Directory +RMAN_BKP/ASM re-created!
Directory +RMAN_BKP/SBLCBS/BACKUPSET re-created!
Directory +RMAN_BKP/ASM/DUMPSET re-created!
Directory +RMAN_BKP/SBLCBS/BACKUPSET/2016_12_06 re-created!
Directory +RMAN_BKP/SBLCBS/BACKUPSET/2016_11_29 re-created!
ASMCMD> exit
[grid@erpdcdb01 ~]$
[grid@erpdcdb01 ~]$ asmcmd
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  EXTERN  N         512   4096  1048576    322553   288859                0          288859              0             N  DATA/
MOUNTED  EXTERN  N         512   4096  1048576     92158    61454                0           61454              0             N  FRA/
MOUNTED  NORMAL  N         512   4096  1048576     12285    11359             4095            3632              0             Y  OCR/
MOUNTED  EXTERN  N         512   4096  1048576     92158    92104                0           92104              0             N  RMAN_BKP/
ASMCMD> exit
[grid@erpdcdb01 ~]$
[grid@erpdcdb01 ~]$ srvctl status diskgroup -g RMAN_BKP
Disk Group RMAN_BKP is running on sbldcdb01
[grid@erpdcdb01 ~]$ srvctl stop diskgroup -g RMAN_BKP
[grid@erpdcdb01 ~]$ srvctl start diskgroup -g RMAN_BKP

Tuesday, November 22, 2016

How to Restore RMAN Backup from ASM to file System Database.


1. Connect into RMAN and restore spfile from Backup.

[oracle@OEL564ASMN1 dbs]$ rman target/

Recovery Manager: Release 11.2.0.4.0 - Production on Tue Nov 22 18:11:25 2016

Copyright (c) 1982, 2011, Oracle and/or its affiliates.  All rights reserved.

connected to target database (not started)

RMAN> STARTUP FORCE NOMOUNT

startup failed: ORA-01078: failure in processing system parameters
LRM-00109: could not open parameter file '/u01/app/oracle/product/11.2.0/db_2/dbs/initgolddb.ora'

starting Oracle instance without parameter file for retrieval of spfile
Oracle instance started

Total System Global Area    1068937216 bytes

Fixed Size                     2260088 bytes
Variable Size                281019272 bytes
Database Buffers             780140544 bytes
Redo Buffers                   5517312 bytes

RMAN> RESTORE spfile FROM '/u01/rman_backup/rman_bkp_spfile_GOLDDB_12_20161122.bak';

Starting restore at 22-NOV-16
using target database control file instead of recovery catalog
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=19 device type=DISK

channel ORA_DISK_1: restoring spfile from AUTOBACKUP /u01/rman_backup/rman_bkp_spfile_GOLDDB_12_20161122.bak
channel ORA_DISK_1: SPFILE restore from AUTOBACKUP complete
Finished restore at 22-NOV-16

RMAN> exit


Recovery Manager complete.

2. Connect into database and modify the parameter (control_files, db_create_file_dest, db_recovery_file_dest).

[oracle@OEL564ASMN1 dbs]$ sqlplus "/as sysdba"

SQL*Plus: Release 11.2.0.4.0 Production on Tue Nov 22 18:11:58 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> shut immediate;
ORA-01507: database not mounted


ORACLE instance shut down.
SQL> startup nomount;
ORACLE instance started.

Total System Global Area 1269366784 bytes
Fixed Size                  2252864 bytes
Variable Size             805310400 bytes
Database Buffers          452984832 bytes
Redo Buffers                8818688 bytes
SQL> alter system set control_files='/u01/app/oracle/oradata/controlfile01.ctl' scope=spfile;

System altered.

SQL> alter system set db_create_file_dest='/u01/app/oracle/oradata/' scope=spfile;

System altered.

SQL> alter system set db_recovery_file_dest='/u01/app/oracle/oradata/' scope=spfile;

System altered.

SQL> shut immediate;
ORA-01507: database not mounted


ORACLE instance shut down.
SQL> startup nomount;
ORACLE instance started.

Total System Global Area 1269366784 bytes
Fixed Size                  2252864 bytes
Variable Size             805310400 bytes
Database Buffers          452984832 bytes
Redo Buffers                8818688 bytes
SQL> exit
Disconnected from Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options

3. Restore control file from RMAN Backup.

[oracle@OEL564ASMN1 dbs]$ rman target/

Recovery Manager: Release 11.2.0.4.0 - Production on Tue Nov 22 18:14:18 2016

Copyright (c) 1982, 2011, Oracle and/or its affiliates.  All rights reserved.

connected to target database: GOLDDB (not mounted)

RMAN> RESTORE CONTROLFILE TO '/u01/app/oracle/oradata/controlfile01.ctl' FROM '/u01/rman_backup/rman_bkp_ctl_GOLDDB_928602759_11_1_0brlimk7_1_1';

Starting restore at 22-NOV-16
using target database control file instead of recovery catalog
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=19 device type=DISK

channel ORA_DISK_1: restoring control file
channel ORA_DISK_1: restore complete, elapsed time: 00:00:01
Finished restore at 22-NOV-16

RMAN> exit


Recovery Manager complete.

4. Mount the database and create control file to trace file for find the data file name which we need to rename.

[oracle@OEL564ASMN1 dbs]$ sqlplus "/as sysdba"

SQL*Plus: Release 11.2.0.4.0 Production on Tue Nov 22 18:16:14 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 database mount;

Database altered.

SQL> ALTER DATABASE BACKUP CONTROLFILE TO TRACE AS '/u01/app/oracle/oradata/control_file_records.sql';

Database altered.

SQL> exit
Disconnected from Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
[oracle@OEL564ASMN1 dbs]$

5. Open the control file and find out the name of datafile for generate recovery scripts.

[oracle@OEL564ASMN1 dbs]$ cat /u01/app/oracle/oradata/control_file_records.sql
-- The following are current System-scope REDO Log Archival related
-- parameters and can be included in the database initialization file.
--
-- LOG_ARCHIVE_DEST=''
-- LOG_ARCHIVE_DUPLEX_DEST=''
--
-- LOG_ARCHIVE_FORMAT=%t_%s_%r.dbf
--
-- DB_UNIQUE_NAME="golddb"
--
-- LOG_ARCHIVE_CONFIG='SEND, RECEIVE, NODG_CONFIG'
-- LOG_ARCHIVE_MAX_PROCESSES=4
-- STANDBY_FILE_MANAGEMENT=MANUAL
-- STANDBY_ARCHIVE_DEST=?/dbs/arch
-- FAL_CLIENT=''
-- FAL_SERVER=''
--
-- LOG_ARCHIVE_DEST_1='LOCATION=USE_DB_RECOVERY_FILE_DEST'
-- LOG_ARCHIVE_DEST_1='MANDATORY NOREOPEN NODELAY'
-- LOG_ARCHIVE_DEST_1='ARCH NOAFFIRM EXPEDITE NOVERIFY SYNC'
-- LOG_ARCHIVE_DEST_1='NOREGISTER NOALTERNATE NODEPENDENCY'
-- LOG_ARCHIVE_DEST_1='NOMAX_FAILURE NOQUOTA_SIZE NOQUOTA_USED NODB_UNIQUE_NAME'
-- LOG_ARCHIVE_DEST_1='VALID_FOR=(PRIMARY_ROLE,ONLINE_LOGFILES)'
-- LOG_ARCHIVE_DEST_STATE_1=ENABLE

--
-- Below are two sets of SQL statements, each of which creates a new
-- control file and uses it to open the database. The first set opens
-- the database with the NORESETLOGS option and should be used only if
-- the current versions of all online logs are available. The second
-- set opens the database with the RESETLOGS option and should be used
-- if online logs are unavailable.
-- The appropriate set of statements can be copied from the trace into
-- a script file, edited as necessary, and executed when there is a
-- need to re-create the control file.
--
--     Set #1. NORESETLOGS case
--
-- The following commands will create a new control file and use it
-- to open the database.
-- Data used by Recovery Manager will be lost.
-- Additional logs may be required for media recovery of offline
-- Use this only if the current versions of all online logs are
-- available.
-- WARNING! The current control file needs to be checked against
-- the datafiles to insure it contains the correct files. The
-- commands printed here may be missing log and/or data files.
-- Another report should be made after the database has been
-- successfully opened.

-- After mounting the created controlfile, the following SQL
-- statement will place the database in the appropriate
-- protection mode:
--  ALTER DATABASE SET STANDBY DATABASE TO MAXIMIZE PERFORMANCE

STARTUP NOMOUNT
CREATE CONTROLFILE REUSE DATABASE "GOLDDB" NORESETLOGS  ARCHIVELOG
    MAXLOGFILES 16
    MAXLOGMEMBERS 3
    MAXDATAFILES 100
    MAXINSTANCES 8
    MAXLOGHISTORY 292
LOGFILE
  GROUP 1 '+DATA/golddb/onlinelog/group_1.261.925664911'  SIZE 50M BLOCKSIZE 512,
  GROUP 2 '+DATA/golddb/onlinelog/group_2.262.925664915'  SIZE 50M BLOCKSIZE 512,
  GROUP 3 '+DATA/golddb/onlinelog/group_3.263.925664917'  SIZE 50M BLOCKSIZE 512
-- STANDBY LOGFILE
DATAFILE
  '+DATA/golddb/datafile/system.256.925664777',
  '+DATA/golddb/datafile/sysaux.257.925664781',
  '+DATA/golddb/datafile/undotbs1.258.925664783',
  '+DATA/golddb/datafile/users.259.925664783',
  '+DATA/golddb/datafile/example.265.925664949'
CHARACTER SET WE8MSWIN1252
;

-- Commands to re-create incarnation table
-- Below log names MUST be changed to existing filenames on
-- disk. Any one log file from each branch can be used to
-- re-create incarnation records.
-- ALTER DATABASE REGISTER LOGFILE '/u01/app/oracle/oradata/GOLDDB/archivelog/2016_11_22/o1_mf_1_1_%u_.arc';
-- ALTER DATABASE REGISTER LOGFILE '/u01/app/oracle/oradata/GOLDDB/archivelog/2016_11_22/o1_mf_1_1_%u_.arc';
-- Recovery is required if any of the datafiles are restored backups,
-- or if the last shutdown was not normal or immediate.
RECOVER DATABASE

-- All logs need archiving and a log switch is needed.
ALTER SYSTEM ARCHIVE LOG ALL;

-- Database can now be opened normally.
ALTER DATABASE OPEN;

-- Commands to add tempfiles to temporary tablespaces.
-- Online tempfiles have complete space information.
-- Other tempfiles may require adjustment.
ALTER TABLESPACE TEMP ADD TEMPFILE '+DATA/golddb/tempfile/temp.264.925664933' REUSE;
-- End of tempfile additions.
--
--     Set #2. RESETLOGS case
--
-- The following commands will create a new control file and use it
-- to open the database.
-- Data used by Recovery Manager will be lost.
-- The contents of online logs will be lost and all backups will
-- be invalidated. Use this only if online logs are damaged.
-- WARNING! The current control file needs to be checked against
-- the datafiles to insure it contains the correct files. The
-- commands printed here may be missing log and/or data files.
-- Another report should be made after the database has been
-- successfully opened.

-- After mounting the created controlfile, the following SQL
-- statement will place the database in the appropriate
-- protection mode:
--  ALTER DATABASE SET STANDBY DATABASE TO MAXIMIZE PERFORMANCE

STARTUP NOMOUNT
CREATE CONTROLFILE REUSE DATABASE "GOLDDB" RESETLOGS  ARCHIVELOG
    MAXLOGFILES 16
    MAXLOGMEMBERS 3
    MAXDATAFILES 100
    MAXINSTANCES 8
    MAXLOGHISTORY 292
LOGFILE
  GROUP 1 '+DATA/golddb/onlinelog/group_1.261.925664911'  SIZE 50M BLOCKSIZE 512,
  GROUP 2 '+DATA/golddb/onlinelog/group_2.262.925664915'  SIZE 50M BLOCKSIZE 512,
  GROUP 3 '+DATA/golddb/onlinelog/group_3.263.925664917'  SIZE 50M BLOCKSIZE 512
-- STANDBY LOGFILE
DATAFILE
  '+DATA/golddb/datafile/system.256.925664777',
  '+DATA/golddb/datafile/sysaux.257.925664781',
  '+DATA/golddb/datafile/undotbs1.258.925664783',
  '+DATA/golddb/datafile/users.259.925664783',
  '+DATA/golddb/datafile/example.265.925664949'
CHARACTER SET WE8MSWIN1252
;

-- Commands to re-create incarnation table
-- Below log names MUST be changed to existing filenames on
-- disk. Any one log file from each branch can be used to
-- re-create incarnation records.
-- ALTER DATABASE REGISTER LOGFILE '/u01/app/oracle/oradata/GOLDDB/archivelog/2016_11_22/o1_mf_1_1_%u_.arc';
-- ALTER DATABASE REGISTER LOGFILE '/u01/app/oracle/oradata/GOLDDB/archivelog/2016_11_22/o1_mf_1_1_%u_.arc';
-- Recovery is required if any of the datafiles are restored backups,
-- or if the last shutdown was not normal or immediate.
RECOVER DATABASE USING BACKUP CONTROLFILE

-- Database can now be opened zeroing the online logs.
ALTER DATABASE OPEN RESETLOGS;

-- Commands to add tempfiles to temporary tablespaces.
-- Online tempfiles have complete space information.
-- Other tempfiles may require adjustment.
ALTER TABLESPACE TEMP ADD TEMPFILE '+DATA/golddb/tempfile/temp.264.925664933' REUSE;
-- End of tempfile additions.
--
[oracle@OEL564ASMN1 dbs]$

6. Restore the database from RMAN Backup. [ Recovery will replay error cause of redo log issue]

[oracle@OEL564ASMN1 ~]$ rman target/

Recovery Manager: Release 11.2.0.4.0 - Production on Tue Nov 22 18:22:19 2016

Copyright (c) 1982, 2011, Oracle and/or its affiliates.  All rights reserved.

connected to target database: GOLDDB (DBID=1679955469, not open)

RMAN> RUN
{
2> SET NEWNAME FOR DATAFILE '+DATA/golddb/datafile/system.256.925664777'  TO '/u01/app/oracle/oradata/system01.dbf';
SET NEWNAME FOR DATAFILE '+DATA/golddb/datafile/sysaux.257.925664781' TO '/u01/app/oracle/oradata/sysaux01.dbf';
SET NEWNAME FOR DATAFILE '+DATA/golddb/datafile/undotbs1.258.925664783' TO '/u01/app/oracle/oradata/undotbs101.dbf';
SET NEWNAME FOR DATAFILE '+DATA/golddb/datafile/users.259.925664783' TO '/u01/app/oracle/oradata/users01.dbf';
SET NEWNAME FOR DATAFILE '+DATA/golddb/datafile/example.265.925664949' TO '/u01/app/oracle/oradata/example01.dbf';
RESTORE DATABASE;
SWITCH DATAFILE ALL;
RECOVER DATABASE;
}
3> 4> 5> 6> 7> 8> 9> 10> 11>
executing command: SET NEWNAME

executing command: SET NEWNAME

executing command: SET NEWNAME

executing command: SET NEWNAME

executing command: SET NEWNAME

Starting restore at 22-NOV-16
Starting implicit crosscheck backup at 22-NOV-16
using target database control file instead of recovery catalog
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=17 device type=DISK
Crosschecked 8 objects
Finished implicit crosscheck backup at 22-NOV-16

Starting implicit crosscheck copy at 22-NOV-16
using channel ORA_DISK_1
Finished implicit crosscheck copy at 22-NOV-16

searching for all files in the recovery area
cataloging files...
no files cataloged

using channel ORA_DISK_1

channel ORA_DISK_1: starting datafile backup set restore
channel ORA_DISK_1: specifying datafile(s) to restore from backup set
channel ORA_DISK_1: restoring datafile 00002 to /u01/app/oracle/oradata/sysaux01.dbf
channel ORA_DISK_1: restoring datafile 00005 to /u01/app/oracle/oradata/example01.dbf
channel ORA_DISK_1: reading from backup piece /u01/rman_backup/rman_bkp_df2_GOLDDB_928602649_6_1_06rlimgp_1_1
channel ORA_DISK_1: piece handle=/u01/rman_backup/rman_bkp_df2_GOLDDB_928602649_6_1_06rlimgp_1_1 tag=TAG20161122T171048
channel ORA_DISK_1: restored backup piece 1
channel ORA_DISK_1: restore complete, elapsed time: 00:00:25
channel ORA_DISK_1: starting datafile backup set restore
channel ORA_DISK_1: specifying datafile(s) to restore from backup set
channel ORA_DISK_1: restoring datafile 00001 to /u01/app/oracle/oradata/system01.dbf
channel ORA_DISK_1: restoring datafile 00003 to /u01/app/oracle/oradata/undotbs101.dbf
channel ORA_DISK_1: restoring datafile 00004 to /u01/app/oracle/oradata/users01.dbf
channel ORA_DISK_1: reading from backup piece /u01/rman_backup/rman_bkp_df1_GOLDDB_928602649_5_1_05rlimgp_1_1
channel ORA_DISK_1: piece handle=/u01/rman_backup/rman_bkp_df1_GOLDDB_928602649_5_1_05rlimgp_1_1 tag=TAG20161122T171048
channel ORA_DISK_1: restored backup piece 1
channel ORA_DISK_1: restore complete, elapsed time: 00:00:35
Finished restore at 22-NOV-16

datafile 1 switched to datafile copy
input datafile copy RECID=7 STAMP=928607018 file name=/u01/app/oracle/oradata/system01.dbf
datafile 2 switched to datafile copy
input datafile copy RECID=8 STAMP=928607018 file name=/u01/app/oracle/oradata/sysaux01.dbf
datafile 3 switched to datafile copy
input datafile copy RECID=9 STAMP=928607018 file name=/u01/app/oracle/oradata/undotbs101.dbf
datafile 4 switched to datafile copy
input datafile copy RECID=10 STAMP=928607018 file name=/u01/app/oracle/oradata/users01.dbf
datafile 5 switched to datafile copy
input datafile copy RECID=11 STAMP=928607018 file name=/u01/app/oracle/oradata/example01.dbf

Starting recover at 22-NOV-16
using channel ORA_DISK_1

starting media recovery

channel ORA_DISK_1: starting archived log restore to default destination
channel ORA_DISK_1: restoring archived log
archived log thread=1 sequence=4
channel ORA_DISK_1: reading from backup piece /u01/rman_backup/rman_bkp_archive_GOLDDB_928602754_9_1_09rlimk2_1_1.arch
channel ORA_DISK_1: piece handle=/u01/rman_backup/rman_bkp_archive_GOLDDB_928602754_9_1_09rlimk2_1_1.arch tag=TAG20161122T171233
channel ORA_DISK_1: restored backup piece 1
channel ORA_DISK_1: restore complete, elapsed time: 00:00:01
archived log file name=/u01/app/oracle/oradata/GOLDDB/archivelog/2016_11_22/o1_mf_1_4_d38g6f68_.arc thread=1 sequence=4
channel default: deleting archived log(s)
archived log file name=/u01/app/oracle/oradata/GOLDDB/archivelog/2016_11_22/o1_mf_1_4_d38g6f68_.arc RECID=3 STAMP=928607021
channel ORA_DISK_1: starting archived log restore to default destination
channel ORA_DISK_1: restoring archived log
archived log thread=1 sequence=5
channel ORA_DISK_1: reading from backup piece /u01/rman_backup/rman_bkp_archive_GOLDDB_928602754_10_1_0arlimk2_1_1.arch
channel ORA_DISK_1: piece handle=/u01/rman_backup/rman_bkp_archive_GOLDDB_928602754_10_1_0arlimk2_1_1.arch tag=TAG20161122T171233
channel ORA_DISK_1: restored backup piece 1
channel ORA_DISK_1: restore complete, elapsed time: 00:00:01
archived log file name=/u01/app/oracle/oradata/GOLDDB/archivelog/2016_11_22/o1_mf_1_5_d38g6grf_.arc thread=1 sequence=5
channel default: deleting archived log(s)
archived log file name=/u01/app/oracle/oradata/GOLDDB/archivelog/2016_11_22/o1_mf_1_5_d38g6grf_.arc RECID=4 STAMP=928607022
unable to find archived log
archived log thread=1 sequence=6
RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-03002: failure of recover command at 11/22/2016 18:23:44
RMAN-06054: media recovery requesting unknown archived log for thread 1 with sequence 6 and starting SCN of 984242

RMAN>

7. Connect into database and perform log clear and open the database with resetlog.

[oracle@OEL564ASMN1 ~]$ sqlplus "/as sysdba"

SQL*Plus: Release 11.2.0.4.0 Production on Tue Nov 22 18:46:22 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 DATABASE CLEAR LOGFILE GROUP 1;

Database altered.

SQL> ALTER DATABASE CLEAR LOGFILE GROUP 2;

Database altered.

SQL> ALTER DATABASE CLEAR LOGFILE GROUP 3;

Database altered.

SQL> alter database open RESETLOGS;

Database altered.

SQL> select file_name from dba_data_files;

FILE_NAME
--------------------------------------------------------------------------------
/u01/app/oracle/oradata/users01.dbf
/u01/app/oracle/oradata/undotbs101.dbf
/u01/app/oracle/oradata/sysaux01.dbf
/u01/app/oracle/oradata/system01.dbf
/u01/app/oracle/oradata/example01.dbf

SQL>
SQL> col member format a35
col member format a65
set lines 130
set pages 100
select member, group# from v$logfile;SQL> SQL> SQL> SQL>

MEMBER                                                                GROUP#
----------------------------------------------------------------- ----------
/u01/app/oracle/oradata/GOLDDB/onlinelog/o1_mf_3_d38hkmq7_.log             3
/u01/app/oracle/oradata/GOLDDB/onlinelog/o1_mf_2_d38hkf99_.log             2
/u01/app/oracle/oradata/GOLDDB/onlinelog/o1_mf_1_d38hk2jp_.log             1
/u01/app/oracle/oradata/GOLDDB/onlinelog/o1_mf_1_d38hk2pw_.log             1
/u01/app/oracle/oradata/GOLDDB/onlinelog/o1_mf_2_d38hkfht_.log             2
/u01/app/oracle/oradata/GOLDDB/onlinelog/o1_mf_3_d38hkmxq_.log             3

6 rows selected.

SQL>

Sunday, October 23, 2016

How to find device information of ASM Disks.

1. Find out the asm Disk list using oralceasm listdisks command.
2. Find the device mapping information using oracleasm  querydisk command.
3. Find out the device using ls -l command.

[root@sbdbdr01 ~]# oracleasm listdisks
DB_ORCL_DATA_ASM_01
DB_ORCL_DATA_ASM_02
DB_ORCL_DATA_ASM_03
DB_ORCL_DATA_ASM_04
DB_ORCL_DATA_ASM_05
DB_ORCL_FRA_ASM_01
DB_ORCL_FRA_ASM_02
DB_ORCL_FRA_ASM_03
DB_ORCL_FRA_ASM_04
DB_ORCL_FRA_ASM_05
DB_ORCL_FRA_ASM_06
[root@sbdbdr01 ~]#
[root@sbdbdr01 ~]# oracleasm querydisk -d DB_ORCL_DATA_ASM_05
Disk "DB_ORCL_DATA_ASM_05" is a valid ASM disk on device [8, 97]
[root@sbdbdr01 ~]#
[root@sbdbdr01 ~]#
[root@sbdbdr01 ~]# ls -l /dev/* | grep 8, | grep 97
brw-rw----  1 root disk      8,  97 Oct 23 13:49 /dev/sdg1
[root@sbdbdr01 ~]#

How to drop ASM Disk.

[grid@sbdbdr01 ~]$ sqlplus "/as sysasm"

SQL*Plus: Release 11.2.0.4.0 Production on Sun Oct 23 12:47:18 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 Automatic Storage Management option

SQL> SET ECHO        OFF
SET FEEDBACK    6
SET HEADING     ON
SET LINESIZE    180
SET PAGESIZE    50000
SET TERMOUT     ON
SET TIMING      OFF
SET TRIMOUT     ON
SET TRIMSPOOL   ON
SET VERIFY      OFF

CLEAR COLUMNS
CLEAR BREAKS
CLEAR COMPUTES

COLUMN disk_group_name        FORMAT a25           HEAD 'Disk Group Name'
COLUMN disk_file_path         FORMAT a30           HEAD 'Path'
COLUMN disk_file_name         FORMAT a20           HEAD 'File Name'
COLUMN disk_file_fail_group   FORMAT a20           HEAD 'Fail Group'
COLUMN total_mb               FORMAT 999,999,999   HEAD 'File Size (MB)'
COLUMN used_mb                FORMAT 999,999,999   HEAD 'Used Size (MB)'
COLUMN pct_used               FORMAT 999.99        HEAD 'Pct. Used'

BREAK ON report ON disk_group_name SKIP 1

COMPUTE sum LABEL ""              OF total_mb used_mb ON disk_group_name
COMPUTE sum LABEL "Grand Total: " OF total_mb used_mb ON report

SELECT
    NVL(a.name, '[CANDIDATE]')                       disk_group_name
  , b.name                                           disk_file_name
  , b.failgroup                                      disk_file_fail_group
  , b.total_mb                                       total_mb
  , (b.total_mb - b.free_mb)                         used_mb
FROM
    v$asm_diskgroup a RIGHT OUTER JOIN v$asm_disk b USING (group_number)
ORDER BY
    a.name;
/SQL> SQL> SQL> SQL> SQL> SQL> SQL> SQL> SQL> SQL> SQL> columns cleared
SQL> breaks cleared
SQL> computes cleared
SQL> SQL> SQL> SQL> SQL> SQL> SQL> SQL> SQL> SQL> SQL> SQL> SQL> SQL> SQL>   2    3    4    5    6    7    8    9   10
Disk Group Name           File Name            Fail Group           File Size (MB) Used Size (MB)
------------------------- -------------------- -------------------- -------------- --------------
DATA                      DB_ORCL_DATA_ASM_05  DB_ORCL_DATA_ASM_05          49,151         23,281
                          DB_ORCL_DATA_ASM_04  DB_ORCL_DATA_ASM_04          49,151         23,280
                          DB_ORCL_DATA_ASM_03  DB_ORCL_DATA_ASM_03          49,151         23,283
                          DB_ORCL_DATA_ASM_02  DB_ORCL_DATA_ASM_02          49,151         23,284
                          DB_ORCL_DATA_ASM_01  DB_ORCL_DATA_ASM_01          49,151         23,282
*************************                                           -------------- --------------
                                                                           245,755        116,410

FRA                       DB_ORCL_FRA_ASM_04   DB_ORCL_FRA_ASM_04           23,551          7,071
                          DB_ORCL_FRA_ASM_03   DB_ORCL_FRA_ASM_03           23,551          7,073
                          DB_ORCL_FRA_ASM_02   DB_ORCL_FRA_ASM_02           23,551          7,074
                          DB_ORCL_FRA_ASM_01   DB_ORCL_FRA_ASM_01           23,551          7,077
*************************                                           -------------- --------------
                                                                            94,204         28,295

RMAN_BKP                  DB_ORCL_FRA_ASM_05   DB_ORCL_FRA_ASM_05           23,551             59
*************************                                           -------------- --------------
                                                                            23,551             59

[CANDIDATE]                                                                      0              0
*************************                                           -------------- --------------
                                                                                 0              0

                                                                    -------------- --------------
Grand Total:                                                               363,510        144,764

11 rows selected.
SQL> select * from v$asm_operation ;

no rows selected

SQL> ALTER DISKGROUP DATA DROP DISK DB_ORCL_DATA_ASM_05;

Diskgroup altered.

SQL> select * from v$asm_operation ;

GROUP_NUMBER OPERA STAT      POWER     ACTUAL      SOFAR   EST_WORK   EST_RATE EST_MINUTES ERROR_CODE
------------ ----- ---- ---------- ---------- ---------- ---------- ---------- ----------- --------------------------------------------
           1 REBAL RUN           1          1        340      33291       5431           6

SQL>

Tuesday, August 23, 2016

How to add disk into ASM Disk Group

[grid@sbldcdb01 ~]$ sqlplus "/as sysasm"

SQL*Plus: Release 11.2.0.4.0 Production on Tue Aug 23 17:38:28 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 Real Application Clusters and Automatic Storage Management options

SQL> SET LINE 200
COL NAME FORMAT A30
COL HEADER_STATUS FORMAT A15
COL PATH FORMAT A50
COL TOTAL_MB FORMAT 99999

SELECT NAME,TOTAL_MB, HEADER_STATUS, PATH FROM V$ASM_DISK;SQL> SQL> SQL> SQL> SQL> SQL>

NAME                           TOTAL_MB HEADER_STATUS   PATH
------------------------------ -------- --------------- --------------------------------------------------
                                      0 PROVISIONED     ORCL:DB_ORCL_DATA_ASM_03
                                      0 PROVISIONED     ORCL:DB_ORCL_DATA_ASM_04
                                      0 PROVISIONED     ORCL:DB_ORCL_FRA_ASM_06
                                      0 PROVISIONED     ORCL:DB_ORCL_FRA_ASM_05
                                      0 PROVISIONED     ORCL:DB_ORCL_FRA_ASM_04
                                      0 PROVISIONED     ORCL:DB_ORCL_FRA_ASM_03
                                      0 PROVISIONED     ORCL:DB_ORCL_DATA_ASM_10
                                      0 PROVISIONED     ORCL:DB_ORCL_DATA_ASM_09
                                      0 PROVISIONED     ORCL:DB_ORCL_DATA_ASM_08
                                      0 PROVISIONED     ORCL:DB_ORCL_DATA_ASM_05
                                      0 PROVISIONED     ORCL:DB_ORCL_DATA_ASM_06

NAME                           TOTAL_MB HEADER_STATUS   PATH
------------------------------ -------- --------------- --------------------------------------------------
                                      0 PROVISIONED     ORCL:DB_ORCL_DATA_ASM_07
DB_ORCL_DATA_ASM_01               46079 MEMBER          ORCL:DB_ORCL_DATA_ASM_01
DB_ORCL_DATA_ASM_02               46079 MEMBER          ORCL:DB_ORCL_DATA_ASM_02
DB_ORCL_FRA_ASM_01                46079 MEMBER          ORCL:DB_ORCL_FRA_ASM_01
DB_ORCL_FRA_ASM_02                46079 MEMBER          ORCL:DB_ORCL_FRA_ASM_02
DB_ORCL_OCR_01                     4095 MEMBER          ORCL:DB_ORCL_OCR_01
DB_ORCL_OCR_02                     4095 MEMBER          ORCL:DB_ORCL_OCR_02
DB_ORCL_OCR_03                     4095 MEMBER          ORCL:DB_ORCL_OCR_03
DB_ORCL_RMAN_BACKUP_01            46079 MEMBER          ORCL:DB_ORCL_RMAN_BACKUP_01

20 rows selected.

SQL> ALTER DISKGROUP DATA ADD DISK 'ORCL:DB_ORCL_DATA_ASM_03';

Diskgroup altered.

SQL> SELECT NAME,TOTAL_MB, HEADER_STATUS, PATH FROM V$ASM_DISK;

NAME                           TOTAL_MB HEADER_STATUS   PATH
------------------------------ -------- --------------- --------------------------------------------------
                                      0 PROVISIONED     ORCL:DB_ORCL_DATA_ASM_04
                                      0 PROVISIONED     ORCL:DB_ORCL_DATA_ASM_05
                                      0 PROVISIONED     ORCL:DB_ORCL_FRA_ASM_06
                                      0 PROVISIONED     ORCL:DB_ORCL_FRA_ASM_05
                                      0 PROVISIONED     ORCL:DB_ORCL_FRA_ASM_04
                                      0 PROVISIONED     ORCL:DB_ORCL_FRA_ASM_03
                                      0 PROVISIONED     ORCL:DB_ORCL_DATA_ASM_10
                                      0 PROVISIONED     ORCL:DB_ORCL_DATA_ASM_09
                                      0 PROVISIONED     ORCL:DB_ORCL_DATA_ASM_08
                                      0 PROVISIONED     ORCL:DB_ORCL_DATA_ASM_07
                                      0 PROVISIONED     ORCL:DB_ORCL_DATA_ASM_06

NAME                           TOTAL_MB HEADER_STATUS   PATH
------------------------------ -------- --------------- --------------------------------------------------
DB_ORCL_DATA_ASM_01               46079 MEMBER          ORCL:DB_ORCL_DATA_ASM_01
DB_ORCL_DATA_ASM_02               46079 MEMBER          ORCL:DB_ORCL_DATA_ASM_02
DB_ORCL_DATA_ASM_03               46079 MEMBER          ORCL:DB_ORCL_DATA_ASM_03
DB_ORCL_FRA_ASM_01                46079 MEMBER          ORCL:DB_ORCL_FRA_ASM_01
DB_ORCL_FRA_ASM_02                46079 MEMBER          ORCL:DB_ORCL_FRA_ASM_02
DB_ORCL_OCR_01                     4095 MEMBER          ORCL:DB_ORCL_OCR_01
DB_ORCL_OCR_02                     4095 MEMBER          ORCL:DB_ORCL_OCR_02
DB_ORCL_OCR_03                     4095 MEMBER          ORCL:DB_ORCL_OCR_03
DB_ORCL_RMAN_BACKUP_01            46079 MEMBER          ORCL:DB_ORCL_RMAN_BACKUP_01

20 rows selected.

SQL>

Monday, June 22, 2015

Find the mapping of ASM Disk to Physical Device.

1. Disk list of oracleasm

[root@OEL564ASMN1 ~]# oracleasm listdisks
DATAVOL1
FRAVOL1
RMAN_BKP

2. Physical Device for ASM Disks.

[root@OEL564ASMN1 ~]# /etc/init.d/oracleasm querydisk -p DATAVOL1
Disk "DATAVOL1" is a valid ASM disk
/dev/sdb1: LABEL="DATAVOL1" TYPE="oracleasm"
[root@OEL564ASMN1 ~]# /etc/init.d/oracleasm querydisk -p FRAVOL1
Disk "FRAVOL1" is a valid ASM disk
/dev/sdc1: LABEL="FRAVOL1" TYPE="oracleasm"

Or

[root@OEL564ASMN1 ~]# /etc/init.d/oracleasm querydisk -d DATAVOL1
Disk "DATAVOL1" is a valid ASM disk on device /dev/sdb1[8,17]

3. ASM Disks Name for Physical Device.

[root@OEL564ASMN1 ~]# /etc/init.d/oracleasm querydisk /dev/sdb1
Device "/dev/sdb1" is marked an ASM disk with the label "DATAVOL1"

Thursday, May 28, 2015

Instantiating disk: failed

Cause :

1. Shell Linux Not Disabled.
2. ASM is not loaded.

Action :

1. Ensure your SELINUX=disabled from vi /etc/selinux/config.

2. Perform the following ..

[root@OEL5RACN2 ~]# oracleasm createdisk CRS_FILES_01 /dev/sdb1
Writing disk header: done
Instantiating disk: failed
Clearing disk header: done
[root@OEL5RACN2 ~]# oracleasm status
Checking if ASM is loaded: no
Checking if /dev/oracleasm is mounted: no

Reboot your System.

[root@OEL5RACN1 ~]# oracleasm status
Checking if ASM is loaded: yes
Checking if /dev/oracleasm is mounted: yes
[root@OEL5RACN1 ~]# oracleasm createdisk CRS_FILES_01 /dev/sdb1
Writing disk header: done
Instantiating disk: done

[root@OEL5RACN1 ~]#

RMAN Backup In ASM Disk Group.

It will help us to take RMAN Backup in ASM Disk Group.

[oracle@OEL564ASMN1 ~]$ rman target/

Recovery Manager: Release 11.2.0.3.0 - Production on Thu May 28 17:16:59 2015

Copyright (c) 1982, 2011, Oracle and/or its affiliates.  All rights reserved.

connected to target database: ASMDB (DBID=624768357)

RMAN> backup device type disk format '+RMAN_BACKUP/%U' database plus archivelog delete input;

Starting backup at 28-MAY-15
current log archived
using target database control file instead of recovery catalog
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=47 device type=DISK
channel ORA_DISK_1: starting archived log backup set
channel ORA_DISK_1: specifying archived log(s) in backup set
input archived log thread=1 sequence=3 RECID=1 STAMP=880572465
input archived log thread=1 sequence=4 RECID=2 STAMP=880573855
input archived log thread=1 sequence=5 RECID=3 STAMP=880658166
input archived log thread=1 sequence=6 RECID=4 STAMP=880897231
input archived log thread=1 sequence=7 RECID=5 STAMP=880898978
input archived log thread=1 sequence=8 RECID=6 STAMP=880909238
input archived log thread=1 sequence=9 RECID=7 STAMP=880910336
channel ORA_DISK_1: starting piece 1 at 28-MAY-15
channel ORA_DISK_1: finished piece 1 at 28-MAY-15
piece handle=+RMAN_BACKUP/01q83801_1_1 tag=TAG20150528T171856 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:15
channel ORA_DISK_1: deleting archived log(s)
archived log file name=+FRA/asmdb/archivelog/2015_05_24/thread_1_seq_3.260.880572457 RECID=1 STAMP=880572465
archived log file name=+FRA/asmdb/archivelog/2015_05_24/thread_1_seq_4.261.880573849 RECID=2 STAMP=880573855
archived log file name=+FRA/asmdb/archivelog/2015_05_25/thread_1_seq_5.262.880658159 RECID=3 STAMP=880658166
archived log file name=+FRA/asmdb/archivelog/2015_05_28/thread_1_seq_6.263.880897227 RECID=4 STAMP=880897231
archived log file name=+FRA/asmdb/archivelog/2015_05_28/thread_1_seq_7.264.880898973 RECID=5 STAMP=880898978
archived log file name=+FRA/asmdb/archivelog/2015_05_28/thread_1_seq_8.265.880909235 RECID=6 STAMP=880909238
archived log file name=+FRA/asmdb/archivelog/2015_05_28/thread_1_seq_9.266.880910333 RECID=7 STAMP=880910336
Finished backup at 28-MAY-15

Starting backup at 28-MAY-15
using channel ORA_DISK_1
channel ORA_DISK_1: starting full datafile backup set
channel ORA_DISK_1: specifying datafile(s) in backup set
input datafile file number=00001 name=+DATA/asmdb/datafile/system.256.880569463
input datafile file number=00002 name=+DATA/asmdb/datafile/sysaux.257.880569467
input datafile file number=00005 name=+DATA/asmdb/datafile/example.265.880569629
input datafile file number=00003 name=+DATA/asmdb/datafile/undotbs1.258.880569467
input datafile file number=00004 name=+DATA/asmdb/datafile/users.259.880569471
channel ORA_DISK_1: starting piece 1 at 28-MAY-15
channel ORA_DISK_1: finished piece 1 at 28-MAY-15
piece handle=+RMAN_BACKUP/02q8380o_1_1 tag=TAG20150528T171920 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:01:15
channel ORA_DISK_1: starting full datafile backup set
channel ORA_DISK_1: specifying datafile(s) in backup set
including current control file in backup set
including current SPFILE in backup set
channel ORA_DISK_1: starting piece 1 at 28-MAY-15
channel ORA_DISK_1: finished piece 1 at 28-MAY-15
piece handle=+RMAN_BACKUP/03q83833_1_1 tag=TAG20150528T171920 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:07
Finished backup at 28-MAY-15

Starting backup at 28-MAY-15
current log archived
using channel ORA_DISK_1
channel ORA_DISK_1: starting archived log backup set
channel ORA_DISK_1: specifying archived log(s) in backup set
input archived log thread=1 sequence=10 RECID=8 STAMP=880910447
channel ORA_DISK_1: starting piece 1 at 28-MAY-15
channel ORA_DISK_1: finished piece 1 at 28-MAY-15
piece handle=+RMAN_BACKUP/04q8383g_1_1 tag=TAG20150528T172047 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:07
channel ORA_DISK_1: deleting archived log(s)
archived log file name=+FRA/asmdb/archivelog/2015_05_28/thread_1_seq_10.266.880910443 RECID=8 STAMP=880910447
Finished backup at 28-MAY-15

RMAN> exit

Recovery Manager complete.
[oracle@OEL564ASMN1 ~]$

=== Backup Piece ====

[grid@OEL564ASMN1 ~]$ asmcmd
ASMCMD> ls
DATA/
FRA/
RMAN_BACKUP/
ASMCMD> cd /RMAN_BACKUP/
ASMCMD> ls
01q83801_1_1
02q8380o_1_1
03q83833_1_1
04q8383g_1_1
ASMDB/
ASMCMD> ls -ltr
WARNING:option 'r' is deprecated for 'ls'
please use 'reverse'

Type       Redund  Striped  Time             Sys  Name
                                             Y    ASMDB/
                                             N    01q83801_1_1 => +RMAN_BACKUP/ASMDB/BACKUPSET/2015_05_28/annnf0_TAG20150528T171856_0.256.880910339
                                             N    02q8380o_1_1 => +RMAN_BACKUP/ASMDB/BACKUPSET/2015_05_28/nnndf0_TAG20150528T171920_0.257.880910361
                                             N    03q83833_1_1 => +RMAN_BACKUP/ASMDB/BACKUPSET/2015_05_28/ncsnf0_TAG20150528T171920_0.258.880910437
                                             N    04q8383g_1_1 => +RMAN_BACKUP/ASMDB/BACKUPSET/2015_05_28/annnf0_TAG20150528T172047_0.259.880910449
ASMCMD>

Add New Disk Group In ASM

Disk Redundancy : There are three disk redundancy in Oracle ASM which are used at the time of Disk group creation.

NORMAL REDUNDANCY - Two-way mirroring, requiring two failure groups.
HIGH REDUNDANCY - Three-way mirroring, requiring three failure groups.
EXTERNAL REDUNDANCY - No mirroring for disks that are already protected using hardware mirroring or RAID.

Disk Group REBALANCE: REBALANCE would not required normally, ASM automatically rebalances disk groups when their configuration changes. We can do an manual REBALANCE operation to control the speed.

POWER: This is specifies the degree of parallelism, and thus the speed of the rebalance operation.

[

CREATE DISKGROUP RMAN_BACKUP EXTERNAL REDUNDANCY DISK '/dev/oracleasm/disks/RMAN_BKP';

CREATE DISKGROUP RMAN_BACKUP NORMAL REDUNDANCY
  FAILGROUP fail_group_1 DISK
    '/dev/oracleasm/disks/file01' NAME disk1,
    '/dev/oracleasm/disks/file02' NAME disk2
  FAILGROUP fail_group_2 DISK
    '/dev/oracleasm/disks/file03' NAME disk1,
    '/dev/oracleasm/disks/file04' NAME disk2;

 CREATE DISKGROUP DATA_DISK01 HIGH REDUNDANCY
 FAILGROUP FAIL_GROUP_1 DISK
 '/dev/oracleasm/disks/file01'
 FAILGROUP FAIL_GROUP_1 DISK
 '/dev/oracleasm/disks/file02'
 FAILGROUP FAIL_GROUP_1 DISK
 '/dev/oracleasm/disks/file03'
 FAILGROUP FAIL_GROUP_1 DISK
 '/dev/oracleasm/disks/file04'
 FAILGROUP FAIL_GROUP_1 DISK
 '/dev/oracleasm/disks/file05'
 FAILGROUP FAIL_GROUP_1 DISK
 '/dev/oracleasm/disks/file06'
 ATTRIBUTE 'compatible.asm' = '11.2.0.0.0';

 ]

=== From root User

List of LUN Available for ASM

[root@OEL564ASMN1 ~]# fdisk -l

Disk /dev/sda: 53.6 GB, 53687091200 bytes
255 heads, 63 sectors/track, 6527 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1   *           1          13      104391   83  Linux
/dev/sda2              14        2624    20972857+  83  Linux
/dev/sda3            2625        3146     4192965   82  Linux swap / Solaris
/dev/sda4            3147        6527    27157882+   5  Extended
/dev/sda5            3147        6527    27157851   8e  Linux LVM

Disk /dev/sdb: 32.2 GB, 32212254720 bytes
255 heads, 63 sectors/track, 3916 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

   Device Boot      Start         End      Blocks   Id  System
/dev/sdb1               1        3916    31455238+  83  Linux

Disk /dev/sdc: 10.7 GB, 10737418240 bytes
255 heads, 63 sectors/track, 1305 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

   Device Boot      Start         End      Blocks   Id  System
/dev/sdc1               1        1305    10482381   83  Linux

Disk /dev/sdd: 5368 MB, 5368709120 bytes
255 heads, 63 sectors/track, 652 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

Disk /dev/sdd doesn't contain a valid partition table

Prepare Disk For ASM

[root@OEL564ASMN1 ~]# fdisk /dev/sdd
Device contains neither a valid DOS partition table, nor Sun, SGI or OSF disklabel
Building a new DOS disklabel. Changes will remain in memory only,
until you decide to write them. After that, of course, the previous
content won't be recoverable.

Warning: invalid flag 0x0000 of partition table 4 will be corrected by w(rite)

Command (m for help): n
Command action
   e   extended
   p   primary partition (1-4)
p
Partition number (1-4): 1
First cylinder (1-652, default 1):
Using default value 1
Last cylinder or +size or +sizeM or +sizeK (1-652, default 652):
Using default value 652

Command (m for help): w
The partition table has been altered!

Calling ioctl() to re-read partition table.
Syncing disks.
[root@OEL564ASMN1 ~]#

List of Disk For ASM

[root@OEL564ASMN1 ~]# fdisk -l

Disk /dev/sda: 53.6 GB, 53687091200 bytes
255 heads, 63 sectors/track, 6527 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1   *           1          13      104391   83  Linux
/dev/sda2              14        2624    20972857+  83  Linux
/dev/sda3            2625        3146     4192965   82  Linux swap / Solaris
/dev/sda4            3147        6527    27157882+   5  Extended
/dev/sda5            3147        6527    27157851   8e  Linux LVM

Disk /dev/sdb: 32.2 GB, 32212254720 bytes
255 heads, 63 sectors/track, 3916 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

   Device Boot      Start         End      Blocks   Id  System
/dev/sdb1               1        3916    31455238+  83  Linux

Disk /dev/sdc: 10.7 GB, 10737418240 bytes
255 heads, 63 sectors/track, 1305 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

   Device Boot      Start         End      Blocks   Id  System
/dev/sdc1               1        1305    10482381   83  Linux

Disk /dev/sdd: 5368 MB, 5368709120 bytes
255 heads, 63 sectors/track, 652 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

   Device Boot      Start         End      Blocks   Id  System
/dev/sdd1               1         652     5237158+  83  Linux
[root@OEL564ASMN1 ~]# oracleasm createdisk RMAN_BKP /dev/sdd1
Writing disk header: done
Instantiating disk: done
[root@OEL564ASMN1 ~]#
[root@OEL564ASMN1 ~]# oracleasm listdisks
DATAVOL1
FRAVOL1
RMAN_BKP
[root@OEL564ASMN1 ~]#
[root@OEL564ASMN1 ~]# oracleasm-discover
Using ASMLib from /opt/oracle/extapi/32/asm/orcl/1/libasm.so
[ASM Library - Generic Linux, version 2.0.4 (KABI_V2)]
Discovered disk: ORCL:DATAVOL1 [62910477 blocks (32210164224 bytes), maxio 512]
Discovered disk: ORCL:FRAVOL1 [20964762 blocks (10733958144 bytes), maxio 512]
Discovered disk: ORCL:RMAN_BKP [10474317 blocks (5362850304 bytes), maxio 512]
[root@OEL564ASMN1 ~]#
[root@OEL564ASMN1 ~]# oracleasm scandisks
Reloading disk partitions: done
Cleaning any stale ASM disks...
Scanning system for ASM disks...
[root@OEL564ASMN1 ~]#

=== From grid User

[grid@OEL564ASMN1 ~]$ sqlplus /nolog

SQL*Plus: Release 11.2.0.3.0 Production on Thu May 28 14:17:16 2015

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

SQL> conn /as sysasm
Connected.
SQL> SELECT GROUP_NUMBER, NAME FROM V$ASM_DISKGROUP;

GROUP_NUMBER Disk Name
------------ ------------
           1 DATA
           2 FRA

SQL> SET LINE 2000
SQL> COLUMN group_number                FORMAT 999,999       HEAD 'Group Number'
SQL> COLUMN MOUNT_STATUS         FORMAT a10           HEAD 'Mount Status'
SQL> COLUMN HEADER_STATUS               FORMAT a12           HEAD 'Header Status'
SQL> COLUMN MODE_STATUS         FORMAT a10           HEAD ' Mode Status'
SQL> COLUMN STATE                       FORMAT a10           HEAD 'State'
SQL> COLUMN TOTAL_MB                    FORMAT 999,999       HEAD 'Total Size In MB'
SQL> COLUMN FREE_MB                     FORMAT 999,999       HEAD 'Free Space In MB'
SQL> COLUMN NAME                        FORMAT a12           HEAD 'Disk Name'
SQL> COLUMN PATH                        FORMAT a45           HEAD 'Disk Location'
SQL> COLUMN LABEL                       FORMAT a12           HEAD 'Disk Level'
SQL> SELECT GROUP_NUMBER, MOUNT_STATUS,HEADER_STATUS,MODE_STATUS,STATE,TOTAL_MB,FREE_MB,NAME,PATH,LABEL FROM V$ASM_DISK;

Group Number Mount Stat Header Statu  Mode Stat State      Total Size In MB Free Space In MB Disk Name    Disk Location                                 Disk Level
------------ ---------- ------------ ---------- ---------- ---------------- ---------------- ------------ --------------------------------------------- ------------
           0 CLOSED     PROVISIONED  ONLINE     NORMAL                    0                0              /dev/oracleasm/disks/RMAN_BKP
           2 CACHED     MEMBER       ONLINE     NORMAL               10,236            9,942 FRA_0000     /dev/oracleasm/disks/FRAVOL1
           1 CACHED     MEMBER       ONLINE     NORMAL               30,718           28,836 DATA_0000    /dev/oracleasm/disks/DATAVOL1

SQL>
SQL> CREATE DISKGROUP RMAN_BACKUP EXTERNAL REDUNDANCY DISK '/dev/oracleasm/disks/RMAN_BKP';

Diskgroup created.

SQL>
SQL> SELECT GROUP_NUMBER, MOUNT_STATUS,HEADER_STATUS,MODE_STATUS,STATE,TOTAL_MB,FREE_MB,NAME,PATH,LABEL FROM V$ASM_DISK;

Group Number Mount Stat Header Statu  Mode Stat State      Total Size In MB Free Space In MB Disk Name    Disk Location                                 Disk Level
------------ ---------- ------------ ---------- ---------- ---------------- ---------------- ------------ --------------------------------------------- ------------
           2 CACHED     MEMBER       ONLINE     NORMAL               10,236            9,942 FRA_0000     /dev/oracleasm/disks/FRAVOL1
           1 CACHED     MEMBER       ONLINE     NORMAL               30,718           28,836 DATA_0000    /dev/oracleasm/disks/DATAVOL1
           3 CACHED     MEMBER       ONLINE     NORMAL                5,114            5,064 RMAN_BACKUP_ /dev/oracleasm/disks/RMAN_BKP
                                                                                             0000
SQL>


Monday, May 25, 2015

Install Oracle ASM packages and create ASM disk groups.

We will perform the following task for configuring ASM disk group. All task will perform from root user.

1. Install ASM rpm.
2. Configuring and load the ASM kernel module.
3. Creating ASM disk volumes.
4. Creating ASM disks.
5. Test disks discovery.

1. Install ASM rpm.

To configure ASM we have to install the following rpm. You can find this rpm file from OTN

oracleasm-2.6.18-194.el5-2.0.5-1.el5.x86_64.rpm
oracleasmlib-2.0.4-1.el5.i386.rpm
oracleasm-support-2.1.8-1.el5.i386.rpm

[root@OEL564ASMN1 ASM]# ls -ltr
total 244
-rwxrwxr-x 1 root root 137486 Apr 11 12:14 oracleasm-2.6.18-194.el5-2.0.5-1.el5.x86_64.rpm
-rwxrwxr-x 1 root root  85303 Apr 11 12:16 oracleasm-support-2.1.8-1.el5.i386.rpm
-rwxrwxr-x 1 root root  13929 Apr 11 12:17 oracleasmlib-2.0.4-1.el5.i386.rpm
[root@OEL564ASMN1 ASM]# rpm -Uvh oracleasm-support-2.1.8-1.el5.i386.rpm
warning: oracleasm-support-2.1.8-1.el5.i386.rpm: Header V3 DSA signature: NOKEY, key ID 1e5e0159
Preparing...                ########################################### [100%]
   1:oracleasm-support      ########################################### [100%]
[root@OEL564ASMN1 ASM]# rpm -Uvh oracleasm-2.6.18-194.el5-2.0.5-1.el5.x86_64.rpm
warning: oracleasm-2.6.18-194.el5-2.0.5-1.el5.x86_64.rpm: Header V3 DSA signature: NOKEY, key ID 1e5e0159
Preparing...                ########################################### [100%]
   1:oracleasm-2.6.18-194.el########################################### [100%]
[root@OEL564ASMN1 ASM]# rpm -Uvh oracleasmlib-2.0.4-1.el5.i386.rpm
warning: oracleasmlib-2.0.4-1.el5.i386.rpm: Header V3 DSA signature: NOKEY, key ID 1e5e0159
Preparing...                ########################################### [100%]
   1:oracleasmlib           ########################################### [100%]

2. Configuring and load the ASM kernel module.

[This script completes the following tasks.
Creates the /etc/sysconfig/oracleasm configuration file
Creates the /dev/oracleasm mount point
Mounts the ASMLib driver file system
]

[root@OEL564ASMN1 ASM]# oracleasm configure -i
Configuring the Oracle ASM library driver.

This will configure the on-boot properties of the Oracle ASM library
driver.  The following questions will determine whether the driver is
loaded on boot and what permissions it will have.  The current values
will be shown in brackets ('[]').  Hitting <ENTER> without typing an
answer will keep that current value.  Ctrl-C will abort.

Default user to own the driver interface []: grid
Default group to own the driver interface []: asmadmin
Start Oracle ASM library driver on boot (y/n) [n]: y
Scan for Oracle ASM disks on boot (y/n) [y]: y
Writing Oracle ASM library driver configuration: done

[This will load oracleasm kernel module ]

[root@OEL564ASMN1 ASM]# oracleasm init
Creating /dev/oracleasm mount point: /dev/oracleasm
Loading module "oracleasm": oracleasm

Mounting ASMlib driver filesystem: /dev/oracleasm

3. Creating ASM disk volumes.

Showing available disk for Oracle ASM Disk Volume.
[root@OEL564ASMN1 ASM]# fdisk -l

Disk /dev/sda: 53.6 GB, 53687091200 bytes
255 heads, 63 sectors/track, 6527 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1   *           1          13      104391   83  Linux
/dev/sda2              14        2624    20972857+  83  Linux
/dev/sda3            2625        3146     4192965   82  Linux swap / Solaris
/dev/sda4            3147        6527    27157882+   5  Extended
/dev/sda5            3147        6527    27157851   8e  Linux LVM

Disk /dev/sdb: 32.2 GB, 32212254720 bytes
255 heads, 63 sectors/track, 3916 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

Disk /dev/sdb doesn't contain a valid partition table

Disk /dev/sdc: 10.7 GB, 10737418240 bytes
255 heads, 63 sectors/track, 1305 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

Disk /dev/sdc doesn't contain a valid partition table

[ We will use /dev/sdb and /dev/sdc for ASM Disk group ]

[root@OEL564ASMN1 ASM]# fdisk /dev/sdb
Device contains neither a valid DOS partition table, nor Sun, SGI or OSF disklabel
Building a new DOS disklabel. Changes will remain in memory only,
until you decide to write them. After that, of course, the previous
content won't be recoverable.


The number of cylinders for this disk is set to 3916.
There is nothing wrong with that, but this is larger than 1024,
and could in certain setups cause problems with:
1) software that runs at boot time (e.g., old versions of LILO)
2) booting and partitioning software from other OSs
   (e.g., DOS FDISK, OS/2 FDISK)
Warning: invalid flag 0x0000 of partition table 4 will be corrected by w(rite)

Command (m for help): n
Command action
   e   extended
   p   primary partition (1-4)
p
Partition number (1-4): 1
First cylinder (1-3916, default 1):
Using default value 1
Last cylinder or +size or +sizeM or +sizeK (1-3916, default 3916):
Using default value 3916

Command (m for help): w
The partition table has been altered!

Calling ioctl() to re-read partition table.
Syncing disks.
[root@OEL564ASMN1 ASM]# fdisk /dev/sdc
Device contains neither a valid DOS partition table, nor Sun, SGI or OSF disklabel
Building a new DOS disklabel. Changes will remain in memory only,
until you decide to write them. After that, of course, the previous
content won't be recoverable.


The number of cylinders for this disk is set to 1305.
There is nothing wrong with that, but this is larger than 1024,
and could in certain setups cause problems with:
1) software that runs at boot time (e.g., old versions of LILO)
2) booting and partitioning software from other OSs
   (e.g., DOS FDISK, OS/2 FDISK)
Warning: invalid flag 0x0000 of partition table 4 will be corrected by w(rite)

Command (m for help): n
Command action
   e   extended
   p   primary partition (1-4)
p
Partition number (1-4): 1
First cylinder (1-1305, default 1):
Using default value 1
Last cylinder or +size or +sizeM or +sizeK (1-1305, default 1305):
Using default value 1305

Command (m for help): w
The partition table has been altered!

Calling ioctl() to re-read partition table.
Syncing disks.

4. Creating ASM disks.

[root@OEL564ASMN1 ~]# oracleasm createdisk DATAVOL1 /dev/sdb1
Writing disk header: done
Instantiating disk: done
[root@OEL564ASMN1 ~]# oracleasm createdisk FRAVOL1 /dev/sdc1
Writing disk header: done

Instantiating disk: done

5. Test disks discovery. (discovery is being used by the oracle DBCA)

[root@OEL564ASMN1 ~]# oracleasm listdisks
DATAVOL1
FRAVOL1
[root@OEL564ASMN1 ~]#
[root@OEL564ASMN1 ~]# oracleasm-discover
Using ASMLib from /opt/oracle/extapi/32/asm/orcl/1/libasm.so
[ASM Library - Generic Linux, version 2.0.4 (KABI_V2)]
Discovered disk: ORCL:DATAVOL1 [62910477 blocks (32210164224 bytes), maxio 512]
Discovered disk: ORCL:FRAVOL1 [20964762 blocks (10733958144 bytes), maxio 512]
[root@OEL564ASMN1 ~]#

Candidate of ASM Disk Not Showing.

Problem: When I am going to Configure ASM in oracle grid infrastructure standalone server installation, I am not able to showing Candidate disk group of ASM.

Solution: Find the ASM disk group location and edit Change Disk Discovery Path.

1. Disk location are empty like this.


2. Open terminal and find you disk group by the following command.



3.Now click Change Disk Discovery Path and you will see the following screen.


4. Now edit Disk Discovery Path Value with your ASM Disk group location.


5. Now Click OK and you can see your ASM Disk group.

6. Now Select Your Disk group and go ahead.