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

Thursday, August 2, 2012

Post 42 of Series - Install Oracle ZFS on Virtual Box and mount on VMware Machines - Part 1


Post 42 of Series - Install Oracle ZFS  on Virtual Box and mount on VMware Machines - Part 1 

Remembering the Lord in meditation, you shall find bliss and peace forever deep within, and your mind will become tranquil and cool. It is like the harsh sun of Maya, with its burning heat; seeing the moon, the Guru, its heat totally vanishes. || 1 || O my mind, night and day, meditate, and chant the Lords Name. Here and hereafter, He shall protect you, everywhere; serve such a God forever.

 



Recently I had an opportunity to work on Oracle ZFS appliance to backup huge database on exadata and then use that backup after taking ZFS snapshots and present to another server and create a snap database to be used for pre-production environment. I was a nice exercise so , I thought to create a simulataed environment on vmware and share here on my blog.


Lets first download the Oracle Virtual Box and also the ZFS simulator software from Oracle website. To download both go th the following url:



You need to install the VBox first in a 64bit OS host.
Just download both softwares from the locations given above, screenshots are provided below.











After download let’s install Virtual box.


Click Run


Next


Next


Next


Next



Install




Install


Finish


Installation is complete now.


Unzip the ZFS simulator software that we downloaded.




Lets import it to the virtual box:


Click choose and go to the unzipped location


Click this file:



Click Next:


Click Import




Import complete



Lets start machine and do the initial network config. Click on Grrrn Arrow to start the machine.





On this screen we need to do the network configuration as follows:

Host Name: OracleZFS
DNS Domain: 192.168.1.254 (Router ip)
IP Address: 192.168.1.195
IP Netmask: 255.255.255.0
Default Router: 192.168.1.254 (Router ip)
DNS Server: 192.168.1.254 (Router ip)
Password: gurpartap
Re-enter Password: gurpartap

After this just Press "Esc and "1" together to start install. It takes time so be patient.



After install is complete just shutdown the machine as we need to fix the network card settings to bring it on our network. 

Shutdown as follows: Machine -> Close


On this screen pick "Power off the machine"


After machine has halted just click on network and change the settings of the network card to bridged.



Here we go, we are all set. now we need to do some initial setup of the machine, I will use GUI to do that instead of command line.


Open the url https://192.168.1.195:215 in your browser and you will get the following window. If you don't get this window, it means your network settings are not good. Please re-check the network settings and get to this page.

Login as :

Username: root
Password: gurpartap



Click start on the following screen.



You will get to this screen and it starts initial configuration, since it's just a simulator we will keep it simple. So, click commit.



Again click commit:


Again click commit:


Again click commit:


Again click commit:


Click "Later" on the following:


Click "OK" on the following:


and you will get to the following screen:


Now let's configure storage.
Click "Configuration" -> "Storage" and you will get to the following screen






Cick "Available Pools"

Give Pool name as "Pool1"







Allocte 1GB and commit.




This takes you to Step 2, click commit:






"Pool1" is created now.


Let’s create shares. Now click "Shares"



 Click "+" infront of "Filesystems"


Just add name as :  "ZFS_DEVICE" and make sure in permissions you click "group" and "others" as well, so that all are yellow and click "APPLY"




Share have been created.


Lets mount it on the database server that we created in Post 1 to 9 as:

Now let's see how it looks on servers and if server can see lets mount it to take backups.
On server as root execute teh following command if the share is visible or not.
showmount -e 192.168.1.195


[root@dgrac02 ~]# showmount -e 192.168.1.195

Export list for 192.168.1.195:

/export/ZFS_DEVICE (everyone)


So its visible.
Let make a directory the we will use to mount this share.
mkdir /zfs1


[root@dgrac02 ~]# mkdir /zfs1


Now, lets mount using following command
mount -o hard,rw,noac,rsize=32768,wsize=32768,suid,proto=tcp,vers=3 192.168.1.195:/export/ZFS_DEVICE /zfs1



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






Verify if it mounted or not:
df -h



[root@dgrac02 ~]# df -h

Filesystem Size Used Avail Use% Mounted on


/dev/mapper/VolGroup00-LogVol00

84G 19G 61G 25% /

/dev/sda1 99M 16M 78M 17% /boot

tmpfs 1.3G 165M 1.1G 14% /dev/shm

192.168.1.195:/export/ZFS_DEVICE

9.8G 0 9.8G 0% /zfs1

[root@dgrac02 ~]#


Now take the backup of database on this mount point using rman scrrips given below.

Backup set level 0 backup:


run
{
sql 'alter system set "_backup_disk_bufcnt"=64 scope=memory';
sql 'alter system set "_backup_disk_bufsz"=1048576 scope=memory';
allocate channel ch01 device type disk
format '/zfs/backup/%U';
allocate channel ch02 device type disk
format '/zfs/backup/%U';
backup as compressed backupset incremental level 0 database tag 'FULLBACKUPSET_L0' plus archivelog tag 'FULLBACKUPSET_L0';
}





run
{
sql 'alter system set "_backup_disk_bufcnt"=64 scope=memory';
sql 'alter system set "_backup_disk_bufsz"=1048576 scope=memory';
allocate channel ch01 device type disk
format '/zfs/backup/%U';
allocate channel ch02 device type disk
format '/zfs/backup/%U';
Backup set level 0 backup:


run
{
sql 'alter system set "_backup_disk_bufcnt"=64 scope=memory';
sql 'alter system set "_backup_disk_bufsz"=1048576 scope=memory';
allocate channel ch01 device type disk
format '/zfs/backup/%U';
allocate channel ch02 device type disk
format '/zfs/backup/%U';
backup as compressed backupset incremental level 0 database tag 'FULLBACKUPSET_L0' plus archivelog tag 'FULLBACKUPSET_L0';

}





run

{

sql 'alter system set "_backup_disk_bufcnt"=64 scope=memory';
sql 'alter system set "_backup_disk_bufsz"=1048576 scope=memory';
allocate channel ch01 device type disk
format '/zfs/backup/%U';
allocate channel ch02 device type disk
format '/zfs/backup/%U';
backup as copy database;
}
backup as copy database;
}


So, on one node "dgrac02" we have mounted the zfs mount point. We will take rman backups and take its snaps and present to another server and create test database there. That we will do in subsequent posts.




 One who is cursed by the Saints, is thrown down on the ground. The slanderer of the Saints is thrown down from the skies. I hold the Saints close to my soul. The Saints are saved instantaneously. || 1 || He alone is a Saint, who is
pleasing to the Lord. The Saints, and God, have only one job to do. || 1 || Pause || God gives His hand to shelter the Saints. He dwells with His Saints, day and night. With each and every breath, He cherishes His Saints. He takes the power away from the enemies of the Saints. || 2 || Let no one slander the Saints. Whoever slanders them, will be destroyed. One who is protected by the Creator Lord, cannot be harmed, no matter how much the whole world may try. || 3 || I place my faith in my God. My soul and body all belong to Him. This is the faith which inspires Nanak: the self-willed manmukhs will fail, while the Gurmukhs will always win. || 4 ||  16 || 18 ||