Creating a Multifile Shadow (Using CREATE SHADOW)
Go Up to Using CREATE SHADOW
You can create multifile shadows, similarly to the way you create multifile databases. To create a multifile shadow, specify the name and size of each file in the shadow set. File specifications are platform-specific.
The following examples illustrate the creation of a multifile shadow on a UNIX platform. They create the shadow files on the A, B, and C drives of the IB_bckup node.
The first example creates a shadow set consisting of three files. The primary file, employee.shd
, is 10,000 database pages in length and the first secondary file is 20,000 database pages long. The final secondary file, as always, grows as needed.
CREATE SHADOW 1 'D:/shadows/employee.shd' LENGTH 10000 FILE 'D:/shadows/employee2.shd' LENGTH 5000 FILE 'D:/shadows/employee3.shd';
Instead of specifying the page length of secondary files, you can specify their starting pages. The previous example could be entered as follows:
CREATE SHADOW 1 'D:/shadows/employee.shd' LENGTH 10000 FILE 'D:/shadows/employee2.shd' STARTING AT 10000 FILE 'D:/shadows/employee3.shd' STARTING AT 30000;
In either case, you can use SHOW DATABASE
to verify the file names, page lengths, and starting pages for the shadow just created:
SHOW DATABASE; Database: employee.ib Owner: SYSDBA Shadow 1: "D:\SHADOWS\EMPLOYEE.SHD" auto length 10000 file D:\SHADOWS\EMPLOYEE2.SHD starting 10000 file D:\SHADOWS\EMPLOYEE3.SHD starting 30000 PAGE_SIZE 1024 Number of DB pages allocated = 462 Sweep interval = 20000
Note
The page length allocated for secondary shadow files need not correspond to the page length of the database’s secondary files. As the database grows and its first shadow file becomes full, updates to the database automatically overflow into the next shadow file.