12cR1 RAC : Convert PolicyManaged DB back to AdminManaged
In our case only one node is up so shutdown the database of that node (shutdown the database of other nodes also).
[oracle@ol6-121-rac1 dbs]$ ps -ef|grep -i pmon
oracle 3923 1 0 02:42 ? 00:00:00 asm_pmon_+ASM1
oracle 13383 1 0 02:48 ? 00:00:00 mdb_pmon_-MGMTDB
oracle 13498 1 0 02:48 ? 00:00:00 ora_pmon_crshcn_1
oracle 20378 24841 0 05:49 pts/0 00:00:00 grep -i pmon
[oracle@ol6-121-rac1 ~]$ srvctl status database -d CRSHCN
Instance crshcn_1 is running on node ol6-121-rac1
[oracle@ol6-121-rac1 ~]$ srvctl stop database -d CRSHCN
[oracle@ol6-121-rac1 ~]$ ps -ef|grep -i pmon
oracle 3923 1 0 02:42 ? 00:00:00 asm_pmon_+ASM1
oracle 13383 1 0 02:48 ? 00:00:00 mdb_pmon_-MGMTDB
oracle 22543 24841 0 05:54 pts/0 00:00:00 grep -i pmon
[oracle@ol6-121-rac1 ~]$ srvctl config database -d CRSHCN
Database unique name: crshcn
Database name: crshcn
Oracle home: /u01/app/oracle/product/12.1.0.2/db_1
Oracle user: oracle
Spfile: +DATA/CRSHCN/PARAMETERFILE/spfile.293.1029968409
Password file: +DATA/CRSHCN/PASSWORD/pwdcrshcn.276.1029968123
Domain:
Start options: open
Stop options: immediate
Database role: PRIMARY
Management policy: AUTOMATIC
Server pools: myserverpool
Disk Groups: DATA
Mount point paths:
Services:
Type: RAC
Start concurrency:
Stop concurrency:
OSDBA group: dba
OSOPER group:
Database instances:
Configured nodes:
Database is policy managed
[oracle@ol6-121-rac1 ~]$
Next, I remove the database from the Cluster Registry.
[oracle@ol6-121-rac1 ~]$ srvctl remove database -d CRSHCN
Remove the database CRSHCN? (y/[n]) y
[oracle@ol6-121-rac1 ~]$ srvctl config database -d CRSHCN
PRCD-1120 : The resource for database CRSHCN could not be found.
PRCR-1001 : Resource ora.crshcn.db does not exist
Then we have to remove the defined Server Pool that I used for this database.
[oracle@ol6-121-rac1 ~]$ srvctl config srvpool
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: myserverpool
Importance: 0, Min: 0, Max: 1
Category: hub
Candidate server names:
[
[oracle@ol6-121-rac1 ~]$ srvctl remove srvpool -serverpool myserverpool
[oracle@ol6-121-rac1 ~]$ srvctl config srvpool
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:
Then add the database back into the Cluster Registry.
[oracle@ol6-121-rac1 ~]$ srvctl add database -d CRSHCN -oraclehome /u01/app/oracle/product/12.1.0.2/db_1 -pwfile +DATA/CRSHCN/PASSWORD/pwdcrshcn.276.1029968123 -spfile +DATA/CRSHCN/PARAMETERFILE/spfile.293.1029968409
[oracle@ol6-121-rac1 ~]$
[oracle@ol6-121-rac1 ~]$
[oracle@ol6-121-rac1 ~]$
[oracle@ol6-121-rac1 ~]$ srvctl config database -d CRSHCN
Database unique name: CRSHCN
Database name:
Oracle home: /u01/app/oracle/product/12.1.0.2/db_1
Oracle user: oracle
Spfile: +DATA/CRSHCN/PARAMETERFILE/spfile.293.1029968409
Password file: +DATA/CRSHCN/PASSWORD/pwdcrshcn.276.1029968123
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:
Database instances:
Configured nodes:
Database is administrator managed
[oracle@ol6-121-rac1 ~]$
Start the second node of the cluster before configuring the instances (Note : $ORACLE_HOME/dbs pfiles created in advance).
[oracle@ol6-121-rac1 ~]$ srvctl add instance -d CRSHCN -i CRSHCN_1 -n ol6-121-rac1
[oracle@ol6-121-rac1 ~]$ srvctl add instance -d CRSHCN -i CRSHCN_2 -n ol6-121-rac2
[oracle@ol6-121-rac1 ~]$ srvctl config database -d CRSHCN
Database unique name: CRSHCN
Database name:
Oracle home: /u01/app/oracle/product/12.1.0.2/db_1
Oracle user: oracle
Spfile: +DATA/CRSHCN/PARAMETERFILE/spfile.293.1029968409
Password file: +DATA/CRSHCN/PASSWORD/pwdcrshcn.276.1029968123
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:
Database instances: CRSHCN_1,CRSHCN_2
Configured nodes: ol6-121-rac1,ol6-121-rac2
Database is administrator managed
[oracle@ol6-121-rac1 ~]$ srvctl start database -d CRSHCN
[oracle@ol6-121-rac1 ~]$ srvctl status database -d CRSHCN
Instance CRSHCN_1 is running on node ol6-121-rac1
Instance CRSHCN_2 is running on node ol6-121-rac2
[oracle@ol6-121-rac1 ~]$ ps -ef|grep -i pmon
oracle 3923 1 0 02:42 ? 00:00:00 asm_pmon_+ASM1
oracle 3987 1 0 06:30 ? 00:00:00 ora_pmon_CRSHCN_1
oracle 5623 24841 0 06:32 pts/0 00:00:00 grep -i pmon
oracle 13383 1 0 02:48 ? 00:00:00 mdb_pmon_-MGMTDB
[oracle@ol6-121-rac1 ~]$ ssh ol6-121-rac2 ps -ef|grep -i pmon
oracle 3667 1 0 02:42 ? 00:00:00 asm_pmon_+ASM2
oracle 20734 1 0 06:30 ? 00:00:00 ora_pmon_CRSHCN_2
[oracle@ol6-121-rac1 ~]$
[oracle@ol6-121-rac1 ~]$ . oraenv
ORACLE_SID = [CRSHCN_1] ?
The Oracle base remains unchanged with value /u01/app/oracle
[oracle@ol6-121-rac1 ~]$ sqlplus / as sysdba
SQL*Plus: Release 12.1.0.2.0 Production on Tue Jan 21 06:35:37 2020
Copyright (c) 1982, 2014, Oracle. All rights reserved.
Connected to:
Oracle Database 12c Enterprise Edition Release 12.1.0.2.0 - 64bit Production
With the Partitioning, Real Application Clusters, Automatic Storage Management, OLAP,
Advanced Analytics and Real Application Testing options
SQL> show pdbs
CON_ID CON_NAME OPEN MODE RESTRICTED
---------- ------------------------------ ---------- ----------
2 PDB$SEED READ ONLY NO
3 CRSHCNPRD MOUNTED
SQL>
SQL> alter pluggable database CRSHCNPRD open;
Pluggable database altered.
SQL> show pdbs
CON_ID CON_NAME OPEN MODE RESTRICTED
---------- ------------------------------ ---------- ----------
2 PDB$SEED READ ONLY NO
3 CRSHCNPRD READ WRITE NO
SQL>
So PolicyManaged database was converted to AdministratorManaged.
No comments:
Post a Comment