Skip to main content

AddressBase Epoch update - Oracle only

This article covers setting up AddressBase and the Epoch, updating the Gazetteer, and checking the latest version.

Y
Written by Yusef Abulaynain
Updated over 3 months ago

AddressBase Premium gives you up to date, accurate information about addresses, properties, and land areas. The AddressBase Premium dataset contains Local Authority, Ordnance Survey and Royal Mail addresses, each uniquely referenced by the Unique Property Reference Number (UPRN).

πŸ“Œ Note: If you're using SQL Server, please use this guide.

After completing an AddressBase update, follow the Configuring Ward Codes and Authorities guide.

Instructions for Oracle database on Linux

The Oracle release of AddressBase Premium is supplied as an Oracle backup, accompanying import control files and SQL Scripts to create the required views. The compressed backup file is approximately 4.5GB and will require decompression and import into Oracle into a 25GB tablespace.

Prerequisites

The AddressBase installation depends on the SDO_GEOMETRY object type. In Oracle 12c Standard Edition this comes as part of the Locator package.

To test this object type is available run the following SQL:

SQL> create table test_loc (id number); 
Table created.
SQL> alter table test_loc add loc MDSYS.SDO_GEOMETRY;
Table altered.
SQL> drop table test_loc cascade constraints;
Table dropped.

If this works you may proceed with the AddressBase installation. Otherwise, you will need to install the Locator features, you can find more information on the Oracle site.

DBO Package Status

The AddressBase installation depends on the DBO package within the Mosaic schema, check the status of this package, if this is marked as invalid AddressBase installs will fail.
​
To resolve this, please raise a new case online and reference the title of this article.


Initial Install Only

πŸ“Œ Note: If AddressBase has been previously imported, skip this step and go to Import data step.

The first time that the new format AddressBase Premium Release is installed in an Oracle instance the following steps must be followed:

1. Create table space and user

A sample SQL Script is provided to create the Table Space and User required for the AddressBase install, this is in cr_addressess.sql. This should be edited to make the paths valid for your system and then executed, i.e. the path to the addresses.dbf path for the table space near the top of the file:

CREATE BIGFILE TABLESPACE addresses DATAFILE
'/u01/app/oracle/oradata/orcl/addresses.dbf' SIZE 60G AUTOEXTEND ON NEXT 100M MAXSIZE UNLIMITED

Then execute the cr_addressess.sql script on your Oracle instance.

2. Import data

Extract the addresses.tar.gz file to get the addresses.dmp file.

Datapump requires a directory object which points to the directory on your file system where you place files to import. Place addresses.dmp in an appropriate location on your system and set the IMPORT_DIR to point to that location, for example, assuming you are using /u01/dumps as your location:

SQL>create or replace directory IMPORT_DIR AS '/u01/dumps';

Create a parameter file e.g. imp_addresses.par, for the data pump import and change the directory and userid values to the appropriate values for your system. Replace [password] with the system password and [database] with the name of the database. See example below.

userid=system/[password]@[database]
logfile=addresses.log
directory=IMPORT_DIR
dumpfile=addresses.dmp
transform=disable_archive_logging:y
TABLE_EXISTS_ACTION=REPLACE

Now run the data pump import from the same directory as imp_addresses.par.

$ impdp parfile=imp_addresses.par

3. Grant permissions

After the import has completed, you should connect as the address's user and grant permissions to the mosaic user (typically fw). The supplied grantAddresses.sql file may be used to do so, if the mosaic user is something other than fw you’ll need to modify the contents of this script first.

4. Create views (optional)

This step should be considered optional and would only need to be run under the following conditions:

  • The views have not been created in Mosaic.

  • The views have been updated since the previous AddressBase update.

  • You wish to change the view format from PAF to LLPG or vice versa.

As the Mosaic user (usually fw) recreate the views required for Mosaic to access the AddressBase Premium data by running the following supplied SQL.
​
​cr_paf_views.sql for PAF format or cr_addressbase_llpg_views.sql for LLPG format.

5. Gather statistics

Run a Gather Statistics or the system performance will be poor:

exec dbms_stats.gather_schema_stats('ADDRESSES',options=>'GATHER', estimate_percent => 100, degree=>4, method_opt => 'FOR ALL COLUMNS SIZE AUTO', granularity => 'ALL', cascade => TRUE);

Upgrade install

The steps for upgrading are the same as above however you'll have to follow them in this order:

  • Drop and recreate user: see the section below.

  • Import data.

  • Grant permissions.

  • Recreate views.

  • Gather statistics.

Drop and recreate user

The addresses user must be dropped and recreated, the supplied recreateAddresses.sql file should be used to do so.

Did this answer your question?