Thursday 3 August 2017

RAC Database Installation using Silent Mode.

Created two new Exadata- RAC database on server acbxyz1 using silent method

1. GOLIA
2. JNV

P.N- whenever exadata box has creatd automattically one generic oracle home env file created i.e dbmo1

To create JNV exadatabase (same steps to follow for GOLIA as well)

Steps to create RAC database using dbca silent mode:
============================================================


login to jump server ioclp3 and do ssh to acbxyz1 as root (reason we dont have access till now)

ioclp3:/home1/khataid> ssh root@acbxyz1             ================== Password of root- debashis1
root@acbxyz1's password:
Last login: Thu Jul 27 23:54:22 2017 from fdfd.eix.com

[root@acbxyz1 ~]# sudo su - oracle

[oracle@acbxyz1 ~]$ . oraenv
ORACLE_SID = [oracle] ? dbm01                               ======================  the defualt SID to set the ORACLE_HOME
The Oracle base has been set to /u01/app/oracle

[oracle@acbxyz1 ~]$
[oracle@acbxyz1 ~]$ export ORACLE_SID=               ===================== Leave it blank- no need to give anything  

[oracle@acbxyz1 ~]$
[oracle@acbxyz1 ~]$ echo $ORACLE_HOME
/u01/app/oracle/product/12.1.0.2/dbhome_1

================================================================================================================================================
>>>>Below script is helping to create the database(JNV) in silent mode - Just run on the command promprt <<<<<
same script is used for creating GOLIA databae only changed parameter -gdbName GOLIA \    &   -sid GOLIA \
=====================================================================================================================================================
[oracle@acbxyz1 ~]$

===========================
dbca -silent \
-createDatabase \
-adminManaged \
-createAsContainerDatabase false \
-templateName General_Purpose.dbc \
-gdbName JNV \
-sid JNV \
-SysPassword Suhhhg_69 \
-SystemPassword Suhhhg_69 \
-emConfiguration NONE \
-redoLogFileSize 4096 \
-recoveryAreaDestination RECOC1 \
-storageType ASM \
-asmSysPassword Welcome$ \
-diskGroupName DATAC1 \
-characterSet AL32UTF8 \
-nationalCharacterSet AL16UTF16 \
-automaticMemoryManagement false \
-totalMemory 8000 \
-databaseType MULTIPURPOSE \
-nodelist acbxyz1,acbxyz2 \
-ignorePreReqs
===============================


The output will be look like below:
===================================
Copying database files
1% complete
3% complete
9% complete
15% complete
21% complete
30% complete
Creating and starting Oracle instance
32% complete
36% complete
40% complete
44% complete
45% complete
48% complete
50% complete
Creating cluster database views
52% complete
70% complete
Completing Database Creation
73% complete
76% complete
85% complete
94% complete
100% complete
Look at the log file "/u01/app/oracle/cfgtoollogs/dbca/JNV/JNV.log" for further details.

============================================================

we are done with the database creation steps

============================================================

[oracle@acbxyz1 ~]$ . oraenv
ORACLE_SID = [oracle] ? JNV
The Oracle base remains unchanged with value /u01/app/oracle
[oracle@acbxyz1 ~]$ export ORACLE_SID=JNV1
[oracle@acbxyz1 ~]$
[oracle@acbxyz1 ~]$
[oracle@acbxyz1 ~]$ sqlplus "/ as sysdba"

SQL*Plus: Release 12.1.0.2.0 Production on Fri Jul 28 00:14:18 2017

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>
SQL>
SQL> select name,open_mode,log_mode from v$database;

NAME      OPEN_MODE            LOG_MODE
--------- -------------------- ------------
JNV      READ WRITE           NOARCHIVELOG

=============================================================

Post steps
=================================================
1.  Check the control file,archive and data file location

2. They should be create on disk group only, if not we have to change the parameter sand direct to proper disk group.

3. By default the database has been created on NOARCHIVELOG mode, so change it to ARCHIVELOG mode.

4. Change the size of the archive log destination.

5. Minimum of redo log size should be 4G ---------------->  This is being in same size during the database creation only.

6. Change the Automatic memory  management to OFF



Post creatin step-  Chaning the archive log location
################################################################

SQL> archive log list;
Database log mode              No Archive Mode
Automatic archival             Disabled
Archive destination            USE_DB_RECOVERY_FILE_DEST
Oldest online log sequence     1
Current log sequence           1
SQL>
SQL>
SQL>
SQL>
SQL> SHOW PARAMETER DB_RECOVERY_FILE_DEST

NAME                                 TYPE        VALUE
------------------------------------ ----------- ------------------------------
db_recovery_file_dest                string      +DATAC1                  ---------------------------------> See it is directng to +DATA disk in ASM
db_recovery_file_dest_size           big integer 600G


==================== Chaning to +RECOC  =====================

SQL> alter system set DB_RECOVERY_FILE_DEST='+RECOC1';

>>>>>>>>>>>>>>>>>>>>>>>>>>> BOUNCE THE DATABASE and CHAANGE TO ARCHIVE LOG MODE  <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<


[oracle@acbxyz1 ~]$ srvctl stop database -d JNV -o immediate
[oracle@acbxyz1 ~]$ srvctl start database -d JNV -o mount
[oracle@acbxyz1 ~]$
[oracle@acbxyz1 ~]$ sqlplus "/as sysdba"

SQL> select open_mode from v$database;

OPEN_MODE
--------------------
MOUNTED

SQL> select name from v$database;

NAME
---------
GOLIA

SQL>
SQL> ALTER DATABASE ARCHIVELOG;

Database altered.

SQL> exit
Disconnected from 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

[oracle@acbxyz1 ~]$ srvctl stop database -d GOLIA -o immediate

[oracle@acbxyz1 ~]$ srvctl start database -d GOLIA

[oracle@acbxyz1 ~]$ srvctl status database -d GOLIA

Instance GOLIA1 is running on node acbxyz1
Instance GOLIA2 is running on node ayxap06dbadm02

[oracle@acbxyz1 ~]$ sqlplus "/ as sysdba"

SQL>
SQL> archive log list;
Database log mode              Archive Mode
Automatic archival             Enabled
Archive destination            USE_DB_RECOVERY_FILE_DEST
Oldest online log sequence     1
Next log sequence to archive   1
Current log sequence           1
SQL>
SQL>
SQL>
SQL> show parameter DB_RECOVERY_FILE_DE

NAME                                 TYPE        VALUE
------------------------------------ ----------- ------------------------------
db_recovery_file_dest                string      +RECOC1 =============================================>  Now directing to RECO DISK GROUP of ASM
db_recovery_file_dest_size           big integer 600G



Chaning the Size and adding the redo log file
===================================================
SQL> SELECT a.GROUP#, a.THREAD#, a.SEQUENCE#,
 a.ARCHIVED, a.STATUS, b.MEMBER AS REDOLOG_FILE_NAME,
 (a.BYTES/1024/1024) AS SIZE_MB FROM v$log a
JOIN v$logfile b ON a.Group#=b.Group#
ORDER BY a.GROUP#;


G  GROUP#    THREAD#  SEQUENCE# ARC STATUS           REDOLOG_FILE_NAME                                                                                                   SIZE_MB
---------- ---------- ---------- --- ---------------- --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- ----------
         1          1          3 YES INACTIVE         +DATAC1/JNV/ONLINELOG/group_1.300.950486967                                                                           4096
         1          1          3 YES INACTIVE         +DATAC1/JNV/ONLINELOG/group_1.299.950486965                                                                           4096
         2          1          4 NO  CURRENT          +DATAC1/JNV/ONLINELOG/group_2.302.950486969                                                                           4096
         2          1          4 NO  CURRENT          +DATAC1/JNV/ONLINELOG/group_2.301.950486969                                                                           4096
         3          2          3 YES INACTIVE         +DATAC1/JNV/ONLINELOG/group_3.305.950487139                                                                           4096
         3          2          3 YES INACTIVE         +DATAC1/JNV/ONLINELOG/group_3.306.950487139                                                                           4096
         4          2          4 NO  CURRENT          +DATAC1/JNV/ONLINELOG/group_4.307.950487141                                                                           4096
         4          2          4 NO  CURRENT          +DATAC1/JNV/ONLINELOG/group_4.308.950487143                                                                           4096




Add logfile to +RECO- directory as per standard


SQL> alter database add logfile member '+RECOC1' to group 1;

Database altered.

SQL> alter database add logfile member '+RECOC1' to group 1;

Database altered.

SQL> alter database add logfile member '+RECOC1' to group 2;

Database altered.

SQL> alter database add logfile member '+RECOC1' to group 2;

Database altered.

SQL> alter database add logfile member '+RECOC1' to group 3;

Database altered.

SQL> alter database add logfile member '+RECOC1' to group 3;

Database altered.

SQL> alter database add logfile member '+RECOC1' to group 4;

Database altered.

SQL> alter database add logfile member '+RECOC1' to group 4;

Database altered.

 SELECT a.group#, a.member, b.bytes/1024/1024/1024 FROM v$logfile a, v$log b WHERE a.group# = b.group# order by a.group#;

   GROUP# MEMBER                                                       B.BYTES/1024/1024/1024
---------- ------------------------------------------------------------ ----------------------
         1 +RECOC1/JNV/ONLINELOG/group_1.302.950494167                                      4
         1 +RECOC1/JNV/ONLINELOG/group_1.301.950494163                                      4
         1 +DATAC1/JNV/ONLINELOG/group_1.300.950486967                                      4
         1 +DATAC1/JNV/ONLINELOG/group_1.299.950486965                                      4
         2 +RECOC1/JNV/ONLINELOG/group_2.303.950494173                                      4
         2 +RECOC1/JNV/ONLINELOG/group_2.304.950494177                                      4
         2 +DATAC1/JNV/ONLINELOG/group_2.301.950486969                                      4
         2 +DATAC1/JNV/ONLINELOG/group_2.302.950486969                                      4
         3 +DATAC1/JNV/ONLINELOG/group_3.305.950487139                                      4
         3 +RECOC1/JNV/ONLINELOG/group_3.305.950494183                                      4
         3 +RECOC1/JNV/ONLINELOG/group_3.306.950494187                                      4
         3 +DATAC1/JNV/ONLINELOG/group_3.306.950487139                                      4
         4 +RECOC1/JNV/ONLINELOG/group_4.307.950494205                                      4
         4 +RECOC1/JNV/ONLINELOG/group_4.308.950494211                                      4
         4 +DATAC1/JNV/ONLINELOG/group_4.307.950487141                                      4
         4 +DATAC1/JNV/ONLINELOG/group_4.308.950487143                                      4



Chaning the Control file location
===================================

before change
*****************

SQL> select name from v$controlfile;

NAME
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
+DATAC1/GOLIA/CONTROLFILE/current.280.950485939
+DATAC1/GOLIA/CONTROLFILE/current.279.950485939


Now mulitplexing the control file to +RECOC1 disk
==================================================
=================================================

SQL> alter system set control_files='+DATAC1/JNV/CONTROLFILE/current.298.950486963','+RECOC1' scope=spfile;

System altered.

SQL> alter system set control_files='+DATAC1/JNV/CONTROLFILE/current.297.950486963','+RECOC1' scope=spfile;

System altered.



Bounce the database and start with nomount mode
=====================================
[oracle@acbxyz1 ~]$ srvctl stop database -d JNV -o immediate
[oracle@acbxyz1 ~]$ srvctl start databse -d JNV -o nomount


mean time you can go and check whether replicate has been created or not

SQL> show parameter control

NAME                                 TYPE        VALUE
------------------------------------ ----------- ------------------------------
control_file_record_keep_time        integer     7
control_files                        string      +DATAC1/GOLIA/CONTROLFILE/curre
                                                 nt.279.950485939, +RECOC1


Please Note-  even if we have two control file under +DATA disk but it will multiple only one control file in +RECO diskgroup

Restore the control file
============================
database is nomount mode only


[oracle@acbxyz1 ~]$ . oraenv
ORACLE_SID = [GOLIA] ? GOLIA1
ORACLE_HOME = [/home/oracle] ? /u01/app/oracle/product/12.1.0.2/dbhome_1
The Oracle base remains unchanged with value /u01/app/oracle

[oracle@acbxyz1 ~]$
[oracle@acbxyz1 ~]$ rman target /

Recovery Manager: Release 12.1.0.2.0 - Production on Fri Jul 28 03:16:46 2017

Copyright (c) 1982, 2014, Oracle and/or its affiliates.  All rights reserved.

connected to target database: JNV (not mounted)

RMAN>

RMAN>

RMAN> restore controlfile from '+DATAC1/JNV/CONTROLFILE/current.298.950486963';

Starting restore at 28-JUL-17
using target database control file instead of recovery catalog
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=392 instance=JNV1 device type=DISK

channel ORA_DISK_1: copied control file copy
output file name=+DATAC1/JNV/CONTROLFILE/current.297.950486963
output file name=+RECOC1/JNV/CONTROLFILE/current.311.950498233
Finished restore at 28-JUL-17

RMAN> restore controlfile from '+DATAC1/JNV/CONTROLFILE/current.297.950486963';

Starting restore at 28-JUL-17
using channel ORA_DISK_1

channel ORA_DISK_1: copied control file copy
output file name=+DATAC1/JNV/CONTROLFILE/current.297.950486963
output file name=+RECOC1/JNV/CONTROLFILE/current.311.950498233
Finished restore at 28-JUL-17


<<<<<<<<<< If you see the control file has overwrite with the same nem even if we want to restore from two different control file of +DATA group >>>>>>>>>>>>>


[oracle@acbxyz1 ~]$ sqlplus "/ as sysdba"

SQL*Plus: Release 12.1.0.2.0 Production on Fri Jul 28 02:54:49 2017

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> alter system set control_files='+DATAC1/GOLIA/CONTROLFILE/current.279.950485939','+RECOC1/GOLIA/CONTROLFILE/current.310.950496635' scope=spfile;

System altered.


<<< Bounce The DB >>>

[oracle@acbxyz1 ~]$ srvctl stop database -d JNV -o immediate
[oracle@acbxyz1 ~]$ srvctl start database -d JNV
[oracle@acbxyz1 ~]$ sqlplus "/ as sysdba"


SQL> select name from v$controlfile;

NAME
--------------------------------------------------------------------------------
+DATAC1/JNV/CONTROLFILE/current.297.950486963
+RECOC1/JNV/CONTROLFILE/current.311.950498233






No comments:

Post a Comment