>> First we need to start ASm instance then RDBMS instance.
>> For shutting down First Shut RDBMS and then ASM instance.
- Starting Sequence :-
Why ASM first because when we start ASM-instance oracle read all the parameters in spfile like
instance_type,Diskgroups names,Background Processes of ASM and then mount all the diskgroups.
After sucessfully mounted then you can start the RDBMS instance. the main reason is your all Files
are store in the ASM-Diskgroup.
C:\Windows\system32> set oracle_sid= +asm
C:\Windows\system32> sqlplus / as sysasm
Connected to an idle instance.
SQL> startup
ASM instance started
Total System Global Area 283930624 bytes
Fixed Size 2254504 bytes
Variable Size 256510296 bytes
ASM Cache 25165824 bytes
ASM diskgroups mounted
SQL> select instance_name,status from v$instance;
INSTANCE_NAME STATUS
---------------------------------------------------
+asm STARTED
SQL> select name,state from v$asm_diskgroup;
NAME STATE
------------------------------ -----------
DATA MOUNTED
- Now Connect to RDBMS Instance :-
C:\app\Moin> set oracle_sid=kkprod
C:\app\Moin> sqlplus / as sysdba
Connected to an idle instance.
SQL> startup
ORACLE instance started.
Total System Global Area 2087780352 bytes
Fixed Size 2256784 bytes
Variable Size 536871024 bytes
Database Buffers 1543503872 bytes
Redo Buffers 5148672 bytes
Database mounted.
Database opened.
SQL> select name from v$datafile;
NAME
----------------------------------------------
+DATA/kkprod/datafile/system.266.962995733
+DATA/kkprod/datafile/sysaux.265.962995779
+DATA/kkprod/datafile/undotbs1.264.962995823
+DATA/kkprod/datafile/users.267.962995627
>> Database is UP now users can access data from these diskgroups.
- Stopping Sequence of ASM :-
- Connect to RDMS instance....
C:\app\Moin> set oracle_sid=kkprod
C:\app\Moin> sqlplus / as sysdba
SQL> select instance_name,status from v$instance;
INSTANCE_NAME STATUS
------------------------------------------------
kkprod OPEN
SQL> shut immediate
Database closed.
Database dismounted.
ORACLE instance shut down.
Now connect to ASM Instance :
SQL> select instance_name,status from v$instance;
INSTANCE_NAME STATUS
------------------------------------------------
+asm STARTED
SQL> select name,state from v$asm_diskgroup;
NAME STATE
------------------------------ -----------
DATA MOUNTED
SQL> shut immediate
ASM diskgroups dismounted
ASM instance shutdown
Done....
If We Shut ASM Instance First, you will face this error :
SQL> shut immediate
ORA-15097: cannot SHUTDOWN ASM instance with connected client (process 4116)
>> ASM will not shutdown with connected client. you can find which client is connected from OS level using
ASMCMD and V$ASM_CLIENT from sqlplus.
ASMCMD> lsof
DB_Name Instance_Name Path
kkprod kkprod +data/kkprod/controlfile/current.262.962995555
kkprod kkprod +data/kkprod/datafile/babts.268.963661839
kkprod kkprod +data/kkprod/datafile/sysaux.265.962995779
kkprod kkprod +data/kkprod/datafile/system.266.962995733
kkprod kkprod +data/kkprod/datafile/undotbs1.264.962995823
kkprod kkprod +data/kkprod/datafile/users.267.962995627
kkprod kkprod +data/kkprod/datafile/users.269.963077837
kkprod kkprod +data/kkprod/onlinelog/group_1.261.963052723
kkprod kkprod +data/kkprod/onlinelog/group_2.260.963052729
kkprod kkprod +data/kkprod/onlinelog/group_3.259.963052735
kkprod kkprod +data/kkprod/tempfile/temp.263.962996209
SQL> select group_number,instance_name,db_name,status,software_version,compatible_version from v$asm_client;
GROUP_NUMBER INSTANCE_NAME DB_NAME STATUS SOFTWARE_VERSION COMPATIBLE_VERSION
------------------------------------------------------------------------------------------
2 kkprod kkprod CONNECTED 11.2.0.3.0 11.2.0.0.0
>> You can see in DB_NAME column 'kkprod' you need to shutdown this client first, nothing but database.
SQL> select name from v$database;
NAME
------------------------------
KKPROD
SQL> shut immediate
Database closed.
Database dismounted.
ORACLE instance shut down.
>> Connect to ASM instance.
C:\Windows\system32>sqlplus / as sysasm
Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - 64bit Production
With the Automatic Storage Management option
SQL> shut immediate
ASM diskgroups dismounted
ASM instance shutdown
Hope This Clear.
Happy Learning....
No comments:
Post a Comment