Tuesday, February 26, 2013

Post 46 of Series - Parallel select query spanning on multiple RAC instances dies if one of the instance its running on crashes or stops

 Shalok, Fifth Mehl :
 
Those who do not remember the lord while they are alive, shall mix with the dust when they die. Nanak, the foolish and filthy  cynic passes his life engrossed in the world.


 
Here I will execute a select query on a two node RAC using a service which spans on two nodes on the RAC cluster and while the query is running one node goes down and the parallel query instead on failing over on to the surviving node, just errors out.


14:57 : oracle : rac1.rac.meditate.com : @GSINGH1 : /home/oracle
$ . oraenv
ORACLE_SID = [GSINGH!] ? GSINGH1
The Oracle base has been set to /u01/app/oracle
 14:57 : oracle : rac1.rac.meditate.com : @GSINGH1 : /home/oracle
$ srvctl status service -d GSINGH
 14:58 : oracle : rac1.rac.meditate.com : @GSINGH1 : /home/oracle
$ srvctl add service -d GSINGH -s PARALLEL -r GSINGH1 -a GSINGH2
 15:03 : oracle : rac1.rac.meditate.com : @GSINGH1 : /home/oracle
$
 15:07 : oracle : rac1.rac.meditate.com : @GSINGH1 : /u01/app/oracle/product/11.2.0.3/network/admin
$ srvctl start service -d GSINGH -s PARALLEL
 15:07 : oracle : rac1.rac.meditate.com : @GSINGH1 : /u01/app/oracle/product/11.2.0.3/network/admin
$ srvctl status service -d GSINGH -s PARALLEL
Service PARALLEL is running on instance(s) GSINGH1
 15:08 : oracle : rac1.rac.meditate.com : @GSINGH1 : /u01/app/oracle/product/11.2.0.3/network/admin
$
 15:08 : oracle : rac1.rac.meditate.com : @GSINGH1 : /u01/app/oracle/product/11.2.0.3/network/admin
$ srvctl modify service -d GSINGH -s PARALLEL -n -i GSINGH1,GSINGH2
 15:09 : oracle : rac1.rac.meditate.com : @GSINGH1 : /u01/app/oracle/product/11.2.0.3/network/admin
$ srvctl stop service -d GSINGH -s PARALLEL
 15:09 : oracle : rac1.rac.meditate.com : @GSINGH1 : /u01/app/oracle/product/11.2.0.3/network/admin
$ srvctl start service -d GSINGH -s PARALLEL
 15:10 : oracle : rac1.rac.meditate.com : @GSINGH1 : /u01/app/oracle/product/11.2.0.3/network/admin
$ srvctl status service -d GSINGH -s PARALLEL
Service PARALLEL is running on instance(s) GSINGH1,GSINGH2
 15:10 : oracle : rac1.rac.meditate.com : @GSINGH1 : /u01/app/oracle/product/11.2.0.3/network/admin
$
===================================================================================================================================
 15:10 : oracle : rac1.rac.meditate.com : @GSINGH1 : /u01/app/oracle/product/11.2.0.3/network/admin
$ sqlplus / as sysdba
SQL*Plus: Release 11.2.0.3.0 Production on Tue Feb 26 15:10:58 2013
Copyright (c) 1982, 2011, Oracle.  All rights reserved.

Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - 64bit Production
With the Partitioning, Real Application Clusters, Automatic Storage Management, OLAP,
Data Mining and Real Application Testing options
SQL> show parameter parallel servers
NAME                                 TYPE        VALUE
------------------------------------ ----------- ------------------------------
fast_start_parallel_rollback         string      LOW
parallel_adaptive_multi_user         boolean     TRUE
parallel_automatic_tuning            boolean     FALSE
parallel_degree_limit                string      CPU
parallel_degree_policy               string      MANUAL
parallel_execution_message_size      integer     16384
parallel_force_local                 boolean     FALSE
parallel_instance_group              string
parallel_io_cap_enabled              boolean     FALSE
parallel_max_servers                 integer     40
parallel_min_percent                 integer     0
NAME                                 TYPE        VALUE
------------------------------------ ----------- ------------------------------
parallel_min_servers                 integer     0
parallel_min_time_threshold          string      AUTO
parallel_server                      boolean     TRUE
parallel_server_instances            integer     2
parallel_servers_target              integer     16
parallel_threads_per_cpu             integer     2
recovery_parallelism                 integer     0
SQL>
SQL> conn gurpartap/gurpartap@parallel
Connected.
SQL>

=======================================================================================================
Open another window i.e. window 2 and execute the following query:
set pages 50
col SID_SERIAL format a15
col OSUSER format a12
col module format a25
col action format a20
col machine format a20
col username format a19
col QCINST_ID format 99
set lines 240
SELECT y.inst_id,a.qcinst_id, a.qcsid, a.qcserial# qcser, a.sid||','||a.serial# sid_serial, substr(y.osuser,1,13) osuser, y.username, substr(y.module,1,25) module, substr(y.action,1,20) action, substr(y.machine,8,20) machine, a.degree, a.req_degree, y.inst_id, y.sql_id, y.status, y.logon_time, y.last_call_et lc_et
    FROM gv$px_session a, gv$session y
    WHERE y.sid = a.sid
    and y.inst_id = a.inst_id
   order by a.qcsid, y.username, y.sql_id, y.inst_id, y.status
/

SQL> set line 300
SQL> set pages 50
col SID_SERIAL format a15
col OSUSER format a12
col module format a25
col action format a20
col machine format a20
col username format a19
col QCINST_ID format 99
set lines 240
SELECT y.inst_id,a.qcinst_id, a.qcsid, a.qcserial# qcser, a.sid||','||a.serial# sid_serial, substr(y.osuser,1,13) osuser, y.username, substr(y.module,1,25) module, substr(y.action,1,20) action, substr(y.machine,8,20) machine, a.degree, a.req_degree, y.inst_id, y.sql_id, y.status, y.logon_time, y.last_call_et lc_et
    FROM gv$px_session a, gv$session y
    WHERE y.sid = a.sid
    and y.inst_id = a.inst_id
SQL>    order by a.qcsid, y.username, y.sql_id, y.inst_id, y.status
/
SQL> SQL> SQL> SQL> SQL> SQL> SQL> SQL> SQL>   2    3    4    5    6
   INST_ID QCINST_ID      QCSID      QCSER SID_SERIAL      OSUSER       USERNAME            MODULE                    ACTION               MACHINE                  DEGREE REQ_DEGREE    INST_ID SQL_ID        STATUS LOGON_TIM      LC_ET
---------- --------- ---------- ---------- --------------- ------------ ------------------- ------------------------- -------------------- -------------------- ---------- ---------- ---------- ------------- -------- --------- ----------
         1         1         76          7 29,71           oracle       SYS                 sqlplus@rac1.rac.meditate                      c.meditate.com                2          2          1 8wn8m9gpwnw3s ACTIVE 26-FEB-13          0
         1                   76            76,7            oracle       SYS                 sqlplus@rac1.rac.meditate                      c.meditate.com                                      1 8wn8m9gpwnw3s ACTIVE 26-FEB-13          0
         2         1         76          7 80,23           oracle       SYS                 sqlplus@rac1.rac.meditate                      c.meditate.com                2          2          2 8wn8m9gpwnw3s ACTIVE 26-FEB-13          0
SQL>
SQL> /
Now go back on the original window i.e. window 1 and execute the query in parallel as follows:
select /*+ parallel( a 33)  parallel(b 33)  */ count(*) from dba_objects a, dba_objects b;

SQL> l
  1* select /*+ parallel( a 33)  parallel(b 33)  */ count(*) from dba_objects a, dba_objects b
SQL> /

Now go back to window 2 and check the parallel sessions from the query we ran earlier on views gv$px_session and gv$session and you will see 33 parallel sessions
on the database as given below and they will have be running on both node1 and node2 as:
SQL>
/
   INST_ID QCINST_ID      QCSID      QCSER SID_SERIAL      OSUSER       USERNAME            MODULE                    ACTION               MACHINE                  DEGREE REQ_DEGREE    INST_ID SQL_ID        STATUS LOGON_TIM      LC_ET
---------- --------- ---------- ---------- --------------- ------------ ------------------- ------------------------- -------------------- -------------------- ---------- ---------- ---------- ------------- -------- --------- ----------
         1         1         56          3 77,3            oracle       SYS                 sqlplus@rac1.rac.meditate                      c.meditate.com                2          2          1 8wn8m9gpwnw3s ACTIVE 26-FEB-13          0
         1                   56            56,3            oracle       SYS                 sqlplus@rac1.rac.meditate                      c.meditate.com                                      1 8wn8m9gpwnw3s ACTIVE 26-FEB-13          1
         2         1         56          3 82,9            oracle       SYS                 sqlplus@rac1.rac.meditate                      c.meditate.com                2          2          2 8wn8m9gpwnw3s ACTIVE 26-FEB-13          0
         1         2         74         53 63,1            oracle       GURPARTAP           SQL*Plus                                       c.meditate.com               33         33          1 3z073sy7b8gfa ACTIVE 26-FEB-13          1
         1         2         74         53 64,1            oracle       GURPARTAP           SQL*Plus                                       c.meditate.com               33         33          1 3z073sy7b8gfa ACTIVE 26-FEB-13          1
         1         2         74         53 65,1            oracle       GURPARTAP           SQL*Plus                                       c.meditate.com               33         33          1 3z073sy7b8gfa ACTIVE 26-FEB-13          1
         1         2         74         53 66,1            oracle       GURPARTAP           SQL*Plus                                       c.meditate.com               33         33          1 3z073sy7b8gfa ACTIVE 26-FEB-13          1
         1         2         74         53 67,1            oracle       GURPARTAP           SQL*Plus                                       c.meditate.com               33         33          1 3z073sy7b8gfa ACTIVE 26-FEB-13          1
         1         2         74         53 68,1            oracle       GURPARTAP           SQL*Plus                                       c.meditate.com               33         33          1 3z073sy7b8gfa ACTIVE 26-FEB-13          1
         1         2         74         53 69,1            oracle       GURPARTAP           SQL*Plus                                       c.meditate.com               33         33          1 3z073sy7b8gfa ACTIVE 26-FEB-13          1
         1         2         74         53 70,1            oracle       GURPARTAP           SQL*Plus                                       c.meditate.com               33         33          1 3z073sy7b8gfa ACTIVE 26-FEB-13          1
         1         2         74         53 71,1            oracle       GURPARTAP           SQL*Plus                                       c.meditate.com               33         33          1 3z073sy7b8gfa ACTIVE 26-FEB-13          1
         1         2         74         53 72,1            oracle       GURPARTAP           SQL*Plus                                       c.meditate.com               33         33          1 3z073sy7b8gfa ACTIVE 26-FEB-13          1
         1         2         74         53 73,1            oracle       GURPARTAP           SQL*Plus                                       c.meditate.com               33         33          1 3z073sy7b8gfa ACTIVE 26-FEB-13          1
         1         2         74         53 74,1            oracle       GURPARTAP           SQL*Plus                                       c.meditate.com               33         33          1 3z073sy7b8gfa ACTIVE 26-FEB-13          1
         1         2         74         53 75,1            oracle       GURPARTAP           SQL*Plus                                       c.meditate.com               33         33          1 3z073sy7b8gfa ACTIVE 26-FEB-13          1
         1         2         74         53 62,3            oracle       GURPARTAP           SQL*Plus                                       c.meditate.com               33         33          1 3z073sy7b8gfa ACTIVE 26-FEB-13          1
         1         2         74         53 61,31           oracle       GURPARTAP           SQL*Plus                                       c.meditate.com               33         33          1 3z073sy7b8gfa ACTIVE 26-FEB-13          1
         1         2         74         53 53,15           oracle       GURPARTAP           SQL*Plus                                       c.meditate.com               33         33          1 3z073sy7b8gfa ACTIVE 26-FEB-13          1
         1         2         74         53 55,25           oracle       GURPARTAP           SQL*Plus                                       c.meditate.com               33         33          1 3z073sy7b8gfa ACTIVE 26-FEB-13          1
         2         2         74         53 45,111          oracle       GURPARTAP           SQL*Plus                                       c.meditate.com               33         33          2 3z073sy7b8gfa ACTIVE 26-FEB-13          0
         2         2         74         53 35,101          oracle       GURPARTAP           SQL*Plus                                       c.meditate.com               33         33          2 3z073sy7b8gfa ACTIVE 26-FEB-13          0
         2         2         74         53 52,5            oracle       GURPARTAP           SQL*Plus                                       c.meditate.com               33         33          2 3z073sy7b8gfa ACTIVE 26-FEB-13          0
         2         2         74         53 58,189          oracle       GURPARTAP           SQL*Plus                                       c.meditate.com               33         33          2 3z073sy7b8gfa ACTIVE 26-FEB-13          0
         2         2         74         53 59,59           oracle       GURPARTAP           SQL*Plus                                       c.meditate.com               33         33          2 3z073sy7b8gfa ACTIVE 26-FEB-13          0
         2         2         74         53 66,87           oracle       GURPARTAP           SQL*Plus                                       c.meditate.com               33         33          2 3z073sy7b8gfa ACTIVE 26-FEB-13          0
         2         2         74         53 67,119          oracle       GURPARTAP           SQL*Plus                                       c.meditate.com               33         33          2 3z073sy7b8gfa ACTIVE 26-FEB-13          0
         2         2         74         53 68,21           oracle       GURPARTAP           SQL*Plus                                       c.meditate.com               33         33          2 3z073sy7b8gfa ACTIVE 26-FEB-13          0
         2         2         74         53 69,37           oracle       GURPARTAP           SQL*Plus                                       c.meditate.com               33         33          2 3z073sy7b8gfa ACTIVE 26-FEB-13          0
         2         2         74         53 70,29           oracle       GURPARTAP           SQL*Plus                                       c.meditate.com               33         33          2 3z073sy7b8gfa ACTIVE 26-FEB-13          0
         2                   74            74,53           oracle       GURPARTAP           SQL*Plus                                       c.meditate.com                                      2 3z073sy7b8gfa ACTIVE 26-FEB-13          5
         2         2         74         53 75,45           oracle       GURPARTAP           SQL*Plus                                       c.meditate.com               33         33          2 3z073sy7b8gfa ACTIVE 26-FEB-13          0
         2         2         74         53 78,7            oracle       GURPARTAP           SQL*Plus                                       c.meditate.com               33         33          2 3z073sy7b8gfa ACTIVE 26-FEB-13          0
         2         2         74         53 79,5            oracle       GURPARTAP           SQL*Plus                                       c.meditate.com               33         33          2 3z073sy7b8gfa ACTIVE 26-FEB-13          0
         2         2         74         53 80,37           oracle       GURPARTAP           SQL*Plus                                       c.meditate.com               33         33          2 3z073sy7b8gfa ACTIVE 26-FEB-13          0
         2         2         74         53 81,15           oracle       GURPARTAP           SQL*Plus                                       c.meditate.com               33         33          2 3z073sy7b8gfa ACTIVE 26-FEB-13          0
         2         2         74         53 51,5            oracle       GURPARTAP           SQL*Plus                                       c.meditate.com               33         33          2 3z073sy7b8gfa ACTIVE 26-FEB-13          0
37 rows selected.
SQL>
   INST_ID QCINST_ID      QCSID      QCSER SID_SERIAL      OSUSER       USERNAME            MODULE                    ACTION               MACHINE                  DEGREE REQ_DEGREE    INST_ID SQL_ID        STATUS LOGON_TIM      LC_ET
---------- --------- ---------- ---------- --------------- ------------ ------------------- ------------------------- -------------------- -------------------- ---------- ---------- ---------- ------------- -------- --------- ----------
         1         1         56          3 77,7            oracle       SYS                 sqlplus@rac1.rac.meditate                      c.meditate.com                2          2          1 8wn8m9gpwnw3s ACTIVE 26-FEB-13          0
         1                   56            56,3            oracle       SYS                 sqlplus@rac1.rac.meditate                      c.meditate.com                                      1 8wn8m9gpwnw3s ACTIVE 26-FEB-13          0
         2         1         56          3 82,13           oracle       SYS                 sqlplus@rac1.rac.meditate                      c.meditate.com                2          2          2 8wn8m9gpwnw3s ACTIVE 26-FEB-13          0
         1         2         74         53 63,1            oracle       GURPARTAP           SQL*Plus                                       c.meditate.com               33         33          1 3z073sy7b8gfa ACTIVE 26-FEB-13          1
         1         2         74         53 64,1            oracle       GURPARTAP           SQL*Plus                                       c.meditate.com               33         33          1 3z073sy7b8gfa ACTIVE 26-FEB-13          1
         1         2         74         53 65,1            oracle       GURPARTAP           SQL*Plus                                       c.meditate.com               33         33          1 3z073sy7b8gfa ACTIVE 26-FEB-13          1
         1         2         74         53 66,1            oracle       GURPARTAP           SQL*Plus                                       c.meditate.com               33         33          1 3z073sy7b8gfa ACTIVE 26-FEB-13          1
         1         2         74         53 67,1            oracle       GURPARTAP           SQL*Plus                                       c.meditate.com               33         33          1 3z073sy7b8gfa ACTIVE 26-FEB-13          1
         1         2         74         53 68,1            oracle       GURPARTAP           SQL*Plus                                       c.meditate.com               33         33          1 3z073sy7b8gfa ACTIVE 26-FEB-13          1
         1         2         74         53 69,1            oracle       GURPARTAP           SQL*Plus                                       c.meditate.com               33         33          1 3z073sy7b8gfa ACTIVE 26-FEB-13          1
         1         2         74         53 70,1            oracle       GURPARTAP           SQL*Plus                                       c.meditate.com               33         33          1 3z073sy7b8gfa ACTIVE 26-FEB-13          1
         1         2         74         53 71,1            oracle       GURPARTAP           SQL*Plus                                       c.meditate.com               33         33          1 3z073sy7b8gfa ACTIVE 26-FEB-13          1
         1         2         74         53 72,1            oracle       GURPARTAP           SQL*Plus                                       c.meditate.com               33         33          1 3z073sy7b8gfa ACTIVE 26-FEB-13          1
         1         2         74         53 73,1            oracle       GURPARTAP           SQL*Plus                                       c.meditate.com               33         33          1 3z073sy7b8gfa ACTIVE 26-FEB-13          1
         1         2         74         53 74,1            oracle       GURPARTAP           SQL*Plus                                       c.meditate.com               33         33          1 3z073sy7b8gfa ACTIVE 26-FEB-13          1
         1         2         74         53 75,1            oracle       GURPARTAP           SQL*Plus                                       c.meditate.com               33         33          1 3z073sy7b8gfa ACTIVE 26-FEB-13          1
         1         2         74         53 62,3            oracle       GURPARTAP           SQL*Plus                                       c.meditate.com               33         33          1 3z073sy7b8gfa ACTIVE 26-FEB-13          1
         1         2         74         53 61,31           oracle       GURPARTAP           SQL*Plus                                       c.meditate.com               33         33          1 3z073sy7b8gfa ACTIVE 26-FEB-13          1
         1         2         74         53 53,15           oracle       GURPARTAP           SQL*Plus                                       c.meditate.com               33         33          1 3z073sy7b8gfa ACTIVE 26-FEB-13          1
         1         2         74         53 55,25           oracle       GURPARTAP           SQL*Plus                                       c.meditate.com               33         33          1 3z073sy7b8gfa ACTIVE 26-FEB-13          1
         2         2         74         53 45,111          oracle       GURPARTAP           SQL*Plus                                       c.meditate.com               33         33          2 3z073sy7b8gfa ACTIVE 26-FEB-13          0
         2         2         74         53 35,101          oracle       GURPARTAP           SQL*Plus                                       c.meditate.com               33         33          2 3z073sy7b8gfa ACTIVE 26-FEB-13          0
         2         2         74         53 52,5            oracle       GURPARTAP           SQL*Plus                                       c.meditate.com               33         33          2 3z073sy7b8gfa ACTIVE 26-FEB-13          0
         2         2         74         53 58,189          oracle       GURPARTAP           SQL*Plus                                       c.meditate.com               33         33          2 3z073sy7b8gfa ACTIVE 26-FEB-13          0
         2         2         74         53 59,59           oracle       GURPARTAP           SQL*Plus                                       c.meditate.com               33         33          2 3z073sy7b8gfa ACTIVE 26-FEB-13          0
         2         2         74         53 66,87           oracle       GURPARTAP           SQL*Plus                                       c.meditate.com               33         33          2 3z073sy7b8gfa ACTIVE 26-FEB-13          0
         2         2         74         53 67,119          oracle       GURPARTAP           SQL*Plus                                       c.meditate.com               33         33          2 3z073sy7b8gfa ACTIVE 26-FEB-13          0
         2         2         74         53 68,21           oracle       GURPARTAP           SQL*Plus                                       c.meditate.com               33         33          2 3z073sy7b8gfa ACTIVE 26-FEB-13          0
         2         2         74         53 69,37           oracle       GURPARTAP           SQL*Plus                                       c.meditate.com               33         33          2 3z073sy7b8gfa ACTIVE 26-FEB-13          0
         2         2         74         53 70,29           oracle       GURPARTAP           SQL*Plus                                       c.meditate.com               33         33          2 3z073sy7b8gfa ACTIVE 26-FEB-13          0
         2                   74            74,53           oracle       GURPARTAP           SQL*Plus                                       c.meditate.com                                      2 3z073sy7b8gfa ACTIVE 26-FEB-13          5
         2         2         74         53 75,45           oracle       GURPARTAP           SQL*Plus                                       c.meditate.com               33         33          2 3z073sy7b8gfa ACTIVE 26-FEB-13          0
         2         2         74         53 78,7            oracle       GURPARTAP           SQL*Plus                                       c.meditate.com               33         33          2 3z073sy7b8gfa ACTIVE 26-FEB-13          0
         2         2         74         53 79,5            oracle       GURPARTAP           SQL*Plus                                       c.meditate.com               33         33          2 3z073sy7b8gfa ACTIVE 26-FEB-13          0
         2         2         74         53 80,37           oracle       GURPARTAP           SQL*Plus                                       c.meditate.com               33         33          2 3z073sy7b8gfa ACTIVE 26-FEB-13          0
         2         2         74         53 81,15           oracle       GURPARTAP           SQL*Plus                                       c.meditate.com               33         33          2 3z073sy7b8gfa ACTIVE 26-FEB-13          0
         2         2         74         53 51,5            oracle       GURPARTAP           SQL*Plus                                       c.meditate.com               33         33          2 3z073sy7b8gfa ACTIVE 26-FEB-13          0
37 rows selected.

Now on this window just stop instance 1 and see that the query in window 1 will error out instead of failing over:
On window 2:
SQL> !srvctl stop instance -d GSINGH -i GSINGH1
SQL>

In window 1:
SQL> select /*+ parallel( a 33)  parallel(b 33)  */ count(*) from dba_objects a, dba_objects b;
select /*+ parallel( a 33)  parallel(b 33)  */ count(*) from dba_objects a, dba_objects b
                                                             *
ERROR at line 1:
ORA-12805: parallel query server died unexpectedly

SQL>
SQL>

==================================================================================================
 
Shalok, Fifth Mehl:
 
Within in my mind, I think thoughts of always rising early, and making the effort. O Lord, my Friend, please bless Nanak with the habit of singing the Kirtan of the Lord's Praises.
 

Friday, January 11, 2013

Post 45 of Series - Space calculation and analysis in case of NORMAL redundancy on ASM




SHALOK, THIRD MEHL

Without serving the True Guru, the soul is
in the bondage of deeds done in ego. Without serving the True Guru, one finds no place of rest; he dies, and is reincarnated, and continues coming and going.Without serving the True Guru, one?s speech is vapid and insipid; the Naam, the Name of the Lord, does not abide in his mind. O Nanak, without serving the True Guru, they are bound and beaten in the City of Death; they arise and depart with blackened
faces. || 1 ||






Here is the output of lsdg on ASM as of now.

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      6144     1847                0            1847              0             N  DATA/
MOUNTED  EXTERN  N         512   4096  1048576      2048      738                0             738              0             N  FLASH/
MOUNTED  EXTERN  N         512   4096  1048576      2048     1652                0            1652              0             Y  GRID/
MOUNTED  NORMAL  N         512   4096  1048576     12288    12123             2048            5037              0             N  TESTING/
ASMCMD>

1. Used 6 disks of 2048 each to create the disk group TESTING (Redundancy is of NORMAL), so total space used is 12288 MB.
2. Some of the space is used in headers so the space FREE in the diskgroup is 12123 MB.
3. Since we are using a mirroring of NORMAL, Oracle is reserving 2048 for failover if it occurs.
4. Usable_file_MB =  (Free_MB - Req_mir_free_MB)/2
5. i.e. Usable_file_MB=(12123-2048)/2 = 5037 MB


Now create a data file of 1024MB on this diskgroup

11:27 : oracle : rac1.rac.meditate.com : @GSINGH1 : /home/oracle
$ . oraenv
ORACLE_SID = [GSINGH1] ? emgc1
The Oracle base remains unchanged with value /u01/app/oracle

11:27 : oracle : rac1.rac.meditate.com : @emgc1 : /home/oracle
$ sqlplus / as sysdba

SQL*Plus: Release 11.2.0.3.0 Production on Fri Jan 11 11:27:12 2013

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


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

SQL>  create tablespace TESTING datafile '+TESTING' size 1024M autoextend off;

Tablespace created.

SQL> SQL>



How it looks on ASM as of now?


11:28 : oracle : rac1.rac.meditate.com : @+ASM1 : /home/oracle
$ 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      6144     1847                0            1847              0             N  DATA/
MOUNTED  EXTERN  N         512   4096  1048576      2048      738                0             738              0             N  FLASH/
MOUNTED  EXTERN  N         512   4096  1048576      2048     1652                0            1652              0             Y  GRID/
MOUNTED  NORMAL  N         512   4096  1048576     12288    10049             2048            4000              0             N  TESTING/
ASMCMD>


1. Total space is same as 12288 which includes all luns including the mirroring luns.
2. Earlier free space available was 12123 MB. Now is 12123-(1024*2(Multiply by 2 as its used by mirroring)=10075 MB. Some MB used for header update so FREE MB is : 10049MB (is as shown)
3. Since we are using a mirroring of NORMAL, Oracle is reserving 2048 for failover if it occurs same as earlier.
4. Usable_file_MB =  (Free_MB - Req_mir_free_MB)/2
5. i.e. Usable_file_MB=(10049-2048)/2 = 4000 MB


11:38 : oracle : rac1.rac.meditate.com : @ : /home/oracle
$ . oraenv
ORACLE_SID = [oracle] ? emgc1
The Oracle base has been set to /u01/app/oracle

11:38 : oracle : rac1.rac.meditate.com : @emgc1 : /home/oracle
$ sqlplus / as sysdba

SQL*Plus: Release 11.2.0.3.0 Production on Fri Jan 11 11:38:57 2013

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


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

SQL> create tablespace TESTING1 datafile '+TESTING' size 4096m autoextend off;

Tablespace created.

SQL>

11:42 : oracle : rac1.rac.meditate.com : @+ASM1 : /home/oracle
$ 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      6144     1847                0            1847              0             N  DATA/
MOUNTED  EXTERN  N         512   4096  1048576      2048      738                0             738              0             N  FLASH/
MOUNTED  EXTERN  N         512   4096  1048576      2048     1652                0            1652              0             Y  GRID/
MOUNTED  NORMAL  N         512   4096  1048576     12288     1852             2048             -98              0             N  TESTING/
ASMCMD>

1. Total space is same as 12288 which includes all luns including the mirroring luns.
2. Earlier free space available was 12123 MB. Now is 10049-(4096*2(Multiply by 2 as its used by mirroring))=1857 MB. Some MB used for header update so FREE MB is : 1852 MB (is as shown)
3. Since we are using a mirroring of NORMAL, Oracle is reserving 2048 for failover if it occurs same as earlier.
4. Usable_file_MB =  (Free_MB - Req_mir_free_MB)/2
5. i.e. Usable_file_MB=(1852-2048)/2 = -98 MB

Remember now we are not protected for the failure of teh disk. Oracle strongly recomends to add space before we go to miuns or approach near zero usable space.



BHAIRAO, FIFTH MEHL

Even though he may be fed with
hundreds of longings and yearnings, still the faithless cynic does not remember the Lord, Har, Har. || 1 || Take in the teachings of the humble Saints. In the Saadh Sangat, the Company of the Holy, you shall obtain the supreme status. || 1 || Pause || Stones may be kept under water for a long time. Even so, they do not absorb the water; they remain hard and dry. || 2 || The six Shaastras may be read to a fool, but it is like the wind blowing in the ten directions. || 3 || It is like threshing a crop without any corn ? nothing is gained. In the same way, no benefit comes from the faithless cynic. || 4 || As the Lord attaches them, so are all attached. Says Nanak, God has formed such a form.




Monday, August 13, 2012

Post 44 of Series - Create or start database on Oracle ZFS Appliance Clones that are mounted on Unix machine - Part 3



SHALOK: Unapproachable and Unfathomable is the Supreme Lord God; whoever speaks of Him shall be liberated. Listen, O friends, Nanak prays, to the wonderful story of the Holy. || 1 ||


ASHTAPADEE: In the Company of the Holy, one’s face becomes radiant. In the Company of the Holy, all filth is removed. In the Company of the Holy, egotism is
eliminated. In the Company of the Holy, spiritual wisdom is revealed. In the Company of the Holy, God is understood to be near at hand. In the Company of the Holy, all conflicts are settled. In the Company of the Holy, one obtains the jewel of the Naam. In the Company of the Holy, one’s efforts are directed toward the One Lord. What mortal can speak of the Glorious Praises of the Holy? O Nanak, the glory of the Holy people merges into God. || 1 ||





Now, we will mount this Oracle ZFS applicance clone on another server and will create the database on that server. I ahe another fresh node rac3.rac.meditate.com. Which is fresh server. I installed non-clustered database binaries on it and mounted the clone on that server. To see how to build rac3 server follow post 1,2,3,4 of my blog. To see how to mount the Oracle ZFS applicance clone on this server (rac3) look at the previous post i.e. post 43. The other solution is to create a standy by database on Oracle ZFS Appliance share and then take its sanp and create clone of snap and mount it on new server and over there on new server open this standby database on clone as read-write database. For now I will use image copy in this post.

Once all above is done, I will restore the spfile of the database as follow:


14:04 : oracle : rac3.rac.meditate.com : @GSINGH : /u01/app/oracle/product/11.2.0/dbhome_1/dbs


$ rman



Recovery Manager: Release 11.2.0.3.0 - Production on Mon Aug 13 14:04:58 2012



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



RMAN> connect target /



connected to target database (not started)



RMAN> set DBID = 686335423



executing command: SET DBID



RMAN> startup nomount;



startup failed: ORA-01078: failure in processing system parameters

LRM-00109: could not open parameter file '/u01/app/oracle/product/11.2.0/dbhome_1/dbs/initGSINGH.ora'



starting Oracle instance without parameter file for retrieval of spfile

Oracle instance started



Total System Global Area 158662656 bytes



Fixed Size 2226456 bytes

Variable Size 92276456 bytes

Database Buffers 58720256 bytes

Redo Buffers 5439488 bytes



RMAN> run {

2> allocate channel c1 device type disk;

3> restore spfile to '/u01/app/oracle/product/11.2.0/dbhome_1/dbs/initGSINGH.ora' from '/zfs/backup/1hnhl9f3_1_1';

4> }



allocated channel: c1

channel c1: SID=19 device type=DISK



Starting restore at 13-AUG-12



channel c1: restoring spfile from AUTOBACKUP /zfs/backup/1hnhl9f3_1_1

channel c1: SPFILE restore from AUTOBACKUP complete

Finished restore at 13-AUG-12

released channel: c1



RMAN> shutdown immediate;



Oracle instance shut down



RMAN> exit





Recovery Manager complete.



14:10 : oracle : rac3.rac.meditate.com : @GSINGH : /u01/app/oracle/product/11.2.0/dbhome_1/dbs



Fix spfile for ASM as this will be a non ASM database and cluster database=false and also fix the location of controlfile to $ORACLE_HOMe/dbs.

Now start teh database in nomount state using this restored spfile and create the contrlfile with new redolog locations (non ASM) and image copy datafiles that we backed up using RMAN.
Create controlfile as follows:



CREATE CONTROLFILE REUSE DATABASE "GSINGH" RESETLOGS ARCHIVELOG

MAXLOGFILES 192

MAXLOGMEMBERS 3

MAXDATAFILES 1024

MAXINSTANCES 32

MAXLOGHISTORY 292

LOGFILE

GROUP 1 '/u01/app/oracle/redo/redo_group_1.log' SIZE 50M BLOCKSIZE 512,

GROUP 2 '/u01/app/oracle/redo/redo_group_2.log' SIZE 50M BLOCKSIZE 512

-- STANDBY LOGFILE

DATAFILE

'/zfs/backup/data_D-GSINGH_I-686335423_TS-SYSTEM_FNO-1_1anhl98s',

'/zfs/backup/data_D-GSINGH_I-686335423_TS-SYSAUX_FNO-2_1bnhl98s',

'/zfs/backup/data_D-GSINGH_I-686335423_TS-UNDOTBS1_FNO-3_1dnhl9ci',

'/zfs/backup/data_D-GSINGH_I-686335423_TS-USERS_FNO-4_1gnhl9f0',

'/zfs/backup/data_D-GSINGH_I-686335423_TS-EXAMPLE_FNO-5_1cnhl9ci',

'/zfs/backup/data_D-GSINGH_I-686335423_TS-UNDOTBS2_FNO-6_1enhl9dj'

CHARACTER SET AL32UTF8

;


Add tempfiles in the end after recovery if you want.


After teh controlfile is created using the above command just mount the database using command:

alter database mount;
After that start the recovery, in this particular cacse I moved the archive log files manually from other nodes nut we can incremental image backps as well and also the archive log backups on to the Oracle ZFS appliance and recover using them.

Recover database as follows:

16:21 : oracle : rac3.rac.meditate.com : @GSINGH : /u01/app/oracle/product/11.2.0/dbhome_1/dbs

$ sqlplus / as sysdba



SQL*Plus: Release 11.2.0.3.0 Production on Mon Aug 13 16:21:46 2012



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





Connected to:

Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - 64bit Production

With the Partitioning, OLAP, Data Mining and Real Application Testing options



SQL> recover database until time '2012-08-10 17:00:00' using backup controlfile;

ORA-00279: change 2259222 generated at 08/07/2012 10:23:17 needed for thread 2

ORA-00289: suggestion :

/u01/app/oracle/product/11.2.0/dbhome_1/dbs/arch2_38_786540867.dbf

ORA-00280: change 2259222 for thread 2 is in sequence #38





Specify log: {=suggested
filename
AUTO
CANCEL}

/u01/app/oracle/product/11.2.0/dbhome_1/dbs/thread_2_seq_38.300.790683799

ORA-00279: change 2259222 generated at 08/02/2012 16:47:30 needed for thread 1

ORA-00289: suggestion :

/u01/app/oracle/product/11.2.0/dbhome_1/dbs/arch1_41_786540867.dbf

ORA-00280: change 2259222 for thread 1 is in sequence #41





Specify log: {=suggested
filename
AUTO
CANCEL}

/u01/app/oracle/product/11.2.0/dbhome_1/dbs/thread_1_seq_41.298.790683797

ORA-00279: change 2259224 generated at 08/07/2012 10:23:17 needed for thread 1

ORA-00289: suggestion :

/u01/app/oracle/product/11.2.0/dbhome_1/dbs/arch1_42_786540867.dbf

ORA-00280: change 2259224 for thread 1 is in sequence #42

ORA-00278: log file

'/u01/app/oracle/product/11.2.0/dbhome_1/dbs/thread_1_seq_41.298.790683797' no

longer needed for this recovery





Specify log: {=suggested
filename
AUTO
CANCEL}

/u01/app/oracle/product/11.2.0/dbhome_1/dbs/thread_1_seq_42.301.790772513

ORA-00288: to continue recovery type ALTER DATABASE RECOVER CONTINUE

ORA-00278: log file

'/u01/app/oracle/product/11.2.0/dbhome_1/dbs/thread_2_seq_38.300.790683799' no

longer needed for this recovery





ORA-00279: change 2260187 generated at 08/07/2012 10:23:54 needed for thread 2

ORA-00289: suggestion :

/u01/app/oracle/product/11.2.0/dbhome_1/dbs/arch2_39_786540867.dbf

ORA-00280: change 2260187 for thread 2 is in sequence #39





Specify log: {=suggested
filename
AUTO
CANCEL}

/u01/app/oracle/product/11.2.0/dbhome_1/dbs/thread_2_seq_39.302.790772515

ORA-00279: change 2347764 generated at 08/08/2012 11:01:50 needed for thread 2

ORA-00289: suggestion :

/u01/app/oracle/product/11.2.0/dbhome_1/dbs/arch2_40_786540867.dbf

ORA-00280: change 2347764 for thread 2 is in sequence #40

ORA-00278: log file

'/u01/app/oracle/product/11.2.0/dbhome_1/dbs/thread_2_seq_39.302.790772515' no

longer needed for this recovery





Specify log: {=suggested
filename
AUTO
CANCEL}

/u01/app/oracle/product/11.2.0/dbhome_1/dbs/thread_2_seq_39.302.790772515

ORA-00310: archived log contains sequence 39; sequence 40 required

ORA-00334: archived log:

'/u01/app/oracle/product/11.2.0/dbhome_1/dbs/thread_2_seq_39.302.790772515'





SQL> /u01/app/oracle/product/11.2.0/dbhome_1/dbs/thread_2_seq_40.303.790772515

SP2-0734: unknown command beginning "/u01/app/o..." - rest of line ignored.

SQL> recover database until time '2012-08-10 17:00:00' using backup controlfile;

ORA-00279: change 2347764 generated at 08/08/2012 11:01:50 needed for thread 2

ORA-00289: suggestion :

/u01/app/oracle/product/11.2.0/dbhome_1/dbs/arch2_40_786540867.dbf

ORA-00280: change 2347764 for thread 2 is in sequence #40





Specify log: {=suggested
filename
AUTO
CANCEL}

/u01/app/oracle/product/11.2.0/dbhome_1/dbs/thread_2_seq_40.303.790772515

ORA-00279: change 2347764 generated at 08/07/2012 10:23:17 needed for thread 1

ORA-00289: suggestion :

/u01/app/oracle/product/11.2.0/dbhome_1/dbs/arch1_42_786540867.dbf

ORA-00280: change 2347764 for thread 1 is in sequence #42





Specify log: {=suggested
filename
AUTO
CANCEL}

/u01/app/oracle/product/11.2.0/dbhome_1/dbs/thread_1_seq_42.301.790772513

ORA-00279: change 2347765 generated at 08/08/2012 11:01:50 needed for thread 1

ORA-00289: suggestion :

/u01/app/oracle/product/11.2.0/dbhome_1/dbs/arch1_43_786540867.dbf

ORA-00280: change 2347765 for thread 1 is in sequence #43

ORA-00278: log file

'/u01/app/oracle/product/11.2.0/dbhome_1/dbs/thread_1_seq_42.301.790772513' no

longer needed for this recovery





Specify log: {=suggested
filename
AUTO
CANCEL}

/u01/app/oracle/product/11.2.0/dbhome_1/dbs/thread_1_seq_43.305.790946237

ORA-00288: to continue recovery type ALTER DATABASE RECOVER CONTINUE

ORA-00278: log file

'/u01/app/oracle/product/11.2.0/dbhome_1/dbs/thread_2_seq_40.303.790772515' no

longer needed for this recovery





ORA-00279: change 2348669 generated at 08/08/2012 11:02:38 needed for thread 2

ORA-00289: suggestion :

/u01/app/oracle/product/11.2.0/dbhome_1/dbs/arch2_41_786540867.dbf

ORA-00280: change 2348669 for thread 2 is in sequence #41





Specify log: {=suggested
filename
AUTO
CANCEL}

/u01/app/oracle/product/11.2.0/dbhome_1/dbs/thread_2_seq_41.304.790946235

ORA-00279: change 2410687 generated at 08/10/2012 11:17:12 needed for thread 1

ORA-00289: suggestion :

/u01/app/oracle/product/11.2.0/dbhome_1/dbs/arch1_44_786540867.dbf

ORA-00280: change 2410687 for thread 1 is in sequence #44

ORA-00278: log file

'/u01/app/oracle/product/11.2.0/dbhome_1/dbs/thread_1_seq_43.305.790946237' no

longer needed for this recovery





Specify log: {=suggested
filename
AUTO
CANCEL}

/u01/app/oracle/product/11.2.0/dbhome_1/dbs/thread_1_seq_44.307.791199249

ORA-00279: change 2410688 generated at 08/10/2012 11:17:12 needed for thread 2

ORA-00289: suggestion :

/u01/app/oracle/product/11.2.0/dbhome_1/dbs/arch2_42_786540867.dbf

ORA-00280: change 2410688 for thread 2 is in sequence #42

ORA-00278: log file

'/u01/app/oracle/product/11.2.0/dbhome_1/dbs/thread_2_seq_41.304.790946235' no

longer needed for this recovery





Specify log: {=suggested
filename
AUTO
CANCEL}

/u01/app/oracle/product/11.2.0/dbhome_1/dbs/thread_2_seq_42.306.790948027

ORA-00279: change 2425270 generated at 08/10/2012 11:47:05 needed for thread 2

ORA-00289: suggestion :

/u01/app/oracle/product/11.2.0/dbhome_1/dbs/arch2_43_786540867.dbf

ORA-00280: change 2425270 for thread 2 is in sequence #43

ORA-00278: log file

'/u01/app/oracle/product/11.2.0/dbhome_1/dbs/thread_2_seq_42.306.790948027' no

longer needed for this recovery





Specify log: {=suggested
filename
AUTO
CANCEL}

/u01/app/oracle/product/11.2.0/dbhome_1/dbs/thread_2_seq_43.308.791199251

Log applied.

Media recovery complete.

SQL>


Once recovery is compelete, open the database with reset logs. I got teh following error, its becasue of a bug. Just do the fix given below and try to re-open the database and it will work.


SQL>alter database open resetlogs;

alter database open resetlogs

*

ERROR at line 1:

ORA-38856: cannot mark instance UNNAMED_INSTANCE_2 (redo thread 2) as enabled





SQL>







Now you just need to update the spfile with parameter:

_no_recovery_through_resetlogs=TRUE



Create pfile from spfile and update spfile and now create spfile from that pfile and open the database as :





SQL> create spfile='/u01/app/oracle/product/11.2.0/dbhome_1/dbs/spfileGSINGH.ora' from pfile='/u01/app/oracle/product/11.2.0/dbhome_1/dbs/initGSINGH.ora';



File created.



SQL> startup mount;

ORACLE instance started.



Total System Global Area 471830528 bytes

Fixed Size 2229464 bytes

Variable Size 146803496 bytes

Database Buffers 318767104 bytes

Redo Buffers 4030464 bytes

Database mounted.

SQL> alter database open resetlogs;





Database altered.


Here we go, we have a database on ZFS applicance.




SQL> SQL> select * from gv$instance;



INST_ID INSTANCE_NUMBER INSTANCE_NAME

---------- --------------- ----------------

HOST_NAME

----------------------------------------------------------------

VERSION STARTUP_T STATUS PAR THREAD# ARCHIVE LOG_SWITCH_WAIT

----------------- --------- ------------ --- ---------- ------- ---------------

LOGINS SHU DATABASE_STATUS INSTANCE_ROLE ACTIVE_ST BLO

---------- --- ----------------- ------------------ --------- ---

1 1 GSINGH

rac3.rac.meditate.com

11.2.0.3.0 13-AUG-12 OPEN NO 1 STARTED

ALLOWED NO ACTIVE PRIMARY_INSTANCE NORMAL NO





SQL> select name from v$datafile;



NAME

--------------------------------------------------------------------------------

/zfs/backup/data_D-GSINGH_I-686335423_TS-SYSTEM_FNO-1_1anhl98s

/zfs/backup/data_D-GSINGH_I-686335423_TS-SYSAUX_FNO-2_1bnhl98s

/zfs/backup/data_D-GSINGH_I-686335423_TS-UNDOTBS1_FNO-3_1dnhl9ci

/zfs/backup/data_D-GSINGH_I-686335423_TS-USERS_FNO-4_1gnhl9f0

/zfs/backup/data_D-GSINGH_I-686335423_TS-EXAMPLE_FNO-5_1cnhl9ci

/zfs/backup/data_D-GSINGH_I-686335423_TS-UNDOTBS2_FNO-6_1enhl9dj



6 rows selected.



SQL> exit

Disconnected from Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - 64bit Production

With the Partitioning, OLAP, Data Mining and Real Application Testing options



17:49 : oracle : rac3.rac.meditate.com : @GSINGH : /u01/app/oracle/product/11.2.0/dbhome_1/dbs

$ df -h

Filesystem Size Used Avail Use% Mounted on

/dev/mapper/VolGroup00-LogVol00

84G 8.8G 71G 12% /

/dev/sda1 99M 13M 82M 14% /boot

tmpfs 754M 0 754M 0% /dev/shm

192.168.1.195:/export/share0_first_clone

9.7G 2.2G 7.5G 23% /zfs



17:49 : oracle : rac3.rac.meditate.com : @GSINGH : /u01/app/oracle/product/11.2.0/dbhome_1/dbs

$

So we have our database running on the clone of ZFS on new server.
As you wil keep working on the database the delta of clone will keep increasing and so will be the size of the clone. We just updated teh headers of teh databases and the sixe of teh clone increased to 156mb as below.






In the Company of the Holy, one meets the Incomprehensible Lord. In the Company of the Holy, one flourishes forever. In the Company of the Holy, the five passions are brought to rest. In the Company of the Holy, one enjoys the essence of ambrosia. In the Company of the Holy, one becomes the dust of all. In the Company of the Holy, one’s speech is enticing. In the Company of the Holy, the mind does not wander. In the Company of the Holy, the mind becomes stable. In the Company of the Holy, one is rid of Maya. In the Company of the Holy, O Nanak, God is totally pleased. || 2 ||

Friday, August 10, 2012

Post 43 of Series - Create Oracle ZFS Snapshots & Clones and mount on VMware Machines - Part 2

Post 43 of Series - Create Oracle ZFS Snapshots & Clones and mount on VMware Machines - Part 2


The Lord, our Help and Support, is always with us, but the mortal does not remember Him. He shows love to his enemies. He lives in a castle of sand. He enjoys the games of pleasure and the tastes of Maya. He believes them to be permanent this is the belief of his mind. Death does not even come to mind for the fool. Hate, conflict, sexual desire, anger, emotional attachment, falsehood, corruption, immense greed and deceit:  So many lifetimes are wasted in these ways. Nanak: uplift them, and redeem them, O Lord . show Your Mercy!



Lets create the snapsot of the share we have already created. Then edit(delete,copy) the current data on the live share and then restore it from teh snapshot we took. In the next step we will clone the share where we took the backup.

Go to shares and take the mouse on the right most side of your share that you have. I have recreated the share now and now its called "ZFS0/share0". You can you the same as we have in last part or create the one I have using the steps in the last part.  Click on edit and you will see the following screen.



Click on Snapshots and then click the "+" sign in front of the "Snapshot" and you get the following screen. Enter the name of the snapshot here. I am entering "share0_first_snap".
and now the snap of the share is taken.



Lets modify the data on share and restore it from the snap. We already have it mounted on node 1. i.e. rac1.rac.meditate.com. Lets go to that server and modify the data there. This is the RMAN backup of RAC database GSINGH1 that is a RAC database and running on 2 nodes. This backup we took in last post. Once is backup as compressed and one is image copy of the database.


11:24 : oracle : rac1.rac.meditate.com : @GSINGH1 : /zfs/backup


$ ls -lart

total 2259216

drwxrwxrwx 3 nfsnobody bin 3 Aug 2 09:43 ..

-rw-r-----+ 1 oracle oinstall 3744768 Aug 2 09:44 0vnhl8ir_1_1

-rw-r-----+ 1 oracle oinstall 12274176 Aug 2 09:44 10nhl8is_1_1

-rw-r-----+ 1 oracle oinstall 6493696 Aug 2 09:44 11nhl8j1_1_1

-rw-r-----+ 1 oracle oinstall 192987136 Aug 2 09:47 13nhl8je_1_1

-rw-r-----+ 1 oracle oinstall 110706688 Aug 2 09:47 12nhl8je_1_1

-rw-r-----+ 1 oracle oinstall 98304 Aug 2 09:47 15nhl8os_1_1

-rw-r-----+ 1 oracle oinstall 1114112 Aug 2 09:47 14nhl8or_1_1

-rw-r-----+ 1 oracle oinstall 80384 Aug 2 09:47 16nhl8p9_1_1

-rw-r-----+ 1 oracle oinstall 33792 Aug 2 09:47 17nhl8p9_1_1

-rw-r-----+ 1 oracle oinstall 692068352 Aug 2 09:57 data_D-GSINGH_I-686335423_TS-SYSAUX_FNO-2_1bnhl98s

-rw-r-----+ 1 oracle oinstall 754982912 Aug 2 09:57 data_D-GSINGH_I-686335423_TS-SYSTEM_FNO-1_1anhl98s

-rw-r-----+ 1 oracle oinstall 131080192 Aug 2 09:58 data_D-GSINGH_I-686335423_TS-UNDOTBS1_FNO-3_1dnhl9ci

-rw-r-----+ 1 oracle oinstall 52436992 Aug 2 09:58 data_D-GSINGH_I-686335423_TS-UNDOTBS2_FNO-6_1enhl9dj

-rw-r-----+ 1 oracle oinstall 328343552 Aug 2 09:58 data_D-GSINGH_I-686335423_TS-EXAMPLE_FNO-5_1cnhl9ci

-rw-r-----+ 1 oracle oinstall 5251072 Aug 2 09:59 data_D-GSINGH_I-686335423_TS-USERS_FNO-4_1gnhl9f0

-rw-r-----+ 1 oracle oinstall 18792448 Aug 2 09:59 cf_D-GSINGH_id-686335423_1fnhl9e7

drwxr-xr-x+ 2 oracle oinstall 19 Aug 2 09:59 .

-rw-r-----+ 1 oracle oinstall 98304 Aug 2 09:59 1hnhl9f3_1_1



11:24 : oracle : rac1.rac.meditate.com : @GSINGH1 : /zfs/backup

$


Lets delete some data from this directory:

11:24 : oracle : rac1.rac.meditate.com : @GSINGH1 : /zfs/backup


$ rm data_D-GSINGH_I-686335423_TS-SYSAUX_FNO-2_1bnhl98s data_D-GSINGH_I-686335423_TS-SYSTEM_FNO-1_1anhl98s data_D-GSINGH_I-686335423_TS-UNDOTBS1_FNO-3_1dnhl9ci data_D-GSINGH_I-686335423_TS-UNDOTBS2_FNO-6_1enhl9dj data_D-GSINGH_I-686335423_TS-EXAMPLE_FNO-5_1cnhl9ci



Now confirm the we have removed some files.

11:25 : oracle : rac1.rac.meditate.com : @GSINGH1 : /zfs/backup

$ ls -lart

total 344267

drwxrwxrwx 3 nfsnobody bin 3 Aug 2 09:43 ..

-rw-r-----+ 1 oracle oinstall 3744768 Aug 2 09:44 0vnhl8ir_1_1

-rw-r-----+ 1 oracle oinstall 12274176 Aug 2 09:44 10nhl8is_1_1

-rw-r-----+ 1 oracle oinstall 6493696 Aug 2 09:44 11nhl8j1_1_1

-rw-r-----+ 1 oracle oinstall 192987136 Aug 2 09:47 13nhl8je_1_1

-rw-r-----+ 1 oracle oinstall 110706688 Aug 2 09:47 12nhl8je_1_1

-rw-r-----+ 1 oracle oinstall 98304 Aug 2 09:47 15nhl8os_1_1

-rw-r-----+ 1 oracle oinstall 1114112 Aug 2 09:47 14nhl8or_1_1

-rw-r-----+ 1 oracle oinstall 80384 Aug 2 09:47 16nhl8p9_1_1

-rw-r-----+ 1 oracle oinstall 33792 Aug 2 09:47 17nhl8p9_1_1

-rw-r-----+ 1 oracle oinstall 5251072 Aug 2 09:59 data_D-GSINGH_I-686335423_TS-USERS_FNO-4_1gnhl9f0

-rw-r-----+ 1 oracle oinstall 18792448 Aug 2 09:59 cf_D-GSINGH_id-686335423_1fnhl9e7

-rw-r-----+ 1 oracle oinstall 98304 Aug 2 09:59 1hnhl9f3_1_1

drwxr-xr-x+ 2 oracle oinstall 14 Aug 8 04:25 .



11:25 : oracle : rac1.rac.meditate.com : @GSINGH1 : /zfs/backup

$


Now lets restore it from teh snap we took by rolling back the changes to the snap we took from ZFS as follows:

On the following page place you mouse on the line where we have snap "share0_first_snap". You will see a rollback button. Just click it.

You will get the following screen. Click "OK". We are done with rollback and the old files should have been restored by now.






Lets check on the server if the files have been restored.


11:25 : oracle : rac1.rac.meditate.com : @GSINGH1 : /zfs/backup


$ ls -lart

total 2259216

drwxrwxrwx 3 nfsnobody bin 3 Aug 2 09:43 ..

-rw-r-----+ 1 oracle oinstall 3744768 Aug 2 09:44 0vnhl8ir_1_1

-rw-r-----+ 1 oracle oinstall 12274176 Aug 2 09:44 10nhl8is_1_1

-rw-r-----+ 1 oracle oinstall 6493696 Aug 2 09:44 11nhl8j1_1_1

-rw-r-----+ 1 oracle oinstall 192987136 Aug 2 09:47 13nhl8je_1_1

-rw-r-----+ 1 oracle oinstall 110706688 Aug 2 09:47 12nhl8je_1_1

-rw-r-----+ 1 oracle oinstall 98304 Aug 2 09:47 15nhl8os_1_1

-rw-r-----+ 1 oracle oinstall 1114112 Aug 2 09:47 14nhl8or_1_1

-rw-r-----+ 1 oracle oinstall 80384 Aug 2 09:47 16nhl8p9_1_1

-rw-r-----+ 1 oracle oinstall 33792 Aug 2 09:47 17nhl8p9_1_1

-rw-r-----+ 1 oracle oinstall 692068352 Aug 2 09:57 data_D-GSINGH_I-686335423_TS-SYSAUX_FNO-2_1bnhl98s

-rw-r-----+ 1 oracle oinstall 754982912 Aug 2 09:57 data_D-GSINGH_I-686335423_TS-SYSTEM_FNO-1_1anhl98s

-rw-r-----+ 1 oracle oinstall 131080192 Aug 2 09:58 data_D-GSINGH_I-686335423_TS-UNDOTBS1_FNO-3_1dnhl9ci

-rw-r-----+ 1 oracle oinstall 52436992 Aug 2 09:58 data_D-GSINGH_I-686335423_TS-UNDOTBS2_FNO-6_1enhl9dj

-rw-r-----+ 1 oracle oinstall 328343552 Aug 2 09:58 data_D-GSINGH_I-686335423_TS-EXAMPLE_FNO-5_1cnhl9ci

-rw-r-----+ 1 oracle oinstall 5251072 Aug 2 09:59 data_D-GSINGH_I-686335423_TS-USERS_FNO-4_1gnhl9f0

-rw-r-----+ 1 oracle oinstall 18792448 Aug 2 09:59 cf_D-GSINGH_id-686335423_1fnhl9e7

drwxr-xr-x+ 2 oracle oinstall 19 Aug 2 09:59 .

-rw-r-----+ 1 oracle oinstall 98304 Aug 2 09:59 1hnhl9f3_1_1



11:26 : oracle : rac1.rac.meditate.com : @GSINGH1 : /zfs/backup

$

    And the files are back. So, restore is complete.


Lets clone our share now and mount the clone on other RAC node. Click on "Shares".



Click on edit share and you see the following screen




Click on snapshot and take mouse on snap and click centre option to make clone and you will the following window. Enter name of clone as "share0_first_clone" and click apply.


You will see the floowing screen and now if you click on "Shares" you will see two mountpoints. One is clone and one is real muntpoint.



You will see the size of clone will be very less as its just the difference between base share snapshot and clone. As you keep doing changes on clone you will see the size of clone will keep increasing.





On Node 2:


See which mountpoints are visible from ZFS to this node, use the folllowing command:

"showmount -e 192.168.1.195"


11:32 : oracle : rac2.rac.meditate.com : @GSINGH2 : /home/oracle

$ su -

Password:

[root@rac2 ~]# showmount -e 192.168.1.195

Export list for 192.168.1.195:

/export/share0_first_clone (everyone)

/export/share0 (everyone)

[root@rac2 ~]#

===========

Lets mount the clone using following command.


[root@rac2 ~]# mount -o hard,rw,noac,rsize=32768,wsize=32768,suid,proto=tcp,vers=3 192.168.1.195:/export/share0_first_clone /zfs

[root@rac2 ~]# df -h

Filesystem Size Used Avail Use% Mounted on

/dev/mapper/VolGroup00-LogVol00

84G 11G 69G 14% /

/dev/sda1 99M 13M 82M 14% /boot

tmpfs 754M 200M 554M 27% /dev/shm

192.168.1.195:/export/share0_first_clone

9.8G 2.2G 7.7G 23% /zfs

[root@rac2 ~]#

===============

Clone is mounted on node 2. Now as you keep modifying the clone on node2 its size will keep growing as you can see in the snapshot below.




See size is increasing.



Thats it for this post !

In next post we will create the database from image copy on clone on node2 and will drop and recreate database on clone. We will see the size of the clone will increase as we keep using that database on clone that we will create.


SHALOK: One who renounces God the Giver, and attaches himself to other affairs O  Nanak, he shall never succeed. Without the Name, he shall lose his honor. 1