More highlights availableLeonarding.blog.51cto.com
《Oracle comment onComment information methodology
Introduction: some comments may be frequently written in DBA daily work, but I think there should be not many to write and use Oracle commands, in fact, Oracle provides us with a wealth of language expression syntaxes, and we use 30% of the syntax commands in daily use ~ 45%. Oracle Comment on Annotation syntax is not commonly used. Next we will reveal the usage scenarios and usage of Oracle Comment on annotations.
I. Application scenarios
A: When it comes to application scenarios, I think of a frequently-mentioned word "O & M standardization ". The content of O & M standardization is needless to say here. Oracle Comment on annotation is one of the standardized scripts. You often write database scripts, but you often only write management, business, performance, and other scripts, the database structure annotation script is not often written. The comment function is to make the script written by it more readable, maintainability, and manageability. Note information must be included in the script of the system to be launched in our data center. After the script is handed over to the O & M department, the O & M department personnel can understand the object structure information of the database, in this way, we can easily understand what needs to be changed in our system during data maintenance, structure update, and system upgrade, and what impact it will have on our business after the change, and the comments are also easy for future reference, it facilitates smooth handover between the two parties during the system handover process.
2. Usage
Official documentation: SQL Language Reference-> 13 SQL Statements: ALTERTRIGGER to COMMIT-> search for "COMMENT"
Syntax:
650) this. width = 650; "src =" http://www.bkjia.com/uploads/allimg/131229/22142U962-0.jpg "title =" oracle comment synxtu.jpg "alt =" 210009151.jpg"/>
In terms of syntax, Oracle can comment on tables, columns, operations, index types, materialized views, and mining models.
The following example uses tables and columns as samples.
1. Oracle Commenton comment on the table
Table Name: generate_config
Table comment: comment on table generate_config is 'configuration table for generating summary packets ';
2. Oracle Commenton comments on column
Chinese field name |
FIELD English name |
Primary Key ID |
Iid |
Message name |
Name |
Message Type |
Type |
Message Generation Method |
Generatetype |
Status |
State |
Column comment
Comment on columntable. column_name is 'comments _ on_col_information ';
Comment on columngenerate_config.iid is 'Primary key id ';
Comment on columngenerate_config.name is 'packet name ';
Comment on columngenerate_config.type is 'packet type ';
Comment on columngenerate_config.generatetype is 'message generation method ';
Comment on columngenerate_config.state is 'state ';
3. View table comments
Search for a specified table
Select * fromuser_tab_comments where TABLE_NAME = 'generate _ config ';
Select * fromdba_tab_comments where TABLE_NAME = 'generate _ config ';
Select * fromall_tab_comments where TABLE_NAME = 'generate _ config ';
Search for tables with comments not empty
Select * fromuser_tab_comments where comments is not null;
4. View column comments
Queries a specified column.
Select * from user_col_commentswhere TABLE_NAME = 'generate _ config ';
Select * fromdba_col_comments where TABLE_NAME = 'generate _ config ';
Select * fromall_col_comments where TABLE_NAME = 'generate _ config ';
Search for columns with comments not empty
Select * fromuser_col_comments where comments is not null;
5. Delete the comment and leave it blank)
Empty table
Comment on tablegenerate_config is '';
Empty Column
Comment on columngenerate_config.iid is '';
Comment on columngenerate_config.name is '';
Comment on columngenerate_config.type is '';
Comment on columngenerate_config.generatetype is '';
Comment on columngenerate_config.state is '';
PDFBKJIA download center: http://down.51cto.com/data/1039022 "Oracle comment onz annotation information methodology" Please click to download
Comment oracle leonarding on
Leonarding
2013.12.11
Beijing & winter
Sharing Technology ~ Achieving dreams
Blog: www.leonarding.com
This article is from "Liu Sheng sharing technology ~ Achievement dream blog, please be sure to keep this source http://leonarding.blog.51cto.com/6045525/1339543