Anda di halaman 1dari 38

Database Extraction Tool

Manual
Copyright
The copyright in this work is vested in LHS. The information contained in this work (either in
whole or in part) is confidential and must not be modified, reproduced, disclosed or dissemi-
nated to others or used for purposes other than that for which it is supplied, without the prior
written permission of LHS. If this work or any part hereof is furnished to a third party by virtue
of a contract with that party, use of this work by such party shall be governed by the express
contractual terms between LHS, which is party to that contract and the said party.
The information in this document is subject to change without notice and should not be
construed as a commitment by LHS. LHS assumes no responsibility for any errors that may
appear in this document. With the appearance of a new version of this document, all older
versions become invalid.
Database Extraction Tool

Table of Contents

1 Introduction 5
2 New Features in Version 2 7
2.1 New Features from Dec 2008..................................................................................7

3 Requirements 8
3.1 Supported Platforms ...............................................................................................8
3.2 DBExtract-Software and Installation......................................................................8
3.2.1.1 Direct Mode 9
3.2.1.2 Export Mode 9
3.3 Direct mode – Setup Target Database Instance (DBX-DB) ................................10
3.4 Export mode – File export .................................................................................... 11

4 Database Extraction Tool: Step by step - an Overview 12


4.1 Export Mode ...........................................................................................................12
4.2 Direct Mode ............................................................................................................12

5 Detailed Instructions 13
5.1 Creation of a new Oracle Instance .......................................................................13
5.2 Create the SYSADM Schema (sysadm.sql).........................................................14
5.3 Create DBX user (dbx_user.sql)...........................................................................14
5.4 Getting an overview (size.sql) ..............................................................................15
5.5 Configuration of DBExtract (dbextract.cfg) ........................................................15
5.5.1 Restart option of the dbextract.sql 15
5.5.2 Direct or Export Mode 16
5.5.3 Use of Oracle Datapump utilitiy 16
5.5.4 Parallel Mode 18
5.5.5 Partition Pruning 18
5.5.6 Database Connections 19
5.5.7 Define Customer, Accounts, Service Provider… 22
5.5.8 Copy of free Resources 25
5.5.9 Copy full controlgroups or billcycles 25
5.5.10 Date specific data reduction 26
5.5.11 Exclude Tables 29
5.5.12 Exclude or Include large Tables 30
5.6 Exclude tables from DBExtract (pcreate.sql) .....................................................31
5.7 Monitoring with dbx_trace.sql..............................................................................31
5.8 Drop objects created by DBExtract (dbx_drop.sql) ...........................................31
5.9 Remove old dumpfiles (dbx_del_dmp.sh) ..........................................................31
5.10 dbextract.sql ..........................................................................................................32
5.11 Export .....................................................................................................................32

Copyright of LHS Telekom GmbH & Co. KG, 2007. All rights reserved.
Database Extraction Tool

5.11.1 Export with dbx_exp.sh 32


5.11.2 oradump – A Filter Perl Filter Script for Oracle Dumps 33
5.12 Import......................................................................................................................35
5.12.1 Import with dbx_imp.sh 35
5.12.2 Recompile all objects (compile.sql) 35
5.12.3 Resetting all sequences (seqinst.sql) 36

6 Troubleshooting 37

Copyright of LHS Telekom GmbH & Co. KG, 2007. All rights reserved.
Database Extraction Tool
Introduction Formatted: Font: Bold
Deleted: Troubleshooting
5

1 Introduction

DBExtract is a tool to create a size-reduced copy of a BSCS database by reducing the data to a
desired subset.
The purpose of this tool is to create slim and consistent database copies (called DBX DB) from
any BSCS test or production environment in order to:
• generate test databases including full BSCS baseline setup
• copy the production environment for BSCS migrations
• create handy dumps containing particular error cases for external maintenance purposes
To reach this goal, DBExtract can do the following:
• Copy full BSCS baseline setup
• Copy freely configurable subset of subscribers, large accounts and contracts
• Copy any database customizations done by the customer
• Create consistent BSCS databases based on real production Environments
DBExtract can work in two different modes:

In export mode all data will be exported to disk first. Later in a second step the data is imported
in a Target-Database (DBX DB). The advantage of the export mode is that it can work in parallel
(with significant speed increase on multi processor machines) and that it does not require an
existing DBExtract database instance during the extraction phase. The export mode is
especially useful to provide LHS with a database extract as defect support material. In this case
you just tar the extracted files and send them to LHS. You do not have to bother with setting up
a new database and importing the files again.
In direct mode all tables are copied into a separate database instance (DBX DB) via a
database link from the BSCS database. The advantage of the direct mode is that it requires less
disk space and that the data copy is quiet fast, even it does not work in parallel.
DBEXTRACT needs to create some temporary tables to control its internal workflow. To get best
performance, it is recommend to allow DBEXTRACT to create these tables on the BSCS
database (i.e. on the production database). In export mode this is a requirement, while in
direct mode the working tables can also be stored in the new instance (DBX DB). Such a

Copyright of LHS Telekom GmbH & Co. KG, 2007. All rights reserved.
Database Extraction Tool
Introduction Formatted: Font: Bold
Deleted: Troubleshooting
6

configuration reduces the performance but it ensures that there will not be any writing to the
BSCS database.
All customizable DBEXTRACT parameters (e.g. Target and source database names, which
customers should be extracted, etc) can be set in a single control file.
DBExtract will copy the complete structure of the original database.
DBEXTRACT fully copies all tables in the SYSADM scheme and - if existing - all tables of the
DMFADM scheme into the DBX DB, except:
• Tables with customer data. These tables are copied, but consistently reduced in size
according to the control file setting.
• Tables that have explicitly been excluded by the user in the control file. Only the structure of
these tables is copied (without data). Example: Backup or Temporary table.

Copyright of LHS Telekom GmbH & Co. KG, 2007. All rights reserved.
Database Extraction Tool
New Features in Version 2 Formatted: Font: Bold
Deleted: Troubleshooting
7

2 New Features in Version 2

DBExtract was improved with several new features:


1. The new DBExtract supports all BSCS Releases since BSCS 6.00.
2. The Export Mode was introduced, in this mode no target DB is needed at export time.
3. DBExtract is now completely restartable.
4. In Export Mode DBExtract can be started in Parallel: under the condition that your
operating system supports mkfifo pipes.
5. Flexible use of different database connections (BSCS DB, UDR DB, BILL DB, DBXHOME
DB and DBX DB). The configuration file now contains all required connection information.
6. It is now possible to increase the performance by storing the DBX working tables directly
in the BSCS DB.
7. When restarting the SQL script dbextract.sql, it is possible to skip already successfully
executed steps by using the parameter dbx_step in the configuration file.
8. Functionality to copy Free Resources.
9. Functionality to copy UDR Tables.
10. Enhanced Troubleshooting by monitoring the execution of DBExtract with script
dbx_trace.sql.
11. New script dbx_user.sql to create a user called DBX, when standard SYSADM cannot be
used (For details see 5.3)
12. New script dbx_del_dmp.sh to remove old dumpfiles.
13. New and improved Export and Import-Tools dbx_exp.sh and dbx_imp.sh
14. Improved oradump utility to replace the storage information in the export files.
15. New table DBX_SELECTION to configure a large amount of customers

2.1 New Features from Dec 2008


DBExtract was improved with several new features:
1. DBExtract now supports the "datapump" utilities of Oracle Release 11.
2. The PARTITION PRUNING functionality was introduced.
3. A log table called DBX_LOG and logging functionality was introduced.
4. The utilities DBX_EXP.SH and DBX_IMP.SH are writing log files now.
5. To increase performance of direct mode in Oracle 8.1.7.4 environments, the parameter
USE_DRIVING_SITE_VIEW can be used.
6. Parameters ordhdrentdate and tckrccredate can now be set to "-1"
7. Additional parameters to exclude tables (exclude_any_tab01,…) were introduced
8. The SQL-Statements to fill DBX-Working tables were improved

Copyright of LHS Telekom GmbH & Co. KG, 2007. All rights reserved.
Database Extraction Tool
Requirements Formatted: Font: Bold
Deleted: Troubleshooting
8

3 Requirements

3.1 Supported Platforms


DBExtract has been tested successfully with ORACLE versions 8.1.6, 8.1.7, 9.0, 9.2, 10.1, 10.2
and 11.1. .
The perl script oradump (see section 5.11.2) runs on all platforms on which the programming
Language perl is installed. The gzip utility used is open source and available on all platforms.

3.2 DBExtract-Software and Installation


The DBExtract package consists of the following files:

Name Remark
DBExtract_manual The manual you are just reading.
.pdf
sysadm.sql Creates user SYSADM.
dbextract.cfg Configuration file for DBExtract. These files must be
configured before start with DBExtract.
dbextract.sql Main script. Calls dbextract.cfg , dbx_trace.sql and
dbx_spp.sql. Creates and fills dbx working tables. Direct
copy of objects to DBX DB in direct mode.
dbx_exp.sh Oracle Export of objects from BSCS-DB to file system.
Oradump.pl Filters Storage information out of an Oracle dump file.
dbx_imp.sh Oracle Import of objects from file system to DBX DB.
compile.sql Recompiles DB-objects with respect to dependencies.
pcreate.sql Pre-creates tables to prevent them from getting copied
to the DBExtract database (optional).
size.sql Determines the size of a database (lists the size of all
tables) (optional, for information only).
seqinst.sql Installation/Reset script for all Sequences.
dbx_trace.sql By the activation of procedure dbx.SQLTraceOn inside
dbx_trace.sql is possible to show all statements
executed by dbextract.sql.
dbx_spp.sql DXExtract package.
dbx_user.sql Can be used to create a Readonly user called DBX at
the BSCS database.
dbx_drop.sql Can be used to drop all objects created by dbextract.sql.
dbx_del_dump.sh Delete dumpfiles and corresponding logfiles, if the
database was fully exported. If the database was only
partially exported (no structure dump), the dumpfiles
must be deleted manually.

Copyright of LHS Telekom GmbH & Co. KG, 2007. All rights reserved.
Database Extraction Tool
Requirements Formatted: Font: Bold
Deleted: Troubleshooting
9

dbx_selection.sql Create table DBX_SELECTION at BSCS DB

For easier use of DBExtract, it is recommended simply to copy the mentioned files into the
same folder.
Make sure that there is sufficient disk space available on the device.

3.2.1.1 Direct Mode


In direct mode (see section 3.3), only some small files are created:
• One small Oracle dump file. This dump file is a full export of the production database (but
without any table data).
• One file for every Partitioned table is exported into the UNIX file system (Since otherwise
partitioned tables would not be partitioned in the new database).
• One file for every Lob (large binary object) table is exported into the UNIX file system
because currently LOB tables cannot be handled via PLSQL across database links
efficiently.

3.2.1.2 Export Mode


In export mode (see section 3.4) the selected data is exported completely to disk, therefore
make sure that there is sufficient disk space available.
• The exports via utility "exp" are done using gzip.
• The imports via utility "imp" require gzip and perl.
• All SQL scripts must be executed using SQL*Plus, which comes with Oracle.

Copyright of LHS Telekom GmbH & Co. KG, 2007. All rights reserved.
Database Extraction Tool
Requirements Formatted: Font: Bold
Deleted: Troubleshooting
10

3.3 Direct mode – Setup Target Database Instance (DBX-DB)


DBExtract needs a separate and empty database instance to copy the data to.
In direct mode that database is a prerequisite, in export mode it can be created later.
For information on how to create an Oracle database instance please refer to the Oracle
documentation (Server Manager, init.ora, CREATE DATABASE command). It is required to
execute at least catalog.sql and catproc.sql (coming with Oracle) after the database has been
created.
DBExtract requires only one tablespace for user data named ‘DATA’, respectively a tablespace
name that matches the pattern ‘%DATA%’, even if the objects of the users are distributed over
several tablespaces at the BSCS production database. The temporary tablespace should be
named ‘TEMP’, respectively a tablespace name that matches the pattern ‘%TEMP%’. Check
that the default data tablespace and the default temporary tablespace of the SYSADM user are
set to these tablespaces.

Recommendation: size the temporary tablespace about 20 % of the data tablespace!

The size of the DBExtract database instance strongly depends on the number of customers,
large accounts and dealers, which will get extracted from the BSCS database, but also the
amount of existing baseline data has an impact to the final size of the extracted database.
Therefore it is not possible to give exact figures for the new database.
Here are some figures from previous extractions with DBExtract, which can be used to estimate
the necessary resources:

Database BSCS DBExtract


No. of Customers 464.064 9.390
No. of Contracts 599.552 9.205
Tablespace DATA – Size 44,2 GB 2,1 GB

Database BSCS DBExtract


No. of Customers 445.804 1.172
No. of Contracts 2.455.208 3.680
Tablespace DATA – Size 59,4 GB 4,5 GB

Copyright of LHS Telekom GmbH & Co. KG, 2007. All rights reserved.
Database Extraction Tool
Requirements Formatted: Font: Bold
Deleted: Troubleshooting
11

3.4 Export mode – File export


In export mode ‘e’, configured in dbextract.cfg, DBExtract stores all export information in file
format in the ./dumpfiles directory. A target DB (DBX DB) as required in direct mode (see
section 3.3) is not needed at export time in the export mode, but has to be configured in
dbextract.cfg, even if it is not used.
To keep the logic of the tool simple a target DB (DBX DB) has to be configured in
dbextract.cfg. The specified database is not modified, so you can use the same connect string
as for the BSCS database.

DBEXTRACT will not start in Direct mode, if the Target DB is the same as the BSCS DB.

Log Export Information are stored in log_exp Directory. The log_imp directory is used for Import
LOG Information.

Copyright of LHS Telekom GmbH & Co. KG, 2007. All rights reserved.
Database Extraction Tool
Database Extraction Tool: Step by step - an Overview Formatted: Font: Bold
Deleted: Troubleshooting
12

4 Database Extraction Tool: Step by step - an Overview

This section is intended to give you a high level overview on the steps needed to run DBExtract.
See the next section for more details.

4.1 Export Mode


Step One: Use script size.sql to look for large objects in the BSCS database, which are not
required by BSCS and can be excluded in the dbextract.cfg configuration file.
Step Two: Configure dbextract.cfg (see section 5.5), set the dbx_mode=’e’ ; set connect
strings, user names, passwords; define the tables to be excluded and the customer to be
copied.
Step Three: Run script dbextract.sql, which creates and fills the temporary tables of
DBExtract in the BSCS DB. A control file for Step Four is written to file system.
Step Four (main step): Script dbx_exp.sh exports all users and objects (table data according
the configuration in file dbextract.cfg) from the BSCS production database to the file system.
You may use script dbx_del_dmp.sh previously to remove old dmp files and log files.

Defect support material:


When you only want to provide LHS with a database extract as defect support material, you
don’t need to process step Five and step Six. Just tar the complete directory where DBExtract
is installed, including the sub directories and send the tar file to LHS.

Step Five: Create the DBExtract Database. Create BSCS schema ‘SYSADM’ with script
sysadm.sql.
Step Six: Use script dbx_imp.sh to import all dump files into the DBExtract database.

4.2 Direct Mode


Step One: Create the DBExtract Database. Create BSCS schema ‘SYSADM’ at the DBExtract
database with script sysadm.sql.
Step Two: Use script size.sql to look for large objects in the BSCS database, which are not
required by BSCS and can be excluded in the dbextract.cfg configuration file.
Step Three: Configure dbextract.cfg (see section 5.5), set the dbx_mode=’d’; set connect
strings, user names, passwords; define the tables to be excluded and the customer to be
copied.
Step Four (main step): Run Script dbextract.sql, which creates and fills the temporary tables
of DBExtract. Dbextract.sql copies all tables and table data from the BSCS production database
to the DBExtract database. The data is reduced according to the parameters in the configuration
file dbextract.cfg. A control file for Step Four is written to file system.
Step Five: Script dbx_exp.sh exports all users and objects (without table data) from the BSCS
production database to the file system. Additionally all partitioned tables and lob tables are
exported as well incl. contents. You may use script dbx_del_dmp.sh previously to remove old
dmp files and log files.
Step Six: Use script dbx_imp.sh to import all dump files into the DBExtract database.

Copyright of LHS Telekom GmbH & Co. KG, 2007. All rights reserved.
Database Extraction Tool
Detailed Instructions Formatted: Font: Bold
Deleted: Troubleshooting
13

5 Detailed Instructions

In this chapter you will find detailed information on how to configure and run DBExtract.

Please note that it's important to follow all steps mentioned in the sections of this
chapter consecutively in order to run this tool properly!

Please make sure that the system resources are sufficient. The server should not begin
to swap when running the script!

5.1 Creation of a new Oracle Instance


Before running DBExtract in direct mode, you need to setup a separate empty Oracle instance
as the DBExtract destination database (see section 3.3). In export mode the new instance can
be created later.
Also Oracle Net must be configured for the new instance and TNS-Listener must run to
interconnect between the BSCS source database and the DBExtract destination database. For
testing purposes of the extracted database with BSCS Online modules afterwards an entry in
the Centura sql.ini file is required.
Have a look at the tablespaces and their parameters:
• Check whether the sizes of the rollback segment (RBS) and the TEMP segment are
sufficient.
• Check the extension parameters of tablespace DATA.
• A possible data set could look like:

Initial Extend = 16 K, Next Extension = 16K (PCTINCREASE=50).

This can be set in the database using:

alter tablespace DATA default storage (initial 16K next 16K


pctincrease 50)

Copyright of LHS Telekom GmbH & Co. KG, 2007. All rights reserved.
Database Extraction Tool
Detailed Instructions Formatted: Font: Bold
Deleted: Troubleshooting
14

5.2 Create the SYSADM Schema (sysadm.sql)


You can use the script sysadm.sql to create the BSCS schema for user SYSADM on the newly
set up DBExtract database (see 5.1 and 3.3), which therefore usually only contains the standard
users ‘SYSTEM’ and ‘SYS’.

Make sure that the Oracle environment (ORACLE_SID or TWO_TASK) is set correctly to
the new DBExtract database and use SQL*Plus to run this script.

Start SQL-Script sysadm.sql as user ‘SYS’ at the DBExtract database. However, the script will
try to connect itself as user SYS to the DBExtract database. Therefore it prompts for the
password of the user SYS.
In the further process SYSADM.SQL will do the following:
• Check if user SYSADM already exists
• Create user SYSADM with password SYSADM
• Create user DMF and DMFADM with password SYSADM
• Create BSCS_ROLE, SCHEMA_ADM_ROLE, DMF_USER_ROLE
• Grant required roles (privileges) to SYSADM and DMFADM
• Grant quotas on tablespaces to user SYSADM
At the end a short summary of the previous actions will be given. This information can also be
found in the spool file sysadm.log, which gets automatically created every time you run
sysadm.sql.

5.3 Create DBX user (dbx_user.sql)


The DBExtract process needs to login to the BSCS database to extract the database objects. In
case it is not possible to use the standard SYSADM user, the script dbx_user.sql offers a
possibility to create a new user with restricted, but sufficient privileges to be used by DBExtract.
The script dbx_user.sql creates a user called DBX in the BSCS Production Database. This
script calls the dbextract.cfg configuration file, which must be configured before start of
dbx_user.sql.
The user DBX is intended to be used by the DBEXTRACT utility to connect to the BSCS
Production Database (in case the SYSADM user is not available).
If the DBX user created with this script is used, the temporary tables of DBEXTRACT cannot be
stored in the BSCS Production Database but have to be stored in the DBX Database (which
causes a performance loss).

Copyright of LHS Telekom GmbH & Co. KG, 2007. All rights reserved.
Database Extraction Tool
Detailed Instructions Formatted: Font: Bold
Deleted: Troubleshooting
15

5.4 Getting an overview (size.sql)


The script size.sql gives some statistical information about BSCS and DBExtract database.
This script calls the dbextract.cfg configuration file, which must be configured before start of
size.sql.
The output of the scripts is a list of all tables ordered by size and all indexes ordered by size.
Here, one can detect which tables are very large. In case some large tables are no BSCS tables
and are not needed in the target database, these tables can be excluded from the dbextract
process using either the dbextract.cfg file (see sections 5.5.11 and 5.5.12) or the pcreate.sql
script (see section 5.6). In the dbextract.cfg file, it is possible to exclude up to 20 tables. If
more tables are needed to be excluded, the pcreate.sql script should be used.

5.5 Configuration of DBExtract (dbextract.cfg)


dbextract.cfg is used by dbextract.sql, dbx_drop.sql, dbx_exp.sh, dbx_imp.sh, size.sql
and pcreate.sql and must be adapted before these scripts are run.

The size of the DBExtract database depends strongly on the number of the selected customers,
which can be specified by several parameters in the .cfg file and of the tables excluded.
The following paragraphs explain the parameters of the .cfg file in detail.

5.5.1 Restart option of the dbextract.sql


The script dbextract.sql is organized in 6 sub units (“steps”). If an extract run has been
interrupted for some reason, the extract process can be resumed in the step where the extract
was interrupted (see the log file to identify this step.)
The step, where DBExtract should resume its work, must be specified in the .cfg file.
REM ############################################################
REM # dbx_step=0 - DBX starts from the begin #
REM # dbx_step=1 - create DBX Tables at DBX HOME #
REM # dbx_step=2 - load DBX Tables at DBX HOME from BSCS DB #
REM # dbx_step=3 - define WHERE conditions at DBX HOME #
REM # dbx_step=4 - define storage at DBX HOME #
REM # dbx_step=5 - copy all tables to DBX DB (mode d) #
REM # dbx_step=6 - add Default values to DBX DB (mode d) #
REM ############################################################
define dbx_step=0

Copyright of LHS Telekom GmbH & Co. KG, 2007. All rights reserved.
Database Extraction Tool
Detailed Instructions Formatted: Font: Bold
Deleted: Troubleshooting
16

5.5.2 Direct or Export Mode


In configuration file dbextract.cfg direct or export mode with parameter ‘dbx_mode’ should be
specified. When set the direct mode ‘d’ then a target DB is needed, to copy all the BSCS DB to
the DBX DB. When set the export mode ‘e’ then all export information will be written in
dumpfiles for later import.
REM ###########################################################
REM # Specify the mode of DBX #
REM # dbx_mode='e' - Export all tables and import them #
REM # later on. #
REM # #
REM # dbx_mode='d' - Direct copy of tables from BSCS DB #
REM # to DBX DB. #
REM # #
REM # Sample: dbx_mode='e' #
REM ###########################################################
define dbx_mode='e'

5.5.3 Use of Oracle Datapump utilitiy


In Oracle 11 the import/export utilities exp and imp are still available and can be used
DBExtract, but they do not support the new features of Oracle 11. Since Oracle 11 only the
Oracle Datapump utilities expdp and impdp will support all new features of the Oracle
database.
Oracle Datapump can be used by DBExtract starting with Oracle 11.
A disadvantage of Oracle Datapump is that writing and reading files is done by database
server processes only. There is no real client application for Oracle Datapump. That means
that the Oracle Datapump utilities impdp and expdp have to be started on the database
servers and so DBExtract has to be started on the database server too.
Parameter USE_ORACLE_DATAPUMP can used to turn Oracle Datapump ON or OFF.
When Oracle Datapump is used, up to three directory objects are created in the databases.
They are required to enable Oracle Datapump to read from and write to the DBExtract
directories.
The names of these directory objects are defined by the parameters
DIR_NAME_DBX_DUMPFILES_DIR, DIR_NAME_DBX_LOG_EXP_DIR and
DIR_NAME_DBX_LOG_IMP_DIR.
With parameter DATAPUMP_DBXDB_NWMODE Oracle Datapump can also be used in
dbx_mode = "d" instead of using the CTAS method (CTAS=CreateTableAsSelect). Oracle
Datapump can be started in parallel, while CTAS work only sequentially.

REM ###########################################################
REM # Defines the use of ORACLE DATAPUMP #
REM # #
REM # This functionality can only be used since Oracle 11 #
REM # To use this functionality DBEXTRACT must be started #
REM # at all required database servers. #
REM # BSCS/UDR/BILL database server during export (dbx_exp.sh)#

Copyright of LHS Telekom GmbH & Co. KG, 2007. All rights reserved.
Database Extraction Tool
Detailed Instructions Formatted: Font: Bold
Deleted: Troubleshooting
17

REM # DBX database server during import (dbx_imp.sh)#


REM # #
REM # Possible Values: 0 (off) , 1 (on) #
REM # Default: 0 #
REM ###########################################################
define USE_ORACLE_DATAPUMP='0'

REM ###########################################################
REM # Definition of directory names for ORACLE DATAPUMP #
REM # #
REM # The following directories will be created by dbx_exp.sh #
REM # and dbx_imp.sh at the databases when parameter #
REM # USE_ORACLE_DATAPUMP='1'! #
REM # #
REM ###########################################################

define DIR_NAME_DBX_DUMPFILES_DIR='DBX_DUMPFILES_DIR'
define DIR_NAME_DBX_LOG_EXP_DIR='DBX_LOG_EXP_DIR'
define DIR_NAME_DBX_LOG_IMP_DIR='DBX_LOG_IMP_DIR'

REM ###########################################################
REM # When DATAPUMP_DBXDB_NWMODE is set to 'd' (or later 'e'),#
REM # then a local database DBX DB is used by dbx_exp.sh and #
REM # dbx_imp.sh to perform exports and imports remotly. #
REM # #
REM # DATAPUMP_DBXDB_NWMODE = e is only for future use! #
REM # Currently DATAPUMP_DBXDB_NWMODE = e is not supported! #
REM # #
REM # DATAPUMP_DBXDB_NWMODE = 0 #
REM # In dbx_mode e all data is exported and imported via the #
REM # file system by dbx_exp.sh and dbx_imp.sh. #
REM # In dbx_mode d the tables are copied with CTAS method #
REM # (CTAS=CreateTableAsSelect) to DBX DB by dbextract.sql. #
REM # The rest of the data is exported and imported via the #
REM # file system by dbx_exp.sh and dbx_imp.sh. #
REM # #
REM # DATAPUMP_DBXDB_NWMODE = d #
REM # In dbx_mode d all the data is copied over database #
REM # links into database DBXDB by Oracle Datapump. #
REM # Log files are written to the file system. #
REM # #
REM # DATAPUMP_DBXDB_NWMODE = (e) #
REM # In dbx_mode e all the data is copied over database #
REM # links on database DBXDB to file system by Oracle #
REM # Datapump. #
REM # Performance is supposed to be low, because the #
REM # the complete table data is first transfered to DBXDB #
REM # and then the Query-Condition is used to reduce the #
REM # amount of data. #
REM # Can not be used for tables with LONG columns. #
REM # #
REM # Possible Values: 0 (off) #
REM # d (only for direct mode) #

Copyright of LHS Telekom GmbH & Co. KG, 2007. All rights reserved.
Database Extraction Tool
Detailed Instructions Formatted: Font: Bold
Deleted: Troubleshooting
18

REM # (e)(only for export mode) #


REM # #
REM # Default: 0 #
REM ###########################################################

5.5.4 Parallel Mode


The shell utilities of DBExtract (dbx_exp.sh and dbx_imp.sh) can be executed in parallel, by
setting the parameter dbx_parallel > ‘0’. For Oracle Releases < 11.1 or when Oracle Datapump
is not used, the shell utilities use mkfifo pipes in parallel mode. In this case please check if your
file system supports mkfifo pipes before setting dbx_parallel to a higher value than 0
(Example: mkfifo testpipe).
REM ###########################################################
REM # Specify the number of export and import shell sessions #
REM # used in parallel for dbx_mode='e' #
REM # #
REM # When parameter USE_ORACLE_DATAPUMP='0' then os command #
REM # mkfifo is used for parallization. #
REM # When mkfifo is not supported on the operating system #
REM # use 0 for dbx_parallel. #
REM # #
REM # Sample: dbx_parallel='0' #
REM # Sample: dbx_parallel='3' #
REM ###########################################################
define dbx_parallel='0'

5.5.5 Partition Pruning


The Oracle export utility exp is exporting every partition sequentially and applies the provided
Query-Condition at every single partition, even if that partition is required or not.
By turning on Partition Pruning with parameter PRUNE_PARTITION, DBExtract can determine
the required partitions of a lot of BSCS and UDR related tables and it will only export these
partitions.
REM ###########################################################
REM # Defines Partition Pruning Functionality #
REM # during export mode (dbx_mode='e'). #
REM # Oracle exp utility exports the partition of a table #
REM # one after the other and applies the query condition #
REM # to all of them, which is not optimal. #
REM # With PRUNE_PARTITION the DBEXTRACT can restrict #
REM # the number of partitions of a number of tables. #
REM # (UDR_LT, UDR_ST , BI_ACCOUNTS and #
REM # tables partioned by CUSTOMER_ID, CO_ID, OHXACT, #
REM # OTXACT, PRM_VALUE_ID) #
REM # #
REM # Possible Values: 0 (off) , 1 (on) #

Copyright of LHS Telekom GmbH & Co. KG, 2007. All rights reserved.
Database Extraction Tool
Detailed Instructions Formatted: Font: Bold
Deleted: Troubleshooting
19

REM # Default: 1 #
REM ###########################################################
define PRUNE_PARTITION='1'

5.5.6 Database Connections


There are five database connections and all of them must be configured correctly:
1. BSCS DB (central BSCS database)
2. UDR DB (optional database for UDRs)
3. BILL DB (optional database for table BILL_IMAGES and DOCUMENT_ALL of BSCS
Release 6.00 to 8.01),
4. DBXHOME DB (DBX working tables) and
5. DBX DB (target database to copy the Database extract to).
When BSCS, UDR and BILL Data are stored in the same instance, they all should get the same
connect parameters in the .cfg file. Otherwise, please configure the different database
connections.
To achieve best performance it is recommend to store the DBX working tables in the BSCS DB,
which means to specify the same connect data for DBXHOME DB as for BSCS DB.
The DBX DB connect information should point to an empty database, where a SYSADM user is
installed. When you are using the export mode and such an empty database is not available,
you can also use the same connect data for DBX DB as for BSCS DB, because nothing will be
modified. There is check in DBExtract, which will alarm you if you have specified the direct
mode and target and source database name are the same.
Specifying a dummy DB connection is necessary out of implementation details of the script.
Specifying “full qualified” connect strings instead of “service names” can improve performance
(during the connection process) and may help your database to resolve the connect string
correctly.
Example for “service name” as connect string:
sqlplus sysadm/sysadm@orcl
Example for “full qualified” connect string:
sqlplus
sysadm/sysadm@"(DESCRIPTION=(SDU=8192)(ADDRESS_LIST=(ADDRESS=(COMMUNIT
Y=TCPCOM.world)(PROTOCOL=TCP)(Host=servername)(Port=1602)))(CONNECT_DA
TA=(SID=orcl)(GLOBAL_NAME=orcl.world)))"

Copyright of LHS Telekom GmbH & Co. KG, 2007. All rights reserved.
Database Extraction Tool
Detailed Instructions Formatted: Font: Bold
Deleted: Troubleshooting
20

REM ###########################################################
REM # Configuration of Database Connections #
REM #---------------------------------------------------------#
REM # #
REM # BSCS DB - The BSCS database objects are stored #
REM # in the BSCS DB #
REM # #
REM # UDR DB - The BSCS database objects of type #
REM # UDR / RTX may be stored in a #
REM # seperate UDR DB (default: BSCS DB) #
REM # #
REM # BILL DB - The BSCS database objects of type #
REM # BILL may be stored in a #
REM # seperate BILL DB (default: BSCS DB) #
REM # #
REM ###########################################################
REM # #
REM # DBXHOME DB - The working tables of dbextract tool #
REM # #
REM # Possible values: #
REM # a) The BSCS DB for best performance (!) #
REM # b) The empty DBX DB database #
REM # c) A database without any BSCS content #
REM # #
REM ###########################################################
REM # #
REM # DBX DB - The Target database of dbextract tool #
REM # where BSCS objects copied to. #
REM # #
REM # Possible values: #
REM # a) The empty DBX DB database #
REM # (DBX_MODE=d + e) #
REM # b) The DBXHOME DB during export phase #
REM # (DBX_MODE=e) #
REM # c) The BSCS DB during export phase #
REM # (DBX_MODE=e) #
REM # #
REM ###########################################################

REM ###########################################################
REM # Specify a Name for the database link #
REM # #
REM # Sample: define vdb1='dbextract' #
REM ###########################################################

define vdbBSCS ='u5la' -- BSCS DB


define vdbUDR ='u5la' -- RTX/UDR DB
define vdbBILL ='u5la' -- BILL and Document DB
define vdbDBXHOME ='u5la' -- DBX HOME DB to store all DBX Tables
define vdbDBX ='u8la' -- DBX DB to copy all BSCS tables to

Copyright of LHS Telekom GmbH & Co. KG, 2007. All rights reserved.
Database Extraction Tool
Detailed Instructions Formatted: Font: Bold
Deleted: Troubleshooting
21

REM ###########################################################
REM # Connect String to the database #
REM # (usually SID, used by the database link) #
REM # #
REM # Sample: define vdbcon1='bscs' #
REM ###########################################################

define vdbconBSCS ='u5la' -- BSCS DB


define vdbconUDR ='u5la' -- RTX/UDR DB
define vdbconBILL ='u5la' -- BILL and Document DB
define vdbconDBXHOME ='u5la' -- DBX HOME DB to store all DBX Tables
define vdbconDBX ='u8la' -- DBX DB to copy all BSCS tables to

REM ###########################################################
REM # Name of BSCS and DBX database #
REM # (usually ORACLE SID) #
REM # The database name will appear in the filenames #
REM # created by dbx_exp.sh and dbx_imp.sh #
REM ###########################################################
define vdbnameBSCS ='u5la' -- Name of the BSCS DB
define vdbnameDBX ='u8la' -- Name of the DBX DB

Copyright of LHS Telekom GmbH & Co. KG, 2007. All rights reserved.
Database Extraction Tool
Detailed Instructions Formatted: Font: Bold
Deleted: Troubleshooting
22

5.5.7 Define Customer, Accounts, Service Provider…


According to the script, 100 customers out of a range between CUSTOMER_IDs from 10 to 560
will get selected for extraction.
REM ###########################################################
REM # Please enter the lower customer_id (lower boundary) to #
REM # specify the start of a range for the selection of #
REM # customers (flat subscribers only) #
REM # If 0 value is specified, #
REM # then the first customer_id (resp. 1) will be taken. #
REM # #
REM # Sample: define cust_id_low='0' #
REM # Sample: define cust_id_low='1' #
REM ###########################################################

define cust_id_low='10'

REM ###########################################################
REM # Please enter the upper customer_id (upper boundary) to #
REM # specify the end of a range for the selection of #
REM # customers (flat subscribers only) #
REM # If 0 value is specified, #
REM # then the max. customer_id will be taken. #
REM # #
REM # Sample: define customer_id_high='0' #
REM # Sample: define customer_id_high='1234567' #
REM ###########################################################

define cust_id_high='560'

REM ###########################################################
REM # Please enter the total number of flat subscribers #
REM # you want to export with DBEXTRACT. They will be taken #
REM # out of the given range. If the range is smaller, only #
REM # the customers in the range will be taken. #
REM # #
REM # Warning: #
REM # Setting this value to null will export NO ('0') flat #
REM # subscribers. This value can have big impact to the size #
REM # of the destination database! #
REM # #
REM # Sample: define customers_total='1000' #
REM ###########################################################

define cust_total='100'

Copyright of LHS Telekom GmbH & Co. KG, 2007. All rights reserved.
Database Extraction Tool
Detailed Instructions Formatted: Font: Bold
Deleted: Troubleshooting
23

Additionally the customers with the CUSTOMER_ID 1,2,10,20,450,983,1200, 2500, 4711,


12345 will be taken.
REM ###########################################################
REM # You can specify some customer_ids which you want to #
REM # have (additionally) selected (only flat subscribers) #
REM # (max. field length of 2000 bytes). #
REM # #
REM # Sample: define special_customer_ids='1, 2, 4711' #
REM # Sample: define special_customer_ids='' #
REM ###########################################################

define special_cust_id='1,2,10,20,450,983, 1200, 2500, 4711, 12345'

To specify a large number of additional customers, it is possible to create a configuration table


called DBX_CUSTOMER at the BSCS database by using script dbx_selection.sql. After creating
the table, insert the customer_id’s of the required customers into the table and set parameter
SELECTION_TABLE in the configuration file dbextract.cfg to 1. The next time dbextract.sql is
executed the customers specified in table DBX_SELECTION will be added to the list of
customers, which will be copied by DBEXTRACT.
REM ###########################################################
REM # You can specify a lot of customer_ids which you want to #
REM # have (additionally) selected by using a configuration #
REM # table. #
REM # #
REM # The configuration table has to be created manualy #
REM # in the BSCS database by using script dbx_selection.sql .#
REM # The required customer_ids have to be inserted in the #
REM # configuration table called DBX_SELECTION at the BSCS #
REM # database. #
REM # #
REM # Setting parameter SELECTION_TABLE to 1 will enable #
REM # this functionality and script dbextract.sql will #
REM # use the configuration table DBX_SELECTION . #
REM # #
REM # Sample: SELECTION_TABLE=0 #
REM # Sample: SELECTION_TABLE=1 #
REM ###########################################################

define SELECTION_TABLE=0

Copyright of LHS Telekom GmbH & Co. KG, 2007. All rights reserved.
Database Extraction Tool
Detailed Instructions Formatted: Font: Bold
Deleted: Troubleshooting
24

Also all service providers with less or equal than 300 contracts will be added to the selection.
REM ###########################################################
REM # Specify the maximum number of contracts for a #
REM # Service Provider. Service Providers with more than the #
REM # the given number of contracts will be excluded. #
REM # Setting this value to '' (null) will take all records. #
REM # #
REM # Sample: define vservice_providers='300' #
REM ###########################################################

define vservice_providers='300'

If you specify large accounts, all levels and all customers from the given large account will be
added as well. The sample below specifies all Large Accounts starting with ‘2’, (like. 2.10,
2.11…, 2.999) and also the two concrete large accounts 3.14 and 3.33.
Also, if not already part of the selection, every customer from controlgroup ‘A’ will be taken and
also all the customers which depend on billcycle ‘01’.
Please Note: If a control group or billcycle are specified, then all customers of this control group
or billcycle are exported into the new dump. The resulting dump may become quite large and
the export might take very long. Therefore control groups or billcycles should only be specified,
if they are really needed in the new dump.
While customizing this script, make sure that the marked customers are consistent (e. g. all
customers which depend on a Large Account). Please note that specifying an unnecessary big
number of Large Accounts can easily blow up the amount of selected customers. Keep in mind
that also all dealers will automatically be added to the selection of customers.
REM ###########################################################
REM # You can specify up to 10 Large Accounts (0-9) by the #
REM # custcode (first two levels, followed by '%') which you #
REM # want to include into the selection. #
REM # (Do not to specify the same Large Account twice) #
REM # Check the number of customers in the Large Account. #
REM # #
REM # Sample: define 0_large_account='2.12%' #
REM # define 1_large_account='3.14%' #
REM # define ... #
REM # define 8_large_account='' #
REM # define 9_large_account='' #
REM ###########################################################

define 0_large_account='2.%'
define 1_large_account=''
define 2_large_account=''
define 3_large_account=''
define 4_large_account=''
define 5_large_account=''
define 6_large_account=''
define 7_large_account=''
define 8_large_account=''
define 9_large_account=''

Copyright of LHS Telekom GmbH & Co. KG, 2007. All rights reserved.
Database Extraction Tool
Detailed Instructions Formatted: Font: Bold
Deleted: Troubleshooting
25

5.5.8 Copy of free Resources


In the configuration file dbextract.cfg it is possible to specify how many free resources will be
copied.
REM ###########################################################
REM # Specify how many free resources will be copied. #
REM # free_port specify number of free ports per HLCODE #
REM # free_dn specify number of directory numbers per HLCODE #
REM # free_sm specify number of storage mediums per PLCODE. #
REM # #
REM # Sample: define free_port=0; -- Turn that function off #
REM # Sample: define free_port=100; #
REM # Sample: define free_dn=0; -- Turn that function off #
REM # Sample: define free_dn=100; #
REM # Sample: define free_sm=0; -- Turn that function off #
REM # Sample: define free_sm=100; #
REM ###########################################################

define free_port=100;
define free_dn=100;
define free_sm=100;

5.5.9 Copy full controlgroups or billcycles


REM ###########################################################
REM # You can select from an existing controlgroup as it is #
REM # used by the Online Module 'External Interfaces' or #
REM # BCH itself for a test billcycle. All data from this #
REM # Controlgroup will be exported by DBExtract. #
REM # Controlgroups can be set up in the database via the #
REM # field CUSTOMER_ALL.CSTESTBILLRUN. #
REM # #
REM # Sample: define cg=''; #
REM # Sample: define cg='A'; #
REM ###########################################################

define cg='';

REM ###########################################################
REM # If you specify a value for the billcyc-parameter, all #
REM # customers in this billcycle will be taken over by #
REM # DBExtract. #
REM # #
REM # Sample: define billcyc=''; #
REM # Sample: define billcyc='01'; #
REM ###########################################################

define billcyc='';

Copyright of LHS Telekom GmbH & Co. KG, 2007. All rights reserved.
Database Extraction Tool
Detailed Instructions Formatted: Font: Bold
Deleted: Troubleshooting
26

5.5.10 Date specific data reduction


Some big BSCS tables (ORDERHDR_ALL, TICKLER, MPSECTAB, MPSCSTAB) can be
reduced by specifying a split-date: One column in each of these tables specifies the date when
the data was inserted. If one specifies the split date to e.g. 100 days, then only those table rows
are copied, which were inserted in the last 100 days. Note that this “Cut off” affects logical data
consistency, but usually the old data which is cut off is of no importance for the small size DBX
DB which is intended.
REM ###########################################################
REM # If you specify a value for the udrentdate-parameter #
REM # only the udr's with an entry date higher than #
REM # the last created one minus this number of days. #
REM # will be taken over by DBEXTRACT #
REM # #
REM # ( A value of 0 turns this function off) #
REM # #
REM # Sample: define udrentdate=0; #
REM # Sample: define udrentdate=100; #
REM ###########################################################

define udrentdate=100;

REM ###########################################################
REM # If you specify a value for the ordhdrentdate-parameter #
REM # only the orders with an entry date higher than #
REM # the last created one minus this number of days. #
REM # will be taken over by DBEXTRACT #
REM # #
REM # A value of 0 turns this function off. #
REM # A value of -1 will exclude tables with names #
REM # like ORDER% , CASH% and CASHDETAIL% , which are #
REM # required for Accounting and Billing #
REM # #
REM # Sample: define ordhdrentdate=-1; will exclude tables #
REM # ORDER% CASH% #
REM # and CASHDETAIL% #
REM # Sample: define ordhdrentdate=0; #
REM # Sample: define ordhdrentdate=100; #
REM ###########################################################

define ordhdrentdate=100;

REM ###########################################################
REM # If you specify a value for the tckrccredate-parameter #
REM # only the ticklers with a create date higher than #
REM # the last created one minus this number of days. #
REM # will be taken over by DBEXTRACT #
REM # #
REM # Special values: #
REM # A value of 10 will copy all ticklers of the last 10 days#
REM # A value of 0 will copy all ticklers #

Copyright of LHS Telekom GmbH & Co. KG, 2007. All rights reserved.
Database Extraction Tool
Detailed Instructions Formatted: Font: Bold
Deleted: Troubleshooting
27

REM # A value of -1 will exclude table TICKLER_RECORDS #


REM # #
REM # Sample: define tckrccredate=-1; #
REM # Sample: define tckrccredate=0; #
REM # Sample: define tckrccredate=100; #
REM ###########################################################

define tckrccredate=-1;

Copyright of LHS Telekom GmbH & Co. KG, 2007. All rights reserved.
Database Extraction Tool
Detailed Instructions Formatted: Font: Bold
Deleted: Troubleshooting
28

REM ###########################################################
REM # Table MPSECTAB read by EC write by RIH #
REM # If you specify a value for the mpsectabdate-parameter #
REM # only the Statistics with a create date higher than #
REM # the last created one minus this number of days. #
REM # will be taken over by DBEXTRACT #
REM # #
REM # Sample: define mpsectabdate=100; #
REM ###########################################################

define mpsectabdate=100;

REM ###########################################################
REM # Table MPSCSTAB read by EC write by RIH #
REM # If you specify a value for the mpscstabdate-parameter #
REM # only the Statistics with a create date higher than #
REM # the last created one minus this number of days. #
REM # will be taken over by DBEXTRACT #
REM # #
REM # Sample: define mpsectabdate=100; #
REM ###########################################################

define mpscstabdate=100;

Copyright of LHS Telekom GmbH & Co. KG, 2007. All rights reserved.
Database Extraction Tool
Detailed Instructions Formatted: Font: Bold
Deleted: Troubleshooting
29

5.5.11 Exclude Tables


With the help of the “table exclude option” in the dbextract.cfg file, tables in the BSCS Schema
‘SYSADM’ (large non-standard BSCS tables) can be excluded from the DBExtract database to
keep its size small.
As a special feature the “exclude option” allow you to mark multiple tables in the DBExtract
repository at once as “excluded”, performing a wildcard search in the BSCS source database.
Therefore, it is possible to enter the name of the table or the search pattern. Entering e.g.
‘OLD%’ will exclude all the data from tables starting with name ‘OLD’. But, be careful with this
feature, as it is also possible to exclude standard BSCS tables.
REM ###########################################################
REM # Defines a set of BSCS tables (Schema SYSADM), #
REM # which can be excluded from dbextract process. #
REM # These tables will be created with correct structure #
REM # but without data #
REM # #
REM #(The use of % as it is used by LIKE operator is possible)#
REM #(Use \ as an ESCAPE character for the next sign) #
REM ###########################################################

define exclude_tab01="%PLAN_TABLE%"
define exclude_tab02="EITC\_%"
define exclude_tab03="C2B\_%"

REM ###########################################################
REM # Defines a set of BSCS tables (Schema SYSADM), #
REM # which will be excluded from dbextract process. #
REM # All matching table will be excluded, even they were #
REM # selected previously by any other routine of DBExtract. #
REM # #
REM # These tables will be created with correct structure #
REM # but without data #
REM # #
REM #(The use of % as it is used by LIKE operator is possible)#
REM #(Use \ as an ESCAPE character for the next sign) #
REM ###########################################################

define exclude_any_tab01="\_%TMP"
define exclude_any_tab02="%BACK%"

DBExtract will not copy tables ‘NZ0%’ and ‘TAP_RTX_%’ even if they are not excluded
from extraction!

DBExtract exclude tables which are index organized or partitioned and tables with
LONG or LONG ROW columns from the direct copy with dbextract.sql.
These tables are copied with the export/import utility.

Copyright of LHS Telekom GmbH & Co. KG, 2007. All rights reserved.
Database Extraction Tool
Detailed Instructions Formatted: Font: Bold
Deleted: Troubleshooting
30

5.5.12 Exclude or Include large Tables


In dbextract.cfg it is possible to include/exclude the copy of large tables.
(UDR- Tables, DOCUMENT_ALL and BILL_IMAGES).
REM ###########################################################
REM # If you want to copy tables from UDR database at all set #
REM # cp_udr=1 #
REM # #
REM # If you want to copy the large tables UDR_LT , UDR_ST #
REM # set cp_udr_lt_and_st to 1 else to 0 (default) #
REM # #
REM # If you want to copy the large tables RTX_TAP #
REM # set cp_udr_tap to 1 else to 0 (default) #
REM # #
REM # If you want to copy the large tables RTX_TAP_KEY, #
REM # UDR_KEY_HOME, UDR_KEY_VPLMN #
REM # set cp_udr_key to 1 else to 0 (default) #
REM # #
REM # Sample: define cp_udr=0 #
REM # Sample: define cp_udr=1 #
REM ###########################################################
REM

define cp_udr=1
define cp_udr_lt_and_st=1
define cp_udr_tap=1
define cp_udr_key=1

REM ###########################################################
REM # If you want to copy the large table DOCUMENT_ALL, #
REM # set cp_doc to 1 else to 0 (default) #
REM # #
REM # Sample: define cp_doc=0 #
REM # Sample: define cp_doc=1 #
REM ###########################################################
REM

define cp_doc=1

REM ###########################################################
REM # If you want to copy the large table BILL_IMAGES, #
REM # set cp_bill to 1 else to 0 (default) #
REM # #
REM # Sample: define cpbill=0 #
REM # Sample: define cpbill=1 #
REM ###########################################################
REM

define cp_bill=1

Copyright of LHS Telekom GmbH & Co. KG, 2007. All rights reserved.
Database Extraction Tool
Detailed Instructions Formatted: Font: Bold
Deleted: Troubleshooting
31

5.6 Exclude tables from DBExtract (pcreate.sql)


In addition to the functionality provided by the dbextract.sql script, it is also possible to use the
script pcreate.sql to exclude tables from being created.
Script dbextract.sql checks via database link, if there is a table with the same name in both
databases. In this case table data will not get copied.
Therefore, tables to be excluded from copying must be pre-created at the DBExtract database
before script dbextract.sql gets started. As a result these tables will be ignored and the data of
these tables will not get copied to the DBExtract database.
You can use script pcreate.sql to create those tables you don’t want to have extracted.
Prior to the execution of this script it is necessary to customize dbextract.cfg (see section 5.5),
because pcreate.sql needs to create a database link to the BSCS database.
To run pcreate.sql you must be connected to the DBExtract database as user ‘SYSADM’.
As a special feature pcreate.sql allows you to create multiple tables in the DBExtract database
at once, performing a wildcard search in the BSCS source database. Therefore, it prompts the
user to enter the name of the table or the search pattern. Entering e.g. ‘OLD%’ will exclude all
the data from tables starting with name ‘OLD’. But, be careful with this feature, as it is also
possible to exclude standard BSCS tables.

5.7 Monitoring with dbx_trace.sql


While dbx_trace.sql called by dbextract.sql it is possible to modify the output of
dbextract.sql, by modifying script dbx_trace.sql. In case of SQL Errors during the execution of
dbextract.sql it is possible to show all statements executed by dbextract.sql by the activation
of procedure dbx.SQLTraceOn inside dbx_trace.sql.

5.8 Drop objects created by DBExtract (dbx_drop.sql)


All DBX objects which where created by the DBEXTRACT utility can be deleted with
dbx_drop.sql.
The script dbx_drop.sql reads the dbextract.cfg file, which must be configured before call of
this script.

5.9 Remove old dumpfiles (dbx_del_dmp.sh)


Additional tool dbx_del_dmp.sh is useful to delete old dumpfiles from a previous run of
DBExtract. First Dbx_del_dmp.sh proves if a structure dump is available in the dumpfile
directory and deletes all corresponding files, additionally all logs are also deleted from the
log_imp and log_exp directory.
If the database was not fully exported, no structure dump is available, than the dumpfiles must
be deleted manually.

Copyright of LHS Telekom GmbH & Co. KG, 2007. All rights reserved.
Database Extraction Tool
Detailed Instructions Formatted: Font: Bold
Deleted: Troubleshooting
32

5.10 dbextract.sql
The script dbextract.sql creates database links from the DBExtract database to the BSCS
database, according to the parameters given in dbextract.cfg (see section 5.5). In direct mode
it copies via the created database links the large BSCS tables from the BSCS database into to
the DBExtract database. During this process the data of the customer-related tables
automatically would be reduced with respect to the settings in dbextract.cfg. In the next step all
other tables from user ‘SYSADM’ would be copied, except they have not been excluded (using
dbextract.cfg).
The script dbextract.sql will also create all users in the DBExtract database that exist in the
BSCS database and set the default and temporary tablespace for these users and set the
default values for some table columns in the extracted database.
Additionally, dbextract.sql will provide the user with some information, like used diskspace and
time statistics.
To start dbextract.sql, you must be connected to the DBExtract database with SQL*Plus as
user ‘SYSADM’.
All output of the script gets also written to the spool file dbextract.log and the main actions will
be recorded in table DBX_LOG.

5.11 Export
Make sure that the Oracle environment is set correctly and that ORACLE_SID (or
TWO_TASK) is pointing to the BSCS database.
Run dbx_exp.sh in a UNIX session.

5.11.1 Export with dbx_exp.sh


dbx_exp.sh checks if configuration file dbexport.cfg and utilities gzip, whoami and exp tool
exists.
dbx_exp.sh also checks the Oracle version of the database, the version of the exp/expdp tool,
the NLS character set and invalid objects.
The UNIX Shell script dbx_exp.sh will create following directories:
• ./log_exp -- log files and parameter files created during the export
• ./dumpfiles -- dumpfiles and sql files created during the export
• ./log_imp -- log files and parameter files for the import
• /tmp/dbx_{bscsdb} -- pipes in “Export” mode for exp tool
The script dbx_del_dmp.sh (see section 5.9) can be used to delete all files from these
directories.

Copyright of LHS Telekom GmbH & Co. KG, 2007. All rights reserved.
Database Extraction Tool
Detailed Instructions Formatted: Font: Bold
Deleted: Troubleshooting
33

Before dbx_exp.sh exports a table it first checks if the corresponding dmp file already
exists. If the dmp file exists, it will not be overwritten.

To restart dbx_exp.sh first drop all dmp files manually, which where not exported
correctly.

The UNIX Shell script dbx_exp.sh creates dump files in the ./dumpfiles directory and a log file
called dbx_exp.log.
Log-Information are stored in the ./log_exp directory and - after dbx_exp.sh completes - in table
DBX_LOG.
dbx_exp.sh calls the Oracle export tool exp or expdp to export the structure and the data of
the BSCS database (all objects) to the dumpfiles directory. Wherever possible only the
exported table data is reduced in size, according to the configuration in the dbextract.cfg file.
In direct mode the database structure, partitions tables and lob tables are exported.
In export mode the database structure and all tables are exported.
When you used the export mode to export all data to disk, you can use these files directly and
send them to LHS as a reference for feature implementation and for error correction.
For this reason create a tar file of the complete directory where DBExtract is installed or at least
of the directories “./log_exp” and “./dumpfiles”. Then send the tar file to your LHS Customer
Support Contact.
When your operating system is able to use PIPES (you may check that with the mkfifo
command: mkfifo testpipe) or when you use Oracle Datapump, you can start the dbx_exp.sh
tool in parallel mode, by setting the dbx_parallel parameter in file dbextract.cfg to a values >
1.
When you use the Oracle Datapump script dbx_exp.sh has to be started at the unix-server of
the BSCS database. The unix-user (oracle) used to install the Oracle Software must have
read/write permission to the directory where DBExtract is located and the BSCS database must
be configured to allow full read/write access to that directory (See Init.ora Parameter:
UTL_FILE_DIR).

5.11.2 oradump – A Filter Perl Filter Script for Oracle Dumps


The perl filter script oradump.pl is used to drop tablespace and storage information from the
export file, which was created by exp. The dbx_imp.sh script uses this program during the
import of the data. Without this tool the storage parameters from the BSCS-database are kept,
which do not fit for the DBExtract database any longer (like too big initial extents). Perl has to be
available on the UNIX machine. If the location of the Perl executable is included in the Path-
environment variable, the filter process can be started using “perl oradump.pl…”, if first line of
the script is adapted to contain the path of Perl executable one can just call oradump.pl…,
otherwise one has to specify <PATH>/perl oradump.pl…
Usage: perl oradump.pl [ -help ]

Copyright of LHS Telekom GmbH & Co. KG, 2007. All rights reserved.
Database Extraction Tool
Detailed Instructions Formatted: Font: Bold
Deleted: Troubleshooting
34

The program uses standard input (STDIN) to get the data from the dump file and writes to
STDOUT. The ‘–help’ option displays a short help on the screen.
If you run oradump, the following statements are removed from the resulting dump file:
CREATE [UNDO|TEMPORARY] TABLESPACE ...
CREATE [PUBLIC] ROLLBACK SEGMENT ...
CREATE CLUSTER SEGMENT ...
USING INDEX
STORAGE (...)
TABLESPACE ...
PCTFREE ...
INITRANS ...
MAXTRANS ...
PCTTHTESHOLD ...
CLUSTER ...
ALTER USER QUOTA UNLIMITED ON ...
DEFAULT TABLESPACE ...
TEMPORARY TABLESPACE ...

Samples:
perl oradump.pl -help
perl oradump.pl < INPUT.DMP > OUTPUT.DMP

When Oracle Datapump is configured, then utility oradump is not used by DBExtract.

Copyright of LHS Telekom GmbH & Co. KG, 2007. All rights reserved.
Database Extraction Tool
Detailed Instructions Formatted: Font: Bold
Deleted: Troubleshooting
35

5.12 Import
Make sure that the Oracle environment is set correctly and dbextract.cfg is configured
(DBExtract DB name, RTX DB Name etc.).

5.12.1 Import with dbx_imp.sh


Start the script dbx_imp.sh within a UNIX shell to import all exported BSCS tables and the
whole BSCS database structure (without data) into the DBExtract database.
Be aware to configure the dbextract.cfg (see section 5.5) before.
The UNIX Shell script dbx_imp.sh will create following directories:
• ./log_exp -- log files and parameter files created during the export and - after dbx_exp.sh
completes - in table DBX_LOG.
• ./dumpfiles -- dumpfiles and sql files created during the export
• ./log_imp -- log files and parameter files for the import
• /tmp/dbx_{bscsdb} -- pipes in “Parallel” mode for imp tool
The shell script expects the Oracle dump files created by dbx_exp.sh (see section 0) in the
./dumpfiles folder.
The script dbx_imp.sh calls the Oracle import tool imp or impdp to import the dump files from
the dumpfiles directory and it creates a log file called dbx_imp.log.
After import is finished check the log files in the log_imp directory.
In direct modus the database structure, partitions tables and lob tables are imported.
In export modus the database structure and all tables are imported.
When your operating system is able to use PIPES (you may check that with the mkfifo
command: mkfifo testpipe ) or when you use Oracle Datapump, you can start the dbx_imp.sh
tool in parallel mode, by setting the dbx_parallel parameter in file dbextract.cfg to a value > 1.
Table DBX_INVALID_OBJECTS will be created in the DBX DB. The table contains the names
and types of all objects in state ‘INVALID’ at the BSCS DB, when dbx_exp.sh was started.
When you use the Oracle Datapump script dbx_imp.sh has to be started at the unix-server of
the DBX database. The unix-user (oracle) used to install the Oracle Software must have
read/write permission to the directory where DBExtract is located and the DBX database must
be configured to allow full read/write access to that directory (See Init.ora Parameter:
UTL_FILE_DIR).

5.12.2 Recompile all objects (compile.sql)


We recommend to finally recompile all objects (packages, functions, procedures, triggers and
views) of user SYSADM with the script compile.sql.
execute dbms_utility.compile_schema(’SYSADM’);

Copyright of LHS Telekom GmbH & Co. KG, 2007. All rights reserved.
Database Extraction Tool
Detailed Instructions Formatted: Font: Bold
Deleted: Troubleshooting
36

For BSCS Release > 8.01 all objects of user DMFADM are recompiled:
execute dbms_utility.compile_schema(’DMFADM’);

5.12.3 Resetting all sequences (seqinst.sql)


Execute the script seqinst.sql. This script will reset all sequences. If this is not done, the
consequence might be getting Oracle unique constraint errors when running BSCS.

Copyright of LHS Telekom GmbH & Co. KG, 2007. All rights reserved.
Database Extraction Tool
Troubleshooting Formatted: Font: Bold
Deleted: Troubleshooting
37

6 Troubleshooting

1. See section 5.12.2 for problems with invalid objects


2. Problems with BSCS Online Modules on the extracted database are often caused by invalid
objects (see 5.12.2) or non-standard BSCS objects – like triggers – which are trying to
reference data (customers, data from other schemata) that doesn’t exist anymore in the
reduced database.
3. Problem analysis in case of failures of the dbextract run: Check the log files. All major steps
of dbextract are recording log-files, which are stored in the directory, where the script is
executed, e.g. dbextract.sql logs into dbextract.log.
4. To get a more output in the log files modify script dbx_trace.sql. You may enable
procedure dbx.SQLTraceOn or SET VERIFY ON or SET ECHO ON to enhance the
information.
5. Export logs are written in the log_exp directory, import logs in the log_imp directory, dmp
files in the dumpfiles directory (export modus).
6. Table DBX_LOG in database DBXHOME shows all main actions and how long they take.
Long running SQL statements of dbextract.sql can be copied from column DBX_LOG
.PARA1 to other tools like SQLPLUS for testing.

Example:
select DBX_TABLE_NAME, ACTION, MESSAGE,
(TO_CHAR(finishtime,'HH24')* 3600 +
TO_CHAR(finishtime,'MI') * 60 +
TO_CHAR(finishtime,'SS') ) -
(TO_CHAR(starttime,'HH24') * 3600 +
TO_CHAR(starttime,'MI')* 60 +
TO_CHAR(starttime,'SS') ) SECONDS, PARA1
from dbx_log order by starttime,action;

Copyright of LHS Telekom GmbH & Co. KG, 2007. All rights reserved.
LHS is a leading provider of telecom billing and customer care systems
across the wireless, wireline, and IP telecom markets worldwide.
LHS Business Support Systems offer full convergence on various levels,
supporting the complete range of business models both across the mix of
fixed and mobile services, as well as prepaid and postpaid services.
LHS builds innovative systems that enable our customers to introduce
new services fast, helping drive revenues up, while keeping operational
costs to a minimum. LHS was awarded “Best Billing or Customer Care
Solution” by the GSM Association in Cannes in 2005, and won the IIR
World Billing Awards for its "Overall Best Contribution to Billing" in
London in 2005 and 2006.
LHS is an independent software vendor (ISV) with headquarters in
Germany, and offices in Brazil, Czech Republic, France, Malaysia,
Turkey, and United Arab Emirates. LHS is part of the LHS Group, and
LHS Aktiengesellschaft as the Group’s Holding company is a public
company listed on the Frankfurter Stock Exchange (LHS400).
For more information, please visit www.lhsgroup.com

Anda mungkin juga menyukai