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

Wednesday, October 09, 2013

How to change password of SYS user on ASM

 

For changing the SYS password on ASM:

In 11.2 we can use asmcmd to change the password as follows

· In single instance environment

$ asmcmd

ASMCMD> passwd sys

Enter old password (optional): ******

Enter new password: ******

· In Cluster environment

ASMCMD> orapwusr --modify --password sys

Enter password: ******

We can not change the password for ASM databases via alter user command.
The password should be the one provided when the password file was created,also REMOTE_LOGIN_PASSWORDFILE should be set to EXCLUSIVE on all instances.

If you want to change the password then you would need to recreate the password file using the orapwd utility

Tuesday, October 08, 2013

How to exclude disk on Linux ASMLib

 

Requirement:

We need the 2 asm disk groups (DG_UAT_DATA_01, DG_UAT_FLASH_01) to be mounted only on +ASM that runs on ServerB.
I see that the disks for these 2 asm disk groups (ORCL:VOL_05_C8, ORCL:VOL_05_C9, ORCL:VOL_05_CE) are presented to both servers (ServerA1 and ServerB) and that ServerB has the 2 disk groups mounted.
I also know that these servers are non-clustered (ie, these are non-RAC ASM instances).

We need to do is to disable ASM on ServerA to discover these 3 asmlib disks that correspond to those 2 asm disk groups.

Solution:

The ASMLIB team will have to do something to disable ServerA to discover these 3 asmlib disks (ie, oracleasm listdisks from ServerA o no longer lst these 3 asmlib disks) but without affecting their discovery in ServerB.
If ASMLIB rpms do not longer lists these 3 disks on ServerA, then ASM on ServerA also will not be presented with them and therefore these will no longer be listed in v$asm_disk view.
 

1. Edit /etc/sysconfig/oracleasm file and you can add the non-required disk in below field:

ORACLEASM_SCANEXCLUDE=

e.g. ORACLEASM_SCANEXCLUDE="sdb sdc"

It will ensure that those disk are not scanned while you perform oracleasm scandisk

2. Restart the ASMLib

Sunday, January 01, 2012

RMAN-06169: could not read file header for datafile nn error reason 4

 

RMAN-06169: could not read file header for datafile nn error reason 4
RMAN-06169: could not read file header for datafile nn error reason 4
RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-03002: failure of backup command at 10/20/2011 07:41:54
RMAN-06056: could not access datafile nn

The reason code of 4 meant for DBWR could not find the file. After investigating found that the new data file added on locally for a RAC database. That data file not available on other node cause this backup failure.

To resolve this, the locally create data file moved to ASM.

Friday, October 14, 2011

Moving Data files Between ASM Disk Groups

 

Method 1: Using RMAN

Step 1: Start RMAN and connect to the target database.

$ rman target /

Step 2: Generate a report that shows the names of the datafiles.

RMAN> REPORT SCHEMA;

Step 3:  Back up the datafile to the new ASM disk group.

RMAN> BACKUP AS COPY DATAFILE '+DG_DEVSYS_mydb1_FLASH_01/mydb1/datafile/data01.290.709985421' FORMAT '+DG_DEVSYS_mydb1_DATA_01';

Step 4:  Bring the Datafile Offline
alter database datafile '+DG_DEVSYS_mydb1_FLASH_01/mydb1/datafile/data01.290.709985421' offline

Step 5: Point the control file to the newly created copy of the datafile

RMAN> SWITCH DATAFILE '+DG_DEVSYS_mydb1_FLASH_01/mydb1/datafile/data01.290.709985421' TO COPY;

Step 6:  Recover the renamed datafile
RMAN> recover datafile '+DG_DEVSYS_mydb1_DATA_01/mydb1/datafile/data01.272.764459767';

Step 7. Bring the datafile online.
alter database datafile '+DG_DEVSYS_mydb1_DATA_01/mydb1/datafile/data01.272.764459767' online

Step 8. Delete the old datafile
RMAN>DELETE DATAFILECOPY “DG_DEVSYS_mydb1_FLASH_01/mydb1/datafile/data01.290.709985421”

Reference: http://download.oracle.com/docs/cd/B28359_01/backup.111/b28270/rcmasmmi.htm

Method 2: Using ASMCMD CP ( Copy ) Command

Step 1: Start RMAN and connect to the target database.

$ rman target /

Step 2: Generate a report that shows the names of the datafiles.

RMAN> REPORT SCHEMA;

Step 3:  Bring the Datafile Offline
alter database datafile '+DG_DEVSYS_mydb1_FLASH_01/mydb1/datafile/data01.290.709985421' offline

Step 4:  Connect to ASMCMD and use CP to copy files
$ asmcmd –p

ASMCMD [+] > cp +DG_DEVSYS_mydb1_FLASH_01/mydb1/datafile/data01.290.709985421 +DG_DEVSYS_mydb1_DATA_01

Step 5:  After copied datafile, then rename file in database.  With ASM(OMF) this delete old datafile.

alter database rename file '+DG_DEVSYS_mydb1_FLASH_01/mydb1/datafile/data01.290.709985421'  to '+DG_DEVSYS_mydb1_DATA_01/mydb1/datafile/data01.272.764459767'

Step 6:  Recover the renamed datafile
RMAN> recover datafile '+DG_DEVSYS_mydb1_DATA_01/mydb1/datafile/data01.272.764459767';

Step 7. Bring the datafile online.
alter database datafile '+DG_DEVSYS_mydb1_DATA_01/mydb1/datafile/data01.272.764459767' online

Step 8: Verify the file name
RMAN> REPORT SCHEMA


Method 3:  Using RMAN Copy

Step 1:  Restrict the Session
ALTER SYSTEM enable restricted session;

Step 2:   Bring the Datafile Offline

alter database datafile '+DG_DEVSYS_mydb1_FLASH_01/mydb1/datafile/data01.290.709985421' offline

Step 3: Start RMAN and connect to the target database.

$ rman target /

Step 4:  RMAN Copy datafile
RMAN> copy datafile '+DG_DEVSYS_mydb1_FLASH_01/mydb1/datafile/data01.290.709985421' to '+DG_DEVSYS_mydb1_DATA_01';

Step 5:  After copied datafile, then rename file in database.  With ASM(OMF) this delete old datafile.

alter database rename file '+DG_DEVSYS_mydb1_FLASH_01/mydb1/datafile/data01.290.709985421'  to '+DG_DEVSYS_mydb1_DATA_01/mydb1/datafile/data01.272.764459767'

Step 6:  Recover the renamed datafile
RMAN> recover datafile '+DG_DEVSYS_mydb1_DATA_01/mydb1/datafile/data01.272.764459767';

Step 7. Bring the datafile online.
alter database datafile '+DG_DEVSYS_mydb1_DATA_01/mydb1/datafile/data01.272.764459767' online


Step 8: Verify the file name
RMAN> REPORT SCHEMA

Step 9: Disable the Restricted Session

ALTER SYSTEM disable restricted session;

Friday, September 30, 2011

How to monitor ASM Disk group usage on OEM Grid

  1. Connect to OEM
  2. Connect to the Host
  3. From the Host –> Go to Target Tab
    image
  4. From the listed target, select ASM by looking at type as  “Automatic Storage Management
    image

  5. Now select type ASM, then we will be landed at ASM on OEM Grid Control.
  6. On the Home Page of ASM, we can find the Disk group usage
    image
  7. Also from the Home, go to tab Disk Group

    image

Disk group has used % of safely usable free space

OEM Alert Message looks like;

Message=Disk group DISGKGROUP_FLASH_01 has used 75.08% of safely usable free space.
Metric=Disk Group Used % of Safely Usable
Metric value=75.08
Disk Group Name=DISGKGROUP_FLASH_01
Severity=Warning
Target Name=+ASM1_DBSRVR.siva.com
Target type=Automatic Storage Management
Host=dbsrvr.siva.com
Occurred At=Sep 29, 2011 11:14:52 PM IST
Acknowledged=No
Notification Rule Name=DBSrvr ASM Health Check
Notification Rule Owner=DBA

 

By default:
This metric will generate a warning alert if the Disk Group is using 90% of the Safely usable space and
Critical warning for 100 %. Threshold limit can be changed to generate alert at different values.

This metric is collected at a time interval of 15 minutes.

Metric Collection:
This metric is collected from the view V$ASM_DISKGROUP_STAT

Used % of Safely Usable = 100 - (usable_file_mb/usable_total_mb)*100

Where usable_total_mb = total_mb - required_mirror_free_mb)/redundancy_factor

total_mb and required_mirror_free_mb will come from the V$ASM_DISKGROUP_STAT  view column and

Redundancy Factor Disk Group Type
1 External
2 Normal
3 High

Query:

 select 100-(FREE_MB/TOTAL_MB)*100 as "Used % Safely Usable Area",  Name from v$asm_diskgroup_stat

Alternatively connect to ASM and check the free space;

ASMCMD> lsdg


Workaround:
If the Archive Log file occupies the ASM Disk group, move the files or delete files to free up Disk group.

Permanent Resolution:
New disks can be added in a disk group to avoid the alerts.
Go to the Disk Group general page ---> and click on add button to add a new disk to a disk group.

Wednesday, May 25, 2011

ASM – Automatic Storage Management

 

ASM : is the vertical integration of File system and Volume Manager, specifically built for Oracle Database files.

Advantages:

  1. Dynamic storage management, without shut downs of the Oracle database, storage can be adjusted.
  2. I/O Load balancing : distribute the I/O Load across all available resource to optimize the performance, while removing the manual need.
  3. Provide fault tolerance by maintaining redundant copy of data, per file basis.
    Supports mirroring at file level not at volume level.
  4. Supports online disk reconfiguration and dynamic rebalancing
  5. stripes files not the logical volumes
  6. Supports RAC and eliminates need of
    Cluster File system or Cluster Logical Volume Manager.

image

ASM divides data files into extent. This extent is different from data file extent.
Spread each extents across all the disks. It uses indexes to track the placement of each extent.

Monday, May 23, 2011

How to find the instance names of ASM on the cluster nodes

 

crsctl status resource ora.asm –f | grep servername

How to current directory to be displayed in the prompt, while using ASMCMD command?

asmcmd –p

-p causes the current directory to be displayed in the prompt.

+ signs denotes the root directory

To list the Disk group details

 ASMCMD [+] > ls -l +

State    Type    Rebal  Name
MOUNTED  EXTERN  N      DG_Test_DATA_01/
MOUNTED  EXTERN  N      DG_Test_FLASH_01/

To list the sizing information for each Disk group

ASMCMD [+] > ls -s +

Sector  Block       AU  Total_MB  Free_MB  Req_mir_free_MB  Usable_file_MB  Offline_disks  Name
  1024   4096  8388608   3407872   665384                0          665384              0  DG_Test_DATA_01/
  1024   4096  8388608    524288   152944                0          152944              0  DG_Test_FLASH_01/

To display the content of current directory and its subdirectory

ASMCMD [+] > ls *

To find  file name matching the given query
ASMCMD [+] > find + *.dbf