content_image/770086.jpg content_image/770087.jpg content_image/770088.jpg content_image/770089.jpg
Given a schema name, this procedure creates a synonym schema containing views that refer to all the tables and views in the original schema. This can be used, for example, to create a shorter name by which to refer to a schema with a long name (such as info  rather than INFORMATION_SCHEMA ). 

## Parameters 

• in_db_name VARCHAR(64) : The name of the schema for which to create the synonym. 

• in_synonym VARCHAR(64) : The name to use for the synonym schema. This schema must not already exist. 

## Example 

## 28.4.4.2 The diagnostics() Procedure 

mysql> SHOW DATABASES; 

<img src='content_image/770086.jpg'>

CALL sys.create_synonym_db(’INFORMATION_SCHEMA’, ’info’); 

<img src='content_image/770087.jpg'>

mysql> SHOW DATABASES; 

<img src='content_image/770088.jpg'>

mysql> SHOW FULL TABLES FROM info; 

<img src='content_image/770089.jpg'>

Creates a report of the current server status for diagnostic purposes. 

This procedure disables binary logging during its execution by manipulating the session value of the sql_log_bin  system variable. That is a restricted operation, so the procedure requires privileges sufficient to set restricted session variables. See Section 5.1.9.1, “System Variable Privileges” . 

Data collected for diagnostics()  includes this information: 

•Information from the metrics  view (see Section 28.4.3.21, “The metrics View” ) 

