Vous êtes sur la page 1sur 15

1 Preparation

  • 1.1 Perform backup

Perform backup of the target system with using ADOP-T

  • 1.2 Relocate system to spare server & turn off archivelog

Shutdown, unbind and unmount the target system

For example UB6.

As ub6adm user logon to am2hc239; cd /usr/sap/adaptive/scripts

./ UB6_06_CI.sh down app ./ UB6_06_DB.sh down app ./ UB6_06_CI.sh down bind mount ./ UB6_06_DB.sh down bind mount

Clean the shared memory with using cleanipc and ipcrm command.

cleanipc 06 remove ipcs | grep ora #if there is any ouput, remove it with using ipcrm ipcs | grep adm #if there is any ouput, remove it with using ipcrm

Make sure all filesystems belong to UB6 have been unmounted. df –g | grep ub6 #make sure no output

As ub6adm user logon to am2hc097 (Shell UI spare server); cd /usr/sap/adaptive/scripts

./ UB6_06_DB.sh up bind mount ./ UB6_06_CI.sh up bind mount

Turn off the archivelog before starting DB with SQL command

sqlplus / as sysdba startup mount alter database noarchivelog

alter database open

shutdown immediate #because we have to start DB with using Appcom script

./ UB6_06_DB.sh up app

#DO NOT need to bring CI up

  • 1.3 Increase PSAPUNDO

Check current size of PSAPUNDO with brtools

Increase PSAPUNDO to 400GB with using brtools, each data file with size 2GB

2

Offline Reorganization

The offline reorganization consist of using BRTOOLS ( expdp – Databpump utility).

  • 2.1 Export tables from a tablespace

As orasid user set an initial password to vnc concole with command vncpasswd Then, initial vncserver with command vncserver. Take note on the vncserver display number. Open vncviewer application and launch the vnc with the display number gotten earlier. Execute brtools from the vncviewer session.

ztm2051:oraa02 27> brtools BR0651I BRTOOLS 7.00 (39)

BR0280I BRTOOLS time stamp: 2009-04-08 22.37.34

BR0656I Choice menu 1 - please make a selection

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

BR*Tools main menu

1

= Instance management

2

- Space management

3

- Segment management

4

- Backup and database copy

5

- Restore and recovery

6

- Check and verification

7

- Database statistics

8

- Additional functions

9

- Exit program

Standard keys: c - cont, b - back, s - stop, r - refr, h - help

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

BR0662I Enter your choice:

3

BR0280I BRTOOLS time stamp: 2009-04-08 22.38.33 BR0656I Choice menu 7 - please make a selection

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

Database segment management

1

= Reorganize tables

2

- Rebuild indexes

3

- Export tables

4

- Import tables

5

- Alter tables

6

- Alter indexes

7

- Additional segment functions

8

- Reset program status

Standard keys: c - cont, b - back, s - stop, r - refr, h - help BR0662I Enter your choice:

BR0280I BRTOOLS time stamp: 2009-04-08 22.39.19

BR0657I Input menu 93 - please enter/check input values

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

BRSPACE options for export tables

1

2

3

4

- BRSPACE profile (profile)

.......

[initA02.sap]

- Database user/password (user)

...

- Export utility (utility)

........

[exp]

~ Tablespace names (tablespaces)

[/]

..

[]

  • 5 ~ Table owner (owner) ............. []

  • 6 ~ Table names (tables)

............

[]

  • 7 ~ Export dump directory (dumpdir) . []

  • 8 - Confirmation mode (confirm)

[yes]

  • 9 - Extended output (output)

[no]

  • 10 - Scrolling line count (scroll)

[20]

  • 11 - Message language (language)

[E]

  • 12 - BRSPACE command line (command)

..

[-p initA02.sap -s 20 -l E -f tbexport -l exp]

Standard keys: c - cont, b - back, s - stop, r - refr, h - help

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

BR0662I Enter your choice:

3

BR0280I BRTOOLS time stamp: 2009-04-08 22.39.32

BR0663I Your choice: '3'

 

BR0280I BRTOOLS time stamp: 2009-04-08 22.39.32

BR0681I Enter string value for "utility" (exp|expdp) [exp]:

 

expdp

BR0280I BRTOOLS time stamp: 2009-04-08 22.39.55

BR0657I Input menu 93 - please enter/check input values

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

BRSPACE options for export tables

 

1

- BRSPACE profile (profile)

[initA02.sap]

 

2

- Database user/password (user)

[/]

3

- Export utility (utility)

[expdp]

4

~ Tablespace names (tablespaces)

[]

5

~ Table owner (owner)

[]

6

~ Table names (tables)

............

[]

7

~ Export dump directory (dumpdir) . []

 

8

- Confirmation mode (confirm)

[yes]

9

- Extended output (output)

........

[no]

10

- Scrolling line count (scroll)

[20]

11

- Message language (language)

[E]

12

- BRSPACE command line (command)

 

[-p initA02.sap -s 20 -l E -f tbexport -l expdp]

Standard keys: c - cont, b - back, s - stop, r - refr, h - help

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

BR0662I Enter your choice:

 

4

BR0280I BRTOOLS time stamp: 2009-04-08 22.40.14

BR0663I Your choice: '4'

BR0280I BRTOOLS time stamp: 2009-04-08 22.40.14

BR0681I Enter string value for "tablespace" []:

PSAPMIWODS

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

BRSPACE options for export tables

1

- BRSPACE profile (profile)

[initA02.sap]

 

2

- Database user/password (user)

 

[/]

3

- Export utility (utility)

[expdp]

4

~ Tablespace names (tablespaces)

[psapbtabd]

5

~ Table owner (owner)

[]

6

~ Table names (tables)

[]

7

~ Export dump directory (dumpdir) . []

 

8

- Confirmation mode (confirm)

[yes]

9

- Extended output (output)

........

[no]

10

- Scrolling line count (scroll)

...

[20]

11

- Message language (language)

 

[E]

12

- BRSPACE command line (command)

[-p initA02.sap -s 20 -l E -f tbexport -l expdp -s

psapbtabd]

 

Standard keys: c - cont, b - back, s - stop, r - refr, h - help

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

BR0662I Enter your choice:

 

6

BR0280I BRTOOLS time stamp: 2009-04-08 22.47.02

BR0663I Your choice: '6'

BR0280I BRTOOLS time stamp: 2009-04-08 22.47.02

BR0681I Enter string value for "table" []:

*

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

BRSPACE options for export tables

  • 1 - BRSPACE profile (profile)

[initA02.sap]

  • 2 - Database user/password (user)

[/]

  • 3 - Export utility (utility)

[expdp]

 
  • 4 ~ Tablespace names (tablespaces)

[PSAPMIWODS]

  • 5 ~ Table owner (owner)

[]

  • 6 ~ Table names (tables)

[*]

  • 7 ~ Export dump directory (dumpdir) . []

 
  • 8 - Confirmation mode (confirm)

[yes]

  • 9 - Extended output (output)

........

[no]

  • 10 - Scrolling line count (scroll)

...

[20]

  • 11 - Message language (language)

[E]

  • 12 - BRSPACE command line (command)

psapmiwods -t "*"]

..

[-p initPB6.sap -s 20 -l E -f tbexport -l expdp -s

Standard keys: c - cont, b - back, s - stop, r - refr, h - help

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

BR0662I Enter your choice:

c

BR0280I BRTOOLS time stamp: 2009-04-08 22.47.39 BR0663I Your choice: 'c' BR0259I Program execution will be continued ...

 

BR0291I BRSPACE will be started with options '-p initPB6.sap -s 20 -l E -f tbexport -l expdp -s psapmiwods -t "*"'

BR0280I BRTOOLS time stamp: 2009-04-08 22.47.39

 

BR0670I Enter 'c[ont]' to continue, 'b[ack]' to go back, 's[top]' to abort:

c

EXAMPLE:

 

BR0280I BRSPACE time stamp: 2009-04-08 22.48.05

 

BR0660I List display 358 - no selection possible

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

List of tables for export

 

Pos. Owner

Table

Part.

Rows Space[KB] Data[KB:%]

 

1

- SAPR3

ACTFLI

NO

0

16

0:0

2

- SAPR3

ADMI_BUFFC

NO

0

16

0:0

3

- SAPR3

ADMI_BUFFI

NO

0

16

0:0

4

- SAPR3

ADMI_JOBS

NO

12

24

1:4

5

- SAPR3

ADMI_RJOBS

NO

0

16

0:0

6

- SAPR3

ADMI_SKIP

NO

0

16

0:0

7

- SAPR3

ADMI_VARIA

NO

10

24

0:1

8

- SAPR3

ADRCMAT

NO

0

16

0:0

9

- SAPR3

ADRCMX

NO

0

16

0:0

10 - SAPR3

ADRCWO

AGDB

AGR_BUFFI

AGR_BUFFI2

AGR_BUFFI3

AGR_HIER

AGR_HIER2

AGR_HIER3

AGR_MAPP

AGR_MARK

AGR_MINI

NO

0

16

0:0

11 - SAPR3

NO

34

200

90:45

12 - SAPR3

NO

636

240

119:49

13 - SAPR3

NO

0

16

0:0

14 - SAPR3

NO

0

16

0:0

15 - SAPR3

NO

21345

11240

2335:21

16 - SAPR3

NO

0

16

0:0

17 - SAPR3

NO

0

16

0:0

18 - SAPR3

NO

3

24

0:1

19 - SAPR3

NO

0

16

0:0

20 - SAPR3

NO

189

192

35:18

Press <Rtn> - scroll, 'c' - cont, 'h' - header, 's' - stop ...

c

  • 1175 - SAPR3

WFQUE

NO

2

24

0:0

  • 1176 - SAPR3

WFSTO

NO

0

16

0:0

  • 1177 NO

- SAPR3

WIZ_STAT

0

16

0:0

  • 1178 NO

- SAPR3

WPTOTLIUSR

0

16

0:0

Standard keys: c - cont, b - back, s - stop, r - refr, h - help

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

BR0662I Enter your choice:

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

Main options for export of tables: SAPR3.ACTFLI,

...

(1178 tables)

  • 1 * Export utility (utility)

[EXPDP]

  • 2 * Tablespaces for export (tablespaces)

[PSAPMIWODS]

  • 3 * Owner for export (owner)

[]

  • 4 - Export table rows (rows)

[yes]

  • 5 - Export table indexes (indexes)

[yes]

  • 6 - Export table constraints (constraints) . [yes]

 
  • 7 - Export table grants (grants)

[yes]

  • 8 - Export table triggers (triggers)

[yes]

Standard keys: c - cont, b - back, s - stop, r - refr, h - help

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

BR0662I Enter your choice:

c

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

Additional options for export of tables: SAPR3.ACTFLI,

...

(1178 tables)

1

2

3

4

5

# Use direct path (direct)

................

[yes]

# Export buffer size in KB (buffer)

.......

[2000000]

- Compress table extents/data (compress)

..

- Consistent export (consistent)

..........

[no]

- Parallel degree (parallel)

..............

[20]

[no]

  • 6 - Max. size of dump file in MB (filesize) . [20000]

  • 7 - Force table export (force)

[no]

  • 8 - EXP/EXPDP command (command)

[/oracle/PB6/102_64/bin/expdp

parfile=/oracle/PB6/sapreorg/seahuzuf/parfile.exp]

Standard keys: c - cont, b - back, s - stop, r - refr, h - help

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

BR0662I Enter your choice:

c

BR0280I BRSPACE time stamp: 2009-04-08 22.50.09 BR0663I Your choice: 'c' BR0259I Program execution will be continued ...

BR0280I BRSPACE time stamp: 2009-04-08 22.50.09 BR0370I Directory /oracle/PB6/sapreorg/seahuzuf created

BR0280I BRSPACE time stamp: 2009-04-08 22.50.09 BR0370I Directory /oracle/PB6/sapreorg/seahuzuf.edd created

BR1164I Export of tables will be started with command line: /oracle/PB6/102_64/bin/expdp

parfile=/oracle/PB6/sapreorg/seahuzuf/parfile.exp

BR0280I BRSPACE time stamp: 2009-04-08 22.50.09 BR0670I Enter 'c[ont]' to continue, 'b[ack]' to go back, 's[top]' to abort:

c

BR0259I Program execution will be continued ...

BR0278I Command output of '/oracle/PB6/102_64/bin/expdp

parfile=/oracle/PB6/sapreorg/seahuzuf/parfile.exp':

Export: Release 10.2.0.4.0 - 64bit Production on Wednesday, 08 April, 2009 22:50:59

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

Username:

Connected to: Oracle Database 10g Enterprise Edition Release 10.2.0.4.0 - 64bit Production With the Partitioning, Data Mining and Real Application Testing options Starting "SYS"."BR_EXPORT_SEAHUZUF": /******** AS SYSDBA

parfile=/oracle/A02/sapreorg/seahuzuf/parfile.exp

Estimate in progress using BLOCKS method ... Processing object type TABLE_EXPORT/TABLE/TABLE_DATA Total estimation using BLOCKS method: 662.4 MB Processing object type TABLE_EXPORT/TABLE/TABLE

exported "SAPR3"."WBWL_TAB"

0 KB

0 rows

exported "SAPR3"."WFSTO"

0 KB

0 rows

exported "SAPR3"."WIZ_STAT"

0 KB

0 rows

exported "SAPR3"."WPTOTLIUSR"

0 KB

0 rows

/oracle/PB6/sapreorg/seahuzuf.edd/expdat.dmp

Job "SYS"."BR_EXPORT_SEAHUZUF" successfully completed at 22:52:53

BR0280I BRSPACE time stamp: 2009-04-08 22.52.54 BR1160I 1178 tables exported by EXPDP utility

BR0280I BRSPACE time stamp: 2009-04-08 22.52.54

BR0670I Enter 'c[ont]' to continue, 'b[ack]' to go back, 's[top]' to abort:

c

#############################################################################

##

BR0292I Execution of BRSPACE finished with return code 0

BR0280I BRTOOLS time stamp: 2009-04-08 22.55.13

BR0256I Enter 'c[ont]' to continue, 's[top]' to cancel BRTOOLS:

c

2.2

Drop and re-create the tablespace

Currently there are 239 datafiles.

Drop tablespace -

SQL> drop tablespace PSAPMIWODS including contents;

!! Run below script to create datafile folder

2.2 Drop and re-create the tablespace Currently there are 239 datafiles. Drop tablespace - SQL> drop

folder_create.txt

Create tablespace PSAPMIWODS -

SQL> create tablespace PSAPMIWODS extent management local datafile '/oracle/UB6/sapdata1/miwods_1/miwods.data1' SIZE 20480M REUSE AUTOEXTEND OFF;

SQL> ALTER TABLESPACE PSAPMIWODS ADD DATAFILE '/oracle/UB6/sapdata1/miwods_2/miwods.data2' SIZE 20480M REUSE AUTOEXTEND OFF; ............................................................................................................................................

Run below script to automate datafile creations. (from sqlplus) The script will create up to 100 datafiles.

!! Refer to complete list of datafile creations

2.2 Drop and re-create the tablespace Currently there are 239 datafiles. Drop tablespace - SQL> drop

datafile_create.txt

During import, MONITOR tablespace growth and increase when needed. Always check available space in sapdata before adding new datafile

2.3

Import tables into the tablespace

ztm2051:oraa02 29> brtools BR0651I BRTOOLS 7.00 (39)

BR0280I BRTOOLS time stamp: 2009-04-08 23.44.40

BR0656I Choice menu 1 - please make a selection

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

BR*Tools main menu

1

= Instance management

2

- Space management

3

- Segment management

4

- Backup and database copy

5

- Restore and recovery

6

- Check and verification

7

- Database statistics

8

- Additional functions

9

- Exit program

Standard keys: c - cont, b - back, s - stop, r - refr, h - help

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

BR0662I Enter your choice:

 

3

Database segment management

 

1

= Reorganize tables

2

- Rebuild indexes

3

- Export tables

4

- Import tables

5

- Alter tables

6

- Alter indexes

7

- Additional segment functions

8

- Reset program status

Standard keys: c - cont, b - back, s - stop, r - refr, h - help

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

BR0662I Enter your choice:

 

4

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

BRSPACE options for import tables

 

1

- BRSPACE profile (profile)

...............

[initPB6.sap]

2

- Database user/password (user)

[/]

3

~ BRSPACE export run / dump file (export) . []

 

4

- Confirmation mode (confirm)

[yes]

5

- Extended output (output)

[no]

6

- Scrolling line count (scroll)

[20]

7

- Message language (language)

.............

[E]

8

- BRSPACE command line (command)

 

[-p initA02.sap -s 20 -l E -f tbimport]

Standard keys: c - cont, b - back, s - stop, r - refr, h - help

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

BR0662I Enter your choice:

3

BR0280I BRTOOLS time stamp: 2009-04-08 23.52.46 BR0681I Enter string value for "export" []:

 

seahuzuf.tbe (example – please use the correct export file)

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

BRSPACE options for import tables

 

1

- BRSPACE profile (profile)

...............

[initPB6.sap]

2

- Database user/password (user)

[/]

3

~ BRSPACE export run / dump file (export) . [seahuzuf.tbe]

4

- Confirmation mode (confirm)

[yes]

5

- Extended output (output)

................

[no]

6

- Scrolling line count (scroll)

...........

[20]

7

- Message language (language)

[E]

- BRSPACE command line (command) seahuzuf.tbe]

8

 

[-p initPB6.sap -s 20 -l E -f tbimport -x

Standard keys: c - cont, b - back, s - stop, r - refr, h - help

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

BR0662I Enter your choice:

c

BR0259I Program execution will be continued ...

BR0291I BRSPACE will be started with options '-p initPB6.sap -s 20 -l E -f tbimport -x seahuzuf.tbe'

BR0280I BRTOOLS time stamp: 2009-04-08 23.54.06

BR0670I Enter 'c[ont]' to continue, 'b[ack]' to go back, 's[top]' to abort:

c

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

Main options for import from dump file /oracle/PB6/sapreorg/seahuzuf.edd/expdat.dmp

  • 1 * Import utility (utility)

[IMPDP]

  • 2 - Import type (type)

.....................

[full]

  • 3 # Owner for import (owner)

[]

  • 4 # Tables for import (tables)

[]

  • 5 - Import table rows (rows)

[yes]

  • 6 - Import table indexes (indexes)

[yes]

  • 7 - Import table constraints (constraints) . [yes]

  • 8 - Import table grants (grants)

[yes]

  • 9 - Import table triggers (triggers)

[yes]

Standard keys: c - cont, b - back, s - stop, r - refr, h - help

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

BR0662I Enter your choice:

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

Additional options for import from dump file /oracle/PB6/sapreorg/seahuzuf.edd/expdat.dmp

  • 1 # Import buffer size in KB (buffer)

.......

[2000000]

  • 2 # Commit after each array insert (commit) . [NO]

  • 3 # Ignore creation errors (ignore)

[yes]

  • 4 - Table exists action (action)

[skip]

  • 5 - Parallel degree (parallel)

[20]

  • 6 # Max. size of dump file in MB (filesize) . [200000]

 
  • 7 - Force table import (force)

[no]

  • 8 - IMP/IMPDP command (command)

[/oracle/PB6/102_64/bin/impdp

parfile=/oracle/PB6/sapreorg/seahvfrm/parfile.imp]

Standard keys: c - cont, b - back, s - stop, r - refr, h - help

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

BR0662I Enter your choice:

c

BR0280I BRSPACE time stamp: 2009-04-08 23.56.37 BR0370I Directory /oracle/PB6/sapreorg/seahvfrm created

BR1172I Import of tables will be started with command line: /oracle/PB6/102_64/bin/impdp

parfile=/oracle/PB6/sapreorg/seahvfrm/parfile.imp

BR0280I BRSPACE time stamp: 2009-04-08 23.56.37

BR0670I Enter 'c[ont]' to continue, 'b[ack]' to go back, 's[top]' to abort:

c

BR0278I Command output of '/oracle/A02/102_64/bin/impdp

parfile=/oracle/PB6/sapreorg/seahvfrm/parfile.imp':

Import: Release 10.2.0.4.0 - 64bit Production on Wednesday, 08 April, 2009 23:56:56

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

Username:

Connected to: Oracle Database 10g Enterprise Edition Release 10.2.0.4.0 - 64bit Production With the Partitioning, Data Mining and Real Application Testing options Master table "SYS"."BR_IMPORT_SEAHVFRM" successfully loaded/unloaded Starting "SYS"."BR_IMPORT_SEAHVFRM": /******** AS SYSDBA

parfile=/oracle/A02/sapreorg/seahvfrm/parfile.imp

Processing object type TABLE_EXPORT/TABLE/TABLE

imported "SAPR3"."WFSTO"

0 KB

0 rows

imported "SAPR3"."WIZ_STAT"

0 KB

0 rows

imported "SAPR3"."WPTOTLIUSR"

0 KB

0 rows

Processing object type TABLE_EXPORT/TABLE/GRANT/OWNER_GRANT/OBJECT_GRANT 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 Job "SYS"."BR_IMPORT_SEAHVFRM" successfully completed at 00:03:18

BR0280I BRSPACE time stamp: 2009-04-09 00.03.21 BR1166I 1178 tables imported by IMPDP utility

BR0280I BRSPACE time stamp: 2009-04-09 00.03.22

BR0670I Enter 'c[ont]' to continue, 'b[ack]' to go back, 's[top]' to abort:

c

3

Post activities

  • 3.1 Datafile relocation ( NOT required)

Perform this step when DB is down.

Depending on the sapdata size after reorg. Relocate the datafile to each and every sapdata until each sapdata reaching 95%.

Database controfile has to be recreated back

  • 3.2 Reduce PSAPUNDO

Create a temporary undo tablespace SQL> create undo tablespace PSAPUNDO2 datafile '/oracle/DEV/sapdata3/undo2.data1' size

1G;

Make this the default undo tablespace SQL> alter system set undo_tablespace=PSAPUNDO2 scope=memory;

Drop PSAPUNDO SQL> drop tablespace PSAPUNDO including contents and datafiles;

Recreate PSAPUNDO, e.g. with a single datafile of 2 GB until it’s original size before reorg SQL> create undo tablespace PSAPUNDO datafile '/oracle/DEV/sapdata3/undo_1/undo.data1' size 2G;

Make PSAPUNDO again the default undo tablespace SQL> alter system set undo_tablespace=PSAPUNDO scope=both;

Remove the temporary undo tablespace SQL> drop tablespace PSAPUNDO2 including contents and datafiles;

  • 3.3 Move system back to original LPAR

As ub6adm user logon to am2hc097; cd /usr/sap/adaptive/scripts

./ UB6_06_CI.sh down app #if CI is up

./ UB6_06_DB.sh down app ./ UB6_06_CI.sh down bind mount ./ UB6_06_DB.sh down bind mount

Clean the shared memory with using cleanipc and ipcrm command.

cleanipc 06 remove

ipcs | grep ora #if there is any ouput, remove it with using ipcrm ipcs | grep adm #if there is any ouput, remove it with using ipcrm

Make sure all filesystems belong to UB6 have been unmounted. df –g | grep ub6 #make sure no output

As ub6adm user logon to am2hc239 cd /usr/sap/adaptive/scripts

./ UB6_06_DB.sh up bind mount ./ UB6_06_CI.sh up bind mount ./ UB6_06_DB.sh up app ./ UB6_06_CI.sh up