Restart Enable Database OR ADD & Remove Database with Modify in ASM/CRS as
Services 12CR1
ADD Database in ASM/Cluster Services for Auto Start
& Stop (Reboot)
[oracle@oda12 db_1]$ pwd
When we add database in ASM Services we will use switch
“–o”. Its mean you are defining Oracle Home like above and if you perfume
database adding step from grid user you will face below mention error.
Database is not running.
Database
is running.
--------------------------------------------------------------------------------
Name
Target State Server State details
--------------------------------------------------------------------------------
Local Resources
--------------------------------------------------------------------------------
ora.CRS.dg
ONLINE ONLINE oda12 STABLE
ora.DATA.dg
ONLINE ONLINE oda12 STABLE
ora.FRA.dg
ONLINE ONLINE
oda12 STABLE
ora.HMDB_LSN.lsnr
ONLINE ONLINE oda12 STABLE
ora.LISTENER.lsnr
ONLINE ONLINE oda12 STABLE
ora.asm
ONLINE ONLINE oda12 Started,STABLE
ora.ons
OFFLINE OFFLINE oda12 STABLE
--------------------------------------------------------------------------------
Cluster Resources
--------------------------------------------------------------------------------
ora.cssd
1 ONLINE ONLINE oda12 STABLE
ora.diskmon
1 OFFLINE OFFLINE STABLE
ora.evmd
1 ONLINE
ONLINE oda12 STABLE
ora.hmdb.db
1 ONLINE
ONLINE oda12 Open,STABLE
ora.orcl.db
1 ONLINE
ONLINE oda12 Open,STABLE
--------------------------------------------------------------------------------
[grid@oda12 ~]$
[oracle@oda12 db_1]$ sqlplus / as sysdba
Oracle Database 12c Enterprise Edition Release 12.1.0.2.0
- 64bit Production
With the Partitioning, Automatic Storage Management,
OLAP, Advanced Analytics
and Real Application Testing options
------------------------------------ -----------
------------------------------
db_name string hmdb
---------------- ------------ -----------------
hmdb OPEN 12.1.0.2.0
----------------------------------------------------------------------
+DATA/HMDB/DATAFILE/system.267.1053832677
+DATA/HMDB/DATAFILE/sysaux.268.1053832775
+DATA/HMDB/DATAFILE/undotbs1.269.1053832851
+DATA/HMDB/DATAFILE/users.271.1053832873
[root@oda12 ~]# reboot
login
as: oracle
oracle@192.168.10.10's
password:
Last login: Thu Oct 29 01:35:00 2020
[oracle@oda12 ~]$ hmdb
[oracle@oda12 ~]$ sqlplus / as sysdba
Oracle Database 12c Enterprise Edition Release 12.1.0.2.0
- 64bit Production
With the Partitioning, Automatic Storage Management,
OLAP, Advanced Analytics
and Real Application Testing options
------------------------------------ ----------- ------------------------------
db_name string hmdb
---------------- ------------ -----------------
hmdb OPEN 12.1.0.2.0
----------------------------------------------------------------------
+DATA/HMDB/DATAFILE/system.267.1053832677
+DATA/HMDB/DATAFILE/sysaux.268.1053832775
+DATA/HMDB/DATAFILE/undotbs1.269.1053832851
+DATA/HMDB/DATAFILE/users.271.1053832873
Database unique name: hmdb
Database name:
Oracle home: /u01/app/oracle/product/12.1.0/db_1
Oracle user: oracle
Spfile:
Password file:
Domain:
Start options: open
Stop options: immediate
Database role: PRIMARY
Management policy: AUTOMATIC
Disk Groups: DATA,FRA
Services:
OSDBA group:
OSOPER group:
Database instance: hmdb
[grid@oda12 ~]$
[grid@oda12 ~]$ srvctl status database -d HMDB
Database is running.
--------------------------------------------------------------------------------
Name Target State
Server State
details
--------------------------------------------------------------------------------
Local
Resources
--------------------------------------------------------------------------------
ora.CRS.dg
ONLINE ONLINE
oda12 STABLE
ora.DATA.dg
ONLINE ONLINE
oda12 STABLE
ora.FRA.dg
ONLINE
ONLINE oda12 STABLE
ora.HMDB_LSN.lsnr
ONLINE ONLINE
oda12 STABLE
ora.LISTENER.lsnr
ONLINE ONLINE
oda12 STABLE
ora.asm
ONLINE ONLINE
oda12
Started,STABLE
ora.ons
OFFLINE OFFLINE oda12 STABLE
--------------------------------------------------------------------------------
Cluster
Resources
--------------------------------------------------------------------------------
ora.cssd
1
ONLINE ONLINE oda12 STABLE
ora.diskmon
1
OFFLINE OFFLINE STABLE
ora.evmd
1
ONLINE ONLINE oda12 STABLE
ora.hmdb.db
1
ONLINE ONLINE oda12 Open,STABLE
ora.orcl.db
1
ONLINE ONLINE oda12 Open,STABLE
--------------------------------------------------------------------------------
2- Stop Database from Grid User
[grid@oda12 ~]$ srvctl stop database -db HMDB
3- Remove Database into OCR from Grid User
PRKO-3141
: Database HMDB could not be removed because it was running
If Your Database is running so you will remove your
database with switch “–f” for force fully.
PRCD-1120 : The resource for database HMDB could not be found.
PRCR-1001 : Resource ora.hmdb.db does not exist
--------------------------------------------------------------------------------
Name Target State
Server State
details
--------------------------------------------------------------------------------
Local
Resources
--------------------------------------------------------------------------------
ora.CRS.dg
ONLINE ONLINE
oda12 STABLE
ora.DATA.dg
ONLINE ONLINE
oda12 STABLE
ora.FRA.dg
ONLINE ONLINE
oda12 STABLE
ora.HMDB_LSN.lsnr
ONLINE ONLINE
oda12 STABLE
ora.LISTENER.lsnr
ONLINE ONLINE
oda12 STABLE
ora.asm
ONLINE ONLINE
oda12
Started,STABLE
ora.ons
OFFLINE OFFLINE oda12 STABLE
--------------------------------------------------------------------------------
Cluster
Resources
--------------------------------------------------------------------------------
ora.cssd
1
ONLINE ONLINE oda12 STABLE
ora.diskmon
1
OFFLINE OFFLINE STABLE
ora.evmd
1
ONLINE ONLINE oda12 STABLE
ora.orcl.db
1
ONLINE ONLINE oda12 Open,STABLE
--------------------------------------------------------------------------------
Oracle Database 12c Enterprise Edition Release 12.1.0.2.0
- 64bit Production
With the Partitioning, Automatic Storage Management,
OLAP, Advanced Analytics
and Real Application Testing options
------------------------------------ -----------
------------------------------
db_name string hmdb
---------------- ------------ -----------------
hmdb OPEN 12.1.0.2.0
SQL> exit
Disconnected from Oracle Database 12c Enterprise Edition
Release 12.1.0.2.0 - 64bit Production
With the Partitioning, Automatic Storage Management,
OLAP, Advanced Analytics
and Real Application Testing options
[oracle@oda12 admin]$ exit
logout
We are no longer a registered authentication agent.
login as: root
root@192.168.10.10's
password:
Last login: Thu Oct 29 01:29:31 2020 from 192.168.10.9
Last login: Thu Oct 29 01:26:01 PKT 2020 on pts/1
[oracle@oda12 ~]$ sqlplus / as sysdba
PRCD-1120 : The resource for database HMDB could not be
found.
PRCR-1001 : Resource ora.hmdb.db does not exist
--------------------------------------------------------------------------------
Name Target State
Server State
details
--------------------------------------------------------------------------------
Local
Resources
--------------------------------------------------------------------------------
ora.CRS.dg
ONLINE ONLINE
oda12 STABLE
ora.DATA.dg
ONLINE ONLINE
oda12 STABLE
ora.FRA.dg
ONLINE ONLINE
oda12 STABLE
ora.HMDB_LSN.lsnr
ONLINE ONLINE
oda12 STABLE
ora.LISTENER.lsnr
ONLINE ONLINE
oda12 STABLE
ora.asm
ONLINE ONLINE
oda12
Started,STABLE
ora.ons
OFFLINE OFFLINE oda12 STABLE
--------------------------------------------------------------------------------
Cluster
Resources
--------------------------------------------------------------------------------
ora.cssd
1
ONLINE ONLINE oda12 STABLE
ora.diskmon
1
OFFLINE OFFLINE STABLE
ora.evmd
1
ONLINE ONLINE oda12
STABLE
ora.orcl.db
1
ONLINE ONLINE oda12 Open,STABLE
--------------------------------------------------------------------------------
--------------------------------------------------------------------------------
Name Target State
Server State
details
--------------------------------------------------------------------------------
Local
Resources
--------------------------------------------------------------------------------
ora.CRS.dg
ONLINE ONLINE
oda12 STABLE
ora.DATA.dg
ONLINE ONLINE
oda12 STABLE
ora.FRA.dg
ONLINE ONLINE
oda12 STABLE
ora.HMDB_LSN.lsnr
ONLINE ONLINE
oda12 STABLE
ora.LISTENER.lsnr
ONLINE ONLINE
oda12 STABLE
ora.asm
ONLINE ONLINE
oda12
Started,STABLE
ora.ons
OFFLINE OFFLINE oda12 STABLE
--------------------------------------------------------------------------------
Cluster
Resources
--------------------------------------------------------------------------------
ora.cssd
1
ONLINE ONLINE oda12 STABLE
ora.diskmon
1
OFFLINE OFFLINE STABLE
ora.evmd
1
ONLINE ONLINE oda12 STABLE
ora.orcl.db
1
ONLINE ONLINE oda12 Open,STABLE
--------------------------------------------------------------------------------
ADD Database Spfile in ASM/CRS through Modification
1- Source DBS Environment and Check Spfile Location
[oracle@oda12 ~]$ hmdb
[oracle@oda12 ~]$ sqlplus / as sysdba
SQL*Plus: Release 12.1.0.2.0 Production on Thu Oct 29 21:45:18 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, Automatic Storage Management,
OLAP, Advanced Analytics
and Real Application Testing options
SQL> show parameter spfile
NAME TYPE VALUE
------------------------------ ----------- ------------------------------
spfile string /u01/app/oracle/product/12.1.0/db_1/dbs/spfilehmdb.ora
2- Create Pfile and Check Pfile is Creating in Default Location
SQL> create pfile from spfile;
File created.
SQL> exit
Disconnected from Oracle Database 12c Enterprise Edition
Release 12.1.0.2.0 - 64bit Production
With the Partitioning, Automatic Storage Management,
OLAP, Advanced Analytics
and Real Application Testing options
[oracle@oda12 ~]$ cd $ORACLE_HOME/dbs
[oracle@oda12 dbs]$ ls init
inithmdb.ora init.ora initorcl.ora
[oracle@oda12 dbs]$ ls inithmdb.ora
inithmdb.ora
[oracle@oda12 dbs]$ pwd
/u01/app/oracle/product/12.1.0/db_1/dbs
[oracle@oda12 dbs]$ ls /u01/app/oracle/product/12.1.0/db_1/dbs/inithmdb.ora
/u01/app/oracle/product/12.1.0/db_1/dbs/inithmdb.ora
3- Create Spfile in ASM File (Disk Group)
[oracle@oda12 dbs]$ sqlplus / as sysdba
SQL*Plus: Release 12.1.0.2.0 Production on Thu Oct 29 22:18:57 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, Automatic Storage Management,
OLAP, Advanced Analytics
and Real Application Testing options
SQL> create spfile='+DATA' from pfile='/u01/app/oracle/product/12.1.0/db_1/dbs/inithmdb.ora';
File created.
4- Check Spfile Location ASM File (Disk Group) from Grid User
[grid@oda12 ~]$ asmcmd
ASMCMD> cd DATA
ASMCMD> ls
HMDB/
ORCL/
ASMCMD> cd HMDB
ASMCMD> ls
BACKUPSET/
CONTROLFILE/
DATAFILE/
ONLINELOG/
PARAMETERFILE/
TEMPFILE/
ASMCMD> cd PARAMETERFILE/
ASMCMD> ls
spfile.277.1055110761
ASMCMD> find +data sp*
+data/HMDB/PARAMETERFILE/spfile.277.1055110761
+data/ORCL/PARAMETERFILE/spfile.265.1052778363
5- Add and Modify Spfile in ASM/CRS from Grid User
[grid@oda12 ~]$ srvctl config database -d hmdb
Database unique name: hmdb
Database name:
Oracle home: /u01/app/oracle/product/12.1.0/db_1
Oracle user: oracle
Spfile:
Password file:
Domain:
Start options: open
Stop options: immediate
Database role: PRIMARY
Management policy: AUTOMATIC
Disk Groups: DATA, FRA
Services:
OSDBA group:
OSOPER group:
Database instance: hmdb
[oracle@oda12 dbs]$ srvctl modify database -d hmdb -p +data/HMDB/PARAMETERFILE/spfile.277.1055110761
[grid@oda12 ~]$ srvctl config database -d hmdb
Database unique name: hmdb
Database name:
Oracle home: /u01/app/oracle/product/12.1.0/db_1
Oracle user: oracle
Spfile: +data/HMDB/PARAMETERFILE/spfile.277.1055110761
Password file:
Domain:
Start options: open
Stop options: immediate
Database role: PRIMARY
Management policy: AUTOMATIC
Disk Groups: DATA, FRA
Services:
OSDBA group:
OSOPER group:
Database instance: hmdb
6- Verify The Database is Running with newly migrate Spfile from Oracle User
[oracle@oda12 dbs]$ sqlplus / as sysdba
SQL*Plus: Release 12.1.0.2.0 Production on Thu Oct 29 22:24:07 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, Automatic Storage Management,
OLAP, Advanced Analytics
and Real Application Testing options
SQL> show parameter spfile
NAME TYPE VALUE
---------------------------- ------------
------------------------------
spfile string /u01/app/oracle/product/12.1.0/db_1/dbs/spfilehmdb.ora
7- Stop Then Start database from Grid user
[grid@oda12 ~]$ srvctl stop database -d hmdb
[grid@oda12 ~]$ srvctl start database -d hmdb
8- Verify Again the Database is Running with newly migrate Spfile from Oracle User
[oracle@oda12 dbs]$ sqlplus / as sysdba
SQL*Plus: Release 12.1.0.2.0 Production on Thu Oct 29 22:26:03 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, Automatic Storage Management,
OLAP, Advanced Analytics
and Real Application Testing options
SQL> show parameter spfile
NAME TYPE VALUE
----------------------------- -----------
------------------------------
spfile string +DATA/HMDB/PARAMETERFILE/spfile.277.1055110761
No comments:
Post a Comment