Moneycontrol Brokerage Recos

Sunday, December 11, 2011

Database Backup Using RMAN including current controlfile and archivelogs

C:\>rman target /
Recovery Manager: Release 11.2.0.1.0 - Production on Sun Dec 11 00:27:36 2011
Copyright (c) 1982, 2009, Oracle and/or its affiliates.  All rights reserved.
connected to target database: TESTDB (DBID=1278452275)
RMAN> list incarnation of database
2> ;
using target database control file instead of recovery catalog
List of Database Incarnations
DB Key  Inc Key DB Name  DB ID            STATUS  Reset SCN  Reset Time
------- ------- -------- ---------------- --- ---------- ----------
1       1       TESTDB  1278452275       PARENT  1          02-APR-10
2       2       TESTDB  1278452275       CURRENT 940976     10-DEC-11
RMAN>
RMAN>
RMAN> list backupset;
specification does not match any backup in the repository
RMAN> backup as compressed backupset database include current controlfile plus archivelog delete input;


Starting backup at 11-DEC-11
current log archived
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=27 device type=DISK
channel ORA_DISK_1: starting compressed archived log backup set
channel ORA_DISK_1: specifying archived log(s) in backup set
input archived log thread=1 sequence=3 RECID=1 STAMP=769532924
input archived log thread=1 sequence=4 RECID=2 STAMP=769533898
input archived log thread=1 sequence=5 RECID=3 STAMP=769555449
input archived log thread=1 sequence=6 RECID=4 STAMP=769564042
input archived log thread=1 sequence=7 RECID=5 STAMP=769564076
input archived log thread=1 sequence=8 RECID=6 STAMP=769564095
input archived log thread=1 sequence=9 RECID=7 STAMP=769564115
input archived log thread=1 sequence=10 RECID=8 STAMP=769564133
input archived log thread=1 sequence=11 RECID=9 STAMP=769564287
input archived log thread=1 sequence=12 RECID=10 STAMP=769564335
input archived log thread=1 sequence=13 RECID=11 STAMP=769564365
input archived log thread=1 sequence=14 RECID=12 STAMP=769564407
input archived log thread=1 sequence=15 RECID=13 STAMP=769564447
input archived log thread=1 sequence=16 RECID=14 STAMP=769564511
input archived log thread=1 sequence=17 RECID=15 STAMP=769564598
input archived log thread=1 sequence=18 RECID=16 STAMP=769564666
input archived log thread=1 sequence=19 RECID=17 STAMP=769564836
input archived log thread=1 sequence=20 RECID=18 STAMP=769565147
input archived log thread=1 sequence=21 RECID=19 STAMP=769566519
channel ORA_DISK_1: starting piece 1 at 11-DEC-11
channel ORA_DISK_1: finished piece 1 at 11-DEC-11
piece handle=C:\APP\RAJKUMAR\FLASH_RECOVERY_AREA\TESTDB\BACKUPSET\2011_12_11\O1_MF_ANNNN_TAG20111211T002840_7G7B
ONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:55
channel ORA_DISK_1: deleting archived log(s)
archived log file name=C:\APP\RAJKUMAR\FLASH_RECOVERY_AREA\TESTDB\ARCHIVELOG\2011_12_10\O1_MF_1_3_7G6B51TC_.ARC
archived log file name=C:\APP\RAJKUMAR\FLASH_RECOVERY_AREA\TESTDB\ARCHIVELOG\2011_12_10\O1_MF_1_4_7G6C3LF5_.ARC
archived log file name=C:\APP\RAJKUMAR\FLASH_RECOVERY_AREA\TESTDB\ARCHIVELOG\2011_12_10\O1_MF_1_5_7G70507T_.ARC
archived log file name=C:\APP\RAJKUMAR\FLASH_RECOVERY_AREA\TESTDB\ARCHIVELOG\2011_12_10\O1_MF_1_6_7G78KJ6C_.ARC
archived log file name=C:\APP\RAJKUMAR\FLASH_RECOVERY_AREA\TESTDB\ARCHIVELOG\2011_12_10\O1_MF_1_7_7G78LK8S_.ARC
archived log file name=C:\APP\RAJKUMAR\FLASH_RECOVERY_AREA\TESTDB\ARCHIVELOG\2011_12_10\O1_MF_1_8_7G78M4J3_.ARC
archived log file name=C:\APP\RAJKUMAR\FLASH_RECOVERY_AREA\TESTDB\ARCHIVELOG\2011_12_10\O1_MF_1_9_7G78MR3F_.ARC
archived log file name=C:\APP\RAJKUMAR\FLASH_RECOVERY_AREA\TESTDB\ARCHIVELOG\2011_12_10\O1_MF_1_10_7G78NBVC_.ARC
archived log file name=C:\APP\RAJKUMAR\FLASH_RECOVERY_AREA\TESTDB\ARCHIVELOG\2011_12_10\O1_MF_1_11_7G78S40Z_.ARC
archived log file name=C:\APP\RAJKUMAR\FLASH_RECOVERY_AREA\TESTDB\ARCHIVELOG\2011_12_10\O1_MF_1_12_7G78TNPG_.ARC
archived log file name=C:\APP\RAJKUMAR\FLASH_RECOVERY_AREA\TESTDB\ARCHIVELOG\2011_12_10\O1_MF_1_13_7G78VM7B_.ARC
archived log file name=C:\APP\RAJKUMAR\FLASH_RECOVERY_AREA\TESTDB\ARCHIVELOG\2011_12_10\O1_MF_1_14_7G78WXNZ_.ARC
archived log file name=C:\APP\RAJKUMAR\FLASH_RECOVERY_AREA\TESTDB\ARCHIVELOG\2011_12_10\O1_MF_1_15_7G78Y4SD_.ARC
archived log file name=C:\APP\RAJKUMAR\FLASH_RECOVERY_AREA\TESTDB\ARCHIVELOG\2011_12_10\O1_MF_1_16_7G79041G_.ARC
archived log file name=C:\APP\RAJKUMAR\FLASH_RECOVERY_AREA\TESTDB\ARCHIVELOG\2011_12_10\O1_MF_1_17_7G792VRW_.ARC
archived log file name=C:\APP\RAJKUMAR\FLASH_RECOVERY_AREA\TESTDB\ARCHIVELOG\2011_12_10\O1_MF_1_18_7G7950F5_.ARC
archived log file name=C:\APP\RAJKUMAR\FLASH_RECOVERY_AREA\TESTDB\ARCHIVELOG\2011_12_11\O1_MF_1_19_7G79B9FO_.ARC
archived log file name=C:\APP\RAJKUMAR\FLASH_RECOVERY_AREA\TESTDB\ARCHIVELOG\2011_12_11\O1_MF_1_20_7G79N2SW_.ARC
archived log file name=C:\APP\RAJKUMAR\FLASH_RECOVERY_AREA\TESTDB\ARCHIVELOG\2011_12_11\O1_MF_1_21_7G7BYXJ3_.ARC
Finished backup at 11-DEC-11
Starting backup at 11-DEC-11
using channel ORA_DISK_1
channel ORA_DISK_1: starting compressed full datafile backup set
channel ORA_DISK_1: specifying datafile(s) in backup set
input datafile file number=00001 name=C:\APP\RAJKUMAR\ORADATA\TESTDB\SYSTEM01.DBF
input datafile file number=00002 name=C:\APP\RAJKUMAR\ORADATA\TESTDB\SYSAUX01.DBF
input datafile file number=00003 name=C:\APP\RAJKUMAR\ORADATA\TESTDB\UNDOTBS01.DBF
input datafile file number=00005 name=C:\APP\RAJKUMAR\ORADATA\TESTDB\EXAMPLE01.DBF
input datafile file number=00004 name=C:\APP\RAJKUMAR\ORADATA\TESTDB\USERS01.DBF
channel ORA_DISK_1: starting piece 1 at 11-DEC-11
channel ORA_DISK_1: finished piece 1 at 11-DEC-11
piece handle=C:\APP\RAJKUMAR\FLASH_RECOVERY_AREA\TESTDB\BACKUPSET\2011_12_11\O1_MF_NNNDF_TAG20111211T002942_7G7C
ONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:01:35
channel ORA_DISK_1: starting compressed 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 11-DEC-11
channel ORA_DISK_1: finished piece 1 at 11-DEC-11
piece handle=C:\APP\RAJKUMAR\FLASH_RECOVERY_AREA\TESTDB\BACKUPSET\2011_12_11\O1_MF_NCSNF_TAG20111211T002942_7G7C
ONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:02
Finished backup at 11-DEC-11
Starting backup at 11-DEC-11
current log archived
using channel ORA_DISK_1
channel ORA_DISK_1: starting compressed archived log backup set
channel ORA_DISK_1: specifying archived log(s) in backup set
input archived log thread=1 sequence=22 RECID=20 STAMP=769566681
channel ORA_DISK_1: starting piece 1 at 11-DEC-11
channel ORA_DISK_1: finished piece 1 at 11-DEC-11
piece handle=C:\APP\RAJKUMAR\FLASH_RECOVERY_AREA\TESTDB\BACKUPSET\2011_12_11\O1_MF_ANNNN_TAG20111211T003121_7G7C
ONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:01
channel ORA_DISK_1: deleting archived log(s)
archived log file name=C:\APP\RAJKUMAR\FLASH_RECOVERY_AREA\TESTDB\ARCHIVELOG\2011_12_11\O1_MF_1_22_7G7C41HN_.ARC
Finished backup at 11-DEC-11
RMAN>

Manually Configure Oracle 11gR2 Enterprise Manager Database Control

Here I have outlined the steps to configure Oracle 11g R2 OEM manually:

C:\>emca -deconfig dbcontrol db -repos drop
STARTED EMCA at Dec 10, 2011 11:45:23 PM
EM Configuration Assistant, Version 11.2.0.0.2 Production
Copyright (c) 2003, 2005, Oracle.  All rights reserved.
Enter the following information:
Database SID: TESTDB
Listener port number: 1521
Password for SYS user:
Password for SYSMAN user:
Password for SYSMAN user:
Do you wish to continue? [yes(Y)/no(N)]: y
Dec 10, 2011 11:45:58 PM oracle.sysman.emcp.EMConfig perform
INFO: This operation is being logged at C:\app\RAJKUMAR\cfgtoollogs\emca\TESTDB\emca_2011_12_10_23_45_22.log.
Dec 10, 2011 11:45:59 PM oracle.sysman.emcp.util.DBControlUtil stopOMS
INFO: Stopping Database Control (this may take a while) ...
Dec 10, 2011 11:46:08 PM oracle.sysman.emcp.ParamsManager checkListenerStatusForDBControl
WARNING: Error initializing SQL connection. SQL operations cannot be performed
Dec 10, 2011 11:46:08 PM oracle.sysman.emcp.EMReposConfig invoke
INFO: Dropping the EM repository (this may take a while) ...
Dec 10, 2011 11:49:29 PM oracle.sysman.emcp.EMReposConfig invoke
INFO: Repository successfully dropped
Enterprise Manager configuration completed successfully
FINISHED EMCA at Dec 10, 2011 11:49:39 PM
C:\>emca -repos create
STARTED EMCA at Dec 10, 2011 11:50:48 PM
EM Configuration Assistant, Version 11.2.0.0.2 Production
Copyright (c) 2003, 2005, Oracle.  All rights reserved.
Enter the following information:
Database SID: TESTDB
Listener port number: 1521
Password for SYS user:
Password for SYSMAN user:  s
Password for SYSMAN user:
Do you wish to continue? [yes(Y)/no(N)]: y
Dec 10, 2011 11:51:08 PM oracle.sysman.emcp.EMConfig perform
INFO: This operation is being logged at C:\app\RAJKUMAR\cfgtoollogs\emca\TESTDB\emca_2011_12_10_23_50_48.log.
Dec 10, 2011 11:51:08 PM oracle.sysman.emcp.EMReposConfig createRepository
INFO: Creating the EM repository (this may take a while) ...
Dec 11, 2011 12:00:57 AM oracle.sysman.emcp.EMReposConfig invoke
INFO: Repository successfully created
Enterprise Manager configuration completed successfully
FINISHED EMCA at Dec 11, 2011 12:00:57 AM


C:\>emca -config dbcontrol db
STARTED EMCA at Dec 11, 2011 12:06:01 AM
EM Configuration Assistant, Version 11.2.0.0.2 Production
Copyright (c) 2003, 2005, Oracle.  All rights reserved.
Enter the following information:
Database SID: TESTDB
Listener port number: 1521
Listener ORACLE_HOME [ C:\app\RAJKUMAR\product\11.2.0\dbhome_1 ]:
Password for SYS user:
Password for DBSNMP user:
Password for SYSMAN user:
Invalid username/password.
Password for SYSMAN user:
Password for SYSMAN user: Email address for notifications (optional):
Outgoing Mail (SMTP) server for notifications (optional):
-----------------------------------------------------------------
You have specified the following settings
Database ORACLE_HOME ................ C:\app\RAJKUMAR\product\11.2.0\dbhome_1
Local hostname ................ RAJKUMAR
Listener ORACLE_HOME ................ C:\app\RAJKUMAR\product\11.2.0\dbhome_1
Listener port number ................ 1521
Database SID ................ TESTDB
Email address for notifications ...............
Outgoing Mail (SMTP) server for notifications ...............
-----------------------------------------------------------------
Do you wish to continue? [yes(Y)/no(N)]: y
Dec 11, 2011 12:06:43 AM oracle.sysman.emcp.EMConfig perform
INFO: This operation is being logged at C:\app\RAJKUMAR\cfgtoollogs\emca\TESTDB\emca_2011_12_11_00_06_01.log.
Dec 11, 2011 12:07:01 AM oracle.sysman.emcp.EMReposConfig uploadConfigDataToRepository
INFO: Uploading configuration data to EM repository (this may take a while) ...
Dec 11, 2011 12:08:44 AM oracle.sysman.emcp.EMReposConfig invoke
INFO: Uploaded configuration data successfully
Dec 11, 2011 12:09:08 AM oracle.sysman.emcp.util.DBControlUtil configureSoftwareLib
INFO: Software library configured successfully.
Dec 11, 2011 12:09:08 AM oracle.sysman.emcp.EMDBPostConfig configureSoftwareLibrary
INFO: Deploying Provisioning archives ...
Dec 11, 2011 12:10:23 AM oracle.sysman.emcp.EMDBPostConfig configureSoftwareLibrary
INFO: Provisioning archives deployed successfully.
Dec 11, 2011 12:10:23 AM oracle.sysman.emcp.util.DBControlUtil secureDBConsole
INFO: Securing Database Control (this may take a while) ...
Dec 11, 2011 12:10:52 AM oracle.sysman.emcp.util.DBControlUtil secureDBConsole
INFO: Database Control secured successfully.
Dec 11, 2011 12:10:52 AM oracle.sysman.emcp.util.DBControlUtil startOMS
INFO: Starting Database Control (this may take a while) ...
Dec 11, 2011 12:12:38 AM oracle.sysman.emcp.EMDBPostConfig performConfiguration
INFO: Database Control started successfully
Dec 11, 2011 12:12:39 AM oracle.sysman.emcp.EMDBPostConfig performConfiguration
INFO: >>>>>>>>>>> The Database Control URL is https://RAJKUMAR:1158/em <<<<<<<<<<<
Dec 11, 2011 12:12:43 AM oracle.sysman.emcp.EMDBPostConfig invoke
WARNING:
************************  WARNING  ************************
Management Repository has been placed in secure mode wherein Enterprise Manager data will be encrypted.  The encryption key has been placed in the file: C:/app/
RAJKUMAR/product/11.2.0/dbhome_1/RAJKUMAR_TESTDB/sysman/config/emkey.ora.   Please ensure this file is backed up as the encrypted data will become unusabl
e if this file is lost.
***********************************************************
Enterprise Manager configuration completed successfully
FINISHED EMCA at Dec 11, 2011 12:12:44 AM

Hope it would help someone....