dcsimg
Database Journal
MS SQL Oracle DB2 Access MySQL PostgreSQL Sybase PHP SQL Etc SQL Scripts & Samples Tips Database Forum

» Database Journal Home
» Database Articles
» Database Tutorials
MS SQL
Oracle
DB2
MS Access
MySQL
» RESOURCES
SQL Scripts & Samples
Tips
» Database Forum
» Slideshows
» Sitemap
Free Newsletters:
DatabaseDaily  

By submitting your information, you agree that databasejournal.com may send you databasejournal offers via email, phone and text message, as well as email offers about other products and services that databasejournal believes may be of interest to you. databasejournal will process your information in accordance with the Quinstreet Privacy Policy.

News Via RSS Feed


Database Journal |DBA Support |SQLCourse |SQLCourse2
 

Featured Database Articles

Oracle

Posted Apr 5, 2011

Oracle 11gR2 I/O Performance Tuning: Implementing I/O Performance Improvements - Page 2

By Jim Czuprynski


/*
|| Oracle 11gR2: I/O Performance Tuning Series, Listing 7
||
|| Contains:
|| -- Batch commands and SQL statements to create beginning and ending
||    AWR snapshots at the start and end of each Benchmark Factory job run
||
|| that . . .
||
|| Author: Jim Czuprynski
||
*/

/*
|| Listing 7.1:
|| Backing up selected tablespaces as image copies to ASM storage
*/

#
[oracle@11gR2Base AP_LoadGenerator]$ rman target /

Recovery Manager: Release 11.2.0.1.0 - Production on Sat Feb 5 21:19:47 2011

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

connected to target database: TPCDB (DBID=195077799)

RMAN> RUN {
        BACKUP AS COPY FORMAT '+DATA' TABLESPACE ap_data;
        BACKUP AS COPY FORMAT '+DATA' TABLESPACE ap_idx;
        BACKUP AS COPY FORMAT '+DATA' TABLESPACE example;
}

2> 3> 4> 5> 
Starting backup at 2011-02-05 21:20:08
using target database control file instead of recovery catalog
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=18 device type=DISK
channel ORA_DISK_1: starting datafile copy
input datafile file number=00006 name=/u01/app/oracle/oradata/tpcdb/ap_data01.dbf
output file name=+DATA/tpcdb/datafile/ap_data.256.742339219 tag=TAG20110205T212010 RECID=2 STAMP=742339227
channel ORA_DISK_1: datafile copy complete, elapsed time: 00:00:25
Finished backup at 2011-02-05 21:20:36

Starting backup at 2011-02-05 21:20:36
using channel ORA_DISK_1
channel ORA_DISK_1: starting datafile copy
input datafile file number=00007 name=/u01/app/oracle/oradata/tpcdb/ap_idx01.dbf
output file name=+DATA/tpcdb/datafile/ap_idx.257.742339237 tag=TAG20110205T212036 RECID=3 STAMP=742339246
channel ORA_DISK_1: datafile copy complete, elapsed time: 00:00:15
Finished backup at 2011-02-05 21:20:51

Starting backup at 2011-02-05 21:20:51
using channel ORA_DISK_1
channel ORA_DISK_1: starting datafile copy
input datafile file number=00005 name=/u01/app/oracle/oradata/tpcdb/example01.dbf
output file name=+DATA/tpcdb/datafile/example.258.742339253 tag=TAG20110205T212051 RECID=4 STAMP=742339259
channel ORA_DISK_1: datafile copy complete, elapsed time: 00:00:15
Finished backup at 2011-02-05 21:21:06

/*
|| Listing 7.2:
|| Switching the selected tablespaces to ASM storage
*/

RMAN>   SQL "ALTER TABLESPACE ap_data OFFLINE IMMEDIATE";
        SQL "ALTER TABLESPACE ap_idx OFFLINE IMMEDIATE";
        SQL "ALTER TABLESPACE example OFFLINE IMMEDIATE";

sql statement: ALTER TABLESPACE ap_data OFFLINE IMMEDIATE

RMAN> 
sql statement: ALTER TABLESPACE ap_idx OFFLINE IMMEDIATE

RMAN> 
sql statement: ALTER TABLESPACE example OFFLINE IMMEDIATE

RMAN>   SWITCH TABLESPACE ap_data TO COPY;
        RECOVER TABLESPACE ap_data;

        SWITCH TABLESPACE ap_idx TO COPY;
        RECOVER TABLESPACE ap_idx;

        SWITCH TABLESPACE example TO COPY;
        RECOVER TABLESPACE example;

datafile 6 switched to datafile copy "+DATA/tpcdb/datafile/ap_data.256.742339219"

RMAN> 
Starting recover at 2011-02-05 21:21:38
using channel ORA_DISK_1

starting media recovery
media recovery complete, elapsed time: 00:00:01

Finished recover at 2011-02-05 21:21:39

RMAN> 
RMAN> 
datafile 7 switched to datafile copy "+DATA/tpcdb/datafile/ap_idx.257.742339237"

RMAN> 
Starting recover at 2011-02-05 21:21:39
using channel ORA_DISK_1

starting media recovery
media recovery complete, elapsed time: 00:00:00

Finished recover at 2011-02-05 21:21:39

RMAN> 
RMAN> 
datafile 5 switched to datafile copy "+DATA/tpcdb/datafile/example.258.742339253"

RMAN> 
Starting recover at 2011-02-05 21:21:40
using channel ORA_DISK_1

starting media recovery
media recovery complete, elapsed time: 00:00:00

Finished recover at 2011-02-05 21:21:40

RMAN>   SQL "ALTER TABLESPACE ap_data ONLINE";
        SQL "ALTER TABLESPACE ap_idx ONLINE";
        SQL "ALTER TABLESPACE example ONLINE";


sql statement: ALTER TABLESPACE ap_data ONLINE

RMAN> 
sql statement: ALTER TABLESPACE ap_idx ONLINE

RMAN> 
sql statement: ALTER TABLESPACE example ONLINE


Oracle Archives

Comment and Contribute

 


(Maximum characters: 1200). You have characters left.

 

 




Latest Forum Threads
Oracle Forum
Topic By Replies Updated
Oracle Data Mining: Classification jan.hasller 0 July 5th, 07:19 AM
Find duplicates - Unique IDs Lava 5 July 2nd, 08:30 AM
no matching unique or primary key rcanter 1 April 25th, 12:32 PM
Update values of one table based on condition of values in other table using Trigger Gladiator 3 February 29th, 06:01 PM