Sunday, March 6, 2016

Converting 12c RAC database to Archivelog mode

In-order to convert RAC database from No Archivelog to Archivelog Log Mode 

Step1: set "cluster_database" to False 
Step2: Bring down Database using srvctl 
Step3: open database in mount stage from any one of the instance 
step4: convert database to archivelog mode in mount stage 
step5: set cluster_database to true again
Step6: start up database using srvctl 

[oracle@tnc1 admin]$ db
[oracle@tnc1 admin]$ sql
SQL*Plus: Release 12.1.0.2.0 Production on Thu Mar 3 01:16:17 2016
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> archive log list;  
Database log mode       No Archive Mode
Automatic archival       Disabled
Archive destination       USE_DB_RECOVERY_FILE_DEST
Oldest online log sequence     38
Current log sequence       39
SQL> show parameter db_recovery
NAME     TYPE VALUE
------------------------------------ ----------- ------------------------------
db_recovery_file_dest     string +FRA
db_recovery_file_dest_size     big integer 4785M

SQL> alter system set cluster_database=FALSE scope=spfile;
#---
[oracle@tnc1 ~]$ srvctl stop database -d p1tncd

[oracle@tnc1 ~]$ db
[oracle@tnc1 ~]$ sql
SQL*Plus: Release 12.1.0.2.0 Production on Thu Mar 3 01:43:52 2016
Copyright (c) 1982, 2014, Oracle.  All rights reserved.
Connected to an idle instance.
SQL> startup mount;
ORACLE instance started.
Total System Global Area  549453824 bytes
Fixed Size     2926616 bytes
Variable Size   293603304 bytes
Database Buffers   247463936 bytes
Redo Buffers     5459968 bytes
Database mounted.

SQL> alter database archivelog;
Database altered.

SQL> alter system set cluster_database=TRUE scope=spfile;
System altered.

SQL> show parameter cluster
NAME     TYPE VALUE
------------------------------------ ----------- ------------------------------
cluster_database     boolean FALSE
cluster_database_instances     integer 1
cluster_interconnects     string
SQL> 
SQL> shut immediate;
ORA-01109: database not open
Database dismounted.
ORACLE instance shut down.

[oracle@tnc1 ~]$ srvctl start database -d p1tncd
[oracle@tnc2 ~]$ db
[oracle@tnc2 ~]$ sql

SQL*Plus: Release 12.1.0.2.0 Production on Thu Mar 3 01:49:06 2016
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 parameter db_name;
NAME     TYPE VALUE
------------------------------------ ----------- ------------------------------
db_name      string p1tncd 

SQL> archive log list;
Database log mode       Archive Mode
Automatic archival       Enabled
Archive destination       USE_DB_RECOVERY_FILE_DEST
Oldest online log sequence     33
Next log sequence to archive   34
Current log sequence           34

---Nikhil Tatineni--
---12c RAC Database--

Querys to monitor RAC

following few  Query's will help to find out culprits-  Query to check long running transaction from last 8 hours  Col Sid Fo...