srvctl add commands syntax and example
The srvctl add commands can be used to add a database, instance, service, nodeapps and asm configurations in the OCR (Oracle cluster registry). The OCR is the repository used by the CRS (cluster readu services) processes to run a database in RAC environment.
So the following operation can be performed
srvctl add database
srvctl add instance
srvctl add service
srvctl add nodeapps
srvctl add asm
SRVCTL ADD DATABASE
This command should be used to add a database configuration to the clustered database configuration.
Sintax:
srvctl add database -d db_name -o oracle_home
-d is database name
-o is oracle home
Example:
srvctl add database -d mndb -o /u01/app/oracle/product/11.1.0/db_1
This example adds a database named mndb and specifies that oracle home is in
/u01/app/oracle/product/11.1.0/db_1
SRVCTL ADD INSTANCE
This command should be used to add an instance configuration to the clustered database configuration.
Syntax:
srvctl add instance -d db_name -i instance_name -n node_name
-d is database name
-i name of the instance
-n name of the node where the instance should normally run
Example:
srvctl add instance -d mndb -i mndb1 -n node01
The above example will add an instance called mndb1 to the node node01. The instance will be based on the database called mndb.
SRVCTL ADD SERVICE
This command should be used to add service configuration to the clustered database configuration.
Syntax:
srvctl add service -d db_unique_name -s service_name -r preferred_list [-a available_list] [-P TAF_policy]
-d db_unique_name (the unique database name)
-s service_name (a name to the service that you are adding)
-r preferred list, a list of preferred instance where the service should run
-a available list on instances. The list will be used when no preffered instance is available
-P TAF (transparent application failover) polic (e.g NONE, BASIC, or PRECONNECT).
Example:
srvctl add service -d mndb -s mndb_sales -r mndb1 -a mndb2
srvctl add service -d mndb -s mndb_sales -r mndb1 -a mndb2 -P Preconnect
SRVCTL ADD NODEAPPS
This command should be used to add nodeapps configuration to the clustered database configuration.
Syntax:
srvctl add nodeapps -n node_name -o oracle_home -A addr_str
-n node name
-o oracle home location
-A address string
VIP (virtual ip) address (name|ip/netmask[/if1[|if2|...]]).
Example:
srvctl add nodeapps -n node01 -o /u01/app/oracle/product/11.1.0/db_1 -A 132.12.23.40/255.255.255.0
SRVCTL ADD ASM
This command should be used to add asm configuration to the clustered database configuration.
Adds a record for an ASM instance to the specified node.
Syntax:
srvctl add asm -n node_name -i asm_instance_name -o oracle_home
-n node name
-i asm instance name
-o oracle home (e.g. /u01/app/oracle/product/11.1.0/db_1)
Example:
srvctl add asm -n node01 -i asm01 -o /u01/app/oracle/product/11.1.0/db_1
No Comments »