Vous êtes sur la page 1sur 25

Managing Space for the Database

Copyright © 2009, Oracle. All rights reserved.


Objectives

After completing this lesson, you should be able to:


• Describe the concepts and use of 4 KB-sector disks
• Use transportable tablespaces
• Describe the concepts of transportable databases

19 - 2 Copyright © 2009, Oracle. All rights reserved.


Database Storage

Instance
SMON PMON RECO Others

SGA
Database Redo log
Shared pool
buffer cache buffer
PGA
Server
DBWn CKPT LGWR ARCn
process

User
process Control Online redo
Data files files log files Archived
Database log files

19 - 3 Copyright © 2009, Oracle. All rights reserved.


Supporting 4-KB Sector Disks

• Emulation mode:
LBA0 LBA1 LBA2 LBA3 LBA4 LBA5 LBA6 LBA7

4,096-byte physical sector

• Native mode:
Logical sector
LBA0

4,096-byte physical sector

Physical sector

19 - 4 Copyright © 2009, Oracle. All rights reserved.


Using 4-KB Sector Disks

Emulation mode: Native mode:


• Recommended 4-KB block • Mandatory 4-KB block size
size for logs for logs
• Recommended 4-KB block • Mandatory 4-KB block size
size (or larger) for data files (or larger) for data files
Not affected:
• Control file block size: 16 KB

Control Online redo Archived


Data files files log files log files
Database

19 - 5 Copyright © 2009, Oracle. All rights reserved.


Specifying the Disk Sector Size

Using the SECTOR_SIZE and BLOCKSIZE clauses of the


following commands:
• CREATE DISKGROUP
• ALTER DATABASE Default sector size based
on hardware (not the
• CREATE DATABASE earlier 512-byte sectors)
• CREATE CONTROL FILE
CREATE DATABASE sample NORESETLOGS FORCE LOGGING
ARCHIVELOG
LOGFILE
GROUP 1 '$ORACLE_BASE/oradata/sample/redo01.log'
SIZE 100M BLOCKSIZE 4096,
GROUP 2 '$ORACLE_BASE/oradata/sample/redo02.log‘
SIZE 100M BLOCKSIZE 4096
DATAFILE
...

19 - 6 Copyright © 2009, Oracle. All rights reserved.


Quiz

You must use 4-KB log files on 4-KB native mode disks.
1. True
2. False

19 - 7 Copyright © 2009, Oracle. All rights reserved.


Quiz

Oracle recommends that you create 512-byte blocks on a 4-KB


emulation disk for performance reasons.
1. True
2. False

19 - 8 Copyright © 2009, Oracle. All rights reserved.


Quiz

Control files are not affected by 4-KB sector disks (because


they are already larger).
1. True
2. False

19 - 9 Copyright © 2009, Oracle. All rights reserved.


Transporting Tablespaces

• Cross-platform transportable tablespaces:


– Simplify moving data between data warehouse and data
marts
– Allow database migration from one platform to another
• Supported platforms include:
Solaris[tm] OE (32-bit) HP-UX (64-bit) Microsoft Windows IA (64-bit)

Solaris[tm] OE (64-bit) HP Tru64 UNIX IBM zSeries Based Linux

Microsoft Windows IA (32-bit) HP-UX IA (64-bit) Linux 64-bit for AMD

Linux IA (32-bit) Linux IA (64-bit) Apple Mac OS

AIX-Based Systems (64-bit) HP Open VMS Microsoft Windows 64-bit AMD

IBM Power Based Linux HP IA Open VMS Solaris x86 and AMD64

19 - 10 Copyright © 2009, Oracle. All rights reserved.


Concept: Minimum Compatibility Level

• Both source and target databases must have


COMPATIBLE set to 10.0.0 or higher.
• Data file headers are platform-aware.
• Before transporting, make sure that all read-only and
offline files are platform-aware.

Read/ Read/
write write

Read- Read- Read/ Read-


only only write only
COMPATIBLE=9.2.0 COMPATIBLE=10.0.0

19 - 11 Copyright © 2009, Oracle. All rights reserved.


Minimum Compatibility Level

Minimum Compatibility Setting


Source Database Target Database
Transport Scenario
Databases on the same platform 8.0 8.0
Tablespace with different database block 9.0 9.0
size than the target database
Databases on different platforms 10.0 10.0

19 - 12 Copyright © 2009, Oracle. All rights reserved.


Transportable Tablespace Procedure

Source Make tablespaces read-only.

Use Data Pump to extract metadata.

Target
uses the same No
endian format?
Convert data files
by using RMAN.
Yes

Ship data files and dump file to target.

Use Data Pump to import metadata.

Target Make tablespaces read/write.

19 - 13 Copyright © 2009, Oracle. All rights reserved.


Determining the Endian Format of a Platform

SELECT tp.endian_format
FROM v$transportable_platform tp, v$database d
WHERE tp.platform_name = d.platform_name;

Source Target

19 - 14 Copyright © 2009, Oracle. All rights reserved.


Using the RMAN CONVERT Command

RMAN:
• Converts tablespaces, data files, or databases to the
format of a destination platform
• Does not change input files
• Writes converted files to output destination
CONNECT TARGET SYS@orcl
RMAN>
SQL 'ALTER TABLESPACE hr READ ONLY';
CONVERT TABLESPACE hr
TO PLATFORM 'Solaris[tm] OE (64-bit)'
FORMAT '/tmp/transport_to_solaris/%U';;

19 - 16 Copyright © 2009, Oracle. All rights reserved.


Transportable Tablespaces with
Enterprise Manager

19 - 17 Copyright © 2009, Oracle. All rights reserved.


Transportable Tablespaces with
Enterprise Manager

19 - 18 Copyright © 2009, Oracle. All rights reserved.


Transportable Tablespaces with
Enterprise Manager

19 - 19 Copyright © 2009, Oracle. All rights reserved.


Transporting Databases

• Generalize the transportable tablespace feature.


• Data subsets can easily be distributed from a data
warehousing environment to data marts, which are usually
on smaller platforms.
• A database can be migrated from one platform to another
very quickly.

Platform X Same “endianness” Platform Y

Database files transfer

Existing database New database

19 - 20 Copyright © 2009, Oracle. All rights reserved.


Database Transportation Procedure:
Source System Conversion

Open database in READ ONLY mode


and COMPATIBLE=10.0.0 or higher.

Ship
Read- Read- Read- Read-
files only only
only CONVERT only
DATABASE
TO PLATFORM

Source Target
system system

19 - 21 Copyright © 2009, Oracle. All rights reserved.


Database Transportation Procedure:
Target System Conversion

Open database in READ ONLY mode


and COMPATIBLE=10.0.0 or higher

CONVERT
DATABASE Read- Ship Read- Read- Read-
ON DESTINATION only only only only
files
PLATFORM

Source Target
system system

19 - 22 Copyright © 2009, Oracle. All rights reserved.


Database Transportation: Considerations

• Create the password file on the target platform.


• Transport the BFILEs used in the source database.
• The generated PFILE and transport script use OMF.
• Use DBNEWID to change the DBID.

19 - 23 Copyright © 2009, Oracle. All rights reserved.


Quiz

Select the statements that are true:


1. The RMAN CONVERT command performs an in-place
conversion, so your input files are changed before they are
transported to the destination.
2. Read/write tablespaces need to be in read-only mode at
the time of an endian conversion.
3. You can use the RMAN CONVERT command for tables,
tablespaces, and databases.
4. You can transport databases into a data warehouse
environment.

19 - 24 Copyright © 2009, Oracle. All rights reserved.


Summary

In this lesson, you should have learned how to:


• Describe the concepts and use of 4 KB-sector disks
• Describe the concepts of transportable tablespaces and
databases

19 - 25 Copyright © 2009, Oracle. All rights reserved.


Practice 19 Overview:
Managing Space for the Database
This practice covers the following topic:
• Viewing a demonstration on “Using 4 KB-sector disks”

19 - 26 Copyright © 2009, Oracle. All rights reserved.