Skip to content
This repository was archived by the owner on Aug 28, 2024. It is now read-only.

Commit c6efb92

Browse files
committed
Testing object docs in readme
1 parent 4490a3d commit c6efb92

File tree

1 file changed

+91
-0
lines changed

1 file changed

+91
-0
lines changed

README.md

Lines changed: 91 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@ A collection of views, functions and procedures to help MySQL administrators get
44

55
There are install files available for 5.6 and 5.7 respectively. To load these, you must position yourself within the directory that you downloaded to, as these top level files SOURCE individual files that are shared across versions in most cases (though not all).
66

7+
## Installation
8+
79
The objects should all be created as the root user (but run with the privileges of the invoker).
810

911
For instance if you download to /tmp/mysql-sys/, and want to install the 5.6 version you should:
@@ -18,3 +20,92 @@ Or if you would like to log in to the client, and install the 5.7 version:
1820
SOURCE ./sys_57.sql
1921

2022
Alternatively, you could just choose to load individual files based on your needs, but beware, certain objects have dependencies on other objects. You will need to ensure that these are also loaded.
23+
24+
## Overview of objects
25+
26+
### Procedures
27+
28+
#### create_synonym_db
29+
30+
##### Description
31+
32+
Takes a source database name and synonym name, and then creates the synonym database with views that point to all of the tables within the source database.
33+
34+
Useful for creating a "ps" synonym for "performance_schema", or "is" instead of "information_schema", for example.
35+
36+
##### Parameters
37+
38+
* in_db_name (VARCHAR(64)):
39+
** The database name that you would like to create a synonym for.
40+
* in_synonym (VARCHAR(64)):
41+
** The database synonym name.
42+
43+
##### Example
44+
45+
mysql> SHOW DATABASES;
46+
+--------------------+
47+
| Database |
48+
+--------------------+
49+
| information_schema |
50+
| mysql |
51+
| performance_schema |
52+
| sys |
53+
| test |
54+
+--------------------+
55+
5 rows in set (0.00 sec)
56+
57+
mysql> CALL sys.create_synonym_db('performance_schema', 'ps');
58+
+-------------------------------------+
59+
| summary |
60+
+-------------------------------------+
61+
| Created 74 views in the ps database |
62+
+-------------------------------------+
63+
1 row in set (8.57 sec)
64+
65+
Query OK, 0 rows affected (8.57 sec)
66+
67+
mysql> SHOW DATABASES;
68+
+--------------------+
69+
| Database |
70+
+--------------------+
71+
| information_schema |
72+
| mysql |
73+
| performance_schema |
74+
| ps |
75+
| sys |
76+
| test |
77+
+--------------------+
78+
6 rows in set (0.00 sec)
79+
80+
mysql> SHOW FULL TABLES FROM ps;
81+
+------------------------------------------------------+------------+
82+
| Tables_in_ps | Table_type |
83+
+------------------------------------------------------+------------+
84+
| accounts | VIEW |
85+
| cond_instances | VIEW |
86+
| events_stages_current | VIEW |
87+
| events_stages_history | VIEW |
88+
...
89+
90+
91+
#### ps_setup_disable_background_threads
92+
93+
##### Description
94+
95+
Disable all background thread instrumentation within Performance Schema.
96+
97+
Requires the SUPER privilege for "SET sql_log_bin = 0;".
98+
99+
##### Parameters
100+
101+
None.
102+
103+
##### Example
104+
105+
mysql> CALL sys.ps_setup_disable_background_threads();
106+
+--------------------------------+
107+
| summary |
108+
+--------------------------------+
109+
| Disabled 18 background threads |
110+
+--------------------------------+
111+
1 row in set (0.00 sec)

0 commit comments

Comments
 (0)