Home » Server Options » RAC & Failsafe » Get instance mapping (10.2.* and 11.2.*)
Get instance mapping [message #607157] Mon, 03 February 2014 06:07 Go to next message
Michel Cadot
Messages: 59731
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator

We can map/unmap an instance on one or several nodes using
srvctl add instance -d db_unique_name -i instance_name -n node_name
srvctl modify instance -d db_unique_name -i instance_name -n node_name
srvctl modify instance -d db_unique_name -i instance_name -z

but how can we get the current mapping?

Re: Get instance mapping [message #607168 is a reply to message #607157] Mon, 03 February 2014 06:47 Go to previous messageGo to next message
John Watson
Messages: 4791
Registered: January 2010
Location: Global Village
Senior Member
I'm using 12.1 in my little sandbox, so my results may be different from yours.

Does this give you what you need, down at the bottom:
"[oracle@iron1 ~]$ crsctl stat res ora.jw.db -p
NAME=ora.jw.db
TYPE=ora.database.type
ACL=owner:oracle:rwx,pgrp:oinstall:rwx,other::r--
ACTIONS=
ACTION_FAILURE_TEMPLATE=
ACTION_SCRIPT=
ACTION_TIMEOUT=60
ACTIVE_PLACEMENT=0
AGENT_FILENAME=%CRS_HOME%/bin/oraagent%CRS_EXE_SUFFIX%
ALERT_TEMPLATE=
ALIAS_NAME=
AUTO_START=restore
CARDINALITY=%CRS_SERVER_POOL_SIZE%
CHECK_INTERVAL=1
CHECK_TIMEOUT=30
CLEAN_TIMEOUT=60
CLUSTER_DATABASE=true
DATABASE_TYPE=RAC
DB_UNIQUE_NAME=jw
DEFAULT_TEMPLATE=PROPERTY(RESOURCE_CLASS=database) PROPERTY(DB_UNIQUE_NAME= CONCAT(PARSE(%NAME%, ., 2), %USR_ORA_DOMAIN%, .)) ELEMENT(INSTANCE_NAME= %GEN_USR_ORA_INST_NAME%) ELEMENT(DATABASE_TYPE= %DATABASE_TYPE%)
DEGREE=1
DELETE_TIMEOUT=60
DESCRIPTION=Oracle Database resource
ENABLED=1
FAILOVER_DELAY=0
FAILURE_INTERVAL=60
FAILURE_THRESHOLD=1
GEN_AUDIT_FILE_DEST=
GEN_START_OPTIONS=
GEN_USR_ORA_INST_NAME=
HOSTING_MEMBERS=
INSTANCE_FAILOVER=1
INTERMEDIATE_TIMEOUT=0
LOAD=1
LOGGING_LEVEL=1
MANAGEMENT_POLICY=AUTOMATIC
MODIFY_TIMEOUT=60
NLS_LANG=
NOT_RESTARTING_TEMPLATE=
OFFLINE_CHECK_INTERVAL=0
ONLINE_RELOCATION_TIMEOUT=0
ORACLE_HOME=/u01/app/oracle/product/12.1.0/dbhome_1
ORACLE_HOME_OLD=
PLACEMENT=restricted
PROFILE_CHANGE_TEMPLATE=
PWFILE=
RELOCATE_BY_DEPENDENCY=1
RESTART_ATTEMPTS=2
ROLE=PRIMARY
SCRIPT_TIMEOUT=60
SERVER_CATEGORY=
SERVER_POOLS=ora.jwpool
SERVER_POOLS_PQ=
SPFILE=
START_CONCURRENCY=0
START_DEPENDENCIES=weak(type:ora.listener.type,global:type:ora.scan_listener.type,uniform:ora.ons,global:ora.gns)
START_TIMEOUT=600
STATE_CHANGE_TEMPLATE=
STOP_CONCURRENCY=0
STOP_DEPENDENCIES=
STOP_TIMEOUT=600
TYPE_VERSION=3.3
UPTIME_THRESHOLD=1h
USER_WORKLOAD=yes
USE_STICKINESS=0
USR_ORA_DB_NAME=
USR_ORA_DOMAIN=
USR_ORA_ENV=
USR_ORA_FLAGS=
USR_ORA_INST_NAME=
USR_ORA_INST_NAME@SERVERNAME(iron2)=jw2
USR_ORA_OPEN_MODE=open
USR_ORA_OPI=false
USR_ORA_STOP_MODE=immediate
VERSION=12.1.0.1.0

[oracle@iron1 ~]$


But I think your commands don't quite make sense. The -Z switch is only meaningful for a policy managed database, but the ADD INSTANCE command can be used only for an administrator managed database. Another point is that when I try to use -Z in 12.1 I can't, so I think we'd better avoid it with 11.2:
[oracle@iron1 ~]$ srvctl modify instance -db jw -instance jw2 -node iron2 -z
PRKO-2207 : Warning:-nonode option has been deprecated and will be ignored.
[oracle@iron1 ~]$
that was with a policy managed database.

Re: Get instance mapping [message #607171 is a reply to message #607168] Mon, 03 February 2014 07:33 Go to previous messageGo to next message
Michel Cadot
Messages: 59731
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator

Thanks, it seems to provide what I need, I will investigate in crsctl.
Any way to get it from srvctl (because we have a srvctl menu so if it is possible I just have to add the option in the menu)?

Re: Get instance mapping [message #607403 is a reply to message #607168] Wed, 05 February 2014 09:51 Go to previous messageGo to next message
Michel Cadot
Messages: 59731
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator

crsctl was indeed a good option, I could hide this call behind our menu.
I wonder why Oracle removed from 11g "srvctl config database" command this information about instance/node relationship we had in 10g one; maybe the new implementation prevent srvctl to retrieve this information. The outputs of the same command are completely different which does not help to create automatic script.

Re: Get instance mapping [message #607404 is a reply to message #607403] Wed, 05 February 2014 09:56 Go to previous messageGo to next message
John Watson
Messages: 4791
Registered: January 2010
Location: Global Village
Senior Member
the command is there:
bash-3.1$
bash-3.1$ srvctl config database -help

Displays the configuration for the database.

Usage: srvctl config database [-d <db_unique_name> [-a]] [-v]
    -d <db_unique_name>      Unique name for the database
    -a                       Print detailed configuration information
    -v                       Verbose output
    -h                       Print usage
bash-3.1$
that was 11.2.0.3, Linux.
Re: Get instance mapping [message #607405 is a reply to message #607404] Wed, 05 February 2014 11:13 Go to previous messageGo to next message
Michel Cadot
Messages: 59731
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator

I agree but in 10g the output of the command also gave the mapping between instances and nodes whereas it does not in 11g. I have not it now but I'll will post the output next Monday.

Re: Get instance mapping [message #607597 is a reply to message #607405] Mon, 10 February 2014 03:16 Go to previous messageGo to next message
Michel Cadot
Messages: 59731
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
As promised here's the output from the 2 same commands in 11g and 10g.
11g:
$ srvctl config database -d RMN5TST1 -a
Nom de base de données unique : RMN5TST1
Nom de la base de données : RMN5TST1
Répertoire d'origine Oracle Home : /orabin/app/product/11.2.0/dbhome_1
Utilisateur Oracle : oracle
Fichier SPFILE : /oradata1/SPFILES/spfileRMN5TST1.ora
Domaine :
Options de démarrage : open
Options d'arrêt : immediate
Rôle de base de données : PRIMARY
Stratégie de gestion : AUTOMATIC
Pools de serveurs : RMN5TST1
Instances de base de données : RMN5TST11,RMN5TST12
Groupes de disques :
Chemins de point de montage :
Services : CADOT,MICHEL
Type : RAC
La base de données est activée
La base de données est gérée par un administrateur

in 10g:
$ srvctl config database -d RMN5TST0 -a
rcpsieoracdev02 RMN5TST02 /orabin/app/product/10.2.0
rcpsieoracdev01 RMN5TST01 /orabin/app/product/10.2.0
DB_NAME: RMN5TST0
ORACLE_HOME: /orabin/app/product/10.2.0
SPFILE: /oradata1/SPFILES/spfileRMN5TST0.ora
DOMAIN: null
DB_ROLE: null
START_OPTIONS: null
POLICY:  AUTOMATIC
ENABLE FLAG: DB ENABLED

As you can see in 10g, the first (two) lines gave us the mapping between instances and nodes.
Too bad it is no more the case in 11g.
Re: Get instance mapping [message #607598 is a reply to message #607597] Mon, 10 February 2014 03:24 Go to previous messageGo to next message
John Watson
Messages: 4791
Registered: January 2010
Location: Global Village
Senior Member
That is a really stupid change, isn't it.
Re: Get instance mapping [message #607614 is a reply to message #607598] Mon, 10 February 2014 04:37 Go to previous message
Michel Cadot
Messages: 59731
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator

It is indeed. Sad

Previous Topic: the listener can not listen service
Next Topic: OCFS2 FS won't mount
Goto Forum:
  


Current Time: Thu Nov 20 21:14:43 CST 2014

Total time taken to generate the page: 0.24353 seconds