Добавил:
Upload Опубликованный материал нарушает ваши авторские права? Сообщите нам.
Вуз: Предмет: Файл:
Oracle Database 11g.pdf
Скачиваний:
78
Добавлен:
10.06.2015
Размер:
12.69 Mб
Скачать

Lab 11.1: Exporting a Transportable Tablespace  

757

Lab 11.1: Exporting a Transportable

Tablespace

This lab was created using Windows XP. However, it should also work using Unix (and in fact was tested using Linux). In this lab, you’ll export a transportable tablespace set.

1.Query the v$transportable_platform view to determine which destination platforms are compatible with the source database platform.

SQL> select

* from v$transportable_platform;

 

PLATFORM_ID

PLATFORM_NAME

 

ENDIAN_FORMAT

-----------

--------------------------------

--------------

1

Solaris[tm] OE (32-bit)

Big

2

Solaris[tm] OE (64-bit)

Big

7

Microsoft Windows

IA (32-bit)

Little

10

Linux IA (32-bit)

 

Little

6

AIX-Based Systems

(64-bit)

Big

3

HP-UX (64-bit)

 

Big

5

HP Tru64 UNIX

 

Little

4

HP-UX IA (64-bit)

 

Big

11

Linux IA (64-bit)

 

Little

15

HP Open VMS

 

Little

8

Microsoft Windows

IA (64-bit)

Little

9

IBM zSeries Based

Linux

Big

13

Linux 64-bit for AMD

Little

16

Apple Mac OS

 

Big

12

Microsoft Windows

64-bit for AMD

Little

17

Solaris Operating

System (x86)

Little

18

IBM Power Based Linux

Big

19

HP IA Open VMS

 

Little

20

Solaris Operating

System (AMD64)

Little

19 rows selected. SQL>

2.After you have identified the names of the tablespaces you want to transport, execute the DBMS_TTS.TRANSPORT_SET_CHECK procedure. Next, query the TRANSPORT_ SET_VIOLATIONS view.

SQL> SET SERVEROUTPUT ON

SQL> exec dbms_tts.transport_set_check (‘USER_DATA’); PL/SQL procedure successfully completed.

758  Appendix A  n  Lab Exercises

SQL> SELECT * FROM TRANSPORT_SET_VIOLATIONS;

SQL>

3.To generate the transportable tablespace set, you’ll need to place the tablespaces in read-only mode.

SQL>alter tablespace user_data read only; Tablespace altered.

4.Exit to the host prompt and execute the data pump export utility to export the metadata.

SQL>host

C:\>expdp dumpfile=expdat.dmp DIRECTORY=exp_dir TRANSPORT_TABLESPACES= user_data

Export: Release 11.1.0.6.0 - Production on Sunday, 28 September, 2008 14:40:19

Copyright (c) 2003, 2007, Oracle. All rights reserved.

Username: sys as sysdba Password:

Connected to: Oracle Database 11g Enterprise Edition Release 11.1.0.6.0 - Produc

tion

With the Partitioning, OLAP, Data Mining and Real Application Testing options

Starting “SYS”.”SYS_EXPORT_TRANSPORTABLE_01”: sys/******** AS SYSDBA dumpfile=e

xpdat.dmp DIRECTORY=EXP_DIR TRANSPORT_TABLESPACES= user_data Processing object type TRANSPORTABLE_EXPORT/PLUGTS_BLK Processing object type TRANSPORTABLE_EXPORT/TABLE Processing object type TRANSPORTABLE_EXPORT/INDEX

Processing object type TRANSPORTABLE_EXPORT/CONSTRAINT/CONSTRAINT Processing object type TRANSPORTABLE_EXPORT/INDEX_STATISTICS Processing object type TRANSPORTABLE_EXPORT/TABLE_STATISTICS Processing object type TRANSPORTABLE_EXPORT/POST_INSTANCE/PLUGTS_BLK Master table “SYS”.”SYS_EXPORT_TRANSPORTABLE_01”

successfully loaded/unloaded

*************************

Dump file set for SYS.SYS_EXPORT_TRANSPORTABLE_01 is:

Lab 11.2: Testing Resumable Space Allocation 

759

C:\TEMP\EXPDAT.DMP

*************************

Datafiles required for transportable tablespace USER_DATA: C:\ORACLE\ORADATA\ORCL\USER_DATA01.DBF

Job “SYS”.”SYS_EXPORT_TRANSPORTABLE_01” successfully completed at 14:41:47

5.Now copy the tablespace database files to the staging area, either local or remote. Once the copy is complete, return to SQL*Plus and place the tablespaces in read-write mode:

SQL>alter tablespace user_data read write; Tablespace altered.

SQL>

Lab 11.2: Testing Resumable

Space Allocation

In this lab, you will perform a more detailed resumable-space-allocation exercise. You will create a table, start an insert operation that will create a resumable condition, monitor the table’s space utilization, and then remedy the condition.

1.Shrink the existing USER_DATA tablespace and create a table with minimal storage values.

SQL> alter database datafile ‘c:\oracle\oradata\orcl\user_data01.dbf’ resize 10 m;

Database altered.

SQL> create table scott.resumable_test (x number, y varchar2(10))

storage (initial 1k maxextents 1) tablespace user_data;

Table created.

2.Start an insert operation.

SQL> insert into resumable_test values (1, ‘testtest’); SQL> insert into resumable values (1, ‘testtest’);

1 row created.

SQL> insert into resumable select * from resumable; 1 row created.

760  Appendix A  n  Lab Exercises

SQL> /

2 rows created. SQL> /

4 rows created. SQL> /

8 rows created. SQL> /

16 rows created. SQL> /

32 rows created. SQL> /

64 rows created. SQL> /

128 rows created. SQL> /

256 rows created. SQL> /

512 rows created. SQL> /

1024 rows created. SQL> /

2048 rows created. SQL> /

4096 rows created. SQL> /

8192 rows created. SQL> /

16384 rows created. SQL> /

32768 rows created. SQL> /

65536 rows created. SQL> /

131072 rows created. SQL> /

The session should hang at this point.

3.Monitor the operation from another SQL*Plus session:

SQL> select session_id, sql_text, error_msg from dba_resumable;

Соседние файлы в предмете [НЕСОРТИРОВАННОЕ]