Monday, July 4, 2011

MoidIITDocID-938: My notes on RMAN --Moid

MIITDocID-958: Command Line Reference Guide --Moid

MoidIITDocID-540: How to perform TABLESPACE point in time recovery? --Moid

MoidIITDocID-528: How to perform point in time recovery? --Moid

MoidIITDocID-549: Scenario-18: How to restore Oracle datafile? --Moid

RMAN: Scenario-17: How to restore Oracle tablespace? --Moid

RMAN Scenario-16 | How to restore Oracle database? --Moid

RMAN: Scenerio-15: How to restore database with a new name from Cold Backup --Moid

Backup and Recovery Scenerio-14 | How to restore archivelogs from backups? --Moid

Backup and Recovery Scenerio-13 | How to perform time-based Oracle Point-In-Time recovery using RMAN? --Moid

Backup and Recovery Scenerio-10 [How to duplex Oracle 10g RMAN backups?] --Moid

Click here for the document.

--Moid

Backup and Recovery Scenerio-9 (How to perform a point in time tablespace recovery)

How to perform a point in time tablespace recovery? In this exercise, tablespace name is CT_COMMON_DATA?
$ export ORACLE_SID=PrimeDG
$ rman target /
RMAN> sql 'alter tablespace CT_COMMON_DATA offline';

RMAN> run

{

set until time "to_date('FEB 28 2008 13:59:00','Mon DD YYYY HH24:MI:SS')";

recover tablespace CT_COMMON_DATA;

}

RMAN> sql 'alter tablespace CT_COMMON_DATA online';
RMAN> exit;

Backup and Recovery Scenerio-12 (How to transport a tablespace?) -- Moid

Backup and Recovery Scenerio-11 (How to restore and rename database on a different server) --Moid

MIITDocID-942: Controlfiles are lost and database is still open. How to rebuild the lost controlfiles? --Moid

Backup and Recovery Scenario-7 | How to duplicate (clone) database on the DIFFERENT HOST from NON-ASM to ASM using RMAN? --Moid

Click here for the document.


Migrate NON-ASM to ASM on a different host.

--Moid Muhammad

Backup and Recovery Scenario-6 | How to duplicate (clone) database on the same server from NON-ASM to ASM using RMAN?

Click here for the document.

Migrate NON-ASM to ASM.

--Moid Muhammad

Backup and Recovery Scenario-5 | How to duplicate (clone) database on the different server using RMAN?

Click here for the document.

--Moid

Backup and Recovery Scenario-3 | How to restore and recover database on a remote server using RMAN?

Click here for 10g document.

Click here for 11g document.

--Moid

Backup and Recovery Scenario-4 | How to duplicate (clone) database on the same server using RMAN? --Moid

Click here for the document.

NON-ASM to NON-ASM

--Moid

Backup and Recovery Scenerio-2 | How to recover a datafile when all archivelogs are available?

Click here for the document.

--Moid

Backup and Recovery Scenario-1 (Recover Lost Datafile from User-Managed Full Backup)

Click here for the document.

--Moid

Backup and Recovery Scenario-0 |How to perform a user-managed cold backup?

Click here for the document.

--Moid

Oracle Background Processes

Click here for the document.

--Moid

Saturday, May 28, 2011

MoidIITDocID-502: How to create a password file? --Moid

$ orapwd file=$ORACLE_HOME/dbs/orapw$ORACLE_SID password='abc123' ignorecase=Y entries=5 force=y


Starting from 19c, atleast 8 bytes are required for SYS password.

orapwd file=$ORACLE_HOME/dbs/orapw$ORACLE_SID password='abc123'  force=y
OPW-00029: Password complexity failed for SYS user : Password must contain at least 8 characters.

Solution is to add "format=12". See below:
orapwd file=$ORACLE_HOME/dbs/orapw$ORACLE_SID password='abc123'  force=y  format=12


--Moid Muhammad

Monday, May 2, 2011

11g GoldenGate Installation (High Level steps) v1.4 --Moid

Very high level GG installation can be found from the following document.

Click here for the document.

--Moid





Golden Gate
GoldenGate
uni-directional
unidirectional
GG

Friday, March 18, 2011

Monday, February 28, 2011

10g RAC using openfiler (Jeff Hunter's Document)

Build Your Own 10g R2 Oracle RAC Cluster on Oracle Enterprise Linux and iSCSI Part-1
Build Your Own 10g R2 Oracle RAC Cluster on Oracle Enterprise Linux and iSCSI Part-2
Build Your Own 10g R2 Oracle RAC Cluster on Oracle Enterprise Linux and iSCSI Part-3


Also the cached pages are at my network at the following location:
\\192.168.0.61\lsi_shared_files\Build_10g_RAC_(Jeff_Hunter_Oracle_Document)

--Moid

Wednesday, February 2, 2011

How to change the protection mode from "maximum performance" to "maximum availability" in a 10g Data Guard environment?

Let's see how many different kind of protection modes Oracle offers in a Data Guard Environment.

Maximum Protection—This mode offers the highest level of data protection. Data is synchronously transmitted to the standby database from the primary database and transactions are not committed on the primary database unless the redo data is available on at least one standby database configured in this mode. If the last standby database configured in this mode becomes unavailable, processing stops on the primary database. This mode ensures no-data-loss.

Maximum Availability—This mode is similar to the maximum protection mode, including zero data loss. However, if a standby database becomes unavailable (for example, because of network connectivity problems), processing continues on the primary database. When the fault is corrected, the standby database is automatically resynchronized with the primary database.

Maximum Performance—This mode offers slightly less data protection on the primary database, but higher performance than maximum availability mode. In this mode, as the primary database processes transactions, redo data is asynchronously shipped to the standby database. The commit operation of the primary database does not wait for the standby database to acknowledge receipt of redo data before completing write operations on the primary database. If any standby destination becomes unavailable, processing continues on the primary database and there is little effect on primary database performance.

How to change from "maximum performance" to "maximum availability"? Click here for the instructions.

--Moid


Keywords:

Data Guard Protection Mode.

Wednesday, January 19, 2011

How to duplicate VMWare machine from an existing VMWare Machine v1.1

clicking here for the document..

--Moid Muhammad


Keyword: VMWare Cloning with screenshot, VMWare Duplicate, VMWare Oracle Database Cloning, step-by-step VMWare Cloning, VMWare image, VM Machine Image

Wednesday, December 29, 2010

11g R2 (11.2.0.2) -- Script to Auto Start/Shutdown databases during reboots.

I have a standalone 11 R2 (11.2.0.2) non-ASM database. The following is my script which can auto start/stop database and listener during system reboots. Please note that script reads /etc/oratab file to check which database to start. During startups, any database entry which has the "Y" at the end in the /etc/oratab file, will be started and anything which ends with "N", will be skipped.

Step 1:
Login as root and create a file called /etc/init.d/oracle. Add the following lines in the script.

#!/bin/bash

#######################################################################
#
# Run-level Startup script for the Oracle Instance and Listener
#
# chkconfig: 345 98 34
# description: Startup/Shutdown script for 11g Oracle instances
#
#######################################################################

#######################################################################
#
# Note:
# cp $ORACLE_HOME/bin/dbstart $ORACLE_HOME/bin/dbstart.orig
# Make the following changes in $ORACLE_HOME/bin/dbstart
#
# Line#80 has the following:
# ORACLE_HOME_LISTNER=$1
#
# Replace it with the following two lines:
# export ORACLE_HOME=/u01/app/oracle/product/11.2.0/db_1
# ORACLE_HOME_LISTNER=$ORACLE_HOME
#
# cp $ORACLE_HOME/bin/dbshut $ORACLE_HOME/bin/dbshut.orig
# Make the following changes in $ORACLE_HOME/bin/dbshut
#
# Line#50 has the following:
# ORACLE_HOME_LISTNER=$1
#
# Replace it with the following two lines:
# export ORACLE_HOME=/u01/app/oracle/product/11.2.0/db_1
# ORACLE_HOME_LISTNER=$ORACLE_HOME
#
# save the file and proceed with the steps below
#
#######################################################################

#######################################################################
#Instructions to start start isntances manually
#
# To Start --> /etc/init.d/oracle start
# To Stop --> /etc/init.d/oracle stop
# To restrart --> /etc/init.d/oracle restart
#
#######################################################################

ORA_HM="/u01/app/oracle/product/11.2.0/db_1"
ORA_OWNR="oracle"
# if the executables do not exist -- display error
if [ ! -f $ORA_HM/bin/dbstart -o ! -d $ORA_HM ]
then
echo "Oracle startup: cannot start"
exit 1
fi

# depending on parameter -- startup, shutdown, restart
# of the instance and listener or usage display

case "$1" in
start)
# starting Oracle instances
echo -n "starting Oracle Instances"
su - $ORA_OWNR -c $ORA_HM/bin/dbstart
touch /var/lock/subsys/oracle
ps -ef |grep pmon |grep -v grep
ps -ef |grep lsnr |grep -v grep
echo "OK"
;;
stop)

# Oracle listener and instance shutdown
su - $ORA_OWNR -c $ORA_HM/bin/dbshut
rm -f /var/lock/subsys/oracle
ps -ef |grep pmon |grep -v grep
ps -ef |grep lsnr |grep -v grep
echo "OK"
;;

reload|restart)
$0 stop
$0 start
ps -ef |grep pmon |grep -v grep
ps -ef |grep lsnr |grep -v grep
echo "OK"
;;
*)
echo "Usage: $0 start|stop|restart|reload"
exit 1
esac
exit 0
clear
###################### END of SCRIPT ##############################


Step-2:
Change the permission of the script
chmod 750 /etc/init.d/oracle

Step-3:
Execute the following so that runlevel 3,4 & 5 will execute the script during system reboots.
chkconfig --level 345 oracle on

Step-4
Execute the script and verify everything is working as expected. Alternatively, you can download the script directory from here.


Additionally you can turn on and turn on with the following.
[root@bl-mm-db-dev ~]# /sbin/chkconfig oracle off
[root@bl-mm-db-dev ~]# /sbin/chkconfig --levels 345 oracle on

That's it. We are done.


--Moid

Tuesday, November 23, 2010

Oracle Support Policy and Product Expiration Dates

Details can be accessed from here.

--Moid




http://www.oracle.com/us/support/library/lifetime-support-technology-069183.pdf

How to mount the CDROM in Linux? --Moid

create an empty directory called /mnt/cdrom

[root@chicago /]# mkdir -p /mnt/cdrom
[root@chicago /]# mount -t iso9660 -r /dev/cdrom /mnt/cdrom
[root@chicago /]# cd /mnt/cdrom
[root@chicago /]# ls -ltr

to unmount

# umount /mnt/cdrom
# cd /
eject

--Moid



My page is here.

Monday, November 15, 2010

MIITDocID-916: How to find the biggest / Largest table (row wise) from a schema (or all schemas)? --Moid

Click here for the query.

--Moid

MIITDocID-919: How to find out the used size of the schema? --Moid

Click here for the SQL.

--Moid

How to check the current size (given and used) of the database?

Click here for the query.

--Moid

How to find out the Oracle port numbers (used for isqlplus, DBConsole, Grid Control [OMS], OM agent etc)? --Moid

moid@Linux-223:(PrimeDG)$ cat $ORACLE_HOME/install/portlist.ini
iSQL*Plus HTTP port number =5561
iSQL*Plus HTTP port number =5560
Enterprise Manager Console HTTP Port (FlashDB) = 5501
Enterprise Manager Agent Port (FlashDB) = 1831
Enterprise Manager Console HTTP Port (kaleemdba) = 5502
Enterprise Manager Agent Port (kaleemdba) = 1832
Enterprise Manager Console HTTP Port (RecoCAT) = 5503
Enterprise Manager Agent Port (RecoCAT) = 3938
Enterprise Manager Console HTTP Port (STAR) = 5504
Enterprise Manager Agent Port (STAR) = 1830
Enterprise Manager Console HTTP Port (MarsDB) = 5500
Enterprise Manager Agent Port (MarsDB) = 1830
Enterprise Manager Console HTTP Port (alidb) = 5505
Enterprise Manager Agent Port (alidb) = 1831
Enterprise Manager Console HTTP Port (PrimeDG) = 5506
Enterprise Manager Agent Port (PrimeDG) = 3938
Enterprise Manager Console HTTP Port (TRYDB) = 5507
Enterprise Manager Agent Port (TRYDB) = 1832


Hope this helps.

--Moid

Wednesday, November 10, 2010

Wednesday, November 3, 2010

How to write DBID to alert long on a regular basis? --Moid

Every Oracle database has an internal unique DBID that can be queried from V$DATABASE
as follows:

SQL> select dbid from v$database;DBID------------------------------1794272723

RMAN uses the DBID to uniquely identify databases. The DBID helps RMAN identify the
correct RMAN backup piece from which to restore the control file. If you don’t use a flash
recovery area or a recovery catalog, then you should record the DBID in a safe location and
have it available in the event you need to restore your control file.


Writing the DBID to the Alert.log File

Another way of recording the DBID is to make sure that it is written to the alert.log file on a
regular basis using the DBMS_SYSTEM package. For example, you could have this SQL code execute as part of your backup job

COL dbid NEW_VALUE hold_dbidSELECT dbid FROM v$database;exec dbms_system.ksdwrt(2,'DBID: '||TO_CHAR(&hold_dbid));

After running the previous code, you should see a text message in your target database
alert.log file that looks like this:

==> alert_PrimeDG.log <==Wed Nov  3 03:06:47 2010DBID: 1794272723
You can easily put this in a cron job to write on a daily or weekly basis.Extracting of DBID from Redo Log fileAnother way of getting DBID is possible by getting the dump of the any availabe datafile, redolog or archvied log. I chosed to take a dumpfile of the online redolog and following are the steps I have taken.
SQL> ALTER SESSION SET sql_trace = true;Session altered.SQL> ALTER SESSION SET tracefile_identifier=Moid_Logfile_dump;Session altered.SQL> alter system dump logfile '/u15/oradata/Prime/redo01a.rdo';System altered.
At this point, I changed my directory to the user dump destination and dumpfile is available to be skinned.
Linux-223:(PrimeDG)$ pwd/u01/app/oracle/admin/PrimeDG/udumpLinux-223:(PrimeDG)$ ls -ltrhtotal 203M-rw-r-----  1 oracle oinstall  948 Nov  3 03:39 primedg_rfs_8676.trc-rw-r-----  1 oracle oinstall  947 Nov  3 03:44 primedg_rfs_8809.trc-rw-r-----  1 oracle oinstall 135M Nov  3 03:49 primedg_ora_8712.trc-rw-r-----  1 oracle oinstall  947 Nov  3 03:49 primedg_rfs_8979.trc-rw-r-----  1 oracle oinstall  68M Nov  3 03:49 primedg_ora_8712_MOID_LOGFILE_DUMP.trc
A simple cat of the file, provided me what I was looking for, DBID of my database.
Linux-223:(PrimeDG)$ cat primedg_ora_8712_MOID_LOGFILE_DUMP.trc |grep "Db ID"        Db ID=1794272723=0x6af26dd3, Db Name='PRIME'
--Moid
The above instructions can also be found here. 

Followers