Thursday, February 6, 2014

RMAN BACKUP On Database No Archive Mode


RMAN BACKUP On Database  No Archive Mode
========================================

When Database in No archive Mode we only can take consistent Backup by RMAN
Here the following step take consistent Backup by RMAN
 Step-1 : Start RMAN and connect to a target database.
  Step-2: Shut down the database consistently and then mount it.
Step-3: Run the BACKUP DATABASE command.
Step-4: Open the database and resume normal operations.

Here  Given Below Issue the Command and Output the Result

RMAN> connect target /

connected to target database: TESTDB (DBID=2598668270)
using target database control file instead of recovery catalog


Before Issue the Database Backup Command we check the RMAN Configuration


RMAN> show all ;

RMAN configuration parameters for database with db_unique_name TESTDB are:
CONFIGURE RETENTION POLICY TO REDUNDANCY 1; # default
CONFIGURE BACKUP OPTIMIZATION OFF; # default
CONFIGURE DEFAULT DEVICE TYPE TO DISK; # default
CONFIGURE CONTROLFILE AUTOBACKUP OFF; # default
CONFIGURE CONTROLFILE AUTOBACKUP FORMAT FOR DEVICE TYPE DISK TO '%F'; # default
CONFIGURE DEVICE TYPE DISK PARALLELISM 1 BACKUP TYPE TO BACKUPSET; # default
CONFIGURE DATAFILE BACKUP COPIES FOR DEVICE TYPE DISK TO 1; # default
CONFIGURE ARCHIVELOG BACKUP COPIES FOR DEVICE TYPE DISK TO 1; # default
CONFIGURE MAXSETSIZE TO UNLIMITED; # default
CONFIGURE ENCRYPTION FOR DATABASE OFF; # default
CONFIGURE ENCRYPTION ALGORITHM 'AES128'; # default
CONFIGURE COMPRESSION ALGORITHM 'BASIC' AS OF RELEASE 'DEFAULT' OPTIMIZE FOR LOAD TRUE ; # default
CONFIGURE ARCHIVELOG DELETION POLICY TO NONE; # default
CONFIGURE SNAPSHOT CONTROLFILE NAME TO 'D:\APP\USER\PRODUCT\11.2.0\DBHOME_1\DATABASE\SNCFTESTDB.ORA'; # default

RMAN>

Then Issue Shutdown Command


RMAN> shutdown immediate;

database closed
database dismounted
Oracle instance shut down

RMAN> startup force dba;

Oracle instance started
database mounted
database opened

Total System Global Area     535662592 bytes

Fixed Size                     1375792 bytes
Variable Size                327156176 bytes
Database Buffers             201326592 bytes
Redo Buffers                   5804032 bytes

RMAN> shutdown immediate;

database closed
database dismounted
Oracle instance shut down

RMAN> startup mount;

connected to target database (not started)
Oracle instance started
database mounted

Total System Global Area     535662592 bytes

Fixed Size                     1375792 bytes
Variable Size                327156176 bytes
Database Buffers             201326592 bytes
Redo Buffers                   5804032 bytes

Issue the given below command full Database backup

RMAN> backup database;

Starting backup at 06-FEB-14
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=63 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=D:\APP\USER\TESTDB\SYSTEM01.DBF
input datafile file number=00002 name=D:\APP\USER\TESTDB\SYSAUX01.DBF
input datafile file number=00003 name=D:\APP\USER\TESTDB\UNDOTBS01.DBF
input datafile file number=00005 name=D:\APP\USER\TESTDB\EXAMPLE01.DBF
input datafile file number=00004 name=D:\APP\USER\TESTDB\USERS01.DBF
channel ORA_DISK_1: starting piece 1 at 06-FEB-14
channel ORA_DISK_1: finished piece 1 at 06-FEB-14
piece handle=D:\APP\USER\FLASH_RECOVERY_AREA\TESTDB\BACKUPSET\2014_02_06\O1_MF_NNNDF_TAG20140206T180300_9H6YHOS4_.BKP tag=TAG20140206T180300 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:55
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 06-FEB-14
channel ORA_DISK_1: finished piece 1 at 06-FEB-14
piece handle=D:\APP\USER\FLASH_RECOVERY_AREA\TESTDB\BACKUPSET\2014_02_06\O1_MF_NCSNF_TAG20140206T180300_9H6YKG2K_.BKP tag=TAG20140206T180300 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:01
Finished backup at 06-FEB-14

The following variation of the command creates image copy backups of all datafiles in the database:

RMAN> backup as copy database;

Starting backup at 06-FEB-14
using channel ORA_DISK_1
channel ORA_DISK_1: starting datafile copy
input datafile file number=00001 name=D:\APP\USER\TESTDB\SYSTEM01.DBF
output file name=D:\APP\USER\FLASH_RECOVERY_AREA\TESTDB\DATAFILE\O1_MF_SYSTEM_9H6ZR1FJ_.DBF tag=TAG20140206T182433 RECID=2 STAMP=838837492
channel ORA_DISK_1: datafile copy complete, elapsed time: 00:00:25
channel ORA_DISK_1: starting datafile copy
input datafile file number=00002 name=D:\APP\USER\TESTDB\SYSAUX01.DBF
output file name=D:\APP\USER\FLASH_RECOVERY_AREA\TESTDB\DATAFILE\O1_MF_SYSAUX_9H6ZRTM6_.DBF tag=TAG20140206T182433 RECID=3 STAMP=838837518
channel ORA_DISK_1: datafile copy complete, elapsed time: 00:00:25
channel ORA_DISK_1: starting datafile copy
input datafile file number=00003 name=D:\APP\USER\TESTDB\UNDOTBS01.DBF
output file name=D:\APP\USER\FLASH_RECOVERY_AREA\TESTDB\DATAFILE\O1_MF_UNDOTBS1_9H6ZSMS2_.DBF tag=TAG20140206T182433 RECID=4 STAMP=838837531
channel ORA_DISK_1: datafile copy complete, elapsed time: 00:00:15
channel ORA_DISK_1: starting datafile copy
input datafile file number=00005 name=D:\APP\USER\TESTDB\EXAMPLE01.DBF
output file name=D:\APP\USER\FLASH_RECOVERY_AREA\TESTDB\DATAFILE\O1_MF_EXAMPLE_9H6ZT301_.DBF tag=TAG20140206T182433 RECID=5 STAMP=838837542
channel ORA_DISK_1: datafile copy complete, elapsed time: 00:00:08
channel ORA_DISK_1: starting datafile copy
input datafile file number=00004 name=D:\APP\USER\TESTDB\USERS01.DBF
output file name=D:\APP\USER\FLASH_RECOVERY_AREA\TESTDB\DATAFILE\O1_MF_USERS_9H6ZTB6G_.DBF tag=TAG20140206T182433 RECID=6 STAMP=838837546
channel ORA_DISK_1: datafile copy complete, elapsed time: 00:00:01
channel ORA_DISK_1: starting datafile copy
copying current control file
output file name=D:\APP\USER\FLASH_RECOVERY_AREA\TESTDB\CONTROLFILE\O1_MF_TAG20140206T182433_9H6ZTC9R_.CTL tag=TAG20140206T182433 RECID=7 STAMP=838837547
channel ORA_DISK_1: datafile copy complete, elapsed time: 00:00:01
channel ORA_DISK_1: starting full datafile backup set
channel ORA_DISK_1: specifying datafile(s) in backup set
including current SPFILE in backup set
channel ORA_DISK_1: starting piece 1 at 06-FEB-14
channel ORA_DISK_1: finished piece 1 at 06-FEB-14
piece handle=D:\APP\USER\FLASH_RECOVERY_AREA\TESTDB\BACKUPSET\2014_02_06\O1_MF_NNSNF_TAG20140206T182433_9H6ZTDDZ_.BKP tag=TAG20140206T182433 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:01
Finished backup at 06-FEB-14

RMAN> ALTER DATABASE OPEN;

database opened

RMAN>

Happy Reading.......



RMAN Connection step

Basic RMAN Connection step  in window:
===========================
======

Open windows CMD Tools and write rman for call the Oracle Utility tools for Backup and recovery purpose.
And connect the target database that while you want to take backup.
C:\Users\user>rman

Recovery Manager: Release 11.2.0.1.0 - Production on Thu Feb 6 15:51:15 2014

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

RMAN> conn target sys@testdb

RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-00558: error encountered while parsing input commands
RMAN-01009: syntax error: found "identifier": expecting one of: "advise, allocate, alter, backup, @, catalog, change, configure, connect, convert, copy, create, crosscheck, delete, drop, duplicate, exit, flashback, grant, host, import, list, mount, open, print, quit, recover, register, release, repair, replace, report, reset, restore, resync, revoke, run, send, set, show, shutdown, spool, sql, startup, switch, transport, unregister, upgrade, validate, {, "
RMAN-01008: the bad identifier was: conn
RMAN-01007: at line 1 column 1 file: standard input

Above rman connect command syntax are not connect database and return the error for I mistake the command "Connect" as " Conn" as like think as sql*plus.

So write again  correct rman connect command with target database name string: 

RMAN> connect target sys@testdb

target database Password:
connected to target database: TESTDB (DBID=2598668270)

RMAN> exit  

The following variation starts RMAN and then connects to a target database by using operating system authentication:

C:\Users\user>rman

Recovery Manager: Release 11.2.0.1.0 - Production on Thu Feb 6 15:53:39 2014

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

RMAN> connect target /

connected to target database: TESTDB (DBID=2598668270)





if you want to exit from the RMAN  then write the exit command
RMAN> exit


Recovery Manager complete.

If you want to RMAN session Result output in text file. You are doing follwing step:

The following example appends the output from an RMAN session to a text file at

C:\Users\user>rman target / log d:/rmanlog06022014.log append
RMAN> connect target /
RMAN> show all;
RMAN> exit


Happy Reading............

Wednesday, February 5, 2014

Archive Log Mode Oracle 10g/11g Enable and Disable Step

 Archive Log Mode 10g/11g Enable and Disable

[oracle@rnddba ~]$ export ORACLE_SID=eradb11g
[oracle@rnddba ~]$
[oracle@rnddba ~]$
[oracle@rnddba ~]$
[oracle@rnddba ~]$ sqlplus /nolog

SQL*Plus: Release 11.2.0.1.0 Production on Wed Feb 5 06:07:24 2014

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

SQL> conn / as sysdba
Connected.

Check The database is archive mode or No Archive mode

SQL> archive log list
Database log mode           No Archive Mode
Automatic archival           Disabled
Archive destination           USE_DB_RECOVERY_FILE_DEST
Oldest online log sequence     88
Current log sequence           90

Check the archive log file destination path and size

SQL> show parameter recovery_file_dest

NAME                     TYPE     VALUE
------------------------------------ ----------- ------------------------------
db_recovery_file_dest             string     /u01/app/oracle/flash_recovery
                         _area
db_recovery_file_dest_size         big integer 8480M

By default, archive logs will be written to the flash recovery area. If you do not want to write archive logs  to the flash recovery area you can set the parameter LOG_ARCHIVE_DEST_n to the location in which you wish to
write archive logs.

[root@rnddba ~]# mkdir /u02/eradb11g/fraeradb11g
[root@rnddba ~]# chown -R oracle:oinstall /u02/eradb11g/fraeradb11g
[root@rnddba ~]# chmod -R 775 /u02/eradb11g/fraeradb11g

SQL> alter system set log_archive_dest_1='LOCATION=/u02/eradb11g/fraeradb11g' scope = both;

SQL> show parameter log_archive_dest

NAME                     TYPE     VALUE
------------------------------------ ----------- ------------------------------
log_archive_dest             string
log_archive_dest_1             string     LOCATION=/u02/eradb11g/fraerad
                         b11g
SQL> archive log list
Database log mode           No Archive Mode
Automatic archival           Disabled
Archive destination           /u02/eradb11g/fraeradb11g
Oldest online log sequence     88
Current log sequence           90

Before doing Database archive mode please take consistent mode database backup for future recovery purpose.

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

Total System Global Area 3991842816 bytes
Fixed Size            2219512 bytes
Variable Size         2919236104 bytes
Database Buffers     1056964608 bytes
Redo Buffers           13422592 bytes
Database mounted.

SQL> alter database archivelog;

Database altered.

SQL> alter database open;

Database altered.

SQL> archive log list
Database log mode           Archive Mode
Automatic archival           Enabled
Archive destination           /u02/eradb11g/fraeradb11g
Oldest online log sequence     88
Next log sequence to archive   90
Current log sequence           90

You can switch to the log file to see that an archive is written to archive log location.
SQL> alter system switch logfile;

Check the archive log file in archive destination location
SQL> host
[oracle@rnddba ~]$ ls /u02/eradb11g/fraeradb11g/
1_90_821585333.dbf
[oracle@rnddba ~]$ exit
exit


Doing Database No Archive Mode
===============================

Note: It is recommended to perform a backup of the database (after a shutdown normal or immediate) prior to changing the archive status of a database.

The following are the steps required to disable archive log mode on an Oracle 10g or 11g database.
[oracle@rnddba ~]$ sqlplus / as sysdba

SQL*Plus: Release 11.2.0.1.0 Production on Wed Feb 5 07:03:53 2014

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


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

SQL> archive log list
Database log mode           Archive Mode
Automatic archival           Enabled
Archive destination           /u02/eradb11g/fraeradb11g
Oldest online log sequence     89
Next log sequence to archive   91
Current log sequence           91

SQL> shutdown immediate
Database closed.
Database dismounted.
ORACLE instance shut down.

SQL> startup mount
ORACLE instance started.

Total System Global Area 3991842816 bytes
Fixed Size            2219512 bytes
Variable Size         2919236104 bytes
Database Buffers     1056964608 bytes
Redo Buffers           13422592 bytes
Database mounted.
SQL> alter database noarchivelog;

Database altered.

SQL> archive log list
Database log mode           No Archive Mode
Automatic archival           Disabled
Archive destination           /u02/eradb11g/fraeradb11g
Oldest online log sequence     89
Current log sequence           91
SQL>

Thanks For Updating....