Friday, May 13, 2011

mount: 0506-324 Cannot mount /dev/oradata_lv on /oradata: There is a request to a device or address that does not exist.

I have a two node cluster sharing a Storwize V7000 between then. Volume groups "oradata_vg" and "oralogs_vg" were created on the shared LUNs.

I then mounted file systesms /ordata and /oralogs on the volume groups. I was also able to manualy switchover the file system between the two nodes of the cluster.

But now when I tried to mount /oradata on the first node I got the "mount: 0506-324" error message.


isvp14_ora> mount /oradata
mount: 0506-324 Cannot mount /dev/oradata_lv on /oradata: There is a request to a device or address that does not exist.

On doing an lspv on the node I noticed that the volume group was not active. I did an varyonvg on that volume, but that failed.

isvp14_ora> lspv
hdisk0          00f62a6c98758859                    rootvg          active
hdisk1          00f62a6ca2279d3e                    swap            active
hdisk2          00f62a6cdf8874f5                    None
hdisk3          00f62a6cdf8875ff                    None
hdisk4          00f62a6ce57d00d4                    oradata_vg
hdisk5          00f62a6bdf88762c                    None
hdisk6          00f62a6bdf887797                    oralogs_vg
hdisk7          00f62a6bdf887802                    None

I noticed that the volume group was active on the second node, so I did a varoffvg of the volume groups. I then did a varyonvg of the volume groups on the first node. I was then able to mount the file systems


isvp15_ora> lspv
hdisk0          00f62a6c98758859                    rootvg          active
hdisk1          00f62a6ca2279d3e                    swap            active
hdisk2          00f62a6cdf8874f5                    None
hdisk3          00f62a6cdf8875ff                    None
hdisk4          00f62a6ce57d00d4                    oradata_vg      active
hdisk5          00f62a6bdf88762c                    None
hdisk6          00f62a6bdf887797                    oralogs_vg      active
hdisk7          00f62a6bdf887802                    None
isvp15_ora> varyoffvg oradata_vg
isvp15_ora> varyoffvg oralogs_vg

isvp14_ora> varyonvg oradata_vg
isvp14_ora> varyonvg oralogs_vg
isvp14_ora> mount /oradata

Tuesday, May 10, 2011

Manually starting and stopping Oracle 11gR2 from the command line, and a shell script

A colleague of mine asked me how to start Oracle database from the command like without getting into SQL.

To start and stop the database, testora is the name of our database

bash-3.2$ srvctl start database -d testora
bash-3.2$ srvctl stop database -d testora

To shutdown the ASM instance

bash-3.2$ srvctl stop asm -f

Start the ASM instance and the diskgroups:

bash-3.2$ srvctl start asm

Script to startup Oracle(startup.ksh)
#!/usr/bin/ksh
SQLDBA="sqlplus /nolog"
$SQLDBA <<EOF
connect / as sysdba
startup
quit
EOF

Script to shutdown Oracle(shutdown.ksh)
#!/usr/bin/ksh
SQLDBA="sqlplus /nolog"
$SQLDBA <<EOF
connect / as sysdba
shutdown abort
quit
EOF 

Script to startup Oracle ASM(startup_asm.ksh)
#!/usr/bin/ksh
export ORACLE_SID=+ASM
SQLDBA="sqlplus /nolog"

$SQLDBA <<EOF
connect / as sysdba
connect sys/test123 as sysasm
startup
quit
EOF
 
Script to shutdown Oracle ASM(shutdown_asm.ksh)
#!/usr/bin/ksh
ORACLE_SID="+ASM"
export ORACLE_SID
SQLDBA="sqlplus / as sysdba"

$SQLDBA <<EOF
connect sys as sysdba
connect sys/test123 as sysasm
shutdown abort
quit
EOF