Sunteți pe pagina 1din 73

COMPRESS TEST FOR HISTORIC DATABASES

Alejandro Vargas
Oracle Israel

TABLE OF CONTENTS

About the Test .................................................................................................................................................................................................... 6


List of Tested Scenarios ............................................................................................................................................................................ 7
Scenario #1. Alter Table Move Compress into ASM Based Tablespace. .......................................................................... 8
Previous check ................................................................................................................................................................................................ 8
Check table names and sizes before moving............................................................................................................................ 8
Execute Move Objects .................................................................................................................................................................................. 9
Move Tables.................................................................................................................................................................................................... 9
Rebuild Indexes .......................................................................................................................................................................................... 9
Result Scenario 1 ....................................................................................................................................................................................... 10
Commands used: .......................................................................................................................................................................................... 10
Results:......................................................................................................................................................................................................... 10
CONSISTENCY CHECK:................................................................................................................................................................................. 11
On Linux's 10g zylnx:.......................................................................................................................................................................... 11
On Srvtst's 10g zycmp: ....................................................................................................................................................................... 11
On Srvprd's 10g zyhist:..................................................................................................................................................................... 12
Scenario #2. 10g Export Data Pump and Import Data Pump into ASM Based Tablespace................................... 14
Cleanup on Linux the previously plugged in tablespace................................................................................................. 14
Connect to 10g .......................................................................................................................................................................................... 14
Create a directory on 10g on Solaris to hold the export file ................................................................................ 16
Export main table using export data pump on 10g and Solaris .................................................................................. 16
FTP dump file to Linux ........................................................................................................................................................................... 17
Rename the old table and create a new empty compress enabled table to hold the new data ............... 17
Import dump file using impdp into 10g on Linux.................................................................................................................. 18
Create a directory to hold the dump file ............................................................................................................................ 18
Import in parallel................................................................................................................................................................................. 18
Scenario #3: 10g Parallel export Data Pump and import from NFS mounted File System, into ASM
Based Tablespace. ........................................................................................................................................................................................... 21
Export using Parallel 8......................................................................................................................................................................... 21
Timing.............................................................................................................................................................................................................. 21
Parallel command and log .................................................................................................................................................................. 21
Create NFS mount on Linux of the Solaris directory .................................................................................................... 22
10g Import Data Pump from NFS, into ASM Based Tablespace .................................................................................. 22
Scenario #4: Parallel Insert as select from Solaris into ASM Based Tablespace ........................................... 24
Scenario #5: Sequential Insert as select from Solaris into ASM Based Tablespace ...................................... 26
Scenario #6: Transportable Tablespace based on NFS mounted filesystem + Move table ............................... 27
Perform transportable tablespace export for the selected tablespace ............................................................... 27
Convert the Solaris based tablespace to Linux format ................................................................................................... 27
Place the converted files on an NFS file system that is mounted on the Target Linux Server ........ 27
Import metadata on Linux database pointing to the datafiles located on the NFS mounted File
System.................................................................................................................................................................................................................. 27
Move selected table into ASM based tablespace .................................................................................................................... 28
Scenario #7: Transportable Tablespace + Move table into FS based tablespace (scenario 1 with FS)
.................................................................................................................................................................................................................................... 29
Perform transportable tablespace export for the selected tablespace ............................................................... 29
Convert the Solaris based tablespace to Linux format ................................................................................................... 29
FTP converted datafiles to Linux ................................................................................................................................................... 29
Import metadata on Linux database pointing to the datafiles located on the NFS mounted File
System.................................................................................................................................................................................................................. 29
Create a FS based tablespace on Linux ....................................................................................................................................... 30
Check table size before moving ........................................................................................................................................................ 30
Move table compress to FS based tablespace ........................................................................................................................... 31
Scenario #8: Import data pump using network link................................................................................................................. 32
Create database links to the possible source databases .............................................................................................. 32
Execute the import using the network_link parameter...................................................................................................... 32
Both databases need to be 10.1.0.3 at least, if not you will get ora-39022 .......................................... 32
After installing patch 10.1.0.3 on Solaris the import works fine .................................................................. 33
Result.............................................................................................................................................................................................................. 33
Scenario #9: Comparison test, move table in 8i, compare time with move on 10g ........................................... 35
Create tablespace to move table...................................................................................................................................................... 35
Move table ........................................................................................................................................................................................................ 35
Compare times................................................................................................................................................................................................. 36
Removing a big table based on ASM storage.................................................................................................................................. 36
References:.......................................................................................................................................................................................................... 37
Note:277650.1 How to Use Export and Import when Transferring Data Across Platforms ........................... 37
Note:261013.1 Importing into Existing tables with Oracle Data Pump.................................................................. 37
Note:272132.1 Import DataPump - User Schema is Created by Import ...................................................................... 37
Aditional Technical Notes and tips: ................................................................................................................................................ 38
Compress Test Preparation Steps.......................................................................................................................................................... 39
Prepare Source Data on the 8.1.7.4 database......................................................................................................................... 39
Create a tablespace to exchange partitions ....................................................................................................................... 39
Prepare a script to create the tables and indexes that sit on the tablespace to transport ...... 40
Prepare a script to exchange the partitions with the new tables..................................................................... 41
Set the tablespace to transport to read only .................................................................................................................. 41
Export tablespace to transport metadata .............................................................................................................................. 42
Check the exchanged objects sizes............................................................................................................................................. 43
Check the tablespace datafiles .................................................................................................................................................... 43
Copy datafiles and metadata dump to working server .................................................................................................... 44
Create a new 8.1.7.4 database to plug in the tablespace and start to work. .............................................. 44
Create and prepare database zycmp on server srvtst 8174 64 bits. .................................................................. 44
Plug in the transported tablespaces into zycmp.............................................................................................................. 44
Install 10g on Solaris to upgrade the 8.1.7 database.................................................................................................. 45
Use custom Install without database ........................................................................................................................................ 46
Upgrade the 8.1.7 database to 10g................................................................................................................................................. 46
Use Database Upgrade Assistant to upgrade.......................................................................................................................... 46
Transport tablespace to Linux .......................................................................................................................................................... 46
Check the OS platform compatibility, from Solaris to Unix ................................................................................... 46
Set tablespace to read only ........................................................................................................................................................... 47
Export Metadata ........................................................................................................................................................................................ 47
Check the compatibility parameter and change if needed .......................................................................................... 48
Prepare to convert the datafiles to Linux format............................................................................................................. 49
Setup a destination directory ...................................................................................................................................................... 49
Convert datafiles to Linux format................................................................................................................................................. 50
Invoke Rman and check if the tablespace is recognized............................................................................................. 50
Execute the Convert tablespace command to change datafiles to Linux format. ........................................ 51
Ftp or rcp files to Linux ................................................................................................................................................................ 52
Prepare to Plug In into Linux 10g database the converted datafiles. ............................................................... 52
Rename transferred datafiles to their original names ............................................................................................... 52
Check original names on source 10g database..................................................................................................................... 52
Move transferred files on Linux.................................................................................................................................................. 53
Create user fyt_rent on zylnx and grant to it dba ...................................................................................................... 54
If necessaire change national character set to match the nchar of the export...................................... 54
Enable an 8k cache size to plug the 8k block size tablespace into the 32k block size database
............................................................................................................................................................................................................................ 54
Import the metadata: ............................................................................................................................................................................ 54
Check the tablespaces on the Linux database after the plug in.......................................................................... 55
10g Install on Linux AMD64...................................................................................................................................................................... 57
Pre Install requisites ........................................................................................................................................................................... 57
Pre Install checkups ................................................................................................................................................................................ 57
10g ASM, Automatic Storage Manager configuration................................................................................................................. 58
10g Automatic Storage Manager Setup ............................................................................................................................................ 58
Reference Note .......................................................................................................................................................................................... 58
Rpm’s to use, checks and install ............................................................................................................................................... 58
Automatic Storage Manager Libraries (ASMLib) configuration......................................................................................... 59
Automatic Storage Manager (ASM) disks preparation .............................................................................................................. 60
10g Install.......................................................................................................................................................................................................... 63
10g Database Creation on Linux........................................................................................................................................................... 64
top......................................................................................................................................................................................................................... 64
Start ASM instance fail with ORA-29701 unable to connect to Cluster Manager ................................................ 65
Impdp ........................................................................................................................................................................................................................ 67
How to attach to a job and kill it .......................................................................................................................................... 67
Setting 10g Archive log mode with destination out of ASM.............................................................................................. 71
Backup Database using RMAN...................................................................................................................................................................... 72
How to shutdown ocssd.................................................................................................................................................................................. 73
About the Test

This test was designed to check the benefit of data compression to store read only data.
The test was performed using Oracle RDBMS 10.g version 10.0.1.3.0 on Linux and Solaris.
This test was intended to check how long may take to transfer 6 TB of historic data to a 10g Linux based database.
The test was implemented by taking a single partition from the main historic table as sample data, plugging its tablespace into a 10g
database in UNIX, Solaris 5.8 used as a staging area for all the tests.
Each test moved 31 G of data, 8 Scenarios were tested:

1: Alter Table Move Compress into ASM Based Tablespace.


2: 10g Export Data Pump and Import Data Pump into ASM Based Tablespace.
3: 10g Parallel export Data Pump and import from NFS mounted File System, into ASM Based Tablespace.
4: Parallel Insert as select from Solaris into ASM Based Tablespace
5: Sequential Insert as select from Solaris into ASM Based Tablespace
6: Transportable Tablespace based on NFS mounted filesystem + Move table
7: Transportable Tablespace + Move table into FS based tablespace (scenario 1 with FS)
8: Import data pump using network link
9: Comparison test, move table in 8i, compare time with move on 10g

STEP TEST 1: TEST 2: TEST 3: TEST 4: TEST 5: TEST 6: TEST 7: TEST 8: TEST 9:
CONVERT TIME 54 Min 0 Min 0 Min 0 Min 0 Min 54 Min 54 Min 0 Min 0 Min
EXPORT TIME 0 Min 41 Min 0 Min 0 Min 0 Min 0 Min 0 Min 0 Min 0 Min
FTP TIME 86 Min 57 Min 0 Min 0 Min 0 Min 0 Min 86 Min 0 Min 0 Min
MOVE TIME 17 Min 0 Min 0 Min 0 Min 0 Min 51 Min 18 Min 0 Min 40 Min
IMPORT TIME 0 Min 74 Min 79 Min 109 Min 126 Min 0 Min 0 Min 124 Min 0 Min
TOTAL TIME 157 Min 172 Min 120 Min 109 Min 126 Min 105 Min 158 Min 124 Min not relevant
COMPRESSION 73 % 73 % 71 % 63 % 74% 73% 73% 13% 0%

Based on the tests results the best estimation to move 6 Tera of data is:

Simplest Test : #5 Insert as select from source = ~4.2 min/Giga, 420 hours, 17.5 days.
Best Test : #6 Upgrade to 10g / Convert/ NFS mount & Move = ~3.5 min/Giga, 350 hours, 14.5 days
List of Tested Scenarios
top

Scenario #1: Alter Table Move Compress into ASM Based Tablespace.
Scenario #2: 10g Export Data Pump and Import Data Pump into ASM Based Tablespace.
Scenario #3: 10g Parallel export Data Pump and import from NFS mounted File System, into ASM Based Tablespace.
Scenario #4: Parallel Insert as select from Solaris into ASM Based Tablespace
Scenario #5: Sequential Insert as select from Solaris into ASM Based Tablespace
Scenario #6: Transportable Tablespace based on NFS mounted filesystem + Move table
Scenario #7: Transportable Tablespace + Move table into FS based tablespace (scenario 1 with FS)
Scenario #8: Import data pump using network link
Scenario #9: Comparison test, move table in 8i, compare time with move on 10g

top
Scenario #1. Alter Table Move Compress into ASM Based Tablespace.
top

Previous check

Check table names and sizes before moving

> SELECT segment_type,segment_name,bytes/1024/1024 MB


FROM DBA_SEGMENTS
WHERE SEGMENT_NAME IN(SELECT table_name from dba_tables where owner='FYT_RENT')

SEGMENT_TYPE SEGMENT_NAME MB
--------------- -----------------------------------
TABLE CMP_TAB_DET_ALL_P 29700
TABLE TAB_DET_ALL_P0410_BC13 300
TABLE CMP_CALL_PART_TAB_P 300
TABLE CMP_CONT_FREE_UNIT_TAB_P 300
TABLE CMP_INCOME_DETAIL_TAB_P 3300

> SELECT segment_type,segment_name,bytes/1024/1024 MB


FROM DBA_SEGMENTS
WHERE SEGMENT_NAME IN(SELECT index_name from dba_indexes where owner='FYT_RENT')
/

SEGMENT_TYPE SEGMENT_NAME MB
--------------- ------------------------------ ----
INDEX CMP_IND_TAB_DET_ALL 4800
INDEX CMP_PK_INCOME_DETAIL_TAB_P 600
INDEX CMP_PK_CONT_FREE_UNIT_TAB_P 300
INDEX CMP_CALL_PART_TAB_P_I1 300
Execute Move Objects

Move Tables

SQL> alter table fyt_rent.CMP_TAB_DET_ALL_P move compress parallel tablespace data;


Table altered.
Elapsed: 00:17:16.48

SQL> alter table fyt_rent.TAB_DET_ALL_P0410_BC13 move compress tablespace data;


Table altered.
Elapsed: 00:00:00.09

SQL> alter table fyt_rent.CMP_CALL_PART_TAB_P move compress parallel tablespace data;


Table altered.
Elapsed: 00:00:09.71

SQL> alter table fyt_rent.CMP_CONT_FREE_UNIT_TAB_P move compress tablespace data;


Table altered.
Elapsed: 00:00:31.80

SQL> alter table fyt_rent.CMP_INCOME_DETAIL_TAB_P move compress tablespace data;


Table altered.
Elapsed: 00:09:04.79

Rebuild Indexes

SQL> alter index fyt_rent.CMP_IND_TAB_DET_ALL rebuild tablespace data nologging parallel;


Index altered.
Elapsed: 00:10:06.76

SQL> alter index fyt_rent.CMP_PK_INCOME_DETAIL_TAB_P rebuild tablespace data nologging


parallel;
Index altered.
Elapsed: 00:01:51.89
SQL> alter index fyt_rent.CMP_PK_CONT_FREE_UNIT_TAB_P rebuild tablespace data nologging
parallel;
Index altered.
Elapsed: 00:00:09.01

SQL> alter index fyt_rent.CMP_CALL_PART_TAB_P_I1 rebuild tablespace data nologging


parallel;
Index altered.
Elapsed: 00:00:00.06

Result Scenario 1

Commands used:
alter table <tname> move compress parallel tablespace <tbsp>;
alter index <iname> rebuild tablespace <tbsp> nologging parallel;

Results:
TABLES

TABLE NAME MB BEFORE MB AFTER %COMPRESSED MOVE TIME


----------------------------- ---------- ------------- ----------------- ----------------
CMP_TAB_DET_ALL_P 29700 8003 73% 00:17:16.48 (parallel)
TAB_DET_ALL_P0410_BC13 300 304 0% 00:00:00.09 (no parallel)
CMP_CALL_PART_TAB_P 300 000.188 100% 00:00:09.71 (empty table**)
CMP_CONT_FREE_UNIT_TAB_P 300 62 73% 00:00:31.80 (no parallel)
CMP_INCOME_DETAIL_TAB_P 3300 1600 52% 00:09:04.79 (no parallel)

** An empty table has an allocation of 1 extent on the regular tablespace, that is 300MB on the
plugged tablespace. On the ASM based tablespace the size of the stripe unit is 1 MB, the disk is
uniformly divided into 1MB cells, The space allocation required for the empty table is 0.188 MB! .
INDEXES
INDEX NAME MB BEFORE MB AFTER %COMPRESSED MOVE TIME
----------------------------- --------------------- ----------------- ---------------- -------------------------
CMP_IND_TAB_DET_ALL 4,800 802 83% 00:10:06.76 (parallel)
CMP_PK_INCOME_DETAIL_TAB_P 600 55 90% 00:01:51.89 (parallel)
CMP_CALL_PART_TAB_P_I1 300 304 0% 00:00:00.06 (parallel)
CMP_PK_CONT_FREE_UNIT_TAB_P 300 305 0% 00:00:09.01 (parallel)

CONSISTENCY CHECK:

On Linux's 10g zylnx:

SQL> show parameters db_block_size

NAME TYPE VALUE


------------------------------------ ---------- ------------------------------
db_block_size integer 32768 (NOTE: On AMD64 we can have 32k block size)

SQL> select count(*) from fyt_rent.CMP_TAB_DET_ALL_P;

COUNT(*)
----------
76144304

SQL> l
1 select bytes/1024/1024 MB from dba_segments
2 where segment_name='CMP_TAB_DET_ALL_P'
3* and segment_type='TABLE' and owner='FYT_RENT'
SQL> /

MB
----------
8003

On Srvtst's 10g zycmp:


{oracle} /srvtst/app01/oracle/product [Srvtst] > 10g
{oracle} /srvtst/app01/oracle/product [Srvtst] > sts zycmp
{oracle} /srvtst/app01/oracle/product [Srvtst] > sqlplus /

SQL*Plus: Release 10.1.0.2.0 - Production on Mon Feb 7 17:13:52 2005

Copyright (c) 1982, 2004, Oracle. All rights reserved.

Connected to:
Oracle Database 10g Enterprise Edition Release 10.1.0.2.0 - 64bit Production
With the Partitioning and Data Mining options

SQL> show parameters db_block_size

NAME TYPE VALUE


------------------------------------ ---------- ------------------------------
db_block_size integer 8192

SQL> select count(*) from fyt_rent.CMP_TAB_DET_ALL_P;

COUNT(*)
----------
76144304

1 select bytes/1024/1024 MB from dba_segments


2 where segment_name='CMP_TAB_DET_ALL_P'
3* and segment_type='TABLE' and owner='FYT_RENT'
SQL> /

MB
----------
29700

On Srvprd's 10g zyhist:


{oracle} /dbasrv/app01/oracle/product dbasrv > 817
/dbasrv/app01/oracle/product >sqlplus /@zyhist

SQL*Plus: Release 8.1.7.0.0 - Production on Mon Feb 7 17:14:36 2005


(c) Copyright 2000 Oracle Corporation. All rights reserved.

Connected to:
Oracle8i Enterprise Edition Release 8.1.7.4.0 - Production
With the Partitioning option
JServer Release 8.1.7.4.0 - Production

SQL> show parameters db_block_size

NAME TYPE VALUE


------------------------------------ ---------- ------------------------------
db_block_size integer 8192

SQL> select count(*) from fyt_rent.CMP_TAB_DET_ALL_P;

COUNT(*)
----------
76144304

1 select bytes/1024/1024 MB from dba_segments


2 where segment_name='CMP_TAB_DET_ALL_P'
3* and segment_type='TABLE' and owner='FYT_RENT'
SQL> /

MB
----------
29700
Scenario #2. 10g Export Data Pump and Import Data Pump into ASM Based Tablespace.
top

Cleanup on Linux the previously plugged in tablespace

Connect to 10g

Sqlplus
SQL*Plus: Release 10.1.0.3.0 - Production on Tue Feb 8 15:48:31 2005

Copyright (c) 1982, 2004, Oracle. All rights reserved.

Connected to:
Oracle Database 10g Enterprise Edition Release 10.1.0.3.0 - 64bit Production
With the Partitioning, OLAP and Data Mining options

SQL> select tablespace_name from dba_tablespaces;

TABLESPACE_NAME
--------------------------------------------------------------------------------
SYSTEM
UNDOTBS1
SYSAUX
TEMP
DATA
TBS_CDT_0410_BC13_BIG

6 rows selected.

SQL> select file_name from dba_data_files;

FILE_NAME
--------------------------------------------------------------------------------
+DATA/zylnx/datafile/system.264.1
+DATA/zylnx/datafile/undotbs1.265.1
+DATA/zylnx/datafile/sysaux.266.1
+DATA/zylnx/datafile/data.268.1
/srvtst2/od01/zylnx/detall0410_BC13_big_01.dbf
/srvtst2/od01/zylnx/detall0410_BC13_big_02.dbf
/srvtst2/od01/zylnx/detall0410_BC13_big_03.dbf
/srvtst2/od01/zylnx/detall0410_BC13_big_04.dbf
/srvtst2/od01/zylnx/detall0410_BC13_big_05.dbf

9 rows selected.

SQL> alter tablespace TBS_CDT_0410_BC13_BIG offline;

Tablespace altered.

SQL> drop tablespace TBS_CDT_0410_BC13_BIG including contents and datafiles;

Tablespace dropped.

SQL> select file_name from dba_data_files;

FILE_NAME
--------------------------------------------------------------------------------
+DATA/zylnx/datafile/system.264.1
+DATA/zylnx/datafile/undotbs1.265.1
+DATA/zylnx/datafile/sysaux.266.1
+DATA/zylnx/datafile/data.268.1

SQL> !ls /srvtst2/od01/zylnx/

SQL> select tablespace_name from dba_tablespaces;

TABLESPACE_NAME
--------------------------------------------------------------------------------
SYSTEM
UNDOTBS1
SYSAUX
TEMP
DATA
Create a directory on 10g on Solaris to hold the export file

SQL> create or replace directory call_det_exp as '/srvtst/dw/export'


2 /

Directory created.

Export main table using export data pump on 10g and Solaris

Export started at: Tue, Feb 8, 15:25:06, 2005 and


finished at: Tue, Feb 8, 16:06:08, 2005

{oracle} /srvtst/app01/oracle/product/10g/bin [Srvtst] > expdp fyt_rent/fyt directory=call_det_exp


dumpfile=call_det_pump.dmp tables=cmp_tab_det_all_p logfile=call_det_pump.log

Export: Release 10.1.0.2.0 - 64bit Production on Tuesday, 08 February, 2005 15:25

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

Connected to: Oracle Database 10g Enterprise Edition Release 10.1.0.2.0 - 64bit Production
With the Partitioning and Data Mining options
Starting "FYT_RENT"."SYS_EXPORT_TABLE_01": fyt_rent/******** DIRECTORY=call_det_exp
DUMPFILE=call_det_pump.dmp TABLES=CMP_TAB_DET_ALL_P LOGFILE=call_det_pump.log
Estimate in progress using BLOCKS method...
Processing object type TABLE_EXPORT/TABLE/TBL_TABLE_DATA/TABLE/TABLE_DATA
Total estimation using BLOCKS method: 29.00 GB
Processing object type TABLE_EXPORT/TABLE/TABLE
Processing object type TABLE_EXPORT/TABLE/INDEX/INDEX
Processing object type TABLE_EXPORT/TABLE/INDEX/STATISTICS/INDEX_STATISTICS
Processing object type TABLE_EXPORT/TABLE/STATISTICS/TABLE_STATISTICS
. . exported "FYT_RENT"."CMP_TAB_DET_ALL_P" 24.98 GB 76144304 rows
Master table "FYT_RENT"."SYS_EXPORT_TABLE_01" successfully loaded/unloaded
******************************************************************************
Dump file set for FYT_RENT.SYS_EXPORT_TABLE_01 is:
/srvtst/dw/export/call_det_pump.dmp
Job "FYT_RENT"."SYS_EXPORT_TABLE_01" successfully completed at 16:06
FTP dump file to Linux

ftp finished in 57 minutes to transfer 26GB (26824982528 bytes) 7.6 M per second.

{oracle} /srvtst2/od02/export [srvtst2] > ftp srvtst


Connected to srvtst (10.5.189.11).
220 srvtst FTP server (SunOS 5.8) ready.
Name (srvtst:oracle):
331 Password required for oracle.
Password:
230 User oracle logged in.
Remote system type is UNIX.
Using binary mode to transfer files.
ftp> cd /srvtst/dw/export
250 CWD command successful.
ftp> bin
200 Type set to I.
ftp> get call_det_pump.dmp
local: call_det_pump.dmp remote: call_det_pump.dmp
227 Entering Passive Mode (10,5,189,11,156,232)
150 Binary data connection for call_det_pump.dmp (10.5.180.216,30826) (26824982528 bytes).
226 Binary Transfer complete.
26824982528 bytes received in 3.45e+03 secs (7.6e+03 Kbytes/sec)

Rename the old table and create a new empty compress enabled table to hold the new data

SQL> rename CMP_TAB_DET_ALL_P to CMP_TAB_DET_ALL_OLD;

Table renamed.

SQL> CREATE TABLE CMP_TAB_DET_ALL_P COMPRESS AS SELECT * FROM CMP_TAB_DET_ALL_OLD


WHERE 1=2;

Table created.
Import dump file using impdp into 10g on Linux

Create a directory to hold the dump file

SQL> create or replace directory imp_dir as '/srvtst/dw/export'


2 /

Directory created.

Import in parallel

Import Job started on : Wednesday, 09 February, 2005 13:43


Import Job finished on : Wednesday, 09 February, 2005 14:57

{oracle} /srvtst2/od02/export [srvtst2] > impdp directory=imp_dir


dumpfile=call_det_pump.dmp logfile=call_det_pump.log parallel=4
table_exists_action=append content=data_only status=60
Import: Release 10.1.0.3.0 - 64bit Production on Wednesday, 09 February, 2005
13:43

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

Username: fyt_rent
Password:

Connected to: Oracle Database 10g Enterprise Edition Release 10.1.0.3.0 - 64bit
Production
With the Partitioning, OLAP and Data Mining options

Job: SYS_IMPORT_FULL_01
Operation: IMPORT
Mode: FULL
State: EXECUTING
Bytes Processed: 0
Current Parallelism: 4
Job Error Count: 0
Dump File: /srvtst2/od02/export/call_det_pump.dmp

Worker 1 Status:
State: EXECUTING

Worker 2 Status:
State: WORK WAITING

Worker 3 Status:
State: WORK WAITING

Worker 4 Status:
State: WORK WAITING
Master table "FYT_RENT"."SYS_IMPORT_FULL_01" successfully loaded/unloaded

Job: SYS_IMPORT_FULL_01
Operation: IMPORT
Mode: FULL
State: EXECUTING
Bytes Processed: 0
Current Parallelism: 4
Job Error Count: 0
Dump File: /srvtst2/od02/export/call_det_pump.dmp

Worker 1 Status:
State: EXECUTING
Worker 2 Status:
State: WORK WAITING

Worker 3 Status:
State: WORK WAITING

Worker 4 Status:
State: WORK WAITING
Starting "FYT_RENT"."SYS_IMPORT_FULL_01": fyt_rent/******** DIRECTORY=IMP_DIR
dumpfile=call_det_pump.dmp logfile=call_det_pump.log parallel=4
table_exists_action=append content=data_only status=60

Job: SYS_IMPORT_FULL_01
Operation: IMPORT
Mode: FULL
State: COMPLETED
Bytes Processed: 26,824,827,344
Percent Done: 100
Current Parallelism: 4
Job Error Count: 0
Dump File: /srvtst2/od02/export/call_det_pump.dmp

Worker 1 Status:
State: WORK WAITING

Worker 2 Status:
State: WORK WAITING

Worker 3 Status:
State: WORK WAITING

Worker 4 Status:
State: WORK WAITING
Job "FYT_RENT"."SYS_IMPORT_FULL_01" successfully completed at 14:57

Scenario #3: 10g Parallel export Data Pump and import from NFS mounted File System, into ASM
Based Tablespace.
top

Export using Parallel 8

Timing

Export started at 10:51


Export ended at 11.27
Total time 36 minutes

Parallel command and log

{oracle} /srvtst/dw/export [Srvtst] > expdp USERID=fyt_rent/fyt DIRECTORY=call_det_exp


DUMPFILE=expdat%U.dmp parallel=8 TABLES=CMP_TAB_DET_ALL_P LOGFILE=expdat%U.log
JOB_NAME=partst

Export: Release 10.1.0.2.0 - 64bit Production on Thursday, 10 February, 2005 10:51

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

Connected to: Oracle Database 10g Enterprise Edition Release 10.1.0.2.0 - 64bit
Production
With the Partitioning and Data Mining options
Starting "FYT_RENT"."PARTST": USERID=fyt_rent/******** DIRECTORY=call_det_exp
DUMPFILE=expdat%U.dmp parallel=8 TABLES=CMP_TAB_DET_ALL_P LOGFILE=expdat%U.log
JOB_NAME=partst
Estimate in progress using BLOCKS method...
Processing object type TABLE_EXPORT/TABLE/TBL_TABLE_DATA/TABLE/TABLE_DATA
Total estimation using BLOCKS method: 29.00 GB
Processing object type TABLE_EXPORT/TABLE/TABLE
Processing object type TABLE_EXPORT/TABLE/INDEX/INDEX
Processing object type TABLE_EXPORT/TABLE/INDEX/STATISTICS/INDEX_STATISTICS
Processing object type TABLE_EXPORT/TABLE/STATISTICS/TABLE_STATISTICS
. . exported "FYT_RENT"."CMP_TAB_DET_ALL_P" 24.98 GB 76144304 rows
Master table "FYT_RENT"."PARTST" successfully loaded/unloaded
******************************************************************************
Dump file set for FYT_RENT.PARTST is:
/srvtst/dw/export/expdat01.dmp
/srvtst/dw/export/expdat02.dmp
/srvtst/dw/export/expdat03.dmp
/srvtst/dw/export/expdat04.dmp
/srvtst/dw/export/expdat05.dmp
/srvtst/dw/export/expdat06.dmp
/srvtst/dw/export/expdat07.dmp
/srvtst/dw/export/expdat08.dmp
/srvtst/dw/export/expdat09.dmp
Job "FYT_RENT"."PARTST" successfully completed at 11:27

Create NFS mount on Linux of the Solaris directory

{oracle} /srvtst/dw/export [srvtst2] > mount | grep srvtst


srvtst:/srvtst/dw on /srvtst/dw type nfs (rw,addr=10.5.189.11)

10g Import Data Pump from NFS, into ASM Based Tablespace .
Import start 16:21
Import end 17:40
Total Time 79 minutes

;;;
Import: Release 10.1.0.3.0 - 64bit Production on Thursday, 10 February, 2005 16:21

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


;;;
Connected to: Oracle Database 10g Enterprise Edition Release 10.1.0.3.0 - 64bit
Production
With the Partitioning, OLAP and Data Mining options
Master table "FYT_RENT"."IMPTST" successfully loaded/unloaded
Starting "FYT_RENT"."IMPTST": USERID=fyt_rent/******** DIRECTORY=DATA_DUMP_DIR
DUMPFILE=expdat%U.dmp parallel=8 REMAP_TABLESPACE=TBS_CDT_0410_BC13_BIG:DATA
TABLES=CMP_TAB_DET_ALL_P LOGFILE=impdat.log JOB_NAME=imptst STATUS=60
TABLE_EXISTS_ACTION=append CONTENT=data_only
Processing object type TABLE_EXPORT/TABLE/TBL_TABLE_DATA/TABLE/TABLE_DATA
;;; Import> status
;;; Import> exit
. . imported "FYT_RENT"."CMP_TAB_DET_ALL_P" 24.98 GB 76144304 rows
Job "FYT_RENT"."IMPTST" successfully completed at 17:40
Scenario #4: Parallel Insert as select from Solaris into ASM Based Tablespace
top

SQL> set echo on timing on


SQL> spool CTAS_of_CMP_TAB_DET_ALL_P.log;
SQL> select sysdate from dual;

SYSDATE
-------------------
13/02/2005 17:33:33

Elapsed: 00:00:00.00
SQL> create table CMP_TAB_DET_ALL_P compress tablespace data
2 as select * from CMP_TAB_DET_ALL_P@zycmp
3 where 1=2;

Table created.

Elapsed: 00:00:00.71
SQL> alter session enable parallel dml;

Session altered.

Elapsed: 00:00:00.00
SQL> ALTER TABLE CMP_TAB_DET_ALL_P PARALLEL (DEGREE 8);

Table altered.

Elapsed: 00:00:00.01
SQL> insert /*+ APPEND NOLOGGING */ into CMP_TAB_DET_ALL_P select /*+
PARALLEL(instab,4) */ 2 * from CMP_TAB_DET_ALL_P@zycmp
3 /

76144304 rows created.

Elapsed: 01:49:09.57
Scenario #5: Sequential Insert as select from Solaris into ASM Based Tablespace
top

SQL> set timing on;


SQL> truncate table CMP_TAB_DET_ALL_P;

Table truncated.

Elapsed: 00:00:01.14
SQL> alter table CMP_TAB_DET_ALL_P parallel (degree 1);

Table altered.

Elapsed: 00:00:00.01

SQL> insert /*+ APPEND NOLOGGING */ into CMP_TAB_DET_ALL_P


2 select * from CMP_TAB_DET_ALL_P@zyhist
3 /

76144304 rows created.

Elapsed: 02:06:05.21
SQL> select bytes/1024/1024 from dba_segments where
segment_name='CMP_TAB_DET_ALL_P';

BYTES/1024/1024
---------------
8000

Elapsed: 00:00:00.06
Scenario #6: Transportable Tablespace based on NFS mounted filesystem + Move table
top

Perform transportable tablespace export for the selected tablespace

Convert the Solaris based tablespace to Linux format

Place the converted files on an NFS file system that is mounted on the Target Linux Server

Import metadata on Linux database pointing to the datafiles located on the NFS mounted File
System

{oracle} /srvtst2/app01/oracle/scripts/av/compresstest [srvtst2] > imp userid=\'/


as sysdba\' transport_tablespace=y
datafiles=/srvtst/dw/backup/detall0410_bc13_big_01.dbf,/srvtst/dw/backup/detall041
0_bc13_big_02.dbf,/srvtst/dw/backup/detall0410_bc13_big_03.dbf,/srvtst/dw/backup/d
etall0410_bc13_big_04.dbf,/srvtst/dw/backup/detall0410_bc13_big_05.dbf
file=tts_10g.dmp log=tts_nfs.log

Import: Release 10.1.0.3.0 - Production on Tue Feb 15 10:51:25 2005

Copyright (c) 1982, 2004, Oracle. All rights reserved.

Connected to: Oracle Database 10g Enterprise Edition Release 10.1.0.3.0 - 64bit
Production
With the Partitioning, OLAP and Data Mining options

Export file created by EXPORT:V10.01.00 via conventional path


About to import transportable tablespace(s) metadata...
import done in UTF8 character set and AL16UTF16 NCHAR character set
import server uses IW8ISO8859P8 character set (possible charset conversion)
export client uses IW8ISO8859P8 character set (possible charset conversion)
. importing SYS's objects into SYS
. importing FYT_RENT's objects into FYT_RENT
. . importing table "CMP_TAB_DET_ALL_P"
. . importing table "TAB_DET_ALL_P0410_BC13"
. . importing table "CMP_CALL_PART_TAB_P"
. . importing table "CMP_CONT_FREE_UNIT_TAB_P"
. . importing table "CMP_INCOME_DETAIL_TAB_P"
. importing SYS's objects into SYS
Import terminated successfully without warnings.

Move selected table into ASM based tablespace


Started Tue Feb 15 11:00:45 IST 2005
Finished Tue Feb 15 11:51:51 IST 2005
Total Time 105 minutes
Scenario #7: Transportable Tablespace + Move table into FS based tablespace (scenario 1 with FS)
top

Perform transportable tablespace export for the selected tablespace

Convert the Solaris based tablespace to Linux format

FTP converted datafiles to Linux

Import metadata on Linux database pointing to the datafiles located on the NFS mounted File
System

{oracle} /srvtst2/app01/oracle/scripts/av/compresstest [srvtst2] > imp userid=\'/


as sysdba\' transport_tablespace=y
datafiles=/srvtst2/od02/export/detall0410_BC13_big_01.dbf,/srvtst2/od02/export/det
all0410_BC13_big_02.dbf,/srvtst2/od02/export/detall0410_BC13_big_03.dbf,/srvtst2/o
d02/export/detall0410_BC13_big_04.dbf,/srvtst2/od02/export/detall0410_BC13_big_05.
dbf file=TTS_10g.dmp log=TTS_10gTFS.log

Import: Release 10.1.0.3.0 - Production on Tue Feb 15 15:25:59 2005

Copyright (c) 1982, 2004, Oracle. All rights reserved.

Connected to: Oracle Database 10g Enterprise Edition Release 10.1.0.3.0 - 64bit
Production
With the Partitioning, OLAP and Data Mining options

Export file created by EXPORT:V10.01.00 via conventional path


About to import transportable tablespace(s) metadata...
import done in UTF8 character set and AL16UTF16 NCHAR character set
import server uses IW8ISO8859P8 character set (possible charset conversion)
export client uses IW8ISO8859P8 character set (possible charset conversion)
. importing SYS's objects into SYS
. importing FYT_RENT's objects into FYT_RENT
. . importing table "CMP_TAB_DET_ALL_P"
. . importing table "TAB_DET_ALL_P0410_BC13"
. . importing table "CMP_CALL_PART_TAB_P"
. . importing table "CMP_CONT_FREE_UNIT_TAB_P"
. . importing table "CMP_INCOME_DETAIL_TAB_P"
. importing SYS's objects into SYS
Import terminated successfully without warnings.

Create a FS based tablespace on Linux

SQL> create tablespace datafs datafile '/srvtst2/od01/zylnx/datafs_01.dbf' size


30000 m extent management local segment space management auto;

Tablespace created.

Elapsed: 00:09:15.69

Check table size before moving

SQL> select segment_type,segment_name,bytes/1024/1024 mb


2 from dba_segments
3 where segment_name in(select table_name from dba_tables where
owner='fyt_rent')
4*
SQL> /
SEGMENT_TYPE SEGMENT_NAME MB
-------------------- ------------------------------ ----------
TABLE CMP_INCOME_DETAIL_TAB_P 3300
TABLE CMP_CONT_FREE_UNIT_TAB_P 300
TABLE CMP_CALL_PART_TAB_P 300
TABLE TAB_DET_ALL_P0410_BC13 300
TABLE CMP_TAB_DET_ALL_P 29700

Move table compress to FS based tablespace

SQL> alter table fyt_rent.CMP_TAB_DET_ALL_P move compress parallel tablespace


datafs;

Table altered.

Elapsed: 00:18:18.83
Scenario #8: Import data pump using network link
top

Create database links to the possible source databases

Execute the import using the network_link parameter

Both databases need to be 10.1.0.3 at least, if not you will get ora-39022

In this example impdp is run from Linux with rdbms 10.1.0.3 against a Solaris with
rdbms 10.1.0.2:

{oracle} /home/oracle [srvtst2] > impdp userid=fyt_rent/fyt network_link=zycmp


DIRECTORY=DATA_DUMP_DIR REMAP_TABLESPACE=TBS_CDT_0410_BC13_BIG:DATA
TABLES=CMP_TAB_DET_ALL_P LOGFILE=impdat.log JOB_NAME=imptst STATUS=60

Import: Release 10.1.0.3.0 - 64bit Production on Wednesday, 16 February, 2005


11:46

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

Connected to: Oracle Database 10g Enterprise Edition Release 10.1.0.3.0 - 64bit
Production
With the Partitioning, OLAP and Data Mining options
ORA-39006: internal error
ORA-39022: Database version 10.1.0.2.0 is not supported.

After installing patch on 10g on Solaris:


Import: Release 10.1.0.3.0 - 64bit Production on Wednesday, 16 February, 2005
18:55

After installing patch 10.1.0.3 on Solaris the import works fine

Import: Release 10.1.0.3.0 - 64bit Production on Thursday, 17 February, 2005 6:39

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


;;;
Connected to: Oracle Database 10g Enterprise Edition Release 10.1.0.3.0 - 64bit
Production
With the Partitioning, OLAP and Data Mining options
Starting "FYT_RENT"."IMPTST": userid=fyt_rent/******** network_link=zycmp
directory=imp_dir TABLES=CMP_TAB_DET_ALL_P table_exists_action=append
content=data_only parallel=8 JOB_NAME=imptst status=180
Estimate in progress using BLOCKS method...
Processing object type TABLE_EXPORT/TABLE/TBL_TABLE_DATA/TABLE/TABLE_DATA
Total estimation using BLOCKS method: 29.00 GB
. . imported "FYT_RENT"."CMP_TAB_DET_ALL_P" 76144304 rows
Job "FYT_RENT"."IMPTST" successfully completed at 09:03

Result

Start time : 06:39


End time : 09:03
Total Time : 124 Min.
Original size : 31 GB
Compressed Size: 27.GB
Compression Rate: 13%
top
Scenario #9: Comparison test, move table in 8i, compare time with move on 10g
top

Create tablespace to move table

SQL> create tablespace movetest datafile '/srvprd/zyhist/oi01/movetest01.dbf' size


3000m,
2 '/srvprd/zyhist/od03/movetest02.dbf' size 1000m,
3 '/srvprd/zyhist/od05/movetest03.dbf' size 3000m,
4 '/srvprd/zyhist/od07/movetest04.dbf' size 3000m,
5 '/srvprd/zyhist/od06/movetest05.dbf' size 2000m,
6 '/srvprd/zyhist/od08/movetest06.dbf' size 3000m,
7 '/srvprd/zyhist/od09/movetest07.dbf' size 3000m,
8 '/srvprd/zyhist/od10/movetest08.dbf' size 5000m,
9 '/srvprd/zyhist/od15/movetest09.dbf' size 7000m,
10 '/srvprd/zyhist/od13/movetest10.dbf' size 5000m;

Tablespace created.

Move table

SQL> alter table fyt_rent.CMP_TAB_DET_ALL_P move tablespace movetest parallel 8


2 /

Table altered.

Elapsed: 00:39:31.60
Compare times

Removing a big table based on ASM storage


top

SQL> select table_name from user_tables;

TABLE_NAME
--------------------------------------------------------------------------------
CMP_TAB_DET_ALL_P

SQL> select count(*) from dba_extents where segment_name='CMP_TAB_DET_ALL_P';

COUNT(*)
----------
327

SQL> select bytes from dba_segments where segment_name='CMP_TAB_DET_ALL_P';

BYTES
----------
9797894144

SQL> set timing on;


SQL> drop table CMP_TAB_DET_ALL_P;

Table dropped.

Elapsed: 00:00:00.09
References:
top

Note:277650.1 How to Use Export and Import when Transferring Data Across Platforms

Note:261013.1 Importing into Existing tables with Oracle Data Pump

Note:272132.1 Import DataPump - User Schema is Created by Import


Aditional Technical Notes and tips:
top

Compress Test Preparation Steps


10g Install on Linux AMD64
10g ASM, Automatic Storage Manager configuration
Automatic Storage Manager Libraries (ASMLib) configuration
Automatic Storage Manager (ASM) disks preparation
Start ASM instance fail with ORA-29701 unable to connect to Cluster Manager
Setting 10g Archive log mode with destination out of ASM
How to shutdown ocssd
Data Pump examples
Compress Test Preparation Steps
top

Prepare Source Data on the 8.1.7.4 database

Create a tablespace to exchange partitions

create tablespace testcompress datafile '/srvprd/zyhist/od04/testcompress_01.dbf'


size 8000m extent management local;

Check which tab_det_all partitions are not part of the zy view:

select add_months(to_date('050201','yymmdd'),-12) from dual;


01-FEB-04

This mean that the view includes only partitions older than 01/02/2004.
We can use newer partitions to transport them to a side database.

select partition_name, tablespace_name from dba_tab_partitions where


table_name='TAB_DET_ALL_P'
AND partition_name like 'P0409%' ;
select partition_name, tablespace_name from dba_tab_partitions where
table_name='TAB_DET_ALL_P'
AND partition_name like 'P0410%' ;
PARTITION_NAME TABLESPACE_NAME
P0409_BC13 TBS_CDT_0409_BC13_BIG
P0409_BC19 TBS_CDT_0409_BC19_BIG
P0409_BC25 TBS_CDT_0409_BC25_BIG
P0410_BC01 TBS_CDT_0410_BC01_BIG
P0410_BC07 TBS_CDT_0410_BC07_BIG
P0410_BC13 TBS_CDT_0410_BC13_BIG

After checking the objects contained on the last tablespace I did find that it
contain several related objects. Because the size of one partition is quite big,
29GB I did choose to transport the whole tablespace with all its objects into a
side tablespace that will be used to perform all tests.

Prepare a script to create the tables and indexes that sit on the tablespace to
transport

create table cmp_TAB_DET_ALL_P tablespace testcompress as select * from


TAB_DET_ALL_P where 1=2;

create table cmp_CALL_PART_TAB_P tablespace testcompress as select * from


CALL_PART_TAB_P where 1=2
;
create table cmp_CONT_FREE_UNIT_TAB_P tablespace testcompress as select * from
CONT_FREE_UNIT_TAB_P where 1=2;

create table cmp_INCOME_DETAIL_TAB_P tablespace testcompress as select * from


INCOME_DETAIL_TAB_P where 1=2;

create index cmp_IND_TAB_DET_ALL on cmp_TAB_DET_ALL_P (CUST_CODE_10,


INVOICE_NUM_10, CUST_CODE_50, CONTRACT_NUM_20) tablespace testcompress;

create index cmp_CALL_PART_TAB_P_I1 on cmp_CALL_PART_TAB_P (CUST_CODE_10,


INVOICE_NUM_10, CUST_CODE_50, CONTRACT_NUM_20) tablespace testcompress;

create unique index cmp_PK_CONT_FREE_UNIT_TAB_P on cmp_CONT_FREE_UNIT_TAB_P


(CUST_CODE_10, INVOICE_NUM_10, CUST_CODE_50, CONTRACT_NUM_20, CONT_FU_SEQ_NUM,
INVOICE_DATE_10) tablespace testcompress;
create unique index cmp_PK_INCOME_DETAIL_TAB_P on cmp_INCOME_DETAIL_TAB_P
(INCOME_ID_81, CYCLE_DATE_81) tablespace testcompress;

Prepare a script to exchange the partitions with the new tables

set echo on pages 5000 lines 120


spool excobj.log

alter table TAB_DET_ALL_P exchange partition P0410_BC13 with table


cmp_TAB_DET_ALL_P including indexes;

alter table CALL_PART_TAB_P exchange partition P0410_BC13 with table


cmp_CALL_PART_TAB_P including indexes;

alter table CONT_FREE_UNIT_TAB_P exchange partition P0410_BC13 with table


cmp_CONT_FREE_UNIT_TAB_P including indexes;

alter table INCOME_DETAIL_TAB_P exchange partition P0410_BC13 with table


cmp_INCOME_DETAIL_TAB_P including indexes;

spool off;

Set the tablespace to transport to read only

Alter tablespace TBS_CDT_0410_BC13_BIG read only;


Export tablespace to transport metadata

SRVPRD {oracle} /srvprd/app01/oracle/scripts/av/compress_test 15:15 > exp


userid=\"sys as sysdba\" file=transp_zyhist.dmp transport_tablespace=y
tablespaces=TBS_CDT_0410_BC13_BIG

Export: Release 8.1.7.4.0 - Production on Wed Feb 2 15:15:24 2005

(c) Copyright 2000 Oracle Corporation. All rights reserved.

Password:

Connected to: Oracle8i Enterprise Edition Release 8.1.7.4.0 - Production


With the Partitioning option
JServer Release 8.1.7.4.0 - Production
Export done in IW8ISO8859P8 character set and IW8ISO8859P8 NCHAR character set
Note: table data (rows) will not be exported
About to export transportable tablespace metadata...
For tablespace TBS_CDT_0410_BC13_BIG ...
. exporting cluster definitions
. exporting table definitions
. . exporting table CMP_TAB_DET_ALL_P
. . exporting table TAB_DET_ALL_P0410_BC13
. . exporting table CMP_CALL_PART_TAB_P
. . exporting table CMP_CONT_FREE_UNIT_TAB_P
. . exporting table CMP_INCOME_DETAIL_TAB_P
. exporting referential integrity constraints
. exporting triggers
. end transportable tablespace metadata export
Export terminated successfully without warnings.
Check the exchanged objects sizes

select owner,segment_name,segment_type,bytes/1024/1024/1024 GB from dba_segments


where tablespace_name='TBS_CDT_0410_BC13_BIG'

OWNER SEGMENT_NAME SEGMENT_TYPE GB


FYT_RENT CMP_CALL_PART_TAB_P TABLE 00.292
FYT_RENT CMP_INCOME_DETAIL_TAB_P TABLE 03.222
FYT_RENT TAB_DET_ALL_P0410_BC13 TABLE 00.292
FYT_RENT CMP_TAB_DET_ALL_P TABLE 29.003
FYT_RENT CMP_CONT_FREE_UNIT_TAB_P TABLE 00.292
FYT_RENT CMP_PK_CONT_FREE_UNIT_TAB_P INDEX 00.292
FYT_RENT CMP_PK_INCOME_DETAIL_TAB_P INDEX 00.585
FYT_RENT CMP_IND_TAB_DET_ALL INDEX 04.687
FYT_RENT CMP_CALL_PART_TAB_P_I1 INDEX 00.292

Check the tablespace datafiles

select file_name from dba_data_files where


tablespace_name='TBS_CDT_0410_BC13_BIG';

/srvprd/zyhist/od36/oradata/detall0410_BC13_big_01.dbf
/srvprd/zyhist/od36/oradata/detall0410_BC13_big_02.dbf
/srvprd/zyhist/od36/oradata/detall0410_BC13_big_03.dbf
/srvprd/zyhist/od36/oradata/detall0410_BC13_big_04.dbf
/srvprd/zyhist/od36/oradata/detall0410_BC13_big_05.dbf
Copy datafiles and metadata dump to working server

Copy the datafiles and the metadata export over to Srvtst to build up there an
8174 32 bits database to plug in the tablespace.

#!/usr/bin/ksh
# mvdatafiles
v_dest=srvtst:/srvtst/dw/zycmp
rcp -p /srvprd/app01/oracle/scripts/av/compress_test/transp_zyhist.dmp $v_dest
rcp -p /srvprd/zyhist/od36/oradata/detall0410_BC13_big_01.dbf $v_dest
rcp -p /srvprd/zyhist/od36/oradata/detall0410_BC13_big_02.dbf $v_dest
rcp -p /srvprd/zyhist/od36/oradata/detall0410_BC13_big_03.dbf $v_dest
rcp -p /srvprd/zyhist/od36/oradata/detall0410_BC13_big_04.dbf $v_dest
rcp -p /srvprd/zyhist/od36/oradata/detall0410_BC13_big_05.dbf $v_dest
rcp -p /srvprd/app01/oracle/scripts/av/compress_test/ENDcp $v_dest

Create a new 8.1.7.4 database to plug in the tablespace and start to work.

Create and prepare database zycmp on server srvtst 8174 64 bits.

Create user fyt_rent on new database

Plug in the transported tablespaces into zycmp

Import metadata into the target database:

{oracle} /srvtst/dw/zycmp [Srvtst] > imp sys file= transp_zyhist.dmp


transport_tablespace=y datafiles=/srvtst/dw/zycmp/detall0410_BC13_big_01.dbf
,/srvtst/dw/zycmp/detall0410_BC13_big_02.dbf,/srvtst/dw/zycmp/detall0410_BC13_big_
03.dbf,/srvtst/dw/zycmp/detall0410_BC13_big_04.dbf
,/srvtst/dw/zycmp/detall0410_BC13_big_05.dbf

Check that the tablespace and its tables are accessible, check that there are not
columns of type NCHAR on the database, if there are you will need to convert them
to a supported Unicode character set before proceeding to upgrade.

SVRMGR> select unique(DATA_TYPE) from dba_tab_columns;


DATA_TYPE
--------------------------------------------------------------------------------
AQ$_SUBSCRIBERS
BLOB
CHAR
CLOB
DATE
FLOAT
LONG
LONG RAW
MLSLABEL
NCLOB
NUMBER
RAW
ROWID
UNDEFINED
VARCHAR2
15 rows selected.

Install 10g on Solaris to upgrade the 8.1.7 database.


Use custom Install without database

Upgrade the 8.1.7 database to 10g

Use Database Upgrade Assistant to upgrade

Dbua is located on the 10g Oracle Home.


The 8i database must be up and running when invoking Dbua.

Transport tablespace to Linux

Check the OS platform compatibility, from Solaris to Unix

SQL> set pages 50000 lines 120


SQL> col platform_name for a40
SQL> select * from v$transportable_platform where upper(PLATFORM_NAME) like
'%SOLARIS%'
SQL> /

PLATFORM_ID PLATFORM_NAME ENDIAN_FORMAT


----------- ---------------------------------------- --------------
1 Solaris[tm] OE (32-bit) Big
2 Solaris[tm] OE (64-bit) Big

SQL> select * from v$transportable_platform where upper(PLATFORM_NAME) like


'%AMD%';

PLATFORM_ID PLATFORM_NAME ENDIAN_FORMAT


----------- ---------------------------------------- --------------
13 Linux 64-bit for AMD Little
12 Microsoft Windows 64-bit for AMD Little

Because endian_format is different between both platforms conversion is required.

Set tablespace to read only

SQL> alter tablespace TBS_CDT_0410_BC13_BIG read only;


alter tablespace TBS_CDT_0410_BC13_BIG read only
*
ERROR at line 1:
ORA-01644: tablespace 'TBS_CDT_0410_BC13_BIG' is already read only

Export Metadata

{oracle} /srvtst/app01/oracle/scripts/av/compresstest [Srvtst] > exp userid=\'/ as


sysdba\' transport_tablespace=y tablespaces=TBS_CDT_0410_BC13_BIG file=TTS_10g.dmp
log=TTS_10g.log statistics=none

Export: Release 10.1.0.2.0 - Production on Sun Feb 6 14:32:10 2005

Copyright (c) 1982, 2004, Oracle. All rights reserved.

Connected to: Oracle Database 10g Enterprise Edition Release 10.1.0.2.0 - 64bit
Production
With the Partitioning and Data Mining options
Export done in IW8ISO8859P8 character set and AL16UTF16 NCHAR character set
Note: table data (rows) will not be exported
About to export transportable tablespace metadata...
For tablespace TBS_CDT_0410_BC13_BIG ...
. exporting cluster definitions
. exporting table definitions
. . exporting table CMP_TAB_DET_ALL_P
. . exporting table TAB_DET_ALL_P0410_BC13
. . exporting table CMP_CALL_PART_TAB_P
. . exporting table CMP_CONT_FREE_UNIT_TAB_P
. . exporting table CMP_INCOME_DETAIL_TAB_P
. exporting referential integrity constraints
. exporting triggers
. end transportable tablespace metadata export
Export terminated successfully without warnings.

Check the compatibility parameter and change if needed

SQL> show parameters compatible

NAME TYPE VALUE


------------------------------------ ----------- ------------------------------
compatible string 9.2.0

If the parameter is set to 9i, set it up to 10g

SQL> alter system set compatible=’ 10.1.0.2.0’ scope=spfile;

System altered.

SQL> shutdown
Database closed.
Database dismounted.
ORACLE instance shut down.
SQL> startup
ORACLE instance started.

Total System Global Area 251658240 bytes


Fixed Size 1301096 bytes
Variable Size 250095000 bytes
Database Buffers 0 bytes
Redo Buffers 262144 bytes
Database mounted.
Database opened.

SQL> show parameters compatible

NAME TYPE VALUE


------------------------------------ ----------- ------------------------------
compatible string 10.1.0.2.0

Note: 10g compatible must be used in order to convert the tablespace datafiles to
Linux format.

Prepare to convert the datafiles to Linux format

Setup a destination directory

Check that you have enough space to hold a full tablespace backup

{oracle} /srvtst/app01/oracle/product [Srvtst] > mkdir /srvtst/dw/backup


{oracle} /srvtst/app01/oracle/product [Srvtst] > cd /srvtst/dw/backup
{oracle} /srvtst/dw/backup [Srvtst] > df -k .
Filesystem kbytes used avail capacity Mounted on
/dev/vx/dsk/srvtst/dw
335544320 53283632 280064864 16% /srvtst/dw

Convert datafiles to Linux format

Invoke Rman and check if the tablespace is recognized

If you don’t see the datafiles in Rman executing the report schema command, make
the tablespace read write and read only again, and repeat the report schema
command, this will update the control file headers.

{oracle} /srvtst/app01/oracle/product [Srvtst] > rman target=/

Recovery Manager: Release 10.1.0.2.0 - 64bit Production

Copyright (c) 1995, 2004, Oracle. All rights reserved.

connected to target database: ZYCMP (DBID=560918495)

RMAN> report schema;

Report of database schema


File K-bytes Tablespace RB segs Datafile Name
---- ---------- -------------------- ------- -------------------
1 563200 SYSTEM *** /srvtst/dw/zycmp/system01.dbf
2 8192 TOOLS ***
/srvtst/app01/oracle/oradata/zycmp/tools01.dbf
3 512000 RBS *** /srvtst/dw/zycmp/rbs01.dbf
4 69632 TEMP *** /srvtst/dw/temp01.dbf
5 106496 USERS *** /srvtst/dw/zycmp/users01.dbf
6 55296 INDX *** /srvtst/dw/zycmp/indx01.dbf
7 8192000 TBS_CDT_0410_BC13_BIG *** /srvtst/dw/zycmp/detall0410_BC13_big_05.dbf
8 8705024 TBS_CDT_0410_BC13_BIG *** /srvtst/dw/zycmp/detall0410_BC13_big_04.dbf
9 10240000 TBS_CDT_0410_BC13_BIG *** /srvtst/dw/zycmp/detall0410_BC13_big_03.dbf
10 7476224 TBS_CDT_0410_BC13_BIG *** /srvtst/dw/zycmp/detall0410_BC13_big_02.dbf
11 7476224 TBS_CDT_0410_BC13_BIG *** /srvtst/dw/zycmp/detall0410_BC13_big_01.dbf
12 512000 SYSAUX *** /srvtst/dw/zycmp/sysaux01.dbf

Execute the Convert tablespace command to change datafiles to Linux format.

RMAN> convert tablespace TBS_CDT_0410_BC13_BIG


2> to platform 'Linux 64-bit for AMD'
3> format='/srvtst/dw/backup/%U';

Starting backup at 06/02/2005 17:02:37


allocated channel: ORA_DISK_1
channel ORA_DISK_1: sid=154 devtype=DISK
channel ORA_DISK_1: starting datafile conversion
input datafile fno=00009 name=/srvtst/dw/zycmp/detall0410_BC13_big_03.dbf
converted datafile=/srvtst/dw/backup/data_D-ZYCMP_I-560918495_TS-
TBS_CDT_0410_BC13_BIG_FNO-9_02gc3ctf
channel ORA_DISK_1: datafile conversion complete, elapsed time: 00:13:25
channel ORA_DISK_1: starting datafile conversion
input datafile fno=00008 name=/srvtst/dw/zycmp/detall0410_BC13_big_04.dbf
converted datafile=/srvtst/dw/backup/data_D-ZYCMP_I-560918495_TS-
TBS_CDT_0410_BC13_BIG_FNO-8_03gc3dml
channel ORA_DISK_1: datafile conversion complete, elapsed time: 00:11:45
channel ORA_DISK_1: starting datafile conversion
input datafile fno=00007 name=/srvtst/dw/zycmp/detall0410_BC13_big_05.dbf
converted datafile=/srvtst/dw/backup/data_D-ZYCMP_I-560918495_TS-
TBS_CDT_0410_BC13_BIG_FNO-7_04gc3ecn
channel ORA_DISK_1: datafile conversion complete, elapsed time: 00:12:48
channel ORA_DISK_1: starting datafile conversion
input datafile fno=00010 name=/srvtst/dw/zycmp/detall0410_BC13_big_02.dbf
converted datafile=/srvtst/dw/backup/data_D-ZYCMP_I-560918495_TS-
TBS_CDT_0410_BC13_BIG_FNO-10_05gc3f4r
channel ORA_DISK_1: datafile conversion complete, elapsed time: 00:07:26
channel ORA_DISK_1: starting datafile conversion
input datafile fno=00011 name=/srvtst/dw/zycmp/detall0410_BC13_big_01.dbf
converted datafile=/srvtst/dw/backup/data_D-ZYCMP_I-560918495_TS-
TBS_CDT_0410_BC13_BIG_FNO-11_06gc3fip
channel ORA_DISK_1: datafile conversion complete, elapsed time: 00:09:15
Finished backup at 06/02/2005 17:57:24

Ftp or rcp files to Linux

The FTP of 40GB took from 18:18 until 19:44, in total 86 minutes

Prepare to Plug In into Linux 10g database the converted datafiles.

Rename transferred datafiles to their original names

Check original names on source 10g database

SQL> select FILE#,NAME from v$datafile where name like '%detall%';

FILE# NAME
---------- ------------------------------------------------------------
7 /srvtst/dw/zycmp/detall0410_BC13_big_05.dbf
8 /srvtst/dw/zycmp/detall0410_BC13_big_04.dbf
9 /srvtst/dw/zycmp/detall0410_BC13_big_03.dbf
10 /srvtst/dw/zycmp/detall0410_BC13_big_02.dbf
11 /srvtst/dw/zycmp/detall0410_BC13_big_01.dbf

Move transferred files on Linux

{oracle} /srvtst2/od01/zylnx > ls


data_D-ZYCMP_I-560918495_TS-TBS_CDT_0410_BC13_BIG_FNO-10_05gc3f4r
data_D-ZYCMP_I-560918495_TS-TBS_CDT_0410_BC13_BIG_FNO-11_06gc3fip
data_D-ZYCMP_I-560918495_TS-TBS_CDT_0410_BC13_BIG_FNO-7_04gc3ecn
data_D-ZYCMP_I-560918495_TS-TBS_CDT_0410_BC13_BIG_FNO-8_03gc3dml
data_D-ZYCMP_I-560918495_TS-TBS_CDT_0410_BC13_BIG_FNO-9_02gc3ctf

{oracle} /srvtst2/od01/zylnx > mv data_D-ZYCMP_I-560918495_TS-TBS_CDT_0410_BC13_BIG_FNO-


10_05gc3f4r detall0410_BC13_big_02.dbf
{oracle} /srvtst2/od01/zylnx > mv data_D-ZYCMP_I-560918495_TS-TBS_CDT_0410_BC13_BIG_FNO-
11_06gc3fip detall0410_BC13_big_01.dbf
{oracle} /srvtst2/od01/zylnx > mv data_D-ZYCMP_I-560918495_TS-TBS_CDT_0410_BC13_BIG_FNO-
7_04gc3ecn detall0410_BC13_big_05.dbf
{oracle} /srvtst2/od01/zylnx > mv data_D-ZYCMP_I-560918495_TS-TBS_CDT_0410_BC13_BIG_FNO-
8_03gc3dml detall0410_BC13_big_04.dbf
{oracle} /srvtst2/od01/zylnx > mv data_D-ZYCMP_I-560918495_TS-TBS_CDT_0410_BC13_BIG_FNO-
9_02gc3ctf detall0410_BC13_big_03.dbf
{oracle} /srvtst2/od01/zylnx > ls -ltr
total 42130700
-rw-r--r-- 1 oracle dba 7655661568 Feb 6 18:46 detall0410_BC13_big_02.dbf
-rw-r--r-- 1 oracle dba 7655661568 Feb 6 19:00 detall0410_BC13_big_01.dbf
-rw-r--r-- 1 oracle dba 8388616192 Feb 6 19:12 detall0410_BC13_big_05.dbf
-rw-r--r-- 1 oracle dba 8913952768 Feb 6 19:26 detall0410_BC13_big_04.dbf
-rw-r--r-- 1 oracle dba 10485768192 Feb 6 19:44 detall0410_BC13_big_03.dbf
Create user fyt_rent on zylnx and grant to it dba

SQL> create user fyt_rent identified by fyt;

User created.

SQL> grant dba, all privileges to fyt_rent


2 /

Grant succeeded.

If necessaire change national character set to match the nchar of the export

Change national character set, the nchar in solaris was AL16UTF16 while in Linux
is UTF8 in this test:
SQL> alter database NATIONAL CHARACTER SET AL16UTF16;

Database altered.

Enable an 8k cache size to plug the 8k block size tablespace into the 32k block
size database

SQL> alter system set db_8k_cache_size=3000m;

System altered.

Import the metadata:


{oracle} /srvtst2/app01/oracle/scripts/av/compresstest [srvtst2] > imp userid=\'/ as
sysdba\' transport_tablespace=y
datafiles=/srvtst2/od01/zylnx/detall0410_BC13_big_01.dbf,/srvtst2/od01/zylnx/detall0410_B
C13_big_02.dbf,/srvtst2/od01/zylnx/detall0410_BC13_big_03.dbf,/srvtst2/od01/zylnx/detall0
410_BC13_big_04.dbf,/srvtst2/od01/zylnx/detall0410_BC13_big_05.dbf file=TTS_10g.dmp
log=TTS_10g.log

Import: Release 10.1.0.3.0 - Production on Mon Feb 7 13:13:06 2005

Copyright (c) 1982, 2004, Oracle. All rights reserved.

Connected to: Oracle Database 10g Enterprise Edition Release 10.1.0.3.0 - 64bit
Production
With the Partitioning, OLAP and Data Mining options

Export file created by EXPORT:V10.01.00 via conventional path


About to import transportable tablespace(s) metadata...
import done in UTF8 character set and AL16UTF16 NCHAR character set
import server uses IW8ISO8859P8 character set (possible charset conversion)
export client uses IW8ISO8859P8 character set (possible charset conversion)
. importing SYS's objects into SYS
. importing FYT_RENT's objects into FYT_RENT
. . importing table "CMP_TAB_DET_ALL_P"
. . importing table "TAB_DET_ALL_P0410_BC13"
. . importing table "CMP_CALL_PART_TAB_P"
. . importing table "CMP_CONT_FREE_UNIT_TAB_P"
. . importing table "CMP_INCOME_DETAIL_TAB_P"
. importing SYS's objects into SYS
Import terminated successfully without warnings.

Check the tablespaces on the Linux database after the plug in

SQL> select tablespace_name,block_size from dba_tablespaces;


TABLESPACE_NAME BLOCK_SIZE
------------------------------ ----------
SYSTEM 32768
UNDOTBS1 32768
SYSAUX 32768
TEMP 32768
DATA 32768
TBS_CDT_0410_BC13_BIG 8192

6 rows selected.
10g Install on Linux AMD64
top

Pre Install requisites

• Silent install of all recommended patches for 9i-10g (Get from Amnon Nissim)

Pre Install checkups

• Review 10g prerequisites according Note:296665.1: Pre-Install checks for 10g RDBMS on
Linux AMD64/EM64T

o Transfer linuxia64.tar from G:\OracleInstallDisks\Linux\10gx86-


64(amd64)\PreInstallChecks\linuxia64.tar
to the server where you are going to install
o Untar the file : tar –xvf linuxia64.tar
o Execute the check: perl validate.pl 10g_rdbms_linuxia64.txt
o Check the log file with the results and solve any issues detected, ask for help
from Linux System Administrators if needed.
10g ASM, Automatic Storage Manager configuration
top

10g Automatic Storage Manager Setup

Reference Note

Use Note:275315.1 to setup.

Rpm’s to use, checks and install

Transfer ASM Library rpms from G:\OracleInstallDisks\Linux\10gx86-


64(amd64)\OracleASMLib1-0(amd64) to the server

Check the OS level using : uname –a

Linux srvtst2 2.4.21-15.ELsmp #1 SMP Thu Apr 22 00:09:01 EDT 2004 x86_64 x86_64
x86_64 GNU/Linux

Choose and install the library that match your os:

[oracle@srvtst2 ASM-Libraries]$ ls -ltr


total 192
-rw-r--r-- 1 oracle dba 7969 Jan 30 17:21 oracleasmlib-1.0.0-
1.x86_64.rpm
-rw-r--r-- 1 oracle dba 23862 Jan 30 17:27 oracleasm-support-1.0.3-
1.x86_64.rpm
-rw-r--r-- 1 oracle dba 75008 Jan 30 17:27 oracleasm-2.4.21-EL-1.0.3-
1.x86_64.rpm
-rw-r--r-- 1 oracle dba 77780 Jan 30 17:27 oracleasm-2.4.21-EL-smp-
1.0.3-1.x86_64.rpm

Install as root the ASM libraries and packages:

[root@srvtst2 ASM-Libraries]# rpm -Uvh oracleasm-support-1.0.3-1.x86_64.rpm \


> oracleasmlib-1.0.0-1.x86_64.rpm \
> oracleasm-2.4.21-EL-smp-1.0.3-1.x86_64.rpm
Preparing... ########################################### [100%]
1:oracleasm-support ########################################### [ 33%]
2:oracleasm-2.4.21-EL-smp########################################### [ 67%]
Linking module oracleasm.o into the module path [ OK ]
3:oracleasmlib ########################################### [100%]
[root@srvtst2 ASM-Libraries]#

Automatic Storage Manager Libraries (ASMLib) configuration

[root@srvtst2 init.d]# /etc/init.d/oracleasm configure


Configuring the Oracle ASM library driver.

This will configure the on-boot properties of the Oracle ASM library
driver. The following questions will determine whether the driver is
loaded on boot and what permissions it will have. The current values
will be shown in brackets ('[]'). Hitting <ENTER> without typing an
answer will keep that current value. Ctrl-C will abort.

Default user to own the driver interface []: oracle


Default group to own the driver interface []: dba
Start Oracle ASM library driver on boot (y/n) [n]: y
Fix permissions of Oracle ASM disks on boot (y/n) [y]: y
Writing Oracle ASM library driver configuration [ OK ]
Creating /dev/oracleasm mount point [ OK ]
Loading module "oracleasm" [ OK ]
Mounting ASMlib driver filesystem [ OK ]
Scanning system for ASM disks [ OK ]

Automatic Storage Manager (ASM) disks preparation

The preparation of ASM disks consist on marking unformatted disks to make them
available for ASM.

Request unformatted disks from storage (not raw devices), check their names using
fdisk -l as root, in this example disks /dev/sdc and /dev/sdd were added:
[root@srvtst2 root]# fdisk -l

Disk /dev/sda: 73.2 GB, 73272393728 bytes


255 heads, 63 sectors/track, 8908 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

Device Boot Start End Blocks Id System


/dev/sda1 * 1 6819 54773586 83 Linux
/dev/sda2 6820 7863 8385930 82 Linux swap
/dev/sda3 7864 8907 8385930 82 Linux swap

Disk /dev/sdb: 75.1 GB, 75161927680 bytes


255 heads, 63 sectors/track, 9137 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

Disk /dev/sdb doesn't contain a valid partition table

Disk /dev/sdc: 53.6 GB, 53686566912 bytes


255 heads, 63 sectors/track, 6527 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk /dev/sdc doesn't contain a valid partition table

Disk /dev/sdd: 53.6 GB, 53687091200 bytes


255 heads, 63 sectors/track, 6527 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

Device Boot Start End Blocks Id System

Caution: Disks need to be made available without any sort of logical definition.
ie: if the fdisk show then as devices like in this output, oracleasm still will be
able to stamp them as ASM available disks but it will be unable to find them when
it need to create a disk group:

[root@srvtst2 init.d]# fdisk-l


… (look on the output for your disks)
Device Boot Start End Blocks Id System
/dev/sdc1 1 6527 52428096 5 Extended <<< this is incorrect
Disk /dev/sdd: 53.6 GB, 53687091200 bytes
255 heads, 63 sectors/track, 6527 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

Device Boot Start End Blocks Id System


/dev/sdd1 1 6527 52428096 5 Extended <<< this is incorrect

Stamp the empty disks as ASM available:

[root@srvtst2 init.d]# /etc/init.d/oracleasm createdisk VOL1 /dev/sdc


[root@srvtst2 init.d]# /etc/init.d/oracleasm createdisk VOL2 /dev/sdd

Query the new ASM enabled disks:

[root@srvtst2 init.d]# /etc/init.d/oracleasm querydisk /dev/sdc


Disk "/dev/sdc" is marked an ASM disk
[root@srvtst2 init.d]# /etc/init.d/oracleasm querydisk /dev/sdd
Disk "/dev/sdd" is marked an ASM disk

[root@srvtst2 init.d]# /etc/init.d/oracleasm listdisks


VOL1
VOL2

[root@srvtst2 init.d]# /etc/init.d/oracleasm querydisk VOL1


Disk "VOL1" is a valid ASM disk
[root@srvtst2 init.d]# /etc/init.d/oracleasm querydisk VOL2
Disk "VOL2" is a valid ASM disk

Other useful checkup commands, to be run as root:

df –ha
ls -l /dev/oracleasm/disks
cat /proc/filesystems
lsmod
10g Install
top
Execute a custom install, do not create a database.
The install of 10g in Linux is fast and straightforward.

top
10g Database Creation on Linux.
top
Create a custom database using dbca
Choose ASM as the storage use external redundancy.
Choose 32 k for block size.

top
Start ASM instance fail with ORA-29701 unable to connect to Cluster Manager

This problem was seen after taking care of changing the UID and GID of oracle user
to match that of Solaris.
The change was done after shutting down the database and asm instance. But I
forgot to shutdown also the asm manager.

This error was also seen after killing all old cssd processes, and before
restarting asm manager:

SQL> startup
ASM instance started

Total System Global Area 130023424 bytes


Fixed Size 1320472 bytes
Variable Size 128702952 bytes
Database Buffers 0 bytes
Redo Buffers 0 bytes
ORA-15032: not all alterations performed
ORA-15063: diskgroup "DATA" lacks quorum of 2 PST disks;
0 found

SQL> shutdown
ORA-15100: invalid or missing diskgroup name

Steps that solved the problem


Connect as root, check if there are cssd processes up, clean them up
Execute as root:
/etc/init.d/oracleasm stop
/etc/init.d/oracleasm start
/etc/init.d/init.cssd start
Start the ASM instance as oracle
Impdp
top

How to attach to a job and kill it

Scenario: an import using data pump is running. It need to import into a


compressed table but we forget to create the table as compressed. We need to kill
the process.

This is the import command:

impdp
DIRECTORY=DATA_DUMP_DIR
DUMPFILE=expdat%U.dmp
PARALLEL=8
REMAP_TABLESPACE=TBS_CDT_0410_BC13_BIG:DATA
TABLES=CMP_TAB_DET_ALL_P
TABLE_EXISTS_ACTION=append
CONTENT=data_only
LOGFILE=impdat.log
JOB_NAME=imptst
STATUS=60

From another windows invoke impdp and attach to the JOB_NAME you defined in the
impdp session, then execute the kill_job command.

{oracle} /home/oracle [srvtst2] > impdp ATTACH=FYT_RENT.imptst

Import: Release 10.1.0.3.0 - 64bit Production on Thursday, 10 February, 2005 16:35

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


Username: fyt_rent
Password:

Connected to: Oracle Database 10g Enterprise Edition Release 10.1.0.3.0 - 64bit
Production
With the Partitioning, OLAP and Data Mining options

Job: IMPTST
Owner: FYT_RENT
Operation: IMPORT
Creator Privs: FALSE
GUID: EFC3E65A66702BE1E030050AD8B41192
Start Time: Thursday, 10 February, 2005 16:21
Mode: TABLE
Instance: zylnx
Max Parallelism: 8
EXPORT Job Parameters:
CLIENT_COMMAND USERID=fyt_rent/******** DIRECTORY=call_det_exp
DUMPFILE=expdat%U.dmp parallel=8 TABLES=CMP_TAB_DET_ALL_P LOGFILE=expdat%U.log
JOB_NAME=partst
DATA_ACCESS_METHOD AUTOMATIC
ESTIMATE BLOCKS
INCLUDE_METADATA 1
LOG_FILE_DIRECTORY CALL_DET_EXP
LOG_FILE_NAME expdat%U.log
TABLE_CONSISTENCY 0
IMPORT Job Parameters:
Parameter Name Parameter Value:
CLIENT_COMMAND USERID=fyt_rent/******** DIRECTORY=DATA_DUMP_DIR
DUMPFILE=expdat%U.dmp parallel=8 REMAP_TABLESPACE=TBS_CDT_0410_BC13_BIG:DATA
TABLES=CMP_TAB_DET_ALL_P LOGFILE=impdat.log JOB_NAME=imptst STATUS=60
TABLE_EXISTS_ACTION=append CONTENT=data_only
DATA_ACCESS_METHOD AUTOMATIC
INCLUDE_METADATA 0
LOG_FILE_DIRECTORY DATA_DUMP_DIR
LOG_FILE_NAME impdat.log
SKIP_UNUSABLE_INDEXES 1
TABLE_EXISTS_ACTION APPEND
STREAMS_CONFIGURATION 1
State: EXECUTING
Bytes Processed: 0
Current Parallelism: 8
Job Error Count: 0
Dump File: /srvtst/dw/export/expdat%u.dmp
Dump File: /srvtst/dw/export/expdat01.dmp
Dump File: /srvtst/dw/export/expdat02.dmp
Dump File: /srvtst/dw/export/expdat03.dmp
Dump File: /srvtst/dw/export/expdat04.dmp
Dump File: /srvtst/dw/export/expdat05.dmp
Dump File: /srvtst/dw/export/expdat06.dmp
Dump File: /srvtst/dw/export/expdat07.dmp
Dump File: /srvtst/dw/export/expdat08.dmp
Dump File: /srvtst/dw/export/expdat09.dmp

Worker 1 Status:
State: WORK WAITING

Worker 2 Status:
State: WORK WAITING

Worker 3 Status:
State: WORK WAITING

Worker 4 Status:
State: WORK WAITING
Worker 5 Status:
State: EXECUTING
Object Schema: FYT_RENT
Object Name: CMP_TAB_DET_ALL_P
Object Type: TABLE_EXPORT/TABLE/TBL_TABLE_DATA/TABLE/TABLE_DATA
Completed Objects: 1
Completed Rows: 11,253,273
Completed Bytes: 26,823,686,304
Percent Done: 100

Worker 6 Status:
State: WORK WAITING

Worker 7 Status:
State: WORK WAITING

Worker 8 Status:
State: WORK WAITING

Import> KILL_JOB
Are you sure you want to kill job imptst? (yes or no) yes

Press enter to finish.

top
Setting 10g Archive log mode with destination out of ASM
top

Note: log_archive_start=TRUE is no longer required in 10g.

SQL> alter system set db_recovery_file_dest='/srvtst2/od01/zylnx/archives' scope=both;

System altered.

SQL> alter system set db_recovery_file_dest_size=30 g scope=both;

System altered.

SQL> shutdown immediate;


SQL> startup mount;


ORACLE instance started.

Total System Global Area 4831838208 bytes


Fixed Size 1326672 bytes
Variable Size 886817200 bytes
Database Buffers 3942645760 bytes
Redo Buffers 1048576 bytes
Database mounted.

SQL> alter database archivelog;

Database altered.

SQL> alter database open;

Database altered.
SQL> archive log list;
Database log mode Archive Mode
Automatic archival Enabled
Archive destination USE_DB_RECOVERY_FILE_DEST
Oldest online log sequence 464
Next log sequence to archive 466
Current log sequence 466

SQL> alter system switch logfile;

System altered.

SQL> !ls -ltr /srvtst2/od01/zylnx/archives


total 4
drwxr-x--- 3 oracle dba 4096 Feb 16 14:37 ZYLNX

SQL> alter system switch logfile;

System altered.

SQL> !ls -l /srvtst2/od01/zylnx/archives/ZYLNX/archivelog/2005_02_16/


total 6268
-rw-r----- 1 oracle dba 6391808 Feb 16 14:37 o1_mf_1_466_116hnk26_.arc
-rw-r----- 1 oracle dba 11776 Feb 16 14:38 o1_mf_1_467_116homby_.arc

Backup Database using RMAN

Schedule a backup using the Enterprise Manager Database Console,


How to shutdown ocssd

top

Connect as root, change directory to /etc/init.d in both Solaris and Linux.

{oracle} /etc/init.d [Srvtst] > su -


Password:
Sun Microsystems Inc. SunOS 5.8 Generic February 2000
You have new mail.
# tcsh
srvtst:/ [root] > cd /etc/init.d
srvtst:/etc/init.d [root] > ./init.cssd stop
Shutting down CRS daemon.
Shutting down EVM daemon.
Shutting down CSS daemon.
Shutdown request successfully issued.

S-ar putea să vă placă și