Focus On Oracle

Installing, Backup & Recovery, Performance Tuning,
Troubleshooting, Upgrading, Patching

Oracle Engineered System


当前位置: 首页 » 技术文章 » Oracle 12c+

12c Admin-Managed Database和Policy-Managed Database之间相互转换

RAC数据库的配置有两种方式Policy-Managed or Administrator-Managed。Policy-Managed database是基于server pool通过动态管理实例来实现资源利用的最大化。Admin-Managed database的实例和服务器绑定在一起。

Admin-Managed数据库实例后缀名和Policy-Managed数据库实例后缀名是不一样的,前者的后缀名为1(racdb1,racdb2,racdb3),后者的后缀名为_1(racdb_1,racdb_2,racdb_3)。当服务器很多的时候,Policy-Managed管理方式的优势就体现出来了。


将Admin-Managed转化为Policy-Managed

[oracle@ohs1 ~]$ srvctl config database -d pgold

Database unique name: pgold
Database name: pgold
Oracle home: /pgold/ordb/oracle/product/121
Oracle user: oracle
Spfile: +DATA_PGOLD/PGOLD/PARAMETERFILE/spfile.274.923493501
Password file: +DATA_PGOLD/PGOLD/PASSWORD/pwdpgold.256.923492907
Domain:
Start options: open
Stop options: immediate
Database role: PRIMARY
Management policy: AUTOMATIC
Server pools:
Disk Groups: DATA_PGOLD
Mount point paths:
Services:
Type: RAC
Start concurrency:
Stop concurrency:
OSDBA group: dba
OSOPER group: oper
Database instances: pgold1,pgold2,pgold3
Configured nodes: ohs1,ohs2,ohs3
Database is administrator managed
[oracle@ohs1 ~]$ srvctl config service -d pgold
[oracle@ohs1 ~]$ ps -eaf|grep pmon
orgrid    2149     1  0 12:44 ?        00:00:00 asm_pmon_+ASM1
orgrid    3954     1  0 12:45 ?        00:00:00 mdb_pmon_-MGMTDB
oracle    5337     1  0 14:00 ?        00:00:00 ora_pmon_pgold1
oracle   21319 20465  0 14:39 pts/0    00:00:00 grep pmon
[oracle@ohs1 ~]$
[oracle@ohs1 ~]$ srvctl add srvpool -g srvpool -l 0 -u 3
[oracle@ohs1 ~]$
[oracle@ohs1 ~]$ srvctl config serverpool
Server pool name: Free
Importance: 0, Min: 0, Max: -1
Category:
Candidate server names:
Server pool name: Generic
Importance: 0, Min: 0, Max: -1
Category:
Candidate server names:
Server pool name: srvpool
Importance: 0, Min: 0, Max: 3
Category: hub
Candidate server names:
[oracle@ohs1 ~]$
[oracle@ohs1 ~]$ srvctl stop database -d pgold
[oracle@ohs1 ~]$
[oracle@ohs1 ~]$ srvctl modify database -d pgold -g srvpool
[oracle@ohs1 ~]$
[oracle@ohs1 ~]$ srvctl start database -d pgold
[oracle@ohs1 ~]$
[oracle@ohs1 ~]$ ps -ef|grep pmon
orgrid    2149     1  0 12:44 ?        00:00:00 asm_pmon_+ASM1
orgrid    3954     1  0 12:45 ?        00:00:00 mdb_pmon_-MGMTDB
oracle   23252     1  0 14:44 ?        00:00:00 ora_pmon_pgold_3
oracle   23642 20465  0 14:44 pts/0    00:00:00 grep pmon
[oracle@ohs1 ~]$ srvctl config database -d pgold
Database unique name: pgold
Database name: pgold
Oracle home: /pgold/ordb/oracle/product/121
Oracle user: oracle
Spfile: +DATA_PGOLD/PGOLD/PARAMETERFILE/spfile.274.923493501
Password file: +DATA_PGOLD/PGOLD/PASSWORD/pwdpgold.256.923492907
Domain:
Start options: open
Stop options: immediate
Database role: PRIMARY
Management policy: AUTOMATIC
Server pools: srvpool
Disk Groups: DATA_PGOLD
Mount point paths:
Services:
Type: RAC
Start concurrency:
Stop concurrency:
OSDBA group: dba
OSOPER group: oper
Database instances:
Configured nodes: 
Database is policy managed
[oracle@ohs1 ~]$


将Policy-Managed转化为Admin-Managed

[oracle@ohs1 ~]$ srvctl stop database -d pgold
[oracle@ohs1 ~]$
[oracle@ohs1 ~]$ 
[oracle@ohs1 ~]$ srvctl config database -d pgold
Database unique name: pgold
Database name: pgold
Oracle home: /pgold/ordb/oracle/product/121
Oracle user: oracle
Spfile: +DATA_PGOLD/PGOLD/PARAMETERFILE/spfile.274.923493501
Password file: +DATA_PGOLD/PGOLD/PASSWORD/pwdpgold.256.923492907
Domain:
Start options: open
Stop options: immediate
Database role: PRIMARY
Management policy: AUTOMATIC
Server pools: srvpool
Disk Groups: DATA_PGOLD
Mount point paths:
Services:
Type: RAC
Start concurrency:
Stop concurrency:
OSDBA group: dba
OSOPER group: oper
Database instances:
Configured nodes:
Database is policy managed
[oracle@ohs1 ~]$ srvctl remove database -d pgold
Remove the database pgold? (y/[n]) y
[oracle@ohs1 ~]$
[oracle@ohs1 ~]$ srvctl add database -d pgold -o $ORACLE_HOME
[oracle@ohs1 ~]$
[oracle@ohs1 ~]$ srvctl config database -d pgold
Database unique name: pgold
Database name:
Oracle home: /pgold/ordb/oracle/product/121
Oracle user: oracle
Spfile:
Password file:
Domain:
Start options: open
Stop options: immediate
Database role: PRIMARY
Management policy: AUTOMATIC
Server pools:
Disk Groups:
Mount point paths:
Services:
Type: RAC
Start concurrency:
Stop concurrency:
OSDBA group: dba
OSOPER group: oper
Database instances:
Configured nodes:
Database is administrator managed
[oracle@ohs1 ~]$ srvctl add instance -d pgold -i pgold1 -n ohs1
[oracle@ohs1 ~]$ srvctl add instance -d pgold -i pgold2 -n ohs2
[oracle@ohs1 ~]$ srvctl add instance -d pgold -i pgold3 -n ohs3
[oracle@ohs1 ~]$
[oracle@ohs1 ~]$ srvctl config database -d pgold
Database unique name: pgold
Database name:
Oracle home: /pgold/ordb/oracle/product/121
Oracle user: oracle
Spfile:
Password file:
Domain:
Start options: open
Stop options: immediate
Database role: PRIMARY
Management policy: AUTOMATIC
Server pools:
Disk Groups:
Mount point paths:
Services:
Type: RAC
Start concurrency:
Stop concurrency:
OSDBA group: dba
OSOPER group: oper
Database instances: pgold1,pgold2,pgold3
Configured nodes: ohs1,ohs2,ohs3
Database is administrator managed
[oracle@ohs1 ~]$
[oracle@ohs1 ~]$ srvctl start database -d pgold
PRCR-1079 : Failed to start resource ora.pgold.db
CRS-5017: The resource action "ora.pgold.db start" encountered the following error:
ORA-01078: failure in processing system parameters
ORA-01565: error in identifying file '+DATA_PGOLD/pgold/spfilepgold.ora'
ORA-17503: ksfdopn:2 Failed to open file +DATA_PGOLD/pgold/spfilepgold.ora
ORA-15056: additional error message
ORA-17503: ksfdopn:2 Failed to open file +DATA_PGOLD/pgold/spfilepgold.ora
ORA-15173: entry 'spfilepgold.ora' does not exist in directory 'pgold'
ORA-06512: at line 4
. For details refer to "(:CLSN00107:)" in "/pgold/orgrid/grid_base/diag/crs/ohs3/crs/trace/crsd_oraagent_oracle.trc".

CRS-2674: Start of 'ora.pgold.db' on 'ohs3' failed
CRS-5017: The resource action "ora.pgold.db start" encountered the following error:
ORA-01078: failure in processing system parameters
ORA-01565: error in identifying file '+DATA_PGOLD/pgold/spfilepgold.ora'
ORA-17503: ksfdopn:2 Failed to open file +DATA_PGOLD/pgold/spfilepgold.ora
ORA-15056: additional error message
ORA-17503: ksfdopn:2 Failed to open file +DATA_PGOLD/pgold/spfilepgold.ora
ORA-15173: entry 'spfilepgold.ora' does not exist in directory 'pgold'
ORA-06512: at line 4
. For details refer to "(:CLSN00107:)" in "/pgold/orgrid/grid_base/diag/crs/ohs2/crs/trace/crsd_oraagent_oracle.trc".

CRS-2674: Start of 'ora.pgold.db' on 'ohs2' failed
CRS-5017: The resource action "ora.pgold.db start" encountered the following error:
ORA-01078: failure in processing system parameters
ORA-01565: error in identifying file '+DATA_PGOLD/pgold/spfilepgold.ora'
ORA-17503: ksfdopn:2 Failed to open file +DATA_PGOLD/pgold/spfilepgold.ora
ORA-15056: additional error message
ORA-17503: ksfdopn:2 Failed to open file +DATA_PGOLD/pgold/spfilepgold.ora
ORA-15173: entry 'spfilepgold.ora' does not exist in directory 'pgold'
ORA-06512: at line 4
. For details refer to "(:CLSN00107:)" in "/pgold/orgrid/grid_base/diag/crs/ohs1/crs/trace/crsd_oraagent_oracle.trc".

CRS-2674: Start of 'ora.pgold.db' on 'ohs1' failed
CRS-2632: There are no more servers to try to place resource 'ora.pgold.db' on that would satisfy its placement policy
[oracle@ohs1 ~]$ 
[oracle@ohs1 ~]$
[oracle@ohs1 ~]$ srvctl modify database -d pgold -spfile '+DATA_PGOLD/PGOLD/PARAMETERFILE/spfile.274.923493501' -pwfile '+DATA_PGOLD/PGOLD/PASSWORD/pwdpgold.256.923492907' -diskgroup 'DATA_PGOLD'
[oracle@ohs1 ~]$ srvctl config database -d pgold
Database unique name: pgold
Database name:
Oracle home: /pgold/ordb/oracle/product/121
Oracle user: oracle
Spfile: +DATA_PGOLD/PGOLD/PARAMETERFILE/spfile.274.923493501
Password file: +DATA_PGOLD/PGOLD/PASSWORD/pwdpgold.256.923492907
Domain:
Start options: open
Stop options: immediate
Database role: PRIMARY
Management policy: AUTOMATIC
Server pools:
Disk Groups: DATA_PGOLD
Mount point paths:
Services:
Type: RAC
Start concurrency:
Stop concurrency:
OSDBA group: dba
OSOPER group: oper
Database instances: pgold1,pgold2,pgold3
Configured nodes: ohs1,ohs2,ohs3
Database is administrator managed
[oracle@ohs1 ~]$ 
[oracle@ohs1 ~]$ srvctl start database -d pgold
[oracle@ohs1 ~]$ ps -ef|grep pmon
orgrid    2149     1  0 12:44 ?        00:00:00 asm_pmon_+ASM1
orgrid    3954     1  0 12:45 ?        00:00:00 mdb_pmon_-MGMTDB
oracle   29932     1  0 15:00 ?        00:00:00 ora_pmon_pgold1
oracle   30316 20465  0 15:01 pts/0    00:00:00 grep pmon

[oracle@ohs1 ~]$


Reference

http://docs.oracle.com/database/121/RACAD/admin.htm#RACAD8211

http://www.ohsdba.cn/index.php?m=Article&a=show&id=84



关键词:12c rac 

相关文章

Install Oracle Domain Service Cluster Step by Step
Oracle RAC and Third Party Cloud
How to generate AWR on PDB and ADG(12.2 afterwards)
ORA-12514 During DataPump Export/Import In RAC
在12c上使用wm_concat
How to config IB network listener
Oracle MAA汇总
Exadata with database 12.2
如何在oracle 12c中正确的应用补丁?
在OEL6.8上安装12.2 RAC
Oracle Database 12.2 Hands-On Lab
How to Convert Physical Standby to Snapshot Standby
Top