How Retention Policy works if we set RECOVERY WINDOW for N days
For an example If we are taking L0 backup on Sunday and L1 incremental backup over the week day from Monday to Saturday
If we set RECOVERY WINDOW OF 1 DAYS, it Means RMAN would not consider the incremental level backups which we took on weekdays as obsolete. The previous L0(Sunday) and L1 incremental backups will exist for a week until next L1 backup starts after next Sunday L0.
The below diagram will explain in More detail
Thursday, 9 June 2016
Thursday, 2 June 2016
How to Disable Inactivity Log Out in Enterprise Manager Cloud Control 12c
/app/oracle/Middleware/oms/sysman/config
Add the following line after the last line in the above file
oracle.sysman.eml.maxInactiveTime=1440
Restart your OMS using below commands
$OMS_HOME/bin/emctl stop oms
$OMS_HOME/bin/emctl start oms
Wednesday, 1 June 2016
Registered
database with RMAN
[oracle@testserver]$ . oraenv
ORACLE_SID
= [+ASM1] ? PTEST
The
/u01/app/oracle/product/10.2.0/db_1/bin/orabase binary does not exist
You
can set ORACLE_BASE manually if it is required.
[oracle@testserver]$ rman target / catalog rcat@rmaN
Recovery Manager:
Release 10.2.0.5.0 - Production on Mon Mar 23 09:08:35 2015
Copyright (c) 1982,
2007, Oracle. All rights reserved.
connected to target
database: PTEST (DBID=1011970264)
recovery catalog
database Password:
connected to recovery
catalog database
RMAN> register database;
Once it is registered, login to RMAN database and run the below query to check the registered database.
select * from rcat.rc_database;
Shell Script to Purge Audit trail
#!/bin/bash
export ORATAB=/etc/oratab
export PATH=/usr/local/bin:/usr/sbin:$PATH
export SQLDIR=/home/oracle/scripts/Maintanence_script
export DATE=`date +%y%m%d`
ps -ef|grep -v grep|grep pmon|awk '{printf(substr($8,10)"\n")}' | while read DBSID
do
ORACLE_SID=$DBSID
export ORACLE_SID=$DBSID
echo Removing older trace file greater than 15 days ${ORACLE_SID}.....
find /app/oracle/admin/${ORACLE_SID}/adump/*.aud -type f -mtime +15 -exec rm -f {} \;
done
exit;
Tuesday, 31 May 2016
RMAN Backup script to create Physical Standby DB
export ORACLE_HOME=/app/oracle/11.2.0
export ORACLE_SID=Cxxx1
BOX=`uname -a | awk '{print$2}'`
DAYNAM=`date | awk '{print$1}'`
# ----------------------------------
date
# ----------------------------------
rman nocatalog log=/home/oracle/scripts/full_backup_ARCHIVE.log <<EOF
connect target sys/erseee
run{
sql "alter system switch logfile";
allocate channel ch1 type disk format '/home/oracle/datapump/Cxxx1/Primary_bkp_for_stndby_%U';
backup as compressed backupset database plus archivelog;
backup as compressed backupset current controlfile for standby;
sql "alter system archive log current";
}
exit;
EOF
RMAN Commands
List of the backup controlfile
#################################
list backup of controlfile;
list backup of controlfile completed between "to_date('04/17/2015','mm/dd/yyyy')" and "to_date('04/20/2015','mm/dd/yyyy')";
List of the backup
######################
list backup;
list archivelog all;
list backup of archivelog time between "to_date('02-JAN-2009 00:00:00','DD-MON-YYYY HH24:MI:SS')" and "to_date('03-JAN-2009 00:00:00','DD-MON-YYYY HH24:MI:SS')"
list backup of database completed between "to_date('04/17/2015','mm/dd/yyyy')" and "to_date('04/18/2015','mm/dd/yyyy')";
snapshot controlfile
############################
show snapshot controlfile name;
This will delete all the archive log before SYSDATE-2
######################################################
delete noprompt force archivelog until time 'SYSDATE-2';
Rman config
#############
show all;
List of the backup controlfile
#################################
list backup of controlfile;
list backup of controlfile completed between "to_date('04/17/2015','mm/dd/yyyy')" and "to_date('04/20/2015','mm/dd/yyyy')";
List of the backup
######################
list backup;
list archivelog all;
list backup of archivelog time between "to_date('02-JAN-2009 00:00:00','DD-MON-YYYY HH24:MI:SS')" and "to_date('03-JAN-2009 00:00:00','DD-MON-YYYY HH24:MI:SS')"
list backup of database completed between "to_date('04/17/2015','mm/dd/yyyy')" and "to_date('04/18/2015','mm/dd/yyyy')";
snapshot controlfile
############################
show snapshot controlfile name;
This will delete all the archive log before SYSDATE-2
######################################################
delete noprompt force archivelog until time 'SYSDATE-2';
Rman config
#############
show all;
Upgrading
database to 11.2.0.4 from 11.2.0.3
1. Take a backup of the
database before upgrading the database.
3.
Unzip the files
unzip
p13390677_112040_Linux-x86-64_1of7.zip -d oracle114
unzip p13390677_112040_Linux-x86-64_2of7.zip
-d oracle114
4. Complete
the pre-requisite steps noted in this MOS Doc ID 884522.1
5. As mentioned in the MOS Doc ID 884522.1, download the script for the pre-requiste and
execute in the database which needs to be upgrade
Connect to the 11.2.0.3 Vision database
and execute and the script utlu112i_11204_009.sql
$
sqlplus '/ as sysdba'
SQL>
spool upgrade_info.log
SQL>
@utlu112i_11204_009.sql
Below is the output of the script, sort
out any issue mentioned in the log file and recommendations as well before
upgrades start
Oracle
Database 11.2 Pre-Upgrade Information Tool 02-26-2016 12:58:47
Script
Version: 11.2.0.4.0 Build: 009
.
**********************************************************************
Database:
**********************************************************************
-->
name: XXXXX
-->
version: 11.2.0.3.0
-->
compatible: 11.2.0.0.0
-->
blocksize: 8192
-->
platform: Linux x86 64-bit
-->
timezone file: V14
.
**********************************************************************
Tablespaces:
[make adjustments in the current environment]
**********************************************************************
-->
SYSTEM tablespace is adequate for the upgrade.
....
minimum required size: 962 MB
-->
SYSAUX tablespace is adequate for the upgrade.
....
minimum required size: 755 MB
-->
UNDOTBS1 tablespace is adequate for the upgrade.
....
minimum required size: 400 MB
-->
TEMP tablespace is adequate for the upgrade.
....
minimum required size: 60 MB
.
**********************************************************************
Flashback:
OFF
**********************************************************************
**********************************************************************
Update
Parameters: [Update Oracle Database 11.2 init.ora or spfile]
Note:
Pre-upgrade tool was run on a lower version 64-bit database.
**********************************************************************
-->
If Target Oracle is 32-Bit, refer here for Update Parameters:
-- No
update parameter changes are required.
.
-->
If Target Oracle is 64-Bit, refer here for Update Parameters:
-- No update
parameter changes are required.
.
**********************************************************************
Renamed
Parameters: [Update Oracle Database 11.2 init.ora or spfile]
**********************************************************************
-- No
renamed parameters found. No changes are required.
.
**********************************************************************
Obsolete/Deprecated
Parameters: [Update Oracle Database 11.2 init.ora or spfile]
**********************************************************************
-- No
obsolete parameters found. No changes are required
.
**********************************************************************
Components:
[The following database components will be upgraded or installed]
**********************************************************************
-->
Oracle Catalog Views
[upgrade] VALID
-->
Oracle Packages and Types
[upgrade] VALID
-->
JServer JAVA Virtual Machine [upgrade]
VALID
-->
Oracle XDK for Java
[upgrade] VALID
-->
Oracle Workspace Manager
[upgrade] VALID
-->
OLAP Analytic Workspace
[upgrade] VALID
-->
OLAP Catalog
[upgrade] VALID
-->
EM Repository
[upgrade] VALID
-->
Oracle Text
[upgrade] VALID
-->
Oracle XML Database
[upgrade] VALID
-->
Oracle Java Packages
[upgrade] VALID
-->
Oracle interMedia
[upgrade] VALID
-->
Spatial [upgrade] VALID
-->
Expression Filter
[upgrade] VALID
-->
Rule Manager
[upgrade] VALID
-->
Oracle Application Express
[upgrade] VALID
...
APEX will only be upgraded if the version of APEX in
...
the target Oracle home is higher than the current one.
-->
Oracle OLAP API
[upgrade] VALID
.
**********************************************************************
Miscellaneous
Warnings
<Note:
Section can be empty if no such warnings are found.>
**********************************************************************
WARNING:
--> Your recycle bin contains 2 object(s).
....
It is REQUIRED that the recycle bin is empty prior to upgrading
....
your database. The command:
PURGE DBA_RECYCLEBIN
....
must be executed immediately prior to executing your upgrade.
WARNING:
--> Database contains schemas with objects dependent on DBMS_LDAP package.
....
Refer to the 11g Upgrade Guide for instructions to configure Network ACLs.
....
USER APEX_030200 has dependent objects.
.
**********************************************************************
Recommendations
**********************************************************************
Oracle
recommends gathering dictionary statistics prior to
upgrading
the database.
To gather
dictionary statistics execute the following command
while
connected as SYSDBA:
EXECUTE dbms_stats.gather_dictionary_stats;
6.
Install
the 11.2.0.4 binaries into a new ORACLE_HOME
·
Create
a directory dbhome_2 in the location /app/oracle/product/11.2.0/
·
Install
the Oracle binary to the new Oracle home
7.
Upgrading
the Database 11.2.0.3 to 11.2.0.4
Set
ORACLE_HOME to 11.2.0.4 and export below environment variables and then execute
dbua
export
ORACLE_BASE=/app/oracle
export
ORACLE_HOME=/app/oracle/product/11.2.0/dbhome_2
export
PATH=$PATH:$ORACLE_HOME/bin:$ORACLE_HOME/perl/bin
export
LD_LIBRARY_PATH=$ORACLE_HOME/lib
export
PERL5LIB=$ORACLE_HOME/perl/lib/5.10.:$ORACLE_HOME/perl/lib/site_perl/5.10.0
export
PATH=${JAVA_HOME}/bin:${PATH}:$HOME/bin:$ORACLE_HOME/bin
export
PATH=${PATH}:/usr/bin:/bin:/usr/bin/X11:/usr/local/bin:/sbin
Check
env, if still path referred to old ORACLE_HOME, then unset and export again, if
not it will throw error “selected database has already been upgraded” or “mount
database”
8.
Once
upgrade successfully completed, then copy the tnsnames.ora and listener.ora
files from old ORACLE_HOME to new ORACLE_HOME
9.
Modify
the .bash_profile in oracle point to new ORACLE_HOME
10. Tar the old ORACLE_HOME for safety side
incase if we need to roll back.
tar
-cvf /backup/dbhome_1.tar dbhome_1
Note:
Stop all the DB process before taking a backup
11. Create a symbolic link to the Oracle new
point to dbhome_1
ln -s dbhome_2 dbhome_1
12. Change the ORACLE_HOME in the auto start
init script
Recovery Manager complete.
[oracle@Total-dev-oracle adump]$ rman
target sys/pssword
Recovery Manager: Release 11.2.0.4.0 -
Production on Wed Mar 9 16:48:48 2016
Copyright (c) 1982, 2011, Oracle and/or
its affiliates. All rights reserved.
connected to target database: XXXXX
(DBID=3908821090)
RMAN> connect catalog rman/yyyyyy
connected to recovery catalog database
PL/SQL package RMAN.DBMS_RCVCAT version
11.02.00.03 in RCVCAT database is not current
PL/SQL package RMAN.DBMS_RCVMAN version
11.02.00.03 in RCVCAT database is not current
RMAN> upgrade catalog;
recovery catalog owner is RMAN
enter UPGRADE CATALOG command again to
confirm catalog upgrade
RMAN> upgrade catalog;
recovery catalog upgraded to version
11.02.00.04
DBMS_RCVMAN package upgraded to version
11.02.00.04
DBMS_RCVCAT package upgraded to version
11.02.00.04
RMAN>
Subscribe to:
Posts (Atom)