Monday, March 23, 2015

DATAPUMP Dumpfiles in ASM Diskgroup

Hi Guys,

Can I store Datapump dumpfile in asm diskgroup?. Yes you can. Now we can see How do we create directory and store dumpfile.

Step 1: Go To ASM Instance and Create New Directory.

[grid@oracle11 ~]$ sqlplus

SQL*Plus: Release 11.2.0.2.0 Production on Mon Mar 23 12:51:56 2015

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

Enter user-name: /as sysasm

Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.2.0 - 64bit Production
With the Real Application Clusters and Automatic Storage Management options

SQL> alter diskgroup DATA1 add directory '+DATA1/dpdump';

Step 2:  Go to DB Instance
 Create Directory for dumpfile.
SQL>create or replace directory DPS as '+DATA1/dpdump';
SQL>grant read,write on directory DPS to system;
SQL>create or replace directory LOGS as '/u01/app/oracle';
SQL> grant read,write on directory  LOGS to system;
step3:  Doing Export using datapump
$expdp system/xxxxxx directory=DPS dumpfile=testasm.dmp schemas=scott logfile=LOGS:testasm.log
Export: Release 11.2.0.2.0 - Production on Tuesday, 22 February, 2015 15:35:00
Connected to: Oracle Database 10g Enterprise Edition Release 11.2.0.2.0 - Production
With the Partitioning, OLAP and Data Mining options
Starting "SYSTEM"."SYS_EXPORT_SCHEMA_01":  system/******** directory=DPS dump
file=testasm.dmp schemas=scott logfile=LOGS:testasm.log
Estimate in progress using BLOCKS method...
Processing object type SCHEMA_EXPORT/TABLE/TABLE_DATA
Total estimation using BLOCKS method: 192 KB
Processing object type SCHEMA_EXPORT/USER
Processing object type SCHEMA_EXPORT/SYSTEM_GRANT
Processing object type SCHEMA_EXPORT/ROLE_GRANT
Processing object type SCHEMA_EXPORT/DEFAULT_ROLE
Processing object type SCHEMA_EXPORT/PRE_SCHEMA/PROCACT_SCHEMA
Processing object type SCHEMA_EXPORT/TABLE/TABLE
Processing object type SCHEMA_EXPORT/TABLE/INDEX/INDEX
Processing object type SCHEMA_EXPORT/TABLE/CONSTRAINT/CONSTRAINT
Processing object type SCHEMA_EXPORT/TABLE/INDEX/STATISTICS/INDEX_STATISTICS
Processing object type SCHEMA_EXPORT/TABLE/CONSTRAINT/REF_CONSTRAINT
Processing object type SCHEMA_EXPORT/TABLE/STATISTICS/TABLE_STATISTICS
. . exported "SCOTT"."DEPT"                              5.656 KB       4 rows
. . exported "SCOTT"."EMP"                               7.820 KB      14 rows
. . exported "SCOTT"."SALGRADE"                          5.585 KB       5 rows
. . exported "SCOTT"."BONUS"                                 0 KB       0 rows
Master table "SYSTEM"."SYS_EXPORT_SCHEMA_01" successfully loaded/unloaded
******************************************************************************
Dump file set for SYSTEM.SYS_EXPORT_SCHEMA_01 is:
  +DATA1/dpdump/testasm.dmp
Job "SYSTEM"."SYS_EXPORT_SCHEMA_01" successfully completed at 15:36:01
SQL>

Step 4: Go to ASM Instance and Check the file created in ASM

SQL> select file_number,creation_date,bytes from v$asm_file where type='DPS';
FILE_NUMBER CREATION_      BYTES
---------- --------- ----------
        283 22-FEB-11     212992
SQL>

Any doubt please contact enquiry@amktechs.com or www.amktechs.com

Thursday, March 12, 2015

How to change disk group name


Pre-requisites:
  When we are planning to change any disk group name
1. Make a note what are the resource is using this disk group name using crsctl,srvctl
2. cross verify whether any database using this disk group in parameter level like archivelog, online redo log files, datafiles, flash recovery area,controlfiles ,backups and spfiles


Note: here I set bash profile like sql='sqlplus /as sysasm' & sql='sqlplus /as sysdba';


step1: Check the cluster status 
[grid@linux01 ~]$ crsctl stat res -t
--------------------------------------------------------------------------------
Name           Target  State        Server                   State details
--------------------------------------------------------------------------------
Local Resources
--------------------------------------------------------------------------------
ora.ASMNET1LSNR_ASM.lsnr
               ONLINE  ONLINE       linux01                  STABLE
               ONLINE  ONLINE       linux02                  STABLE
ora.DATA.dg
               ONLINE  ONLINE       linux01                  STABLE
               ONLINE  ONLINE       linux02                  STABLE
ora.LISTENER.lsnr
               ONLINE  ONLINE       linux01                  STABLE
               ONLINE  ONLINE       linux02                  STABLE
ora.OCR_VOTE_DG.dg
               ONLINE  OFFLINE      linux01                  STABLE
               ONLINE  ONLINE       linux02                  STABLE
ora.net1.network
               ONLINE  ONLINE       linux01                  STABLE
               ONLINE  ONLINE       linux02                  STABLE
ora.ons
               ONLINE  ONLINE       linux01                  STABLE
               ONLINE  ONLINE       linux02                  STABLE
ora.proxy_advm
               ONLINE  ONLINE       linux01                  STABLE
               ONLINE  ONLINE       linux02                  STABLE
--------------------------------------------------------------------------------
Cluster Resources
--------------------------------------------------------------------------------
ora.LISTENER_SCAN1.lsnr
      1        ONLINE  ONLINE       linux02                  STABLE
ora.LISTENER_SCAN2.lsnr
      1        ONLINE  ONLINE       linux01                  STABLE
ora.LISTENER_SCAN3.lsnr
      1        ONLINE  ONLINE       linux01                  STABLE
ora.MGMTLSNR
      1        ONLINE  ONLINE       linux01                  169.254.125.16 192.1
                                                             01.5.11,STABLE
ora.asm
      1        ONLINE  INTERMEDIATE linux01                  STABLE
      2        ONLINE  ONLINE       linux02                  STABLE
ora.cvu
      1        ONLINE  ONLINE       linux01                  STABLE
ora.gns
      1        ONLINE  ONLINE       linux01                  STABLE
ora.gns.vip
      1        ONLINE  ONLINE       linux01                  STABLE
ora.mgmtdb
      1        ONLINE  OFFLINE      linux01                  STARTING
ora.oc4j
      1        ONLINE  ONLINE       linux01                  STABLE
ora.scan1.vip
      1        ONLINE  ONLINE       linux02                  STABLE
ora.scan2.vip
      1        ONLINE  ONLINE       linux01                  STABLE
ora.scan3.vip
      1        ONLINE  ONLINE       linux01                  STABLE
ora.db12c.db
      1        OFFLINE OFFLINE                               STABLE
      2        OFFLINE OFFLINE                               Instance Shutdown,ST
                                                             ABLE
ora.linux01.vip
      1        ONLINE  ONLINE       linux01                  STABLE
ora.linux02.vip
      1        ONLINE  ONLINE       linux02                  STABLE
--------------------------------------------------------------------------------

step 2: Findout the disk group name

[grid@linux01 ~]$ 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    307194   303413                0          303413              0             N  DATA/
MOUNTED  NORMAL  N         512   4096  1048576     18426     9758             6142            1808              0             Y  OCR_VOTE_DG/

or

[grid@linux01 ~]$ sql

SQL*Plus: Release 12.1.0.1.0 Production on Thu Mar 5 03:03:20 2015

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


Connected to:
Oracle Database 12c Enterprise Edition Release 12.1.0.1.0 - 64bit Production
With the Real Application Clusters and Automatic Storage Management options

SQL> show parameter asm_disk

NAME                                 TYPE        VALUE
------------------------------------ ----------- ------------------------------
asm_diskgroups                       string      OCR_VOTE_DG, DATA
asm_diskstring                       string
SQL> exit
Disconnected from Oracle Database 12c Enterprise Edition Release 12.1.0.1.0 - 64bit Production
With the Real Application Clusters and Automatic Storage Management options

step 3:  Our aim is to change disk group name from DATA to BASE.

Befoure renaming disk group we have to dismount the disk group across  all the nodes.  Make a note if any data is stored in the disk group like spfile,datafiles,controlfiles,archivelogs, redo logs,ocr files, voting files.

#su - grid
$asmcmd
$umount DATA

[grid@linux01 ~]$ renamedg

Parsing parameters..
KFNDG-01000: USAGE:  renamedg [-phase <phase>] -dgname <dgname> -newdgname <newdgname> [-config <configfile> ] [-check -confirm]
Try renamedg -help for more information

[grid@linux01 ~]$ renamedg -dgname DATA -newdgname BASE verbose=true

Parsing parameters..

Parameters in effect:

         Old DG name       : DATA
         New DG name          : BASE
         Phases               :
                 Phase 1
                 Phase 2
         Discovery str        : (null)
         Clean              : TRUE
         Raw only           : TRUE
renamedg operation: -dgname DATA -newdgname BASE verbose=true
Executing phase 1
Discovering the group
Performing discovery with string:
Identified disk ASM:ASM Library - Generic Linux, version 2.0.4 (KABI_V2):ORCL:DISK4 with disk number:0 and timestamp (33016644 2072692736)
Identified disk ASM:ASM Library - Generic Linux, version 2.0.4 (KABI_V2):ORCL:DISK5 with disk number:1 and timestamp (33016644 2072692736)
Identified disk ASM:ASM Library - Generic Linux, version 2.0.4 (KABI_V2):ORCL:DISK6 with disk number:2 and timestamp (33016644 2072692736)
Checking for hearbeat...
Re-discovering the group
Performing discovery with string:
Identified disk ASM:ASM Library - Generic Linux, version 2.0.4 (KABI_V2):ORCL:DISK4 with disk number:0 and timestamp (33016644 2072692736)
Identified disk ASM:ASM Library - Generic Linux, version 2.0.4 (KABI_V2):ORCL:DISK5 with disk number:1 and timestamp (33016644 2072692736)
Identified disk ASM:ASM Library - Generic Linux, version 2.0.4 (KABI_V2):ORCL:DISK6 with disk number:2 and timestamp (33016644 2072692736)
Checking if the diskgroup is mounted or used by CSS
Checking disk number:0
Checking disk number:1
Checking disk number:2
Generating configuration file..
Completed phase 1
Executing phase 2
Looking for ORCL:DISK4
Modifying the header
Looking for ORCL:DISK5
Modifying the header
Looking for ORCL:DISK6
Modifying the header
Completed phase 2
Terminating kgfd context 0x7f97685990a0

check here , renamedg_config file is created.  There is no error.

[grid@linux01 ~]$ ll
total 16
drwxr-xr-x 3 grid oinstall 4096 Feb 16 04:05 oradiag_grid
-rw-r--r-- 1 grid oinstall   63 Mar  5 03:07 renamedg_config
drwxr-xr-x 3 grid oinstall 4096 Feb 20 05:00 report
-rw-r--r-- 1 grid oinstall 2482 Feb 20 03:52 test.sh

Step 4:  Mount the disk group name

[grid@linux01 ~]$ asmcmd mount BASE
[grid@linux01 ~]$ 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    307194   303413                0          303413              0             N  BASE/
MOUNTED  NORMAL  N         512   4096  1048576     18426     9758             6142            1808              0             Y  OCR_VOTE_DG/
ASMCMD> exit


step 5:  Update the disk group name in asm_diskgroup parameters for all nodes.


[grid@linux01 ~]$ sql

SQL*Plus: Release 12.1.0.1.0 Production on Thu Mar 5 03:09:44 2015

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


Connected to:
Oracle Database 12c Enterprise Edition Release 12.1.0.1.0 - 64bit Production
With the Real Application Clusters and Automatic Storage Management options

SQL> show parameter asm

NAME                                 TYPE        VALUE
------------------------------------ ----------- ------------------------------
asm_diskgroups                       string      OCR_VOTE_DG, DATA, BASE
asm_diskstring                       string
asm_power_limit                      integer     1
asm_preferred_read_failure_groups    string
SQL> select name from v$asm_diskgroup;

NAME
------------------------------
BASE
OCR_VOTE_DG
SQL> alter system set asm_diskgroups='OCR_VOTE_DG','BASE';

System altered.

SQL> show parameter asm_disk

NAME                                 TYPE        VALUE
------------------------------------ ----------- ------------------------------
asm_diskgroups                       string      OCR_VOTE_DG, BASE
asm_diskstring                       string

SQL> exit
Disconnected from Oracle Database 12c Enterprise Edition Release 12.1.0.1.0 - 64bit Production
With the Real Application Clusters and Automatic Storage Management options


[grid@linux01 ~]$ crsctl stat res -t
--------------------------------------------------------------------------------
Name           Target  State        Server                   State details
--------------------------------------------------------------------------------
Local Resources
--------------------------------------------------------------------------------
ora.ASMNET1LSNR_ASM.lsnr
               ONLINE  ONLINE       linux01                  STABLE
               ONLINE  ONLINE       linux02                  STABLE
ora.BASE.dg
               ONLINE  ONLINE       linux01                  STABLE
               ONLINE  ONLINE       linux02                  STABLE
ora.DATA.dg
               OFFLINE OFFLINE      linux01                  STABLE
               OFFLINE OFFLINE      linux02                  STABLE
ora.LISTENER.lsnr
               ONLINE  ONLINE       linux01                  STABLE
               ONLINE  ONLINE       linux02                  STABLE
ora.OCR_VOTE_DG.dg
               ONLINE  ONLINE       linux01                  STABLE
               ONLINE  ONLINE       linux02                  STABLE
ora.net1.network
               ONLINE  ONLINE       linux01                  STABLE
               ONLINE  ONLINE       linux02                  STABLE
ora.ons
               ONLINE  ONLINE       linux01                  STABLE
               ONLINE  ONLINE       linux02                  STABLE
ora.proxy_advm
               ONLINE  ONLINE       linux01                  STABLE
               ONLINE  ONLINE       linux02                  STABLE
--------------------------------------------------------------------------------
Cluster Resources
--------------------------------------------------------------------------------
ora.LISTENER_SCAN1.lsnr
      1        ONLINE  ONLINE       linux02                  STABLE
ora.LISTENER_SCAN2.lsnr
      1        ONLINE  ONLINE       linux01                  STABLE
ora.LISTENER_SCAN3.lsnr
      1        ONLINE  ONLINE       linux01                  STABLE
ora.MGMTLSNR
      1        ONLINE  ONLINE       linux01                  169.254.125.16 192.1
                                                             01.5.11,STABLE
ora.asm
      1        ONLINE  ONLINE       linux01                  STABLE
      2        ONLINE  ONLINE       linux02                  STABLE
ora.cvu
      1        ONLINE  ONLINE       linux01                  STABLE
ora.gns
      1        ONLINE  ONLINE       linux01                  STABLE
ora.gns.vip
      1        ONLINE  ONLINE       linux01                  STABLE
ora.mgmtdb
      1        ONLINE  ONLINE       linux01                  Open,STABLE
ora.oc4j
      1        ONLINE  ONLINE       linux01                  STABLE
ora.scan1.vip
      1        ONLINE  ONLINE       linux02                  STABLE
ora.scan2.vip
      1        ONLINE  ONLINE       linux01                  STABLE
ora.scan3.vip
      1        ONLINE  ONLINE       linux01                  STABLE
ora.db12c.db
      1        OFFLINE OFFLINE                               STABLE
      2        OFFLINE OFFLINE                               Instance Shutdown,ST
                                                             ABLE
ora.linux01.vip
      1        ONLINE  ONLINE       linux01                  STABLE
ora.linux02.vip
      1        ONLINE  ONLINE       linux02                  STABLE
--------------------------------------------------------------------------------

step 6:  Check the  each database configuation 
[root@linux02 ~]# su - oracle

[oracle@linux02 ~]$ srvctl config database -d db12c
Database unique name: db12c
Database name: db12c
Oracle home: /u01/app/oracle/product/12.1.0/dbhome_1
Oracle user: oracle
Spfile: +DATA/db12c/spfiledb12c.ora
Password file: +DATA/db12c/orapwdb12c
Domain:
Start options: open
Stop options: immediate
Database role: PRIMARY
Management policy: AUTOMATIC
Server pools: db12c
Database instances: db12c1,db12c2
Disk Groups: DATA
Mount point paths:
Services:
Type: RAC
Start concurrency:
Stop concurrency:
Database is administrator managed


[oracle@linux02 ~]$ srvctl modify database -db db12c -spfile +BASE/db12c/spfiledb12c.ora -pwfile +BASE/db12c/orapwdb12c
[oracle@linux02 ~]$ srvctl config database -d db12c
Database unique name: db12c
Database name: db12c
Oracle home: /u01/app/oracle/product/12.1.0/dbhome_1
Oracle user: oracle
Spfile: +BASE/db12c/spfiledb12c.ora
Password file: +BASE/db12c/orapwdb12c
Domain:
Start options: open
Stop options: immediate
Database role: PRIMARY
Management policy: AUTOMATIC
Server pools: db12c
Database instances: db12c1,db12c2
Disk Groups: DATA
Mount point paths:
Services:
Type: RAC
Start concurrency:
Stop concurrency:
Database is administrator managed


[oracle@linux02 ~]$ sql

SQL*Plus: Release 12.1.0.1.0 Production on Thu Mar 5 03:15:01 2015

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

Connected to an idle instance.

SQL> startup nomount;
ORACLE instance started.

Total System Global Area 2.0176E+10 bytes
Fixed Size                  4264864 bytes
Variable Size            3623881824 bytes
Database Buffers         1.6509E+10 bytes
Redo Buffers               39460864 bytes
SQL> show parameter control

NAME                                 TYPE        VALUE
------------------------------------ ----------- ------------------------------
control_file_record_keep_time        integer     7
control_files                        string      +DATA/db12c/CONTROLFILE/curren
                                                 t.257.872659369
control_management_pack_access       string      NONE
SQL> alter system set control_files='+BASE/db12c/CONTROLFILE/current.257.872659369','+BASE' scope=spfile;

System altered.

SQL> exit
Disconnected from Oracle Database 12c Release 12.1.0.1.0 - 64bit Production
With the Real Application Clusters and Automatic Storage Management options


[oracle@linux02 ~]$ sql

SQL*Plus: Release 12.1.0.1.0 Production on Thu Mar 5 03:17:13 2015

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


Connected to:
Oracle Database 12c Release 12.1.0.1.0 - 64bit Production
With the Real Application Clusters and Automatic Storage Management options

SQL>  alter system set control_files='+BASE/db12c/CONTROLFILE/current.257.872659369' 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 2.0176E+10 bytes
Fixed Size                  4264864 bytes
Variable Size            3623881824 bytes
Database Buffers         1.6509E+10 bytes
Redo Buffers               39460864 bytes
SQL> show parameter control

NAME                                 TYPE        VALUE
------------------------------------ ----------- ------------------------------
control_file_record_keep_time        integer     7
control_files                        string      +BASE/db12c/CONTROLFILE/curren
                                                 t.257.872659369
control_management_pack_access       string      NONE
SQL> show parameter spfile

NAME                                 TYPE        VALUE
------------------------------------ ----------- ------------------------------
spfile                               string      +BASE/db12c/spfiledb12c.ora
SQL> alter database mount;

Database altered.

SQL> select name from v$datafile;

NAME
--------------------------------------------------------------------------------
+DATA/db12c/DATAFILE/system.260.872659369
+DATA/db12c/DATAFILE/sysaux.261.872659373
+DATA/db12c/DATAFILE/undotbs1.262.872659375
+DATA/db12c/DATAFILE/undotbs2.264.872659383
+DATA/db12c/DATAFILE/users.265.872659383


datafiles:


SQL> alter database rename file '+DATA/db12c/DATAFILE/system.260.872659369' to '+BASE/db12c/DATAFILE/system.260.872659369';

Database altered.

SQL> alter database rename file '+DATA/db12c/DATAFILE/sysaux.261.872659373' to '+BASE/db12c/DATAFILE/sysaux.261.872659373';

Database altered.

SQL>  alter database rename file '+DATA/db12c/DATAFILEundotbs1.262.872659375' to '+BASE/db12c/DATAFILE/undotbs1.262.872659375
  2
SQL>
SQL>
SQL> alter database rename file '+DATA/db12c/DATAFILE/undotbs1.262.872659375' to '+BASE/db12c/DATAFILE/undotbs1.262.872659375';

Database altered.

SQL> alter database rename file '+DATA/db12c/DATAFILE/undotbs2.264.872659383' to '+BASE/db12c/DATAFILE/undotbs2.264.872659383';

Database altered.

SQL>  alter database rename file '+DATA/db12c/DATAFILE/users.265.872659383' to '+BASE/db12c/DATAFILE/users.265.872659383';

Database altered.

SQL> select name from v$tempfile;

NAME
--------------------------------------------------------------------------------
+DATA/db12c/TEMPFILE/temp.263.872659375

SQL> alter database rename file '+DATA/db12c/TEMPFILE/temp.263.872659375' to '+BASE/db12c/TEMPFILE/temp.263.872659375';

Database altered.


redo log files:
+++++++++++++++++++++++++++

SQL> select member from v$logfile;

MEMBER
--------------------------------------------------------------------------------
+DATA/db12c/ONLINELOG/group_1.258.872659369
+DATA/db12c/ONLINELOG/group_2.259.872659369
+DATA/db12c/ONLINELOG/group_3.266.872661965
+DATA/db12c/ONLINELOG/group_4.267.872661965

SQL> alter database rename file '+DATA/db12c/ONLINELOG/group_1.258.872659369' to '+BASE/db12c/ONLINELOG/group_1.258.872659369';

Database altered.

SQL>  alter database rename file '+DATA/db12c/ONLINELOG/group_2.259.872659369' to '+BASE/db12c/ONLINELOG/group_2.259.872659369';

Database altered.

SQL> alter database rename file '+DATA/db12c/ONLINELOG/group_3.266.872661965' to '+BASE/db12c/ONLINELOG/group_3.266.872661965';

Database altered.

SQL>  alter database rename file '+DATA/db12c/ONLINELOG/group_4.267.872661965' to '+BASE/db12c/ONLINELOG/group_4.267.872661965';

Database altered.

change the archive log path & db_create_file_dest,flash recovery area path ifs it required.



[root@linux02 ~]# su - oracle
[oracle@linux02 ~]$ sql

SQL*Plus: Release 12.1.0.1.0 Production on Thu Mar 5 03:28:24 2015

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


Connected to:
Oracle Database 12c Release 12.1.0.1.0 - 64bit Production
With the Real Application Clusters and Automatic Storage Management options

SQL> select member from gv$logfile;

MEMBER
--------------------------------------------------------------------------------
+BASE/db12c/ONLINELOG/group_1.258.872659369
+BASE/db12c/ONLINELOG/group_2.259.872659369
+BASE/db12c/ONLINELOG/group_3.266.872661965
+BASE/db12c/ONLINELOG/group_4.267.872661965

SQL> alter database open;

Database altered.

change the path in init file


[oracle@linux02 ~]$ cd $ORACLE_HOME
[oracle@linux02 dbhome_1]$ cd dbs
[oracle@linux02 dbs]$ ll
total 524
-rw-rw---- 1 oracle asmadmin   1544 Mar  5 03:29 hc_db12c2.dat
-rw-rw---- 1 oracle asmadmin 524288 Mar  5 03:29 id_db12c2.dat
-rw-r--r-- 1 oracle oinstall   2992 Feb 26 04:10 init.ora
-rw-r----- 1 oracle oinstall     37 Feb 26 06:06 initdb12c2.ora
[oracle@linux02 dbs]$ cat initdb12c2.ora
SPFILE='+DATA/db12c/spfiledb12c.ora'
[oracle@linux02 dbs]$ vi initdb12c2.ora
[oracle@linux02 dbs]$

step 7: remove the disk group name

[oracle@linux01 ~]$ srvctl remove diskgroup -diskgroup DATA;
PRCA-1002 : Failed to remove CRS resource ora.DATA.dg for ASM Disk Group DATA
PRCR-1028 : Failed to remove resource ora.DATA.dg
PRCR-1072 : Failed to unregister resource ora.DATA.dg
CRS-0222: Resource 'ora.DATA.dg' has dependency error.


[oracle@linux01 ~]$ srvctl remove diskgroup -diskgroup DATA -force
[oracle@linux01 ~]$ exit
logout

step 8: add the disk group name to respective database.

[oracle@linux01 ~]$ srvctl modify database -db db12c -diskgroup BASE;

[oracle@linux01 ~]$ srvctl config database -db db12c
Database unique name: db12c
Database name: db12c
Oracle home: /u01/app/oracle/product/12.1.0/dbhome_1
Oracle user: oracle
Spfile: +BASE/db12c/spfiledb12c.ora
Password file: +BASE/db12c/orapwdb12c
Domain:
Start options: open
Stop options: immediate
Database role: PRIMARY
Management policy: AUTOMATIC
Server pools: db12c
Database instances: db12c1,db12c2
Disk Groups: BASE
Mount point paths:
Services:
Type: RAC
Start concurrency:
Stop concurrency:
Database is administrator managed
[oracle@linux01 ~]$




Wednesday, March 4, 2015

ORA-15173: entry 'orapwasm' does not exist in directory '/'



Hi Guys,


After installing oracle 12c cluster , accidently password file deleted.  we found below error in
alert_+ASM1.log.


"ORA-17503: ksfdopn:2 Failed to open file +DATA/orapwasm
ORA-15173: entry 'orapwasm' does not exist in directory '/'
ORA-06512: at line 4"


Cause:  password file is missing.


In Oracle 12c, passwordfile will store in ASM diskgroup. Prior to 12c, each asm instance have its own password file in the respective GRID_HOME/dbs location. Now all ASM instance will use common password file,preferably VOTE disk diskgroup .


Solution:

In our case votedisk is stored in +DATA diskgroup.  

we have to create the password file.


Login to any asm instance
#su - grid
$orapwd file=orapwASM  password=oracle force=y asm=y


Issue is resovled.



Note: I have 9 years Oracle DBA experience, also teaching online & classroom RAC training.  Please drop a mail to enquiry@amktechs.com 

Tuesday, March 3, 2015

Oracleasm deletedisk failed Unable to clear disk


Hi Guys,


Today , I dropped a asm diskgroup. After that when I am planning to delete asm disks of diskgroup its showing error like
"
#oracleasm deletedisk -v DISK1
Clearing disk header: oracleasm-write-label: Unable to open device "/dev/oracleasm/disks/DISK1": Device or resource busy
failed
Unable to clear disk "DISK1"

or
 oracleasm deletedisk -v DISK6
Clearing disk header: oracleasm-write-label: Unable to open device "/dev/mapper/multipathbp1": Device or resource busy
failed
Unable to clear disk "DISK1"


Cause:  This disk header already in use.
Solution: we have to clear header forcely
step1:
root@rac1 ~]# blkid |grep oracleasm
/dev/sdd1: LABEL="DISK1" TYPE="oracleasm"
dd if=/dev/zero of=/dev/sdd1 bs=1024 count=100
or
dd if=/dev/zero of=/dev/mapper/multipathbp1 bs=1024 count=100

step2: login as root user
#partprobe /dev/mapper/multipathbp1

step3 :
#oracleasm deletedisk -v DISK1