Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to configure Oracle 11g RAC using Manual and Policy Managed methods

2025-01-16 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >

Share

Shulou(Shulou.com)05/31 Report--

Editor to share with you how to configure Oracle 11g RAC using Manual and Policy Managed methods, I believe most people do not know much about it, so share this article for your reference. I hope you will learn a lot after reading this article. Let's learn about it together.

Software environment:

Operating system: Red Hat Enterprise Linux 5.4 (Tikanga)

Oracle:11gR2 11.2.0.4.0 RAC

Database name: racdb

Two node names of RAC cluster: racdb01,racdb02

Introduction of Policy-Managed mode

Policy-based management is based on server pool (Server Pools). To put it simply, you first define some server pools, which contain a certain number of servers, and then define some policies. According to these policies, Oracle will automatically decide how many database instances to run on several machines in the pool. The suffix of the database instance name, the number of database instances, and the host running are all determined by the policy, not by the database administrator.

What kind of environment is suitable for this new way of management?

When managing a large number of server clusters and running a variety of RAC databases with different importance and different strategies, Policy-Managed is recommended to simplify management. in fact, Oracle also recommends that Policy-Managed be used to manage the entire database cluster only when there are more than 3 servers. Imagine what can be achieved by using the Policy-Managed approach: if we have 10 servers, define the criticality of the server pool according to the importance of different applications, and then when some of these machines are down unexpectedly, we can still automatically maintain enough machines to provide database services to important systems while minimizing the number of non-critical system database servers.

Policy management: DBA specifies the server pool in which the database resource runs (excluding generic or free). Oracle Clusterware is responsible for putting database resources on a server.

Policy managed: Database administrators specify in which server pool (excluding generic or free) the database resource will run. Oracle Clusterware is responsible for placing the database resource on a server.

Servers are assigned to the server pool in the following order:

Generic server pool

User assigned server pool

Free

The importance of Oralce Clusterware's use of server pools determines the order in which servers are allocated:

Assign servers to all server pools in order of importance until the minimum number of server pools is met

Assign servers to server pools in order of importance until they meet the maximum number of server pools

By default, any remaining servers join the FREE server pool

The goal behind the policy management database is to delete the hard code to a specific instance or service service

The database can be associated with a server pool (rather than a specific node set). The server pool determines the minimum and maximum number of servers required by resources (databases, services, third-party applications).

The database instance will run on the server that has been assigned to the server pool. (use min_size to determine which servers the database must run on and on which servers)

Since the servers assigned to the server pool can be changed dynamically, this allows Oracle to dynamically deliver services based on the total number of servers available in the cluster.

The database instance will start on enough servers (subject to server availability). There is no need for hard coding to specify which servers the database instance is running on.

Any instance of the database can run on any node. There is no fixed mapping between the instance number and the node.

When servers are released / added / deleted, they are assigned to the existing server pool according to the previously mentioned rules.

A theoretical example

For example, if you have one cluster, there are a total of eight nodes and three RAC databases are supported. Each database defines the minimum and maximum number of servers.

Suppose DB1 defines a minimum of 4 servers and a maximum of 6 servers (importance is 10)

Suppose DB2 defines a minimum of 2 servers and a maximum of 3 servers (importance is 7)

Suppose DB3 defines a minimum of 2 servers and a maximum of 3 servers (importance is 5).

The initial 8 nodes will be configured so that nodes 1-4 are assigned to DB1, nodes 5-6 are assigned to DB2, and nodes 7-8 are assigned to DB3. If node 3 fails for some reason, the system will assign node 7 or 8 to DB1 because it is of higher importance than DB3 and requires a minimum of 4 servers, even if it will cause DB3 to fall below the minimum server level. If Node 3 is reactivated, it is immediately assigned to DB3 to minimize the number of servers required to restore the database.

If the ninth node is added to the cluster, it will be assigned to DB1 because it is of the highest importance and does not meet the maximum number of servers.

Introduction of Admin-Managed mode

In fact, the above statement has clearly explained the difference between Policy-Managed and Admin-Managed. Let's review what it was like to create a RAC database in the past. In the dbca interface, we would choose to run the database instance on several machines in the entire cluster, or two, three, or even more, but as long as a few machines are selected during installation, they will always run on these machines if we do not add or subtract nodes later. Moreover, the database instances on each host are usually automatically named dbname1 to dbnameN according to the sort of host name. These will not change automatically after the administrator has installed them. This is the Admin-Managed way.

Administrator management: DBA specifies all servers on which the database resource runs and manually places the resource as needed. This is the management policy used in previous versions of the Oracle database.

Administrator-managed: Database administrators define the servers on which databases resource run, and place resources manually as needed. This is the management strategy used in previous releases.

Examples of using Policy-Managed mode and Admin-Managed mode Service

1. How to check whether it is in Admin managed mode:

[grid@racdb01] $srvctl config database-d racdb

Database unique name: racdb

Database name: racdb

Oracle home: / app/product/oracle/11.2.0.4/db_1

Oracle user: oracle

Spfile: / app/product/oracle/11.2.0/db_1/dbs/spfileracdb1.ora

Domain:

Start options: open

Stop options: immediate

Database role: PRIMARY

Management policy: AUTOMATIC

Server pools: racdb

Database instances: racdb1,racdb2

Disk Groups: ASM_DATA,ASM_FRA

Mount point paths:

Services: rac_first,rac_second

Type: RAC

Database is administrator managed

This means that Admin Managed is used to manage RAC.

2. Here is an example of how to check and modify the database server pool and Service

A, add server pool mypool (minimum 0, maximum 2)

[oracle@racdb01] $srvctl add serverpool-g mypool-l 0-u 2

Add the database to the custom Server Pool:

B, modify the server pool of the database racdb

[oracle@racdb01] $srvctl modify database-d racdb-g mypool

C, check the RAC database racdb for the new Policy

[grid@racdb02] $srvctl config database-d racdb

Database unique name: racdb

Database name: racdb

Oracle home: / app/product/oracle/11.2.0.4/db_1

Oracle user: oracle

Spfile: / app/product/oracle/11.2.0/db_1/dbs/spfileracdb1.ora

Domain:

Start options: open

Stop options: immediate

Database role: PRIMARY

Management policy: AUTOMATIC

Server pools: mypool

Database instances:

Disk Groups: ASM_DATA,ASM_FRA

Mount point paths:

Services: rac_first,rac_second

Type: RAC

Database is policy managed

It is found that the database has already used the Policy Managed option.

Special reminder:

If there is no particularly strong need, there is no need to add custom Policy Managed, Admin Managed is compatible with 11g RAC and previous versions, more general.

D, use crsctl to check the status of the server pool

Has been changed to

[grid@racdb02] $crsctl status serverpool-p

NAME=Free

IMPORTANCE=0

MIN_SIZE=0

MAX_SIZE=-1

SERVER_NAMES=

PARENT_POOLS=

EXCLUSIVE_POOLS=

ACL=owner:grid:rwx,pgrp:oinstall:rwx,other::r-x

NAME=Generic

IMPORTANCE=0

MIN_SIZE=0

MAX_SIZE=-1

SERVER_NAMES=

PARENT_POOLS=

EXCLUSIVE_POOLS=

ACL=owner:grid:r-x,pgrp:oinstall:r-x,other::r-x

NAME=ora.mypool

IMPORTANCE=0

MIN_SIZE=0

MAX_SIZE=2

SERVER_NAMES=

PARENT_POOLS=

EXCLUSIVE_POOLS=

ACL=owner:oracle:rwx,pgrp:oinstall:rwx,other::r-

E, use srvctl to check the status of the server pool

[grid@racdb01] $srvctl config serverpool-g Free

Server pool name: Free

Importance: 0, Min: 0, Max:-1

Candidate server names:

[grid@racdb01] $srvctl config serverpool-g Generic

PRKO-3160: Server pool Generic is internally managed as part of administrator-managed database configuration and therefore cannot be queried directly via srvpool object.

[grid@racdb01] $srvctl config serverpool-g mypool

Server pool name: mypool

Importance: 0, Min: 0, Max: 2

Candidate server names:

Note: the MIN_SIZE attribute specifies the cardinality of the resource (database, etc.). Assuming min_size is 2, the database instance can run on two servers in the server pool.

Another important note: add a server pool to the cluster using crsctl (warning: adding a server pool using crsctl will be effective for non-database resources such as application servers, for database resources, you need to use srvctl to create a server pool, please refer to the document here)

F, add server pool

For non-database resources

[grid@racdb02] $crsctl add serverpool sp1-attr "MIN_SIZE=1, MAX_SIZE=1, IMPORTANCE=1"-f

CRS-2673: Attempting to stop 'ora.racdb.db' on' racdb01'

CRS-2677: Stop of 'ora.racdb.db' on' racdb01' succeeded

Check server pool status

[grid@racdb02] $crsctl status serverpool-p

NAME=Free

IMPORTANCE=0

MIN_SIZE=0

MAX_SIZE=-1

SERVER_NAMES=

PARENT_POOLS=

EXCLUSIVE_POOLS=

ACL=owner:grid:rwx,pgrp:oinstall:rwx,other::r-x

NAME=Generic

IMPORTANCE=0

MIN_SIZE=0

MAX_SIZE=-1

SERVER_NAMES=

PARENT_POOLS=

EXCLUSIVE_POOLS=

ACL=owner:grid:r-x,pgrp:oinstall:r-x,other::r-x

NAME=ora.mypool

IMPORTANCE=0

MIN_SIZE=0

MAX_SIZE=2

SERVER_NAMES=

PARENT_POOLS=

EXCLUSIVE_POOLS=

ACL=owner:oracle:rwx,pgrp:oinstall:rwx,other::r--

NAME=sp1

IMPORTANCE=1

MIN_SIZE=1

MAX_SIZE=1

SERVER_NAMES=

PARENT_POOLS=

EXCLUSIVE_POOLS=

ACL=owner:grid:rwx,pgrp:oinstall:rwx,other::r-

Delete the server pool:

[grid@racdb02 ~] $crsctl delete serverpool sp1

[grid@racdb02 ~] $crsctl add serverpool sp2-attr "MIN_SIZE=1, MAX_SIZE=1, IMPORTANCE=2"

Delete the server pool:

Note: observe the differences. When using crsctl, you cannot specify individual or desired hosts, but when using srvctl, you can.

G, view server status

[grid@racdb01] $crsctl status server-f

NAME=racdb01

STATE=ONLINE

ACTIVE_POOLS=Generic ora.racdb ora.racdb_rac_first

STATE_DETAILS=

NAME=racdb02

STATE=VISIBLE

ACTIVE_POOLS=Generic ora.racdb ora.racdb_rac_second

STATE_DETAILS=

Convert Policy-Managed Database to Administrator-Managed Database

A, check the current configuration of all services and databases (if you make an error and need to recover, then you can know how to configure it when you start), as follows:

[oracle@racdb01] $srvctl config database-d racdb

Database unique name: racdb

Database name: racdb

Oracle home: / app/product/oracle/11.2.0.4/db_1

Oracle user: oracle

Spfile: / app/product/oracle/11.2.0/db_1/dbs/spfileracdb1.ora

Domain:

Start options: open

Stop options: immediate

Database role: PRIMARY

Management policy: AUTOMATIC

Server pools: mypool

Database instances:

Disk Groups: ASM_DATA,ASM_FRA

Mount point paths:

Services: rac_first,rac_second

Type: RAC

Database is policy managed

The document says:

You can't directly convert a policy-managed database to administrator-managed database. Instead, you can delete the policy-managed configuration using the srvctl remove database and srvctl remove service commands, and then register the database as an administrator-managed database using the srvctl add database and srvctl add instance commands. Once you have registered the database and instance, you must use the srvctl add service command to add back to the service.

1. Delete a database using the SRVCTL tool

[oracle@racdb01] $srvctl remove database-d racdb

PRKO-3141: Database racdb could not be removed because it was running

If the database is running, you can use-f (force) to delete the running database. However, this method is not recommended.

Stop the database and delete

[oracle@racdb01] $srvctl remove database-d racdb

PRKO-3141: Database racdb could not be removed because it was running

[oracle@racdb01] $srvctl stop database-d racdb

[oracle@racdb01] $srvctl status database-d racdb

Instance racdb_1 is not running on node racdb01

Instance racdb2 is not running on node racdb02

[oracle@racdb01] $srvctl remove database-d racdb

Remove the database racdb? (y / [n]) y

[oracle@racdb01] $srvctl status database-d racdb

PRCD-1120: The resource for database racdb could not be found.

PRCR-1001: Resource ora.racdb.db does not exist

two。 Add administrator-managed database

[oracle@racdb01] $srvctl add database-d racdb-o / app/product/oracle/11.2.0.4/db_1-y automatic

[oracle@racdb01] $srvctl config database-d racdb

Database unique name: racdb

Database name:

Oracle home: / app/product/oracle/11.2.0.4/db_1

Oracle user: oracle

Spfile:

Domain:

Start options: open

Stop options: immediate

Database role: PRIMARY

Management policy: AUTOMATIC

Server pools: racdb

Database instances:

Disk Groups:

Mount point paths:

Services:

Type: RAC

Database is administrator managed

3. Add database instance

[oracle@racdb01] $srvctl add instance-d racdb-I racdb1-n racdb01

[oracle@racdb01] $srvctl add instance-d racdb-I racdb2-n racdb02

[oracle@racdb01] $srvctl start database-d racdb

[oracle@racdb01] $srvctl status database-d racdb

Instance racdb1 is running on node racdb01

Instance racdb2 is running on node racdb02

[oracle@racdb01] $srvctl config database-d racdb

Database unique name: racdb

Database name:

Oracle home: / app/product/oracle/11.2.0.4/db_1

Oracle user: oracle

Spfile:

Domain:

Start options: open

Stop options: immediate

Database role: PRIMARY

Management policy: AUTOMATIC

Server pools: racdb

Database instances: racdb1,racdb2

Disk Groups: ASM_DATA,ASM_FRA

Mount point paths:

Services:

Type: RAC

Database is administrator managed

If there is a non-default service, use the srvctl add service command to add back to the service.

4. You must configure Oracle Enterprise Manager in the last step

This is all the content of the article "how to configure Oracle 11g RAC using Manual and Policy Managed methods". Thank you for reading! I believe we all have a certain understanding, hope to share the content to help you, if you want to learn more knowledge, welcome to follow the industry information channel!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Database

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report