Search

Top 60 Oracle Blogs

Recent comments

Post GI / RDBMS Installation Configuration Steps

Introduction

This is the third article in a series of blog posts on building a test environment to closely match a Production environment so we could then upgrade the test environment from Oracle Database 12.1 to Oracle Database 12.2. In the first post, I covered performing a silent installation of the grid infrastructure software. In the second post, I followed that by performing a similar silent installation of the RDBMS software. In this post, I’ll be covering the rest of the configuration work for this environment.

Listener Configuration

The first stage in configuring this environment was to get the listener configured and running. I copied the listener.ora from the GI home on Production to the test environment and updated host names appropriately, and also copied the sqlnet.ora and tnsnames.ora from the database home on Production to the test environment and updated those files appropriately as well. I started the listener to ensure it was working as expected:

[oracle@devdb01 ~]$ lsnrctl

LSNRCTL for Linux: Version 12.1.0.1.0 - Production on 06-FEB-2018 11:19:31

Copyright (c) 1991, 2013, Oracle.  All rights reserved.

Welcome to LSNRCTL, type "help" for information.

LSNRCTL> start
Starting /u01/app/product/12.1.0/grid/bin/tnslsnr: please wait...

TNSLSNR for Linux: Version 12.1.0.1.0 - Production
System parameter file is /u01/app/product/12.1.0/grid/network/admin/listener.ora
Log messages written to /u01/app/diag/tnslsnr/devdb01/listener/alert/log.xml
Listening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC1521)))
Listening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=devdb01.acme.com.au)(PORT=1521)))

Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=IPC)(KEY=EXTPROC1521)))
STATUS of the LISTENER
------------------------
Alias                     LISTENER
Version                   TNSLSNR for Linux: Version 12.1.0.1.0 - Production
Start Date                06-FEB-2018 11:19:37
Uptime                    0 days 0 hr. 0 min. 0 sec
Trace Level               off
Security                  ON: Local OS Authentication
SNMP                      OFF
Listener Parameter File   /u01/app/product/12.1.0/grid/network/admin/listener.ora
Listener Log File         /u01/app/diag/tnslsnr/devdb01/listener/alert/log.xml
Listening Endpoints Summary...
  (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC1521)))
  (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=devdb01.acme.com.au)(PORT=1521)))
The listener supports no services
The command completed successfully

Parameter Files for ASM and the Database

The next step is to copy the relevant parameter files from the Production environment – one for ASM and one for the Production database. The database had an SPFILE on disk, but ASM did not, so to be sure I copied the environment as it currently stood, I created the ASM parameter file from memory and copied it to the test environment:

[oracle@prddb01 ~]$ sqlplus / as sysasm

SQL*Plus: Release 12.1.0.1.0 Production on Tue Feb 6 11:52:41 2018

Copyright (c) 1982, 2013, Oracle.  All rights reserved.


Connected to:
Oracle Database 12c Enterprise Edition Release 12.1.0.1.0 - 64bit Production
With the Automatic Storage Management option

SQL> create pfile='/tmp/init+ASM.ora' from memory;

File created.

SQL> exit
Disconnected from Oracle Database 12c Enterprise Edition Release 12.1.0.1.0 - 64bit Production
With the Automatic Storage Management option

[oracle@prddb01 ~]$ scp /tmp/init+ASM.ora xxx.xxx.x.xx:/u01/app/product/12.1.0/grid/dbs
oracle@xxx.xxx.x.xx's password:
initASM.ora                                                                          100% 6429     6.3KB/s   00:00

Of course, creating a PFILE this way means that all the underscore parameters etc. are included, so I needed to remove all of those and the setting for ASM_DISKGROUP for now, as I haven’t yet created any diskgroups on the test environment. I also had to create the relevant directories under diag.

For the Production database, I created a pfile from the SPFILE so I could edit it as needed, and copied that to test as well:

[oracle@prddb01 ~]$ sqlplus / as sysdba

SQL*Plus: Release 12.1.0.1.0 Production on Tue Feb 6 11:37:08 2018

Copyright (c) 1982, 2013, Oracle.  All rights reserved.


Connected to:
Oracle Database 12c Release 12.1.0.1.0 - 64bit Production
With the Automatic Storage Management option

SQL> show parameter pfile

NAME                                 TYPE        VALUE
------------------------------------ ----------- ------------------------------
spfile                               string      /u01/app/product/12.1.0/oracle
                                                 /dbs/spfileORCL.ora
SQL> create pfile='/tmp/initORCL.ora' from spfile;

File created.

SQL> exit

[oracle@prddb01 ~]$ scp /tmp/initORCL.ora xxx.xxx.x.xx:/u01/app/product/12.1.0/oracle/dbs
oracle@xxx.xxx.x.xx's password:
initORCL.ora                                                                         100% 1300     1.3KB/s   00:00

Configuring ASM

In theory, you might think that we should now be able to start ASM with the modified PFILE. Unfortunately, doing so causes an error:

[oracle@devdb01 ~]$ sqlplus / as sysasm

SQL*Plus: Release 12.1.0.1.0 Production on Tue Feb 6 12:04:39 2018

Copyright (c) 1982, 2013, Oracle.  All rights reserved.

Connected to an idle instance.

SQL> startup pfile='$ORACLE_HOME/dbs/init+ASM.ora'
ORA-29701: unable to connect to Cluster Synchronization Service
ORA-01078: failure in processing system parameters

The problem is that the CRS resources have not yet been started:

[oracle@devdb01 ~]$ crsctl stat res -t
--------------------------------------------------------------------------------
Name           Target  State        Server                   State details
--------------------------------------------------------------------------------
Local Resources
--------------------------------------------------------------------------------
ora.ons
               OFFLINE OFFLINE      devdb01           STABLE
--------------------------------------------------------------------------------
Cluster Resources
--------------------------------------------------------------------------------
ora.cssd
      1        OFFLINE OFFLINE                               STABLE
ora.diskmon
      1        OFFLINE OFFLINE                               STABLE
ora.evmd
      1        ONLINE  ONLINE       devdb01           STABLE
--------------------------------------------------------------------------------
[oracle@devdb01 ~]$ crsctl start resource ora.cssd
CRS-2672: Attempting to start 'ora.cssd' on 'devdb01'
CRS-2672: Attempting to start 'ora.diskmon' on 'devdb01'
CRS-2676: Start of 'ora.diskmon' on 'devdb01' succeeded
CRS-2676: Start of 'ora.cssd' on 'devdb01' succeeded
[oracle@devdb01 ~]$ crsctl stat res -t
--------------------------------------------------------------------------------
Name           Target  State        Server                   State details
--------------------------------------------------------------------------------
Local Resources
--------------------------------------------------------------------------------
ora.ons
               OFFLINE OFFLINE      devdb01           STABLE
--------------------------------------------------------------------------------
Cluster Resources
--------------------------------------------------------------------------------
ora.cssd
      1        ONLINE  ONLINE       devdb01           STABLE
ora.diskmon
      1        OFFLINE OFFLINE                               STABLE
ora.evmd
      1        ONLINE  ONLINE       devdb01           STABLE
--------------------------------------------------------------------------------

Now let’s try starting ASM again:

[oracle@devdb01 ~]$ sqlplus / as sysasm

SQL*Plus: Release 12.1.0.1.0 Production on Tue Feb 6 12:57:19 2018

Copyright (c) 1982, 2013, Oracle.  All rights reserved.

Connected to an idle instance.

SQL> startup pfile='$ORACLE_HOME/dbs/init+ASM.ora'
ASM instance started

Total System Global Area 1135747072 bytes
Fixed Size                  2297344 bytes
Variable Size            1108283904 bytes
ASM Cache                  25165824 bytes
ORA-15110: no diskgroups mounted


SQL> exit
Disconnected from Oracle Database 12c Enterprise Edition Release 12.1.0.1.0 - 64bit Production
With the Automatic Storage Management option

Of course, there are no diskgroups so the ORA-15110 error is expected. In this environment, the customer had set up four disks using multipathing, so I could use the devices mpath[b-e] to create ASM disks:

[root@devdb01 ~]# ls /dev/mapper
control  mpathb  mpathc  mpathd  mpathe  vg_devdb01-lv_root  vg_devdb01-lv_swap
[root@devdb01 ~]# /etc/init.d/oracleasm createdisk DISK1 /dev/mapper/mpathb
Marking disk "DISK1" as an ASM disk:                       [  OK  ]
[root@devdb01 ~]# /etc/init.d/oracleasm createdisk DISK2 /dev/mapper/mpathc
Marking disk "DISK2" as an ASM disk:                       [  OK  ]
[root@devdb01 ~]# /etc/init.d/oracleasm createdisk DISK3 /dev/mapper/mpathd
Marking disk "DISK3" as an ASM disk:                       [  OK  ]
[root@devdb01 ~]# /etc/init.d/oracleasm createdisk DISK4 /dev/mapper/mpathe
Marking disk "DISK4" as an ASM disk:                       [  OK  ]
[root@devdb01 ~]# /etc/init.d/oracleasm listdisks
DISK1
DISK2
DISK3
DISK4

So now we can create the diskgroup:

[oracle@devdb01 ~]$ sqlplus / as sysasm

SQL*Plus: Release 12.1.0.1.0 Production on Tue Feb 6 12:57:19 2018

Copyright (c) 1982, 2013, Oracle.  All rights reserved.


Connected to:
Oracle Database 12c Enterprise Edition Release 12.1.0.1.0 - 64bit Production
With the Automatic Storage Management option

SQL> SELECT path, header_status FROM v$asm_disk;

PATH           HEADER_STATU
--------------- ------------
ORCL:DISK1      PROVISIONED
ORCL:DISK2      PROVISIONED
ORCL:DISK3      PROVISIONED
ORCL:DISK4      PROVISIONED


SQL> CREATE DISKGROUP data EXTERNAL REDUNDANCY
  2  DISK 'ORCL:DISK1', 'ORCL:DISK2', 'ORCL:DISK3', 'ORCL:DISK4';

Diskgroup created.

SQL> SELECT path, header_status FROM v$asm_disk;

PATH            HEADER_STATU
--------------- ------------
ORCL:DISK1      MEMBER
ORCL:DISK2      MEMBER
ORCL:DISK3      MEMBER
ORCL:DISK4      MEMBER

[oracle@devdb01 ~]$ asmcmd
ASMCMD> lsdg
State    Type    Rebal  Sector  Block       AU  Total_MB  Free_MB  Req_mir_free_MB  Usable_file_MB  Offline_disks  Voting_files  Name
MOUNTED  EXTERN  N         512   4096  1048576   2048000  2047928                0         2047928              0             N  DATA/

Duplicating the Database

So now we’re all ready to duplicate the database from its last backup. I already had a script for building the standby for this customer, so I just changed the backup directory and used that:

#!/bin/sh

export ORACLE_SID=ORCL
export ORACLE_HOME=/u01/app/product/12.1.0/oracle
export PATH=$PATH:$ORACLE_HOME:$ORACLE_HOME/bin

sqlplus /nolog <

Left that running for 15 hours (it’s a decent sized database!) and came back to realize I’d made two mistakes. One of them is obvious, and the other less so:

  • The obvious one is of course I left that damn word “standby” in there, so I’d built another standby! D’uh!
  • The less obvious one is that the archives weren’t in that location, so none of the archived files were copied across.

So the first thing I had to do was copy all the relevant archive log files to the test environment. I then set the LOG_ARCHIVE_DEST parameter as needed, issued the RECOVER DATABASE USING BACKUP CONTROLFILE command and activated the standby as a primary. The system was now ready and waiting for the customer to start testing with.

The post Post GI / RDBMS Installation Configuration Steps appeared first on PeteWhoDidNotTweet.com.