Annotations in Oracle Database 23ai/26ai
This article describes the use of annotations to document our database objects in Oracle database 23ai/26ai.
oracle 23configurationintermediate
by OracleDba
76 views
This article describes the use of annotations to document our database objects in Oracle database 23ai/26ai.
1234567891011121314151617181920
ANNOTATIONS ( {ADD|DROP} annotation_name {'annotation_value'} {,} )
create table fruit (
id number annotations (SurrogateKey, UI_Display 'Fruit ID', Classification 'Fruit Info'),
name varchar2(50) annotations (UI_Display 'Fruit Name', Classification 'Fruit Info'),
description varchar2(50) annotations (UI_Display 'Description', Classification 'Fruit Info')
)
annotations (UI_Display 'Fruit Table', Classification 'Fruit Info');
alter table fruit annotations (Visibility 'Everyone');
alter table fruit annotations (drop Visibility);
alter table fruit annotations (add Visibility 'Everyone');
alter table fruit modify (id annotations (Visibility 'Hidden'));
alter table fruit modify (id annotations (drop Visibility));
alter table fruit modify (id annotations (add Visibility 'Hidden'));123456789101112131415161718192021222324252627282930313233343536
set linesize 150
column object_name format a12
column object_type format a12
column column_name format a12
column domain_name format a12
column domain_owner format a12
column annotation_name format a14
column annotation_value format a20
select object_name,
object_type,
column_name,
domain_name,
domain_owner,
annotation_name,
annotation_value
from user_annotations_usage
order by annotation_name, annotation_value;
OBJECT_NAME OBJECT_TYPE COLUMN_NAME DOMAIN_NAME DOMAIN_OWNER ANNOTATION_NAM ANNOTATION_VALUE
------------ ------------ ------------ ------------ ------------ -------------- --------------------
FRUIT TABLE ID CLASSIFICATION Fruit Info
FRUIT TABLE DESCRIPTION CLASSIFICATION Fruit Info
FRUIT TABLE NAME CLASSIFICATION Fruit Info
FRUIT TABLE CLASSIFICATION Fruit Info
FRUIT TABLE ID SURROGATEKEY
FRUIT TABLE DESCRIPTION UI_DISPLAY Description
FRUIT TABLE ID UI_DISPLAY Fruit ID
FRUIT TABLE NAME UI_DISPLAY Fruit Name
FRUIT TABLE UI_DISPLAY Fruit Table
FRUIT TABLE VISIBILITY Everyone
FRUIT TABLE ID VISIBILITY Hidden
11 rows selected.
SQL>Please to add comments
No comments yet. Be the first to comment!