Enter Your Email

Enter your email address:

Delivered by FeedBurner

Custom Search
Showing posts with label Storage RMAN ASM. Show all posts
Showing posts with label Storage RMAN ASM. Show all posts

Wednesday, March 12, 2008

Oracle 11g :: Configuring ASM for Oracle 11g RDBMS

Setting up and configuring storage with ASM for Oracle 11g RDBMS
VMWare Version 1.0.8
Host Operating System: Windows XP – 32 Bit
Guest Operating System: OLE 4 (Update 5)
Oracle RDBMS Version: 11.1.0.6.0

Prerequisites
1. Oracle Software 11.1.0.6 should already installed on the server.

Click here -> For Step by step http://ravidba-oracle.blogspot.com/2008/07/oracle-11g-step-by-step-installation-on.html
2. Raw disks should already be formatted using fdisk and should be available to the server.

3. Disk Label should be created with ORACLE ASM LIB.
http://ravidba-oracle.blogspot.com/2007/05/oracle-10gr2-automatic-storage.html

** Please download Oracle ASM Lib from OTN.
oracleasmlib-2.0.2-1.i386.rpm (or) you can configure this when you setup Linux by selecting
System Tools -> oracle oracleasm-2.6.9.. (driver for UP kernel).
[root@oracledb2 init.d]# ls -ltr oracleasm*
-rwxr-xr-x 1 root root 18114 Oct 24 2006 oracleasm
[root@oracledb2 init.d]# pwd
/etc/init.d
Usage: /etc/init.d/oracleasm {startstoprestartenabledisableconfigurecreatediskdeletediskquerydisklistdisksscandisksstatus}
http://ravidba-oracle.blogspot.com/2007/05/oracle-10gr2-automatic-storage.html
For rest of the steps please follow the above URL to add the disks using oracleasm.
[root@oracledb2 init.d]# /etc/init.d/oracleasm listdisks
VOL1
VOL2
VOL3
Once you have the disks in place, login as Oracle user and run DBCA
1. Select Configure Automatic Storage Management : Step 1 of 4 -> Click Next

2. A warning screen will appear. For ASM (Automatic Storage Management) the Oracle Cluster Synchronization Service (CSS) needs to be running. All you need to do is - login as a root user and run the localconfig reset from $ORACLE_HOME/bin directory, as shown in the below screen.

3. Open a termial / Putty section login as a root user, and execute localconfig reset from $ORACLE_HOME/bin.
Once you have the message "Oracle CSS service is installed and running under init" you can click "OK" at the warning screen.
4. Specify the password for the SYS user. (This is for ASM Instance).
5.
6.
7. I have missed few of the screens, you need to assign the Disk Group Name, assign the Volumes that we create before and select the redundancy. I created two Disk Group's.
+DATA/DB11G
CONTROLFILE/
DATAFILE/
ONLINELOG/
PARAMETERFILE/
TEMPFILE/
spfiledb11g.ora => +DATA/DB11G/PARAMETERFILE/spfile.280.674840503
And the second group RECOVERYDEST/ for FLASH recovery area.
8. Mount the Disks - Click Mount All

9. Mounting Disk Groups...10. Disks are mounted, Next we create database.
Please refer my next post

Wednesday, December 05, 2007

RMAN :: Clone Database to UAT - FTP to a different location

RMAN: Database Clone/Refresh from Production Server to a UAT/Development Server. Test case: (RMAN BACKUP LOCATION is not the same as of the Production).
1. Production Server
oracledb1-> tail -3 /etc/oratab
dgtest:/u01/app/oracle/product/10.2.0/db_1:Y
dataware:/u01/app/oracle/product/10.2.0/db_1:Y
oracledb1->

2. UAT Server (Target Server to clone the database)
oracledb2-> tail -3 /etc/oratab
# Multiple entries with the same $ORACLE_SID are not allowed.
oracledb2->
You can see the Server is clean.
We are now going to restore & recover a Database with SID “Dataware” to on the UAT server.
3. Make sure that you have exact file system and mount points available on the Target server.
I am going to create the directory structure for BACKGROUND Dump locations and for Database file System exactly as in the Production server. In fact in most case’s the environment will be same.

oracledb1-> pwd
/u01/app/oracle/admin/dataware
oracledb1-> ls -ltr
total 88
drwxr-x--- 2 oracle oinstall 4096 Jul 21 13:39 dpdump
drwxr-x--- 2 oracle oinstall 4096 Jul 21 13:39 cdump
drwxr-x--- 2 oracle oinstall 4096 Jul 21 13:44 pfile
drwxr-x--- 2 oracle oinstall 4096 Nov 24 12:32 udump
drwxr-x--- 2 oracle oinstall 36864 Nov 24 12:33 bdump
drwxr-x--- 2 oracle oinstall 12288 Nov 24 12:34 adump
oracledb1->
********************************************************
oracledb2-> mkdir dataware
oracledb2-> cd dataware
oracledb2-> mkdir dpdump cdump pfile udump bdump adump
oracledb2-> ls -ltr
total 48
drwxr-xr-x 2 oracle oinstall 4096 Dec 5 13:04 udump
drwxr-xr-x 2 oracle oinstall 4096 Dec 5 13:04 pfile
drwxr-xr-x 2 oracle oinstall 4096 Dec 5 13:04 dpdump
drwxr-xr-x 2 oracle oinstall 4096 Dec 5 13:04 cdump
drwxr-xr-x 2 oracle oinstall 4096 Dec 5 13:04 bdump
drwxr-xr-x 2 oracle oinstall 4096 Dec 5 13:04 adump
oracledb2-> pwd
/u01/app/oracle/admin/dataware
**********************************************************
oracledb2-> pwd
/oradata/dataware
oracledb2-> ls -ltr
total 8
drwxr-xr-x 2 oracle oinstall 4096 Dec 5 13:09 arch
oracledb2->
*** If the database as a Flash Recovery area enable make sure that you care the directory for that as well.
*********************************************
4. On the Production Database create pfile from spfile, where we are going to have a copy of that.
SQL> !hostname
oracledb1.mycorpdomain.com
SQL> create pfile='/oradata/backup/initdataware.ora' from spfile;
File created.
SQL> !ls -ltr /oradata/backup/
total 8
-rw-r--r-- 1 oracle oinstall 1143 Dec 5 13:03 initdataware.ora
***********
Connect to the Production database with RMAN,
oracledb1-> rman target /
Recovery Manager: Release 10.2.0.3.0 - Production on Fri Dec 5 13:05:47 2007
Copyright (c) 1982, 2005, Oracle. All rights reserved.
connected to target database: DATAWARE (DBID=197345076)
RMAN>
RMAN configuration parameters are:
CONFIGURE RETENTION POLICY TO REDUNDANCY 1; # default
CONFIGURE CONTROLFILE AUTOBACKUP FORMAT FOR DEVICE TYPE DISK TO '/oradata/backup/dataware/%F';
CONFIGURE DEVICE TYPE DISK PARALLELISM 1 BACKUP TYPE TO BACKUPSET; # default
CONFIGURE CHANNEL DEVICE TYPE DISK FORMAT '/oradata/backup/dataware/%U';
CONFIGURE ENCRYPTION ALGORITHM 'AES128'; # default
CONFIGURE SNAPSHOT CONTROLFILE NAME TO '/oradata/backup/dataware/snapcf_dataware.f';
RMAN> backup database plus archivelog;
Starting backup at 05-DEC-07
current log archived
allocated channel: ORA_DISK_1
channel ORA_DISK_1: sid=143 devtype=DISK
channel ORA_DISK_1: starting archive log backupset
channel ORA_DISK_1: specifying archive log(s) in backup set
input archive log thread=1 sequence=56 recid=54 stamp=670070919
piece handle=/oradata/backup/dataware/0sk1ga0l_1_1 tag=TAG20071205T131604 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:01:35
Finished backup at 05-DEC-07
Starting backup at 05-DEC-07
current log archived
using channel ORA_DISK_1
piece handle=/oradata/backup/dataware/0tk1ga3l_1_1 tag=TAG20071205T131741 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:03
Finished backup at 05-DEC-07

Starting Control File and SPFILE Autobackup at 05-DEC-07
piece handle=/oradata/backup/dataware/c-197345076-20071205-00 comment=NONE
Finished Control File and SPFILE Autobackup at 05-DEC-07
5. We have a backup of the Production Database; we are now going to FTP this to the UAT / Development Site. In fact when we do the refresh or clone, we use Tapes to restore the previous Images of the backup’s. As this is just a Test scenario I am not worried about the additional load on the Network and of course taking backup at odd times.
oracledb1-> sftp 192.168.2.135
Connecting to 192.168.2.135...
oracle@192.168.2.135's password:
Permission denied, please try again.
oracle@192.168.2.135's password:
sftp> pwd
Remote working directory: /oradata/rman/dataware
6. Login to the UAT server and copy the init parameter file to ORACLE_HOME/dbs location.
oracledb2-> cp -p initdataware.ora $ORACLE_HOME/dbs/
7. Startup the Database in nomount Stage to perform the Control file Restore
oracledb2-> export ORACLE_SID=dataware
oracledb2-> rman target /
Recovery Manager: Release 10.2.0.3.0 - Production on Fri Dec 5 14:02:14 2007
Copyright (c) 1982, 2005, Oracle. All rights reserved.
connected to target database (not started)
RMAN> startup nomount;
Oracle instance started
Total System Global Area 184549376 bytes
Fixed Size 1260792 bytes
Variable Size 159384328 bytes
Database Buffers 20971520 bytes
Redo Buffers 2932736 bytes
RMAN> restore controlfile from
2> '/oradata/rman/dataware/snapcf_dataware.f';
Starting restore at 05-DEC-07
allocated channel: ORA_DISK_1
channel ORA_DISK_1: sid=156 devtype=DISK
channel ORA_DISK_1: copied control file copy
output filename=/oradata/dataware/control01.ctl
Finished restore at 05-DEC-07
8. Mount the Database and restore all the archive log files to start the Recovery of the Database at UAT.
RMAN> alter database mount;
database mounted
released channel: ORA_DISK_1
*** Recovering all the archivelog files....
RMAN> restore archivelog all;
Starting restore at 05-DEC-07
allocated channel: ORA_DISK_1
channel ORA_DISK_1: sid=156 devtype=DISK
RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-03002: failure of restore command at 12/05/2007 14:06:30
RMAN-06026: some targets not found - aborting restore
RMAN-06025: no backup of log thread 1 seq 36 lowscn 866178 found to restore
WHY THE ABOVE ERROR? # This is what the problem I faced...
RMAN> show all;
RMAN configuration parameters are:
CONFIGURE CONTROLFILE AUTOBACKUP FORMAT FOR DEVICE TYPE DISK TO '/oradata/backup/dataware/%F'; ## See its poiting to a different mount point
CONFIGURE ARCHIVELOG BACKUP COPIES FOR DEVICE TYPE DISK TO 1; # default
CONFIGURE CHANNEL DEVICE TYPE DISK FORMAT '/oradata/backup/dataware/%U';
CONFIGURE MAXSETSIZE TO UNLIMITED; # default
CONFIGURE SNAPSHOT CONTROLFILE NAME TO '/u01/app/oracle/product/10.2.0/db_1/dbs/snapcf_dataware.f'; # default
*** So i changed the mount points on the UAT Server...will this work?

RMAN> CONFIGURE CONTROLFILE AUTOBACKUP FORMAT FOR DEVICE TYPE DISK TO '/oradata/rman/dataware/%F';
old RMAN configuration parameters:
CONFIGURE CONTROLFILE AUTOBACKUP FORMAT FOR DEVICE TYPE DISK TO '/oradata/backup/dataware/%F';
new RMAN configuration parameters:
CONFIGURE CONTROLFILE AUTOBACKUP FORMAT FOR DEVICE TYPE DISK TO '/oradata/rman/dataware/%F';
new RMAN configuration parameters are successfully stored
RMAN> CONFIGURE CHANNEL DEVICE TYPE DISK FORMAT '/oradata/rman/dataware/%U';
old RMAN configuration parameters:
CONFIGURE CHANNEL DEVICE TYPE DISK FORMAT '/oradata/backup/dataware/%U';
new RMAN configuration parameters:
CONFIGURE CHANNEL DEVICE TYPE DISK FORMAT '/oradata/rman/dataware/%U';
new RMAN configuration parameters are successfully stored
released channel: ORA_DISK_1
*********
RMAN> restore archivelog all from
2> '/oradata/rman/dataware/0sk1ga0l_1_1';
Starting restore at 05-DEC-07
using channel ORA_DISK_1
RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-03002: failure of restore command at 12/05/2007 14:20:40
RMAN-06509: only SPFILE or control file can be restored from autobackup
No...
Why it’s happening like this?
and...
RMAN> list backup;
List of Backup Sets
===================
BS Key Type LV Size Device Type Elapsed Time Completion Time
------- ---- -- ---------- ----------- ------------ ---------------
27 Full 782.38M DISK 00:01:26 05-DEC-07
BP Key: 25 Status: AVAILABLE Compressed: NO Tag: TAG20071205T131604
Piece Name: /oradata/backup/dataware/0sk1ga0l_1_1
List of Datafiles in backup set 27
File LV Type Ckp SCN Ckp Time Name
---- -- ---- ---------- --------- ----
1 Full 1486233 05-DEC-07 /oradata/dataware/system01.dbf
3 Full 1486233 05-DEC-07 /oradata/dataware/sysaux01.dbf
8 Full 1486233 05-DEC-07 /oradata/dataware/students.dbf
and what i found is the control file which we restored before as cataloged with different backup tag and sets with different backup locations.
So we need to catalog the newly moved (FTP Location) files.
RMAN> catalog backuppiece '/oradata/rman/dataware/0rk1g9vo_1_1';
cataloged backuppiece
backup piece handle=/oradata/rman/dataware/0rk1g9vo_1_1 recid=27 stamp=672675911
RMAN> catalog backuppiece '/oradata/rman/dataware/0sk1ga0l_1_1';
cataloged backuppiece
backup piece handle=/oradata/rman/dataware/0sk1ga0l_1_1 recid=28 stamp=672675927
RMAN> catalog backuppiece '/oradata/rman/dataware/0tk1ga3l_1_1';
cataloged backuppiece
backup piece handle=/oradata/rman/dataware/0tk1ga3l_1_1 recid=29 stamp=672675936
RMAN> catalog backuppiece '/oradata/rman/dataware/c-197345076-20071205-00';
cataloged backuppiece
backup piece handle=/oradata/rman/dataware/c-197345076-20071205-00 recid=30 stamp=672675947
ALL SET # TO CHECK
RMAN> list backuppiece '/oradata/rman/dataware/0rk1g9vo_1_1';
List of Backup Pieces
BP Key BS Key Pc# Cp# Status Device Type Piece Name
------- ------- --- --- ----------- ----------- ----------
27 26 1 2 AVAILABLE DISK /oradata/rman/dataware/0rk1g9vo_1_1
RMAN> run {
2> set until sequence 88 thread 1;
3> restore database;
4> recover database;
5> sql 'alter database open resetlogs';
6> }
executing command: SET until clause
Starting restore at 05-DEC-07
using channel ORA_DISK_1
channel ORA_DISK_1: starting datafile backupset restore
channel ORA_DISK_1: specifying datafile(s) to restore from backup set
restoring datafile 00001 to /oradata/dataware/system01.dbf
restoring datafile 00007 to /oradata/dataware/tsa01.dbf
restoring datafile 00007 to /oradata/dataware/students.dbf
channel ORA_DISK_1: reading from backup piece /oradata/rman/dataware/10k1gffk_1_1
channel ORA_DISK_1: restored backup piece 1
piece handle=/oradata/rman/dataware/10k1gffk_1_1 tag=TAG20071205T144924
channel ORA_DISK_1: restore complete, elapsed time: 00:01:37
Finished restore at 05-DEC-07
Starting recover at 05-DEC-07
using channel ORA_DISK_1
starting media recovery
channel ORA_DISK_1: starting archive log restore to default destination
channel ORA_DISK_1: restoring archive log
archive log thread=1 sequence=86
channel ORA_DISK_1: restoring archive log
archive log thread=1 sequence=87
channel ORA_DISK_1: reading from backup piece /oradata/rman/dataware/13k1gfkd_1_1
channel ORA_DISK_1: restored backup piece 1
piece handle=/oradata/rman/dataware/13k1gfkd_1_1 tag=TAG20071205T145156
channel ORA_DISK_1: restore complete, elapsed time: 00:00:03
archive log filename=/oradata/dataware/arch/1_86_660663669.arc thread=1 sequence=86
archive log filename=/oradata/dataware/arch/1_87_660663669.arc thread=1 sequence=87
media recovery complete, elapsed time: 00:00:02
Finished recover at 05-DEC-07
sql statement: alter database open resetlog

Any options away from this please let me know...which is more easy than this.

Reference: Oracle Document 10G RMAN :-) Always at help.

Sunday, June 17, 2007

Oracle 10g RMAN Cold Backup

oracledb1-> rman target /
Recovery Manager: Release 10.2.0.3.0 - Production on Thu May 15 12:47:34 2008
Copyright (c) 1982, 2005, Oracle. All rights reserved.
connected to target database: DGPRD (DBID=223112954)
RMAN> run {
2> #Shutdown Target Database DGPRD For Cold Backup
3> shutdown immediate
4> #Startup Mount, Once the Cold Backup Finishes
5> startup mount
6> #Allocate Channel Now
7> allocate channel c1 TYPE DISK;
8> BACKUP DATABASE FORMAT '/oradata/rman/%d_COLD_%u';
9> #One Backup Completes - Open the database
10> sql 'alter database open';
11> backup current controlfile;
12> sql 'ALTER DATABASE BACKUP CONTROLFILE TO TRACE';
13> release channel c1;
14> }
using target database control file instead of recovery catalog
database closed
database dismounted
Oracle instance shut down

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

Total System Global Area 167772160 bytes
Fixed Size 1260696 bytes
Variable Size 88081256 bytes
Database Buffers 75497472 bytes
Redo Buffers 2932736 bytes

allocated channel: c1
channel c1: sid=157 devtype=DISK

Starting backup at 15-MAY-07
channel c1: starting full datafile backupset
channel c1: specifying datafile(s) in backupset
input datafile fno=00001 name=/oradata/dgprd/system01.dbf
input datafile fno=00003 name=/oradata/dgprd/sysaux01.dbf
input datafile fno=00005 name=/oradata/dgprd/example01.dbf
input datafile fno=00002 name=/oradata/dgprd/undotbs01.dbf
input datafile fno=00004 name=/oradata/dgprd/users01.dbf
channel c1: starting piece 1 at 15-MAY-07
channel c1: finished piece 1 at 15-MAY-07
piece handle=/oradata/rman/DGPRD_COLD_02jgef91 tag=TAG20080515T125704 comment=NONE
channel c1: backup set complete, elapsed time: 00:01:45
Finished backup at 15-MAY-07

Starting Control File and SPFILE Autobackup at 15-MAY-07
piece handle=/oradata/dgprd/flash_recovery_area/DGPRD_PR/autobackup/2008_05_15/o1_mf_s_654785806_42rtyfgg_.bkp comment=NONE
Finished Control File and SPFILE Autobackup at 15-MAY-07

sql statement: alter database open
Starting backup at 15-MAY-07
channel c1: starting full datafile backupset
channel c1: specifying datafile(s) in backupset
including current control file in backupset
channel c1: starting piece 1 at 15-MAY-07
channel c1: finished piece 1 at 15-MAY-07
piece handle=/oradata/dgprd/flash_recovery_area/DGPRD_PR/backupset/2008_05_15/o1_mf_ncnnf_TAG20080515T125924_42rtzh7l_.bkp tag=TAG20080515T125924 comment=NONE
channel c1: backup set complete, elapsed time: 00:00:03
Finished backup at 15-MAY-07
\
Starting Control File and SPFILE Autobackup at 15-MAY-07
piece handle=/oradata/dgprd/flash_recovery_area/DGPRD_PR/autobackup/2008_05_15/o1_mf_s_654785968_42rtzltr_.bkp comment=NONE
Finished Control File and SPFILE Autobackup at 15-MAY-07

sql statement: ALTER DATABASE BACKUP CONTROLFILE TO TRACE
released channel: c1

RMAN>

Tuesday, June 12, 2007

RMAN: Database Clone, Refresh for Development

UAT Refresh with RMAN
Production site
oracledb1-> hostname
oracledb1.mycorpdomain.com
UAT
oracledb2-> hostname
oracledb2.mycorpdomain.com
1. Create the File system for Backup Dump on the UAT server
oracledb2-> cd dgprd
oracledb2-> mkdir adump bdump cdump udump pfile dpdump
oracledb2-> pwd
/u01/app/oracle/admin/dgprd
oracledb2-> ls -ltr
total 48
drwxr-xr-x 2 oracle oinstall 4096 Jun 2 10:59 udump
drwxr-xr-x 2 oracle oinstall 4096 Jun 2 10:59 pfile
drwxr-xr-x 2 oracle oinstall 4096 Jun 2 10:59 dpdump
drwxr-xr-x 2 oracle oinstall 4096 Jun 2 10:59 cdump
drwxr-xr-x 2 oracle oinstall 4096 Jun 2 10:59 bdump
drwxr-xr-x 2 oracle oinstall 4096 Jun 2 10:59 adump
2. Create the File system for the Oradata, RMAN, FLASH_RECOVERY_AREA on the UAT
oracledb2-> ls -ltr
total 40
drwx------ 2 root root 16384 Mar 28 13:57 lost+found
drwxr-xr-x 2 oracle oinstall 4096 Jun 2 10:52 rman
drwxr-xr-x 2 oracle oinstall 4096 Jun 2 10:52 dgprd
drwxr-xr-x 2 oracle oinstall 4096 Jun 2 10:53 flash_recovery_area
3. List Incarnation - Test
RMAN> list incarnation;
List of Database Incarnations
DB Key Inc Key DB Name DB ID STATUS Reset SCN Reset Time
------- ------- -------- ---------------- --- ---------- ----------
1 1 DGPRD 224754742 CURRENT 1 02-JUN-07
4. Database Uptime, on Production - 2 Ways
SQL> !ps -efgrep pmon
oracle 3877 1 0 10:34 ? 00:00:00 ora_pmon_dgtest
oracle 5092 1 0 11:03 ? 00:00:00 ora_pmon_dgprd
SQL> select to_char(startup_time, 'DD-MON-YYYY HH24:MI:SS') "DB Startup Time"
2 FROM sys.v_$instance;
DB Startup Time
--------------------
02-JUN-2007 11:03:14
5. Create a pfile from spfile on the Production database(It will be done at the backup time)
SQL> create pfile='/oradata/rman/initdgprd.ora' from spfile;
File created.
SQL> !ls -ltr /oradata/rman/
total 6920
-rw-r----- 1 oracle oinstall 7061504 Jun 2 11:07 snapcontrolfile_dgprd.f
-rw-r--r-- 1 oracle oinstall 1025 Jun 2 11:23 initdgprd.ora
6. Configure the device type and the FTP location
RMAN> configure channel device type disk format '/oradata/rman/%U';
new RMAN configuration parameters:
CONFIGURE CHANNEL DEVICE TYPE DISK FORMAT '/oradata/rman/%U';
new RMAN configuration parameters are successfully stored

******************** BACKUP DATABASE on PRODUCTION NOW *******************
7. RMAN> backup database plus archivelog;
Starting backup at 02-JUN-07
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:02
Finished backup at 02-JUN-07
Starting backup at 02-JUN-07
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:55
Finished backup at 02-JUN-07
Starting backup at 02-JUN-07
Finished backup at 02-JUN-07
Starting Control File and SPFILE Autobackup at 02-JUN-07
piece handle=/oradata/flash_recovery_area/DGPRD/autobackup/2007_06_02/o1_mf_s_656336693_4485cp8x_.bkp comment=NONE
Finished Control File and SPFILE Autobackup at 02-JUN-07
RMAN>
***************************************************************************
8. NOW FTP THE FILEs !!!! Nothing but as Restoring from the TAPE backup.
*********************************************************************************************
oracledb1-> sftp 192.168.2.135
Connecting to 192.168.2.135...
The authenticity of host '192.168.2.135 (192.168.2.135)' can't be established.
RSA key fingerprint is 32:ff:dd:a1:36:1c:0c:71:8a:ef:ad:09:73:ec:e4:1c.
Are you sure you want to continue connecting (yes/no)? yes
Warning: Permanently added '192.168.2.135' (RSA) to the list of known hosts.
oracle@192.168.2.135's password:
sftp> pwd
Remote working directory: /export/home/oracle
sftp> cd /oradata
sftp> cd rman
snapcontrolfile_dgprd.f 100% 6896KB 6.7MB/s 00:01
sftp> mput *
Uploading 01jhtpnp_1_1 to /oradata/rman/01jhtpnp_1_1
01jhtpnp_1_1 100% 8811KB 8.6MB/s 00:00
Uploading 02jhtpns_1_1 to /oradata/rman/02jhtpns_1_1
02jhtpns_1_1 100% 553MB 8.1MB/s 01:07
Uploading 03jhtppj_1_1 to /oradata/rman/03jhtppj_1_1
03jhtppj_1_1 100% 2560 2.5KB/s 00:00
Uploading initdgprd.ora to /oradata/rman/initdgprd.ora
initdgprd.ora 100% 1025 1.0KB/s 00:00
Uploading snapcontrolfile_dgprd.f to /oradata/rman/snapcontrolfile_dgprd.f
snapcontrolfile_dgprd.f 100% 6896KB 6.7MB/s 00:01
***********************************************************************************************************
9. Login to the UAT server
1. Copy the Parameter file to the dbs location
/oradata/rman
oracledb2-> cp -p initdgprd.ora /u01/app/oracle/product/10.2.0/db_1/dbs/
oracledb2-> pwd
/oradata/rman
2. Perform Controlfile Restore *************************************************
oracledb2-> rman target /
Recovery Manager: Release 10.2.0.3.0 - Production on Mon Jun 2 11:57:50 2007
Copyright (c) 1982, 2005, Oracle. All rights reserved.
connected to target database (not started)
RMAN> startup nomount;
startup failed: ORA-01078: failure in processing system parameters
LRM-00109: could not open parameter file '/u01/app/oracle/product/10.2.0/db_1/dbs/initdgprd.ora'
starting Oracle instance without parameter file for retrival of spfile
Oracle instance started

Total System Global Area 159383552 bytes
Fixed Size 1260648 bytes
Variable Size 58721176 bytes
Database Buffers 96468992 bytes
Redo Buffers 2932736 bytes
RMAN> shutdown abort;
Oracle instance shut down
******************** COPY the parameter file ****************
oracledb2-> cp -p initdgprd.ora /u01/app/oracle/product/10.2.0/db_1/dbs/
oracledb2-> pwd
***************************************************************
RMAN> startup nomount;
connected to target database (not started)
Oracle instance started
Total System Global Area 167772160 bytes
Fixed Size 1260696 bytes
Variable Size 67109736 bytes
Database Buffers 96468992 bytes
Redo Buffers 2932736 bytes
RMAN> restore controlfile from autobackup;
Starting restore at 02-JUN-07
allocated channel: ORA_DISK_1
channel ORA_DISK_1: sid=156 devtype=DISK
recovery area destination: /oradata/flash_recovery_area
database name (or database unique name) used for search: DGPRD
channel ORA_DISK_1: no autobackups found in the recovery area
autobackup search outside recovery area not attempted because DBID was not set
RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-03002: failure of restore command at 06/02/2007 12:02:16
RMAN-06172: no autobackup found or specified handle is not a valid copy or piece

RMAN> restore controlfile from '/oradata/rman/snapcontrolfile_dgprd.f';

Starting restore at 02-JUN-07
using channel ORA_DISK_1

channel ORA_DISK_1: copied control file copy
output filename=/oradata/dgprd/control01.ctl
output filename=/oradata/dgprd/control02.ctl
output filename=/oradata/dgprd/control03.ctl
Finished restore at 02-JUN-07

RMAN> alter database mount;

database mounted
released channel: ORA_DISK_1
9 ****** Recover the Database Until time ***************************************
RMAN> alter database mount;
database mounted
released channel: ORA_DISK_1
RMAN> restore archivelog all;
Starting restore at 02-JUN-07
Starting implicit crosscheck backup at 02-JUN-07
allocated channel: ORA_DISK_1
channel ORA_DISK_1: sid=156 devtype=DISK
Crosschecked 8 objects
Finished implicit crosscheck backup at 02-JUN-07

Starting implicit crosscheck copy at 02-JUN-07
using channel ORA_DISK_1
Finished implicit crosscheck copy at 02-JUN-07

searching for all files in the recovery area
cataloging files...
cataloging done

List of Cataloged Files
=======================
File Name: /oradata/flash_recovery_area/DGPRD/autobackup/2007_06_02/o1_mf_n_656339154_4487rn3f_.bkp

using channel ORA_DISK_1

channel ORA_DISK_1: starting archive log restore to default destination
>>>Removed Few

archive log thread=1 sequence=71
channel ORA_DISK_1: reading from backup piece /oradata/rman/05jhtsib_1_1
channel ORA_DISK_1: restored backup piece 1
piece handle=/oradata/rman/05jhtsib_1_1 tag=TAG20070602T123211
channel ORA_DISK_1: restore complete, elapsed time: 00:00:03
channel ORA_DISK_1: starting archive log restore to default destination
channel ORA_DISK_1: restoring archive log
archive log thread=1 sequence=72
channel ORA_DISK_1: reading from backup piece /oradata/rman/07jhtsk5_1_1
channel ORA_DISK_1: restored backup piece 1
piece handle=/oradata/rman/07jhtsk5_1_1 tag=TAG20070602T123309
channel ORA_DISK_1: restore complete, elapsed time: 00:00:01
Finished restore at 02-JUN-07
RMAN> list incarnation;
List of Database Incarnations
DB Key Inc Key DB Name DB ID STATUS Reset SCN Reset Time
------- ------- -------- ---------------- --- ---------- ----------
1 1 DGPRD 224754742 PARENT 1 02-JUN-07
2 2 DGPRD 224754742 CURRENT 225172 02-JUN-07
RMAN> reset database to incarnation 1;
database reset to incarnation 1
RMAN> list incarnation;
List of Database Incarnations
DB Key Inc Key DB Name DB ID STATUS Reset SCN Reset Time
------- ------- -------- ---------------- --- ---------- ----------
1 1 DGPRD 224754742 CURRENT 1 02-JUN-07
2 2 DGPRD 224754742 ORPHAN 225172 02-JUN-07

RMAN> run {
2> set until time "to_date('02-JUNE-2007 12:20:00','DD-MON-YYYY HH24:MI:SS')";
3> restore database;
4> recover database;
5> sql 'alter database open resetlogs';
6> }

executing command: SET until clause

Starting restore at 02-JUN-07
using channel ORA_DISK_1

channel ORA_DISK_1: starting datafile backupset restore
channel ORA_DISK_1: specifying datafile(s) to restore from backup set
restoring datafile 00001 to /oradata/dgprd/system01.dbf
restoring datafile 00002 to /oradata/dgprd/undotbs01.dbf
restoring datafile 00003 to /oradata/dgprd/sysaux01.dbf
restoring datafile 00004 to /oradata/dgprd/users01.dbf
channel ORA_DISK_1: reading from backup piece /oradata/rman/02jhtpns_1_1
channel ORA_DISK_1: restored backup piece 1
piece handle=/oradata/rman/02jhtpns_1_1 tag=TAG20070602T114355
channel ORA_DISK_1: restore complete, elapsed time: 00:00:56
Finished restore at 02-JUN-07

Starting recover at 02-JUN-07
using channel ORA_DISK_1

starting media recovery

archive log thread 1 sequence 58 is already on disk as file /oradata/dgprd/arc/1_58_656333366.arc
archive log thread 1 sequence 59 is already on disk as file /oradata/dgprd/arc/1_59_656333366.arc
archive log filename=/oradata/dgprd/arc/1_58_656333366.arc thread=1 sequence=58
archive log filename=/oradata/dgprd/arc/1_59_656333366.arc thread=1 sequence=59
media recovery complete, elapsed time: 00:00:04
Finished recover at 02-JUN-07
sql statement: alter database open resetlogs
RMAN>

Sunday, June 03, 2007

Automatic Stroage Management (ASM): Adding a disk to a existing Diskgroup

Automatic Storage Management:
Adding a Disk to an existing Disk Group:
Oracle 10G RAC:
In day to day activities DBA needs plan and assign storage to the growing database. It’s a brief idea & procedure about how to add a new disk to an existing disk groups.

* Please refer my other posts on ASM and Linux VMware for adding Disks (Shortly edited)
1. Login as a root user and check for the new disk which was just added at the VMware.
[root@rac1 ~]# fdisk -l
Disk /dev/sda: 32.2 GB, 32212254720 bytes
255 heads, 63 sectors/track, 3916 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
[…Truncated]
Disk /dev/sdf doesn't contain a valid partition table
2. Use fdisk to create the partition info for the newly added disk.
*************************************

[root@rac1 ~]# fdisk /dev/sdf
Device contains neither a valid DOS partition table, nor Sun, SGI or OSF disklabel
Building a new DOS disklabel. Changes will remain in memory only,
until you decide to write them. After that, of course, the previous
content won't be recoverable.
Warning: invalid flag 0x0000 of partition table 4 will be corrected by w(rite)
Command (m for help): n
Command action
e extended
p primary partition (1-4)
p
Partition number (1-4): 1
First cylinder (1-261, default 1): 1
Last cylinder or +size or +sizeM or +sizeK (1-261, default 261):
Using default value 261
Command (m for help): w
The partition table has been altered!
Calling ioctl() to re-read partition table.
Syncing disks.
*************************************

3. You can see the new partition info; you can do this on both the Cluster nodes.
******************************************

[root@rac1 ~]# fdisk -l
Disk /dev/sdf: 2147 MB, 2147483648 bytes
255 heads, 63 sectors/track, 261 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Device Boot Start End Blocks Id System
/dev/sdf1 1 261 2096451 83 Linux
[root@rac1 ~]#
****************************************************
NODE 02
[root@rac2 ~]# fdisk -l
Disk /dev/sdf: 2147 MB, 2147483648 bytes
255 heads, 63 sectors/track, 261 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Device Boot Start End Blocks Id System
/dev/sdf1 1 261 2096451 83 Linux

***********************************************
4. In Linux you can use ASM library driver provided by Oracle to configure the new disks.
************************************
oracleasm-support-2.0.3-2
oracleasm-2.6.9-42.0.0.0.1.EL-2.0.3-2
oracleasmlib-2.0.2-1
oracleasm-2.6.9-42.0.0.0.1.ELsmp-2.0.3-2
NODE 01 # Check for existing ASM disks
[root@rac1 ~]# /etc/init.d/oracleasm scandisks
Scanning system for ASM disks: [ OK ]
[root@rac1 ~]# /etc/init.d/oracleasm listdisks
VOL1
VOL2
VOL3
NODE 02 # Check for existing ASM disks
[root@rac2 ~]# /etc/init.d/oracleasm scandisks
Scanning system for ASM disks: [ OK ]
[root@rac2 ~]# /etc/init.d/oracleasm listdisks
VOL1
VOL2
VOL3
*********************************

5. Create ASM disks. Do this on any one node as a root user.
[root@rac1 ~]# /etc/init.d/oracleasm createdisk VOL4 /dev/sdf1
Marking disk "/dev/sdf1" as an ASM disk: [ OK ]
[root@rac1 ~]# /etc/init.d/oracleasm scandisks
Scanning system for ASM disks: [ OK ]
[root@rac1 ~]# /etc/init.d/oracleasm listdisks
VOL1
VOL2
VOL3
VOL4

Check the ASM Disks from NODE 2
[root@rac2 ~]# /etc/init.d/oracleasm scandisks
Scanning system for ASM disks: [ OK ]
[root@rac2 ~]# /etc/init.d/oracleasm listdisks
VOL1
VOL2
VOL3
VOL4
********************************

6. Configure X-Windows and run DBCA as a oracle user from the primary node, to add the disk to a existing disk group.
7. DBCA: Welcome screen: Select Oracle Real Application clusters database
8. DBCA: Operations Screen: Select Configure Automatic Storage Management ->NEXT
9. Node Selection: Select both the nodes -> Next
10. ASM Disk Groups: Select the Disk Group Name, to assing a new disk
11. Add Disks Screen: Select VOL4, we added before with ASM library
This ends up adding space to a existing Disk group.
** This is for knowledge purpose of knowing how and was experimented on free version software and Operating systems.
Please refer other posts on Linux VMware & Oracle ASM.

Tuesday, May 29, 2007

Oracle 10gR2 Automatic Storage Management Adding a New Disk Group

Oracle 10gR2 Automatic Storage Management(ASM) :
Adding a New Disk Group in VMware OLE.
Oracle Database Version: 10.2.0.1
Oracle Real Applications Cluster
Oracle ASM
Oracle Enterprise Linux
VMware server 1.0.4

Login in as a root user on both the nodes, as this is a cluster database, configure the ASM disks on both the nodes.
Before going further make sure, that the hardware (New Raw Device) as been added / assigned / available to both the nodes.

1) Check the Existing Raw devices and verifying the availability by scanning the disks as below. It should be done on both the nodes.

****************************
[root@rac1 ~]# /etc/init.d/oracleasm scandisks
Scanning system for ASM disks: [ OK ]
[root@rac1 ~]# /etc/init.d/oracleasm listdisks
VOL1
VOL2
VOL3
[root@rac1 ~]#
[root@rac2 ~]# /etc/init.d/oracleasm scandisks
Scanning system for ASM disks: [ OK ]
[root@rac2 ~]# /etc/init.d/oracleasm listdisks
VOL1
VOL2
VOL3
[root@rac2 ~]#
*****************************

2. Check the newly added disk, by using FDISK
************************************************

[root@rac1 ~]# fdisk -l
[…Truncated]
Device Boot Start End Blocks Id System
/dev/sde1 1 261 2096451 83 Linux
Disk /dev/sdf: 8589 MB, 8589934592 bytes
255 heads, 63 sectors/track, 1044 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk /dev/sdf doesn't contain a valid partition table
[root@rac1 ~]#
Disk /dev/sdg doesn't contain a valid partition table
[root@rac1 ~]# fdisk /dev/sdg
Device contains neither a valid DOS partition table, nor Sun, SGI or OSF disklab el
Building a new DOS disklabel. Changes will remain in memory only,
until you decide to write them. After that, of course, the previous
content won't be recoverable.
******************************************************
3. Create disk partition of the newly added disk and we will go ahead preparing raw disk for Oracle ASM (/dev/sdf, /dev/sdg).
********************************************
[root@rac1 ~]# fdisk /dev/sdf
Device contains neither a valid DOS partition table, nor Sun, SGI or OSF disklabel
Building a new DOS disklabel. Changes will remain in memory only,
until you decide to write them. After that, of course, the previous
content won't be recoverable.

The number of cylinders for this disk is set to 1044.
There is nothing wrong with that, but this is larger than 1024,
and could in certain setups cause problems with:
1) software that runs at boot time (e.g., old versions of LILO)
2) booting and partitioning software from other OSs
(e.g., DOS FDISK, OS/2 FDISK)
Warning: invalid flag 0x0000 of partition table 4 will be corrected by w(rite)
Command (m for help): n
Command action
e extended
p primary partition (1-4)
p
Partition number (1-4): 1
First cylinder (1-1044, default 1): 1
Last cylinder or +size or +sizeM or +sizeK (1-1044, default 1044):
Using default value 1044
Command (m for help): w
The partition table has been altered!
Calling ioctl() to re-read partition table.
Syncing disks.
[root@rac1 ~]#
* Same for /dev/sdg
***********************************************************

4. Check the Partition information using fdisk -l again
Disk /dev/sdf: 8589 MB, 8589934592 bytes
255 heads, 63 sectors/track, 1044 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Device Boot Start End Blocks Id System
/dev/sdf1 1 1044 8385898+ 83 Linux

5. Create ASM Disk, on any of the Node as the root user.
[root@rac1 ~]# /etc/init.d/oracleasm createdisk VOL4 /dev/sdf1
Marking disk "/dev/sdf1" as an ASM disk: [ OK ]
[root@rac1 ~]#
[root@rac1 ~]# /etc/init.d/oracleasm createdisk VOL5 /dev/sdg1
Marking disk "/dev/sdg1" as an ASM disk: [ OK ]
6. Make sure the ASM disks are visible from every node.
*********************************************
[root@rac1 ~]# /etc/init.d/oracleasm scandisks
Scanning system for ASM disks: [ OK ]
[root@rac1 ~]# /etc/init.d/oracleasm listdisks
VOL1
VOL2
VOL3
VOL4
VOL5

NODE rac2
[root@rac2 ~]# /etc/init.d/oracleasm scandisks
Scanning system for ASM disks: [ OK ]
[root@rac2 ~]# /etc/init.d/oracleasm listdisks
VOL1
VOL2
VOL3
VOL4
VOL5

[root@rac2 ~]#
*********************************
7. Login in as Oracle user and set your x-windows, to run DBCA.
8. Operations: Select Configure Automatic Storage Management from Database Configuration Assistant(DBCA) and click next.
9. Node Selection: Select the nodes listed, as its a cluster Oracle Database, the Disk group should be visible for both the nodes .
10. ASM DISK GROUPS: Click on Create New Tab below to create a new disk group.
11. Create Disk Group: Enter the name, Redundany (normal) & select the member disks for the new group : VOL4 & VOL5. Select both as the redundancy type is normal. ASM needs to Member disks atleast to go with.
12. ASM Disk Groups: The new diskgroup added just before is seen in the below screen.
13. Click Finsih, to end the New Disk group. You can add disks, you can create tablespaces in the new disk group.

14. Check from ASMCMD as well,
rac1-> export ORACLE_SID=+ASM1
rac1-> asmcmd
ASMCMD> lsdg
State Type Rebal Unbal Sector Block AU Total_MB Free_MB Req_mir_free_MB Usable_file_MB Offline_disks Name
MOUNTED NORMAL N N 512 4096 1048576 6134 3352 0 1676 0 DG1/
MOUNTED NORMAL N N 512 4096 1048576 16378 16192 0 8096 0 DG2/
MOUNTED EXTERN N N 512 4096 1048576 2047 1873 0 1873 0 RECOVERYDEST/
ASMCMD> ls
DG1/
DG2/
RECOVERYDEST/
ASMCMD>

Automatic storage management is a new feature in Oracle Database 10g that provides the solution for the DBA storage Management challeneges.
ASM enables the DBA to change the storage configuration without having to take the database offline. ASM automatically rebalances files across the disk group after disks have been added or dropped.

Thursday, February 02, 2006

RMAN Recovery Manager - Oracle 9i

Steps For Configuring Recovery Catalog

Step 1 :
Create A Seperate Database Or Tablespace For Storing RMAN Catalog.
In This Case We Are Storing The Recovery Catalog In The Same Database.

SQL> Create Tablespace Rman_Tablespace Datafile
2 'C:\Sql\Junept\Datafile\Rman01.dbf' Size 20m Autoextend On Next 1m;
Tablespace created.

Step 2 :
Create A Rman Repository Schema.
SQL> Create User Rman_User Identified By Rman Default Tablespace Rman_Tablespace
2 Temporary Tablespace Temp Quota Unlimited On Rman_Tablespace;
User created.

Step 3 :
Grant Privileges To The Rman User Setting The Default Tablespace To The One Create In Step 1
SQL> Grant Connect,Resource To Rman_User;
Grant succeeded.
SQL> Grant Recovery_Catalog_Owner To Rman_User;
Grant succeeded.

Step 4 :
Create The Catalog Using RMAN
Invoke Rman Utility As Below :
$ORACLE_HOME\Bin> RMAN Catalog Rman_User/Rman@Service
Recovery Manager: Release 9.2.0.1.0 - Production
Copyright (c) 1995, 2002, Oracle Corporation. All rights reserved.
connected to recovery catalog database
recovery catalog is not installed
RMAN>
Now At The Rman Prompt Create The Catalog Into Tablespace Created In Step 1
RMAN> Create Catalog Tablespace Rman_Tablespace;
recovery catalog created
Note : The Execution Of The Above Command Will Create Several Base Tables, View, Synonyms ,
Packages, Etc .
RMAN> Exit

Step 5 :
Now Register Your Database Into The Recovery Catalog.
RMAN_USER SQL> Select * From DB_Database;
no rows selected
The Above Statement Proves That Your Database Is Not Yet Registered Into The Recovery Catalog.
C:\>Rman Target /
Recovery Manager: Release 9.2.0.1.0 - Production
Copyright (c) 1995, 2002, Oracle Corporation. All rights reserved.
connected to target database: JUNEPT (DBID=1185895820)
RMAN> Connect Catalog Rman_User/Rman@Service
connected to recovery catalog database
RMAN> Register Database;
database registered in recovery catalog (A)
starting full resync of recovery catalog
full resync complete
Note : The Above Command Updates All The Base Tables For Storing The Database Information Which Is Resistered.
To Prove The Above Said Issue The Following Commands :
RMAN_User SQL> Select Name From Rc_Database;
RMAN_User SQL> Select Tablespace_Name,Name From Rc_Datafile;
RMAN_User SQL> Select Name From Rc_Redo_Log;
/* The Configuration Of Recovery Catalog Is Completed. */
 
Copyright © 2005 - 2008 DBA-ONWeb Technical blog. All rights reserved