Databases in NetApp BlogsWhere is place located?

Log in to ask questions, participate and connect in the NetApp community. Not a member? Join Now!

Recent Blog Posts

Refresh this widget

Hi All,

 

This is neto from Brazil

 

How are you?

 

My friend Leighton Nelson (https://twitter.com/@leight0nn) had asked me (https://twitter.com/@netofrombrazil) to help him with a very interesting challenge.

 

AUTO for Oracle RAC database recovery does not work well, and we will need to execute some queries to find out the exactly change for the recovery.

 

select name, thread#, sequence#, first_change#, next_change# from v$archived_log where thread#=1 and 7728330471997 between first_change# and next_change#;

 

With the exactly change number, we will pass it as the STDIN for the sqlplus process (dynamically).

 

Procedure:

 

Terminal 1: As Oracle user run:

 

mkfifo sql

cat > sql &

sqlplus / as sysdba < sql > output

 

NOTE: sql is the pipe for STDIN and output is for STDOUT

 

Terminal 2: As Oracle user run:

 

tail -f output

 

NOTE: To check all output from sqlplus process.

 

Terminal 3: As Oracle user run:

 

echo "select * from v\$instance;" > sql

 

NOTE: Sending "select * from v$instance" to pipe sql - where it will be redirected to STDIN for sqlplus process


Now, it will be easier to execute queries to find out the change number (check STDOUT) and create dynamic queries to send to sqlplus process (STDIN).

 

echo "recover database using backup controlfile until cancel;" > sql

echo "+DG_ARCH/prod/archivelog/2014_01_06/thread_1_seq_27236.1832.836139501" > sql


Screen Shot 2014-01-10 at 5.04.39 PM.png

 

Love you my friend,

 

All the best

 

neto

NetApp - I love this company!

Hi All,

 

This is neto from Brazil

 

How are you?

 

Here is a wonderful procedure created by the rock star Mike Doherty (NetApp) to integrate Snap Creator Framework into ASMLib (Clones) - Oracle environment.

 

We need to improve it a little bit (e.g. to handle multiple clones on the same host, error handling, etc) but this is a great start.

 

Check V2

 

#!/bin/ksh

# Created 9/17/13

#

# NetApp

#

# Authors:            Mike Doherty, Neto from Brazil, Greg Loughmiller

#

# Purpose:  Automate cloning with ASMLib, scan new luns, rename ASM Disks, rename DiskGroups

#

# - version 0.2

#

# Change Log:

# Created 9-17-2013

#

# Mod 9-18-2013

# replace string with dd -- much faster

# added better logic for disks, used config file instead of string/*

# added asmcmd mount of new DG clones

#

#

#

# NOTES:

# Best if run as ASM owner as asmcmd cmd is invoked to +ASM instance

# You can edit asmcmd and add sudo -E -u <owner> asmcmd mount <variable>

# This is if you add script in SC POST_CLONE_CREATE_CMD01= /script_name

#

# To automate process uncomment lines 66-68

#

######################################################################

# Variable Definitions

# p = current working directory

# b = original asm disk pulled from querydisk

# c = original DG pulled from device header

#

#

#

######################################################################

# Variables

p=`pwd`

#

#

######################################################################

#

sudo /usr/local/bin/ql-dynamic-tgt-lun-disc.sh -s -r << EOF

yes

 

EOF

# Remove exsisting files

rm renamedisks.sh

rm renamedg.sh

rm *.tmp

rm asm_*

 

sudo sanlun lun show -p |grep  -A 3 -i "cl_" |grep "DM-MP DevName:" |   awk '{print $3}' | while read i dummy

do

b=`sudo /etc/init.d/oracleasm querydisk /dev/mapper/$i | awk '{print $11}' | cut -d'"' -f2`

c=`sudo dd if=/dev/mapper/$i bs=1 skip=104 count=11`

echo "sudo /etc/init.d/oracleasm force-renamedisk /dev/mapper/$i CL$b" >> renamedisks.sh

echo "/dev/oracleasm/disks/CL$b $c CL_$c" >> asm_$c.conf

echo "renamedg phase=two dgname=$c newdgname=CL_$c config=asm_$c.conf" >> rndg.tmp

echo "asmcmd mount CL_$c" >> asm.tmp

done

sort rndg.tmp | uniq > renamedg.sh

sort asm.tmp | uniq > asm_mount.sh

sudo chmod 777 *

#$p/renamedisks.sh

#$p/renamedg.sh

#$p/asm_mount.sh

 

Some real data:

 

[oracle@hps11][+ASM][~/ASM]$ ./new_mike.sh

Please make sure there is no active I/O before running this script

Do you want to continue: (yes/no)?

 

Scanning HOST: host0

.............

 

Scanning HOST: host1

....

Found

0:0:0:4

0:0:0:5

0:0:0:6

0:0:1:4

0:0:1:5

0:0:1:6

1:0:0:4

1:0:0:5

1:0:0:6

1:0:1:4

1:0:1:5

1:0:1:6

 

11+0 records in

11+0 records out

11 bytes (11 B) copied, 0.000325 seconds, 33.8 kB/s

11+0 records in

11+0 records out

11 bytes (11 B) copied, 0.000323 seconds, 34.1 kB/s

11+0 records in

11+0 records out

11 bytes (11 B) copied, 0.000281 seconds, 39.1 kB/s

Renaming disk "/dev/mapper/360a98000486e2f4c533474674b62454[  OK  ]LARCH1":

Renaming disk "/dev/mapper/360a98000486e2f4c533474674b62424[  OK  ]LDATA1":

Renaming disk "/dev/mapper/360a98000486e2f4c533474674b62392[  OK  ]LCNTL1":

 

Parsing parameters..

renamedg operation: phase=two dgname=ARCH newdgname=CL_ARCH config=asm_ARCH.conf

Executing phase 2

Completed phase 2

 

Parsing parameters..

renamedg operation: phase=two dgname=CNTL newdgname=CL_CNTL config=asm_CNTL.conf

Executing phase 2

Completed phase 2

 

Parsing parameters..

renamedg operation: phase=two dgname=DATA newdgname=CL_DATA config=asm_DATA.conf

Executing phase 2

Completed phase 2

 

[oracle@hps11][+ASM][~/ASM]$

[oracle@hps11][+ASM][~/ASM]$ asmcmd ls

ARCH/

CL_ARCH/

CL_CNTL/

CL_DATA/

CNTL/

DATA/

REDO/

 

All the best

 

neto

NetApp - I love this company!

Hi All,

 

This is neto from Brazil

 

How are you?

 

Here you have a procedure to install and create a database with ASM diskgroups with 4096 sector size.

 

If you want to use ASMLib please make sure you have the following version and configuration:

 

Screen Shot 2013-09-11 at 1.43.20 PM.png

 

 

GRID install

1.png

 

Checking asm_diskstring (for GRID install)

2.png

Diskgroup with 512 sector size because it's using /dev/mapper on the asm_diskstring

3.png

Create a diskgroup CONF with the string /dev/mapper (512 bytes) to store your spfile (spfile must resides in 512 bytes diskgroup)

4.png

 

5.png

 

Preparing the asm_diskstring to have ORCL:* and /dev/mapper (with the specific disks for GRID and CONF diskgroups)

6.png

Change asm_diskstring in the file and recreate the spfile as: create spfile='+GRID' from pfile='/home/grid/spfile-neto.ora';

 

7.png

After adding the ORCL:* string and create the diskgroups.

8png.png

Using DBCA, the installer will try to create the spfile on the same diskgroup as datafiles and it will fail (because it's 4096 bytes).

 

Please don't click finish on DBCA, save the scripts, modify the spfile to +CONF diskgroup.

 

9.png

 

10.png

After to make all changes to '+CONF', please execute the script:

 

11.png

Database has been created with success.

 

12.png

 

All the best

 

neto

NetApp - I love this company!

Hi All,

 

This is neto from Brazil

 

How are you?

 

When you are using perfstat even with --sshprivatekey-file it always ask to press Enter on the passphrase for SSH key.

 

How to fix it: (remember that you need to create perfstat user and public key on NetApp)

 

Linux and Mac

 

echo -ne '\n' | ./perfstat8 10.61.104.111 -t 6 --sshprivatekey-file=/Users/neto/.ssh/id_rsa --verbose --mode=cluster-mode --diag-passwd=cpoc1302

 

Nossa Senhora:perfstat neto$ echo -ne '\n' | ./perfstat8 1.1.1.1 -t 6 --sshprivatekey-file=/Users/neto/.ssh/id_rsa --verbose --mode=cluster-mode --diag-passwd=netapp

 

[09-04-2013 15:38:15]  INFO *------------- perfstat v8.1 (20130314_1964919) -------------*

[09-04-2013 15:38:15]  INFO Parsing CLI options.

[09-04-2013 15:38:15]  INFO Loading preset information from default preset

[09-04-2013 15:38:15]  INFO Total commands are : 526

[09-04-2013 15:38:15]  INFO Total PRESTATS commands are : 383

[09-04-2013 15:38:15]  INFO Total POSTSTATS commands are : 92

[09-04-2013 15:38:15]  INFO Total PARALLEL commands are : 51

[09-04-2013 15:38:15]  INFO Total PARALLEL_PRESTATS commands are : 0

[09-04-2013 15:38:15]  INFO Total PARALLEL_POSTSTATS commands are : 0

[09-04-2013 15:38:15]  INFO Requesting SSH passphrase from user.

[09-04-2013 15:38:15]  INPUT Enter passphrase for SSH key:

[09-04-2013 15:38:15]  INFO Please wait! trying to authenticate using SSH Key pairs.

 

Windows

 

Create a VBS file and add:

 

'VBScript Example

Dim oShell

Set oShell = WScript.CreateObject("WScript.Shell")

oShell.Run "c:\users\neto\desktop\perfstat\perfstat8 1.1.1.1 -t 6 --sshprivatekey-file=c:\users\neto\desktop\perfstat\id_rsa --verbose --mode=cluster-mode --diag-passwd=netapp"

oShell.AppActivate "C:\Users\neto\Desktop\perfstat\perfstat8.exe"

WScript.Sleep 300

oShell.SendKeys "{ENTER}"

 

Probably you will need to adjust your path on the windows script

 

All the best

 

neto

NetApp - I love this company!

Hi All,

 

This is neto from Brazil

 

How are you?

 

We are doing a live webcast - Oracle and NetApp to talk about Database Provisioning in Minutes: Using Enterprise Manager 12c DBaaS Snap Clone and NetApp Storage

 

The webcast will be in Portuguese.

 

Here is the link:

 

http://www.oracle.com/technetwork/oem/grid-control/webcasts-index-090211.html

 

Looking forward to seeing you there :-)

 

All the best

 

neto

NetApp - I love this company!

More