Managing Databases
Multiple databases can be created under a LakeFormation catalog. Centralized metadata management can maximize the value of data assets.
Prerequisites
- A LakeFormation instance has been created and is running properly.
- A catalog has been created.
- You have created an OBS parallel file system for storing databases by referring to Creating a Metadata Storage Path.
Create a Database
- Log in to the LakeFormation console.
- In the upper left corner, click and choose Analytics > LakeFormation to access the LakeFormation console.
- Select the LakeFormation instance to be operated from the drop-down list on the left and choose Metadata > Database in the navigation pane.
- Select the name of the desired catalog from the Catalog drop-down list box in the upper right corner. You can view the databases contained in this catalog.
- Click Create.
- In the Basic Information area, set the related parameters.
Table 1 Parameters for creating a database Parameter
Description
Database Name
Enter a database name.
The value should contain 1 to 128 characters. Only letters, numbers, and underscores (_) are allowed.
Catalog
Select the name of the catalog to which the database to be created belongs.
Select Location
Select a location where the database information is stored in the OBS parallel file system.
Click , select a location, and click OK.
- The selected location must start with obs:// and must contain one storage object. For example, select obs://lakeformation-test/catalog1/database1. If no suitable parallel file system is available, click go to OBS and create one.
- The path must be different from the storage path of its catalog (the one specified by Select Location on the catalog creation page).
- If a database storage path is added for the catalog to which the database belongs, set this parameter to the subpath of the database storage path or that of the path specified by Select Location during catalog creation.
Description
Description of the created database.
The content length must be between 0 and 4000 bytes (3 bytes per Chinese character).
- (Optional) Click Add under Data Table Storage Locations. On the Add Table Storage Location page, click to manually select a database storage path as required. Click OK.
Click to add more storage paths. Click to delete a storage path.
- Selecting data table storage path is an optional operation.
- The data table storage path can be set to the catalog path and its subpaths, or database storage location path and its subpaths.
- If a data table storage path is added, the tables in this database must be the subpath of the data table storage path or that of the selected database location path.
- (Optional) Click Add under Function Storage Locations. On the Add Function Storage Location page, click to manually select a function storage path as required. Click OK.
Click to add more storage paths. Click to delete a storage path.
- Selecting function storage path is an optional operation.
- The function storage path can be set to the catalog path and its subpaths, or database storage location path and its subpaths.
- If a function storage path is added, the functions in this database must be the subpath of the function storage path or that of the selected database location path.
- Click Submit.
- In the Basic Information area, set the related parameters.
- After the database is created, you can view the database name/ID, catalog, owner, and storage location on the Database page.
Click Modify in the Operation column to modify the configurations of a database.
Click Table in the Operation column to view the tables in a database.
Click More to authorize or delete a database, or view the permissions of a database.
If files are also deleted when metadata is deleted, the metadata is moved to the recycle bin (OBS path lake-formation-trash-dir/table_id) of the corresponding OBS bucket.
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.See the reply and handling status in My Cloud VOC.
For any further questions, feel free to contact us through the chatbot.
Chatbot