Friday, 5 October 2018

Install 18c Grid Infrastructure in Silent Mode


From Oracle 12.2 onwards, installation and configuration of Grid Infrastructure is done using gridSetup.sh.

Follow the following steps to install a 2-node 18c Grid Infrastructure cluster on Linux environment:

1. Download the software

2. Copy the software on first node

2. Unzip the software

3. Run gridSetup.sh


1. Download the software

Download 18.3 Grid Infrastructure from OTN website at https://www.oracle.com/technetwork/database/enterprise-edition/downloads/oracle18c-linux-180000-5022980.html

2. Copy the software on first node

Copy the 18.3 GI software onto the first node of the cluster

3. Unzip the software 

Unzip the 18.3 GI software at the installation directory on the first node of the cluster using below command:

unzip -d /u01/app/18.3.0/grid <path to zip file>

4. Run gridSetup.sh

Create the default responsefile under /u01/app/18.3.0/grid/response directory based on the required cluster configuration such as Scan name, Private, Public interface names and IP addresses etc.

/u01/app/18.3.0/grid/gridSetup.sh -silent -responsefile /u01/app/18.3.0/grid/response/response_file.rsp

When prompted, run root.sh as root user on all nodes starting from 1st:

/u01/app/18.3.0/grid/root.sh

Run the following command to configure tools on the 1st node:

/u01/app/18.3.0/grid/gridSetup.sh -silent -executeConfigTools -responsefile /u01/app/18.3.0/grid/response/response_file.rsp
















Monday, 27 November 2017

ERROR OGG-00446 Unable to lock file while starting Goldengate extract

The Golden gate is installed on a 2-node RAC cluster and registered with Oracle clusterware through Bundle Agent.


On starting the goldengate gg_1 on 1st node, the Goldengate logfile ggserr.log shows following error:

2017-11-27 09:00:22  INFO    OGG-01971  Oracle GoldenGate Capture for Oracle, ggpump.prm:  The previous message, 'INFO OGG-02095', repeated 1 times.
2017-11-27 09:00:22  INFO    OGG-03522  Oracle GoldenGate Capture for Oracle, ggpump.prm:  Setting session time zone to source database time zone 'GMT'.
2017-11-27 09:00:22  INFO    OGG-01971  Oracle GoldenGate Capture for Oracle, ora12c16.prm:  The previous message, 'INFO OGG-02095', repeated 1 times.
2017-11-27 09:00:22  INFO    OGG-03522  Oracle GoldenGate Capture for Oracle, ora12c16.prm:  Setting session time zone to source database time zone 'GMT'.
2017-11-27 09:00:27  INFO    OGG-00987  Oracle GoldenGate Command Interpreter for Oracle:  GGSCI command (oracle): info mgr.
2017-11-27 09:00:32  ERROR   OGG-00446  Oracle GoldenGate Capture for Oracle, ggpump.prm:  Unable to lock file "/u01/app/oracle/product/12.1.2/oggcore_1/dirchk/GGPUMP.cpe" (error 11, Resource temporarily unavailable).
2017-11-27 09:00:32  ERROR   OGG-00446  Oracle GoldenGate Capture for Oracle, ora12c16.prm:  Unable to lock file "/u01/app/oracle/product/12.1.2/oggcore_1/dirchk/ORA12C16.cpe" (error 11, Resource temporarily unavailable).
2017-11-27 09:00:32  ERROR   OGG-01668  Oracle GoldenGate Capture for Oracle, ggpump.prm:  PROCESS ABENDING.
2017-11-27 09:00:33  ERROR   OGG-01668  Oracle GoldenGate Capture for Oracle, ora12c16.prm:  PROCESS ABENDING.

Extract process is not able to obtain lock on the below files:

[oracle@lon2odclborc001a oggcore_1]$ pwd
/u01/app/oracle/product/12.1.2/oggcore_1
[oracle@lon2odclborc001a oggcore_1]$ ls -l dirchk/
total 196
-rw-r----- 1 oracle oinstall  32768 Nov 27 09:17 GGPUMP.cpe
-rw-r----- 1 oracle oinstall   6144 Nov 27 06:47 ORA12C16.cpb
-rw-r----- 1 oracle oinstall 122880 Nov 27 09:17 ORA12C16.cpe

Clusterware shows that Goldengate is running only on node rac01a:

[oracle@rac01a ~]$ agctl status goldengate gg_1
Goldengate  instance 'gg_1' is running on rac01a

In RAC environment, the Goldengate manager process should run only on one node at a time.
But somehow, the manager and extract processes is also got started on the 2nd node.

On second node rac01b, 

[oracle@rac01b oggcore_1]$ cd /u01/app/oracle/product/12.1.2/oggcore_1
[oracle@rac01b oggcore_1]$ ./ggsci

Oracle GoldenGate Command Interpreter for Oracle
Version 12.2.0.1.1 OGGCORE_12.2.0.1.0_PLATFORMS_151211.1401_FBO
Linux, x64, 64bit (optimized), Oracle 12c on Dec 12 2015 02:56:48
Operating system character set identified as UTF-8.

Copyright (C) 1995, 2015, Oracle and/or its affiliates. All rights reserved.


GGSCI (rac01b.markit.partners) 1> status mgr

Manager is running (IP port rac01b.markit.partners.7809, Process ID 14153).

GGSCI (rac01b.markit.partners) 2> stop mgr
Manager process is required by other GGS processes.
Are you sure you want to stop it (y/n)?y

Sending STOP request to MANAGER ...
Request processed.
Manager stopped.

GGSCI (rac01b.markit.partners) 4> stop ER *

Sending STOP request to EXTRACT GGPUMP ...
Request processed.

Sending STOP request to EXTRACT ORA12C16 ...
Request processed.


GGSCI (rac01b.markit.partners) 5> info all

Program     Status      Group       Lag at Chkpt  Time Since Chkpt

MANAGER     STOPPED
EXTRACT     STOPPED     GGPUMP      00:00:00      00:05:23
EXTRACT     STOPPED     ORA12C16    00:00:00      00:05:22



Restart the GoldenGate

[oracle@rac01a ~]$ agctl stop goldengate gg_1
[oracle@rac01a ~]$ agctl start goldengate gg_1
[oracle@rac01a ~]$ agctl status goldengate gg_1
Goldengate  instance 'gg_1' is running on rac01a

Check the GoldenGate extract and manager process

[oracle@rac01a oggcore_1]$ ./ggsci

Oracle GoldenGate Command Interpreter for Oracle
Version 12.2.0.1.1 OGGCORE_12.2.0.1.0_PLATFORMS_151211.1401_FBO
Linux, x64, 64bit (optimized), Oracle 12c on Dec 12 2015 02:56:48
Operating system character set identified as UTF-8.

Copyright (C) 1995, 2015, Oracle and/or its affiliates. All rights reserved.



GGSCI (rac01a.markit.partners) 1> info all

Program     Status      Group       Lag at Chkpt  Time Since Chkpt

MANAGER     RUNNING
EXTRACT     RUNNING     GGPUMP      00:00:00      00:00:04
EXTRACT     RUNNING     ORA12C16    00:00:00      00:00:04


Logfile shows no error stating that lock is released from 2nd node and extract process got started successfully.

[oracle@lon2odclborc001a oggcore_1]$ tail -100f ggserr.log
2017-11-27 09:32:25  INFO    OGG-02089  Oracle GoldenGate Capture for Oracle, ora12c16.prm:  Source redo compatibility version is: 12.1.0.
2017-11-27 09:32:25  INFO    OGG-00546  Oracle GoldenGate Capture for Oracle, ora12c16.prm:  Default thread stack size: 2097152.
2017-11-27 09:32:25  INFO    OGG-01513  Oracle GoldenGate Capture for Oracle, ora12c16.prm:  Positioning to (Thread 1) Sequence 3862, RBA 54800, SCN 0.8878361 (8878361).
2017-11-27 09:32:25  INFO    OGG-01516  Oracle GoldenGate Capture for Oracle, ora12c16.prm:  Positioned to (Thread 1) Sequence 3862, RBA 54800, SCN 0.8878361 (8878361), 27 Nov 2017 09:23:08.
2017-11-27 09:32:25  INFO    OGG-01513  Oracle GoldenGate Capture for Oracle, ora12c16.prm:  Positioning to (Thread 2) Sequence 3850, RBA 845328, SCN 0.8878352 (8878352).
2017-11-27 09:32:25  INFO    OGG-01516  Oracle GoldenGate Capture for Oracle, ora12c16.prm:  Positioned to (Thread 2) Sequence 3850, RBA 845328, SCN 0.8878352 (8878352), 27 Nov 2017 09:23:07.
2017-11-27 09:32:25  INFO    OGG-01517  Oracle GoldenGate Capture for Oracle, ora12c16.prm:  Position of first record processed for Thread 1, Sequence 3862, RBA 54800, SCN 0.8878361 (8878361), 27 Nov 2017 09:23:08.
2017-11-27 09:32:25  INFO    OGG-00993  Oracle GoldenGate Capture for Oracle, ora12c16.prm:  EXTRACT ORA12C16 started.
2017-11-27 09:32:25  INFO    OGG-01517  Oracle GoldenGate Capture for Oracle, ora12c16.prm:  Position of first record processed for Thread 2, Sequence 3850, RBA 845328, SCN 0.8878352 (8878352), 27 Nov 2017 09:23:07.
2017-11-27 09:32:25  INFO    OGG-01055  Oracle GoldenGate Capture for Oracle, ora12c16.prm:  Recovery initialization completed for target file ./dirdat/aa000000012, at RBA 1535.
2017-11-27 09:32:25  INFO    OGG-01478  Oracle GoldenGate Capture for Oracle, ora12c16.prm:  Output file ./dirdat/aa is using format RELEASE 12.2.
2017-11-27 09:32:25  INFO    OGG-01026  Oracle GoldenGate Capture for Oracle, ora12c16.prm:  Rolling over remote file ./dirdat/aa000000012.
2017-11-27 09:32:25  INFO    OGG-01053  Oracle GoldenGate Capture for Oracle, ora12c16.prm:  Recovery completed for target file ./dirdat/aa000000013, at RBA 1535.
2017-11-27 09:32:25  INFO    OGG-01057  Oracle GoldenGate Capture for Oracle, ora12c16.prm:  Recovery completed for all targets.
2017-11-27 09:32:27  INFO    OGG-06507  Oracle GoldenGate Capture for Oracle, ora12c16.prm:  MAP (TABLE) resolved (entry OGG_USER.GGS_MARKER): TABLE "OGG_USER"."GGS_MARKER".
2017-11-27 09:32:28  INFO    OGG-06509  Oracle GoldenGate Capture for Oracle, ora12c16.prm:  Using the following key columns for source table OGG_USER.GGS_MARKER: SEQNO, FRAGMENTNO, OPTIME.
2017-11-27 09:32:29  INFO    OGG-01226  Oracle GoldenGate Capture for Oracle, ggpump.prm:  Socket buffer size set to 27985 (flush size 27985).
2017-11-27 09:32:29  INFO    OGG-01055  Oracle GoldenGate Capture for Oracle, ggpump.prm:  Recovery initialization completed for target file ./dirdat/bb000000025, at RBA 1629.
2017-11-27 09:32:29  INFO    OGG-01478  Oracle GoldenGate Capture for Oracle, ggpump.prm:  Output file ./dirdat/bb is using format RELEASE 12.2.
2017-11-27 09:32:30  INFO    OGG-01026  Oracle GoldenGate Capture for Oracle, ggpump.prm:  Rolling over remote file ./dirdat/bb000000026.
2017-11-27 09:32:31  INFO    OGG-01053  Oracle GoldenGate Capture for Oracle, ggpump.prm:  Recovery completed for target file ./dirdat/bb000000026, at RBA 850.
2017-11-27 09:32:31  INFO    OGG-01057  Oracle GoldenGate Capture for Oracle, ggpump.prm:  Recovery completed for all targets.
2017-11-27 09:32:31  INFO    OGG-02243  Oracle GoldenGate Capture for Oracle, ggpump.prm:  Opened trail file ./dirdat/aa000000012 at 2017-11-27 09:32:31.298588.
2017-11-27 09:32:31  INFO    OGG-02232  Oracle GoldenGate Capture for Oracle, ggpump.prm:  Switching to next trail file ./dirdat/aa000000013 at 2017-11-27 09:32:31.298588 due to EOF. with current RBA 1,535.
2017-11-27 09:32:31  INFO    OGG-01026  Oracle GoldenGate Capture for Oracle, ggpump.prm:  Rolling over remote file ./dirdat/bb000000027.
2017-11-27 09:34:06  INFO    OGG-00987  Oracle GoldenGate Command Interpreter for Oracle:  GGSCI command (oracle): info all.

Thursday, 22 October 2015

Delete obsolete backups with RMAN in Oracle 11g

The RMAN retention policy specifies how many copies of backup we need to retain, By default, the value is 1.
Setting this parameter to 2 ensures that the latest two copies of datafile or tablespace backups is retained.

Check the retention policy of database

RMAN> show retention policy;

using target database control file instead of recovery catalog
RMAN configuration parameters for database with db_unique_name TESTDB are:
CONFIGURE RETENTION POLICY TO REDUNDANCY 1; # default

Take the backup of tablespace or database twice. In this case we will take tablespace backup

RMAN> backup tablespace users;

Starting backup at 22-OCT-15
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=41 device type=DISK
channel ORA_DISK_1: starting full datafile backup set
channel ORA_DISK_1: specifying datafile(s) in backup set
input datafile file number=00004 name=+DATA/testdb/datafile/users.259.892594189
channel ORA_DISK_1: starting piece 1 at 22-OCT-15
channel ORA_DISK_1: finished piece 1 at 22-OCT-15
piece handle=/u01/app/backup/TESTDB_69_%1.bak tag=TAG20151022T230309 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:07
Finished backup at 22-OCT-15

RMAN> backup tablespace users;

Starting backup at 22-OCT-15
using channel ORA_DISK_1
channel ORA_DISK_1: starting full datafile backup set
channel ORA_DISK_1: specifying datafile(s) in backup set
input datafile file number=00004 name=+DATA/testdb/datafile/users.259.892594189
channel ORA_DISK_1: starting piece 1 at 22-OCT-15
channel ORA_DISK_1: finished piece 1 at 22-OCT-15
piece handle=/u01/app/backup/TESTDB_70_%1.bak tag=TAG20151022T230337 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:03
Finished backup at 22-OCT-15

Check whether we have obsolete backups

RMAN> report obsolete;

RMAN retention policy will be applied to the command
RMAN retention policy is set to redundancy 1
Report of obsolete backups and copies
Type                 Key    Completion Time    Filename/Handle
-------------------- ------ ------------------ --------------------
Backup Set           67     22-OCT-15        
  Backup Piece       67     22-OCT-15          /u01/app/backup/TESTDB_69_%1.bak

Delete the backup that does not satisfy retention policy:-

RMAN> delete noprompt obsolete;

RMAN retention policy will be applied to the command
RMAN retention policy is set to redundancy 1
using channel ORA_DISK_1
Deleting the following obsolete backups and copies:
Type                 Key    Completion Time    Filename/Handle
-------------------- ------ ------------------ --------------------
Backup Set           67     22-OCT-15        
  Backup Piece       67     22-OCT-15          /u01/app/backup/TESTDB_69_%1.bak
deleted backup piece
backup piece handle=/u01/app/backup/TESTDB_69_%1.bak RECID=67 STAMP=893804592
Deleted 1 objects


RMAN>

Backup database plus archivelog using RMAN in oracle


When one use the backup database plus archivelog command to back up archive logs, RMAN will perform the following operations in the sequence listed here:

  •  Run the "alter system archive log current" command.
  •  Run the "backup archivelog all" command.
  •  Back up the rest of the data files specified by the backup database command.
  •  Run the "alter system archive log current" command.
  •  Back up the new archive logs generated during the backup operation.

[oracle@oel6 ~]$ rman target /

Recovery Manager: Release 11.2.0.4.0 - Production on Thu Oct 22 22:40:28 2015

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

connected to target database: TESTDB (DBID=2675922698)

RMAN> backup database plus archivelog;

Starting backup at 22-OCT-15
current log archived
using target database control file instead of recovery catalog
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=56 device type=DISK
channel ORA_DISK_1: starting archived log backup set
channel ORA_DISK_1: specifying archived log(s) in backup set
input archived log thread=1 sequence=40 RECID=38 STAMP=893803250
channel ORA_DISK_1: starting piece 1 at 22-OCT-15
channel ORA_DISK_1: finished piece 1 at 22-OCT-15
piece handle=/u01/app/backup/TESTDB_65_%1.bak tag=TAG20151022T224054 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:07
Finished backup at 22-OCT-15

Starting backup at 22-OCT-15
using channel ORA_DISK_1
channel ORA_DISK_1: starting full datafile backup set
channel ORA_DISK_1: specifying datafile(s) in backup set
input datafile file number=00001 name=+DATA/testdb/datafile/system.256.892594189
input datafile file number=00002 name=+DATA/testdb/datafile/sysaux.257.892594189
input datafile file number=00004 name=+DATA/testdb/datafile/users.259.892594189
input datafile file number=00003 name=+DATA/testdb/datafile/undotbs1.258.892594189
channel ORA_DISK_1: starting piece 1 at 22-OCT-15
channel ORA_DISK_1: finished piece 1 at 22-OCT-15
piece handle=/u01/app/backup/TESTDB_66_%1.bak tag=TAG20151022T224104 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:01:45
channel ORA_DISK_1: starting full datafile backup set
channel ORA_DISK_1: specifying datafile(s) in backup set
including current control file in backup set
including current SPFILE in backup set
channel ORA_DISK_1: starting piece 1 at 22-OCT-15
channel ORA_DISK_1: finished piece 1 at 22-OCT-15
piece handle=/u01/app/backup/TESTDB_67_%1.bak tag=TAG20151022T224104 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:03
Finished backup at 22-OCT-15

Starting backup at 22-OCT-15
current log archived
using channel ORA_DISK_1
channel ORA_DISK_1: starting archived log backup set
channel ORA_DISK_1: specifying archived log(s) in backup set
input archived log thread=1 sequence=41 RECID=39 STAMP=893803395
channel ORA_DISK_1: starting piece 1 at 22-OCT-15
channel ORA_DISK_1: finished piece 1 at 22-OCT-15
piece handle=/u01/app/backup/TESTDB_68_%1.bak tag=TAG20151022T224317 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:03
Finished backup at 22-OCT-15

RMAN> 

Backup whole database in oracle 11g


Check the datafiles present in database

RMAN> report schema;

Report of database schema for database with db_unique_name TESTDB

List of Permanent Datafiles
===========================
File Size(MB) Tablespace           RB segs Datafile Name
---- -------- -------------------- ------- ------------------------
1    750      SYSTEM               ***     +DATA/testdb/datafile/system.256.892594189
2    530      SYSAUX               ***     +DATA/testdb/datafile/sysaux.257.892594189
3    55        UNDOTBS1          ***     +DATA/testdb/datafile/undotbs1.258.892594189
4    100      USERS                  ***     +DATA/testdb/datafile/users.259.892594189

List of Temporary Files
=======================
File Size(MB) Tablespace           Maxsize(MB) Tempfile Name
---- -------- -------------------- ----------- --------------------
1    20       TEMP                 32767       +DATA/testdb/tempfile/temp.268.892594713

RMAN> 

Take the backup of database. 

Note that the RMAN takes the backup of datafiles in decreasing order of its size. Also, the temp tablespace is not include in the backup strategy.

[oracle@oel6 ~]$ rman target /

Recovery Manager: Release 11.2.0.4.0 - Production on Thu Oct 22 22:18:07 2015

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

connected to target database: TESTDB (DBID=2675922698)

RMAN> backup database;

Starting backup at 22-OCT-15
using target database control file instead of recovery catalog
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=41 device type=DISK
channel ORA_DISK_1: starting full datafile backup set
channel ORA_DISK_1: specifying datafile(s) in backup set
input datafile file number=00001 name=+DATA/testdb/datafile/system.256.892594189
input datafile file number=00002 name=+DATA/testdb/datafile/sysaux.257.892594189
input datafile file number=00004 name=+DATA/testdb/datafile/users.259.892594189
input datafile file number=00003 name=+DATA/testdb/datafile/undotbs1.258.892594189
channel ORA_DISK_1: starting piece 1 at 22-OCT-15
channel ORA_DISK_1: finished piece 1 at 22-OCT-15
piece handle=/u01/app/backup/TESTDB_63_%1.bak tag=TAG20151022T221825 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:01:35
channel ORA_DISK_1: starting full datafile backup set
channel ORA_DISK_1: specifying datafile(s) in backup set
including current control file in backup set
including current SPFILE in backup set
channel ORA_DISK_1: starting piece 1 at 22-OCT-15
channel ORA_DISK_1: finished piece 1 at 22-OCT-15
piece handle=/u01/app/backup/TESTDB_64_%1.bak tag=TAG20151022T221825 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:03
Finished backup at 22-OCT-15

RMAN>

Backup of controlfile and spfile is always included in a full database backup.

Use the below command to list the available backups of database.

RMAN> list backup;

using target database control file instead of recovery catalog

List of Backup Sets
===================


BS Key  Type LV Size       Device Type Elapsed Time Completion Time
------- ---- -- ---------- ----------- ------------ ---------------
61      Full    1.01G      DISK        00:01:34     22-OCT-15      
        BP Key: 61   Status: AVAILABLE  Compressed: NO  Tag: TAG20151022T221825
        Piece Name: /u01/app/backup/TESTDB_63_%1.bak
  List of Datafiles in backup set 61
  File LV Type Ckp SCN    Ckp Time  Name
  ---- -- ---- ---------- --------- ----
  1       Full 1031184    22-OCT-15 +DATA/testdb/datafile/system.256.892594189
  2       Full 1031184    22-OCT-15 +DATA/testdb/datafile/sysaux.257.892594189
  3       Full 1031184    22-OCT-15 +DATA/testdb/datafile/undotbs1.258.892594189
  4       Full 1031184    22-OCT-15 +DATA/testdb/datafile/users.259.892594189

BS Key  Type LV Size       Device Type Elapsed Time Completion Time
------- ---- -- ---------- ----------- ------------ ---------------
62      Full    9.55M      DISK        00:00:17     22-OCT-15      
        BP Key: 62   Status: AVAILABLE  Compressed: NO  Tag: TAG20151022T221825
        Piece Name: /u01/app/backup/TESTDB_64_%1.bak
  SPFILE Included: Modification time: 22-OCT-15
  SPFILE db_unique_name: TESTDB
  Control File Included: Ckp SCN: 1031225      Ckp time: 22-OCT-15

RMAN> 


Convert the oracle database into archivelog mode

Suppose the database is currently running on noarchivelog mode. To ensure that all the changes in database are always protected one must enable archive logging of database. By converting the database mode, one must be able to perform media and instance recovery when required.

[oracle@oel6 ~]$ sqlplus / as sysdba

SQL*Plus: Release 11.2.0.4.0 Production on Thu Oct 22 21:35:38 2015

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


Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production
With the Partitioning, Automatic Storage Management, OLAP, Data Mining
and Real Application Testing options

SQL> select log_mode from v$database;

LOG_MODE
------------
NOARCHIVELOG

Start the database in mount state

SQL> shu immediate
Database closed.
Database dismounted.
ORACLE instance shut down.
SQL> startup mount
ORACLE instance started.

Total System Global Area  471830528 bytes
Fixed Size    2254344 bytes
Variable Size  197134840 bytes
Database Buffers  268435456 bytes
Redo Buffers    4005888 bytes
Database mounted.
SQL>

Set the archive destination and enable archiving

SQL> alter system set log_archive_dest_1='LOCATION=/u01/app/oracle/archive' scope=both;

System altered.

SQL> alter database archivelog;

Database altered.

Check that the archiving is enabled and destination is correct

SQL> archive log list
Database log mode       Archive Mode
Automatic archival       Enabled
Archive destination       /u01/app/oracle/archive
Oldest online log sequence     0
Next log sequence to archive   1
Current log sequence        1

Open the database

SQL> alter database open;

Database altered.

Perform a log switch and check the archivelog is generated at the location specified:-

SQL> alter system switch logfile;

System altered.

SQL> select name from v$archived_log;

NAME
----------------------------------------------------------
/u01/app/oracle/archive/1_1_892594586.dbf



ORA-19602: cannot backup or copy active file in NOARCHIVELOG mode

The backup of database fails with following error:-
ORA-19602: cannot backup or copy active file in NOARCHIVELOG mode

[oracle@oel6 ~]$ rman target /

Recovery Manager: Release 11.2.0.4.0 - Production on Thu Oct 22 21:22:26 2015

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

connected to target database: TESTDB (DBID=2675922698)

RMAN> backup database;

Starting backup at 22-OCT-15
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=43 device type=DISK
channel ORA_DISK_1: starting full datafile backup set
channel ORA_DISK_1: specifying datafile(s) in backup set
RMAN-03009: failure of backup command on ORA_DISK_1 channel at 10/22/2015 21:26:42
ORA-19602: cannot backup or copy active file in NOARCHIVELOG mode
continuing other job steps, job failed will not be re-run
channel ORA_DISK_1: starting full datafile backup set
channel ORA_DISK_1: specifying datafile(s) in backup set
including current control file in backup set
including current SPFILE in backup set
channel ORA_DISK_1: starting piece 1 at 22-OCT-15
channel ORA_DISK_1: finished piece 1 at 22-OCT-15
piece handle=/u01/app/backup/1sqkcick_1_1 tag=TAG20151022T212639 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:01:07
RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================

RMAN-03009: failure of backup command on ORA_DISK_1 channel at 10/22/2015 21:26:42
ORA-19602: cannot backup or copy active file in NOARCHIVELOG mode

RMAN>

This is because we cannot take online backup of datafiles when database is in NOARCHIVELOG mode.

[oracle@oel6 ~]$ sqlplus / as sysdba

SQL*Plus: Release 11.2.0.4.0 Production on Thu Oct 22 21:35:38 2015

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


Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production
With the Partitioning, Automatic Storage Management, OLAP, Data Mining
and Real Application Testing options

SQL> select log_mode from v$database;

LOG_MODE
------------
NOARCHIVELOG

SQL> 


The solution is to place the database into ARCHIVELOG mode.