星期三, 1月 25, 2017

[FW] Mount ASM diskgroups with new ASM instance

http://msutic.blogspot.tw/2014/10/mount-asm-diskgroups-with-new-asm.html

 

List Oracle ASM disks mounted to new server.
With "scandisks" command I will find devices which have been labeled as ASM disks.


# oracleasm scandisks

Reloading disk partitions: done

Cleaning any stale ASM disks...

Scanning system for ASM disks...

 

# oracleasm listdisks

DISK1

DISK2

DISK3

DISK4

DISK5

FRA1


Install "Oracle Grid Infrastructure software only" option to avoid automatic Oracle Restart and ASM configuration. This configuration will be performed later manually.

After installation finished run noted perl script as root to configure Grid Infrastructure for a Stand-Alone server.
For my configuration script looks like this:

 

To configure Grid Infrastructure for a Stand-Alone Server run the following command as the root user:

/u01/app/11.2.0.1/grid/perl/bin/perl -I/u01/app/11.2.0.1/grid/perl/lib -I/u01/app/11.2.0.1/grid/crs/install /u01/app/11.2.0.1/grid/crs/install/roothas.pl



Start cssd if it's not running.

# ./crsctl stat res -t

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

NAME           TARGET  STATE        SERVER                   STATE_DETAILS

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

Cluster Resources

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

ora.cssd

      1        OFFLINE OFFLINE

ora.diskmon

      1        OFFLINE OFFLINE

 

# ./crs_start ora.cssd

Attempting to start `ora.cssd` on member `asterix`

Attempting to stop `ora.diskmon` on member `asterix`

Stop of `ora.diskmon` on member `asterix` succeeded.

Attempting to start `ora.diskmon` on member `asterix`

Start of `ora.diskmon` on member `asterix` succeeded.

Start of `ora.cssd` on member `asterix` succeeded.



Create parameter file for ASM instance in $ORACLE_HOME/dbs directory of Grid Infrastructure.

init+ASM.ora

*.asm_diskstring='/dev/oracleasm/disks'

*.asm_power_limit=1

*.diagnostic_dest='/u01/app/grid'

*.instance_type='asm'

*.large_pool_size=12M

*.remote_login_passwordfile='EXCLUSIVE'



Register and start ASM instance.

1

2

3

4

5

6

7

$ export ORACLE_SID=+ASM

$ export ORACLE_HOME=/u01/app/11.2.0.1/grid

$ srvctl add asm -p $ORACLE_HOME/dbs/init+ASM.ora

 

$ srvctl start asm

$ srvctl status asm

ASM is running on asterix



Now notice what I see when I start ASM configuration assistant.

1

$ ./asmca




These are diskgroups with my database and recovery files.
Click "Mount all" to mount them all.






Install Oracle database software and create parameter file in "$ORACLE_HOME/dbs" to start database.

$ export ORACLE_HOME=/u01/app/oracle/product/11.2.0/dbhome_1

$ export ORACLE_SID=ora11gr2

 

$ cd $ORACLE_HOME/dbs

$ cat initora11gr2.ora

*.spfile='+DATA1/ora11gr2/spfileora11gr2.ora'

 

$ sqlplus / as sysdba

 

SQL*Plus: Release 11.2.0.1.0 Production on Wed Oct 29 14:29:37 2014

 

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

 

Connected to an idle instance.

 

SQL> startup

ORACLE instance started.

 

Total System Global Area  668082176 bytes

Fixed Size                  2216344 bytes

Variable Size             222301800 bytes

Database Buffers          436207616 bytes

Redo Buffers                7356416 bytes

Database mounted.

Database opened.

SQL>

SQL>

SQL> select name from v$datafile;

 

NAME

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

+DATA1/ora11gr2/datafile/system.297.844627929

+DATA1/ora11gr2/datafile/sysaux.265.844627967

+DATA1/ora11gr2/datafile/undotbs1.266.844627991

+DATA1/ora11gr2/datafile/users.267.844628031

+DATA2/ora11gr2/datafile/marko.261.859213577



Database is successfully opened and you can register instance using SRVCTL command.

$ srvctl add database -d $ORACLE_SID -o $ORACLE_HOME -p $ORACLE_HOME/dbs/initora11gr2.ora

$ srvctl start database -d $ORACLE_SID



Final status.

$ ./crsctl stat res -t

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

NAME           TARGET  STATE        SERVER                   STATE_DETAILS

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

Local Resources

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

ora.DATA1.dg

               ONLINE  ONLINE       asterix

ora.DATA2.dg

               ONLINE  ONLINE       asterix

ora.FRA1.dg

               ONLINE  ONLINE       asterix

ora.asm

               ONLINE  ONLINE       asterix                  Started

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

Cluster Resources

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

ora.cssd

      1        ONLINE  ONLINE       asterix

ora.diskmon

      1        ONLINE  ONLINE       asterix

ora.ora11gr2.db

      1        ONLINE  ONLINE       asterix                  Open



Be aware that this demo is performed in virtual environment on my notebook.

沒有留言:

LinkWithin-相關文件

Related Posts Plugin for WordPress, Blogger...