The document discusses developing plugins for the MySQL INFORMATION_SCHEMA by creating custom tables. It provides steps to create a simple "Hello World" plugin that defines a table with two columns and fills it with sample data. The document also describes how to build and install the plugin so it can be queried from INFORMATION_SCHEMA like a regular table.
Getting to Know MySQL Enterprise MonitorMark Leith
MySQL Enterprise Monitor is the monitoring and management solution for DBAs and developers delivered as part of MySQL Enterprise Edition. It provides background monitoring, alerting, trending, and analysis of the MySQL database and the statement traffic that is running within it.
View this session to learn how to install/configure, customize, and use MySQL Enterprise Monitor to suit your environment. Whether you use a single server or have hundreds of instances, MySQL Enterprise Monitor can provide great insights into how your environment is performing.
This document discusses the Performance Schema in MySQL, which records instrumentation data to help profile and monitor database activity. It provides an overview of the Performance Schema's components and tables, how it has evolved between MySQL versions to include more metrics and functionality, and examples of how to query the tables to analyze wait events, statements, stages and other performance data.
The MySQL sys schema was integrated fully into MySQL Server from version 5.7.7 and has been improved in MySQL 8.0. Whether you are a DBA trying to determine where the resources are being used on your database instance and by whom, or a developer trying to figure out why your MySQL statements are running too slowly, the MySQL sys schema can help. Join this session to learn how to better use the MySQL sys schema to answer your day-to-day questions—from the original developer of the MySQL sys schema.
The document describes the MySQL SYS schema, which provides views, procedures, and functions to help database administrators, developers, and operations teams perform common debugging and tuning tasks. It includes summary views that breakdown user activity by I/O usage, stages, and statement details. The SYS schema also includes views and functions for analyzing I/O performance and retrieving the latest file I/O events. It can be installed on MySQL servers to provide a standardized way of accessing performance data.
MySQL's Performance Schema, SYS Schema and Workbench IntegrationMario Beck
This document discusses the Performance Schema and SYS schema features in MySQL. It provides an overview of the Performance Schema, which records instrumentation data about the server's internal operations. It describes improvements made in MySQL 5.7 for profiling server performance. It also introduces the SYS schema, which provides views, procedures and functions to make Performance Schema data easier to analyze for common DBA and developer use cases.
This document provides an overview of the MySQL sys schema. It discusses how sys schema provides views and functions on top of the Performance Schema to implement common DBA and developer use cases. It covers installing sys schema, the various formatting and helper functions it includes, and the summary views it provides for analyzing user activity, I/O, schema objects and more.
The MySQL sys schema was integrated fully into MySQL Server from version 5.7.7. Whether you are a DBA trying to determine where the resources are being used on your database instance and by whom, or a developer trying to figure out why your MySQL statements are running too slowly, the MySQL sys schema can help. Join this session to learn how to better use the MySQL sys schema to answer your day-to-day questions—from the original developer of the MySQL sys schema. The MySQL sys schema was integrated fully into MySQL Server from version 5.7.7. Whether you are a DBA trying to determine where the resources are being used on your database instance and by whom, or a developer trying to figure out why your MySQL statements are running too slowly, the MySQL sys schema can help. Join this session to learn how to better use the MySQL sys schema to answer your day-to-day questions—from the original developer of the MySQL sys schema.
This document provides summaries of various techniques for capturing and analyzing SQL in MySQL databases, including:
1) MySQL's built-in options like the slow query log, general query log, and binary log.
2) Other techniques like MySQL Proxy, TCP/IP capture, Dtrace/SystemTap, and application management.
3) Details on configuring and using the slow query log, general query log, and binary log to analyze SQL performance.
The document provides an overview of the Oracle Database 11g product family, including the Standard Edition, Standard Edition One, and Enterprise Edition. It describes the key features included in each edition. It also outlines several optional features exclusively available for the Enterprise Edition, such as Oracle Active Data Guard, Oracle Advanced Security, Oracle Partitioning, Oracle Real Application Clusters, and various management packs. Finally, it briefly introduces some related Oracle products that can be used to extend the capabilities of the Oracle database, such as Oracle Exadata Storage Server, Oracle Audit Vault, and Oracle Secure Backup.
This document provides an overview of key considerations and new features for upgrading to Oracle Database 12c. It discusses checking and potentially updating initialization parameters, applying the latest bundle patches, enabling new authentication protocols for client connections, using the new SQLCL tool instead of SQL*Plus, and configuring the free Oracle Enterprise Manager Express product for database management and monitoring. It also mentions new features for the Oracle Automatic Storage Management cluster and the introduction of a management repository for storing cluster metrics.
In Memory Database In Action by Tanel Poder and Kerry OsborneEnkitec
The document discusses Oracle Database In-Memory option and how it improves performance of data retrieval and processing queries. It provides examples of running a simple aggregation query with and without various performance features like In-Memory, vector processing and bloom filters enabled. Enabling these features reduces query elapsed time from 17 seconds to just 3 seconds by minimizing disk I/O and leveraging CPU optimizations like SIMD vector processing.
MySQL Troubleshooting with the Performance SchemaSveta Smirnova
This document discusses using the Performance Schema in MySQL to troubleshoot performance issues. It provides an overview of the Performance Schema and what information it collects. It then discusses how to use specific Performance Schema tables like events_statements_history_long, events_stages_history_long, and others to identify statements that examine too many rows, issues with index usage, and which internal operations are taking a long time. The document provides examples of queries to run and what to look for in the Performance Schema output to help troubleshoot and optimize SQL statements.
Flex Cluster e Flex ASM - GUOB Tech Day - OTN TOUR LA Brazil 2014Alex Zaballa
The document discusses Oracle Flex Cluster and Flex ASM configurations. A Flex Cluster allows running Oracle databases on hub and leaf nodes, where leaf nodes do not require direct access to storage. It also discusses converting existing clusters to Flex Clusters and Flex ASM. Key aspects covered include the use of Grid Naming Service for Flex Clusters, capabilities of hub and leaf nodes, and enhancements in Flex ASM such as larger LUN size support and password file storage in ASM.
Oracle Data redaction - GUOB - OTN TOUR LA - 2015Alex Zaballa
The document summarizes a presentation on Oracle Data Redaction given by Alex Zaballa. It discusses how data redaction in Oracle Database 12c and 11.2.0.4 enables protection of data shown to users in real time without application changes. Redaction policies can be created to redact specific columns for selected users or roles. The document provides examples of redaction methods and considerations for using data redaction with operations like Data Pump and CREATE TABLE AS SELECT.
OTN TOUR 2016 - DBA Commands and Concepts That Every Developer Should KnowAlex Zaballa
This document contains a summary of an Oracle DBA presentation on DBA commands and concepts that every developer should know. The presentation covered topics such as parallel queries, row chaining, explain plans, flashback queries, pending statistics, bulk processing, virtual private databases, extended data types, identity columns, and online table redefinition. It provided examples and demonstrations of many of these commands and concepts.
This document is a tutorial on managing pluggable databases in Oracle 12c. It discusses how to rename, manage, and drop pluggable databases. It also covers security topics like common vs local users and roles, and how privileges are handled between the CDB root and pluggable databases. The tutorial demonstrates renaming a pluggable database called "TEST" to "new", managing tablespaces and datafiles between the root and pluggable databases, and creating both common and local users and roles.
This document provides an overview and agenda for a presentation on MySQL best practices for DBAs and developers. The presentation covers essential MySQL configuration practices like server SQL mode and storage engines. It also discusses improving SQL, user security, schema optimizations, instrumentation, and monitoring. Specific topics include comment SQL, formatting SQL, future proofing SQL, and analyzing SQL. The document provides examples and recommendations for each topic.
The document discusses using CGI::Application, Template::Toolkit, and DBIx::Class to create simple web applications in Perl. It provides an overview of MVC architecture and how these three modules separate code into the Model, View, and Controller components. It includes sample code for setting up a basic application using these modules, interacting with a database via DBIx::Class, and rendering views with Template::Toolkit.
The document provides various PHP and MySQL tips and best practices including:
1) Signing queries and using comments helps when debugging slow queries and process lists.
2) The "LOAD DATA INFILE" statement is 20 times faster than INSERT for loading data.
3) Normalizing data and avoiding storing multiple values in a single column improves performance.
4) Joins should be used instead of executing multiple queries to compare rows.
The document summarizes upcoming improvements and enhancements in MySQL 5.5 related to scalability and performance. Key points include:
1) Semi-synchronous replication, the Performance Schema, SIGNAL/RESIGNAL, and additional partitioning options to improve data integrity and monitoring.
2) Major InnoDB improvements including a faster memory allocator, improved change buffering, prefetching and flushing techniques, and additional background threads to increase scalability.
3) Methods to control resource usage like I/O capacity, purge scheduling, and flushing for better performance under varying workloads.
Tony jambu (obscure) tools of the trade for tuning oracle sq lsInSync Conference
There are several tools available for SQL tuning in Oracle, including those that generate explain plans, analyze trace files, and provide real-time SQL monitoring. The document discusses tuning methodology, generating explain plans with SQL*Plus and Autotrace, tracing using parameters and DBMS_MONITOR, and tools like DBMS_XPLAN, TRCA, SQLTXPLAIN, Oracle Active Report, and Toad. It provides examples of using many of these tools to analyze SQL performance.
The document provides an overview of the MVC pattern and how it is implemented in Symfony. It discusses how Symfony separates code into models, views, and controllers and layers these components. It also describes common Symfony structures like modules, actions, and templates as well as tools like parameter holders, constants, and autoloading that are frequently used.
Presentation for azPHP on setting up a new project using Zend_Tool. Also goes over creating basic modules, controllers, actions, models and layouts.
All code in the presentation has not necessarily been tested. Will update presentation when done.
The document provides instructions for installing and configuring PHP-Fusion, an open source content management system. It describes downloading and unpacking PHP-Fusion files, creating a MySQL database, setting file permissions, and going through the installation steps. It also includes PHP code examples for formatting dates, outputting environment variables, and converting user input to booleans.
The document discusses different strategies for testing persistence in PHP applications, including unit testing with mocks and dependencies, integration testing using DbUnit to insert test data and assert expected results, and techniques for setting up common initial states across tests. It also covers the benefits and downsides of different types of tests, such as layer crossing tests that test interactions across layers but may be more brittle, versus end-to-end black box tests that test through the public API but are harder to debug.
Kumar Pratik presented an overview of the Langoor feature SDK and API. The summary includes:
1) The SDK allows developers to create custom features for the Langoor editor with widgets, databases, and responses to actions like install and getProperty.
2) Features have main classes that define constructor, install, and other functions, while widgets define functions for HTML output, properties, and more.
3) The API uses responses to communicate with the editor, including forms, HTML, and actions like opening dialogs or the widget panel.
4) Developers need to understand HTML, CSS, JavaScript, PHP and MySQL to code features and widgets, which can include creating databases and handlers for functions
CONNECT is a storage engine for MariaDB. It allows to use external, possibly remote data sources of several types. We can then query them as if they were local relational tables. In this presentation, Federico Razzoli demonstrates a couple of interesting things we can do with it. The talk took place at MariaDB Server Fest 2020.
MySQL is an open-source relational database management system that was created to be very fast, reliable and easy to use. It discusses how to install and configure MySQL, describes basic data management commands like creating databases and tables, inserting and querying data. The document also covers advantages of MySQL like being multi-threaded and some disadvantages like not supporting stored procedures initially.
This document provides a tutorial on using PHP and MySQL together. It introduces PHP and MySQL, outlines how to set up a database with MySQL, and includes PHP code examples for adding, querying, updating, and deleting data from the MySQL database. The PHP code examples connect to the database, validate user input, sanitize values, and perform CRUD operations on the database using MySQL queries.
There are 4 types of JDBC drivers. Database connections can be obtained using the DriverManager or a DataSource. Statements are used to execute SQL queries and updates. PreparedStatements are useful for executing the same statement multiple times with different parameter values. Joins allow querying data from multiple tables.
This document provides an introduction to using PHP with MySQL for beginners. It covers establishing a database connection, selecting a database, querying and manipulating data, and retrieving result rows and field metadata. Common PHP functions for MySQL like mysql_connect(), mysql_query(), mysql_fetch_array() and their usage is explained through examples. It also includes SQL scripts for creating a sample database table and inserting records.
This document describes the files and structure of the DBIx-ResultSet Perl module version 0.13 distribution. It includes files like MANIFEST, Changes, LICENSE, META.yml, Makefile.PL, and README, as well as directories for tests and module code. The distribution builds and tests the DBIx-ResultSet module which provides lightweight SQL query building and execution.
MySQL is a relational database management system that was created to be fast, reliable, and easy to use. It supports multiple platforms and can be downloaded and installed for free. Basic commands for MySQL include CREATE, SELECT, DELETE, INSERT, UPDATE, and DROP to manage tables and data.
This tutorial teaches how to create a basic map application using OpenScales by:
1) Adding an OpenScales namespace and creating a map component.
2) Adding base layers like OpenStreetMap or WFS layers.
3) Adding controls for mouse interactions and a control panel.
4) Integrating the map with ActionScript code to initialize controls.
First Steps in Drupal Code Driven DevelopmentNuvole
"First Steps in Code Driven Development" covers basic techniques and good practices. Presented during the "Developer Session" at Krimson office, Antwerp (BE), the 27th of May 2010.
Similar to Developing Information Schema Plugins (20)
Navigating Post-Quantum Blockchain: Resilient Cryptography in Quantum Threatsanupriti
In the rapidly evolving landscape of blockchain technology, the advent of quantum computing poses unprecedented challenges to traditional cryptographic methods. As quantum computing capabilities advance, the vulnerabilities of current cryptographic standards become increasingly apparent.
This presentation, "Navigating Post-Quantum Blockchain: Resilient Cryptography in Quantum Threats," explores the intersection of blockchain technology and quantum computing. It delves into the urgent need for resilient cryptographic solutions that can withstand the computational power of quantum adversaries.
Key topics covered include:
An overview of quantum computing and its implications for blockchain security.
Current cryptographic standards and their vulnerabilities in the face of quantum threats.
Emerging post-quantum cryptographic algorithms and their applicability to blockchain systems.
Case studies and real-world implications of quantum-resistant blockchain implementations.
Strategies for integrating post-quantum cryptography into existing blockchain frameworks.
Join us as we navigate the complexities of securing blockchain networks in a quantum-enabled future. Gain insights into the latest advancements and best practices for safeguarding data integrity and privacy in the era of quantum threats.
Scaling Connections in PostgreSQL Postgres Bangalore(PGBLR) Meetup-2 - MydbopsMydbops
This presentation, delivered at the Postgres Bangalore (PGBLR) Meetup-2 on June 29th, 2024, dives deep into connection pooling for PostgreSQL databases. Aakash M, a PostgreSQL Tech Lead at Mydbops, explores the challenges of managing numerous connections and explains how connection pooling optimizes performance and resource utilization.
Key Takeaways:
* Understand why connection pooling is essential for high-traffic applications
* Explore various connection poolers available for PostgreSQL, including pgbouncer
* Learn the configuration options and functionalities of pgbouncer
* Discover best practices for monitoring and troubleshooting connection pooling setups
* Gain insights into real-world use cases and considerations for production environments
This presentation is ideal for:
* Database administrators (DBAs)
* Developers working with PostgreSQL
* DevOps engineers
* Anyone interested in optimizing PostgreSQL performance
Contact info@mydbops.com for PostgreSQL Managed, Consulting and Remote DBA Services
Blockchain and Cyber Defense Strategies in new genre timesanupriti
Explore robust defense strategies at the intersection of blockchain technology and cybersecurity. This presentation delves into proactive measures and innovative approaches to safeguarding blockchain networks against evolving cyber threats. Discover how secure blockchain implementations can enhance resilience, protect data integrity, and ensure trust in digital transactions. Gain insights into cutting-edge security protocols and best practices essential for mitigating risks in the blockchain ecosystem.
AC Atlassian Coimbatore Session Slides( 22/06/2024)apoorva2579
This is the combined Sessions of ACE Atlassian Coimbatore event happened on 22nd June 2024
The session order is as follows:
1.AI and future of help desk by Rajesh Shanmugam
2. Harnessing the power of GenAI for your business by Siddharth
3. Fallacies of GenAI by Raju Kandaswamy
Hire a private investigator to get cell phone recordsHackersList
Learn what private investigators can legally do to obtain cell phone records and track phones, plus ethical considerations and alternatives for addressing privacy concerns.
Details of description part II: Describing images in practice - Tech Forum 2024BookNet Canada
This presentation explores the practical application of image description techniques. Familiar guidelines will be demonstrated in practice, and descriptions will be developed “live”! If you have learned a lot about the theory of image description techniques but want to feel more confident putting them into practice, this is the presentation for you. There will be useful, actionable information for everyone, whether you are working with authors, colleagues, alone, or leveraging AI as a collaborator.
Link to presentation recording and transcript: https://bnctechforum.ca/sessions/details-of-description-part-ii-describing-images-in-practice/
Presented by BookNet Canada on June 25, 2024, with support from the Department of Canadian Heritage.
The Rise of Supernetwork Data Intensive ComputingLarry Smarr
Invited Remote Lecture to SC21
The International Conference for High Performance Computing, Networking, Storage, and Analysis
St. Louis, Missouri
November 18, 2021
In this follow-up session on knowledge and prompt engineering, we will explore structured prompting, chain of thought prompting, iterative prompting, prompt optimization, emotional language prompts, and the inclusion of user signals and industry-specific data to enhance LLM performance.
Join EIS Founder & CEO Seth Earley and special guest Nick Usborne, Copywriter, Trainer, and Speaker, as they delve into these methodologies to improve AI-driven knowledge processes for employees and customers alike.
Are you interested in learning about creating an attractive website? Here it is! Take part in the challenge that will broaden your knowledge about creating cool websites! Don't miss this opportunity, only in "Redesign Challenge"!
Implementations of Fused Deposition Modeling in real worldEmerging Tech
The presentation showcases the diverse real-world applications of Fused Deposition Modeling (FDM) across multiple industries:
1. **Manufacturing**: FDM is utilized in manufacturing for rapid prototyping, creating custom tools and fixtures, and producing functional end-use parts. Companies leverage its cost-effectiveness and flexibility to streamline production processes.
2. **Medical**: In the medical field, FDM is used to create patient-specific anatomical models, surgical guides, and prosthetics. Its ability to produce precise and biocompatible parts supports advancements in personalized healthcare solutions.
3. **Education**: FDM plays a crucial role in education by enabling students to learn about design and engineering through hands-on 3D printing projects. It promotes innovation and practical skill development in STEM disciplines.
4. **Science**: Researchers use FDM to prototype equipment for scientific experiments, build custom laboratory tools, and create models for visualization and testing purposes. It facilitates rapid iteration and customization in scientific endeavors.
5. **Automotive**: Automotive manufacturers employ FDM for prototyping vehicle components, tooling for assembly lines, and customized parts. It speeds up the design validation process and enhances efficiency in automotive engineering.
6. **Consumer Electronics**: FDM is utilized in consumer electronics for designing and prototyping product enclosures, casings, and internal components. It enables rapid iteration and customization to meet evolving consumer demands.
7. **Robotics**: Robotics engineers leverage FDM to prototype robot parts, create lightweight and durable components, and customize robot designs for specific applications. It supports innovation and optimization in robotic systems.
8. **Aerospace**: In aerospace, FDM is used to manufacture lightweight parts, complex geometries, and prototypes of aircraft components. It contributes to cost reduction, faster production cycles, and weight savings in aerospace engineering.
9. **Architecture**: Architects utilize FDM for creating detailed architectural models, prototypes of building components, and intricate designs. It aids in visualizing concepts, testing structural integrity, and communicating design ideas effectively.
Each industry example demonstrates how FDM enhances innovation, accelerates product development, and addresses specific challenges through advanced manufacturing capabilities.
Quality Patents: Patents That Stand the Test of TimeAurora Consulting
Is your patent a vanity piece of paper for your office wall? Or is it a reliable, defendable, assertable, property right? The difference is often quality.
Is your patent simply a transactional cost and a large pile of legal bills for your startup? Or is it a leverageable asset worthy of attracting precious investment dollars, worth its cost in multiples of valuation? The difference is often quality.
Is your patent application only good enough to get through the examination process? Or has it been crafted to stand the tests of time and varied audiences if you later need to assert that document against an infringer, find yourself litigating with it in an Article 3 Court at the hands of a judge and jury, God forbid, end up having to defend its validity at the PTAB, or even needing to use it to block pirated imports at the International Trade Commission? The difference is often quality.
Quality will be our focus for a good chunk of the remainder of this season. What goes into a quality patent, and where possible, how do you get it without breaking the bank?
** Episode Overview **
In this first episode of our quality series, Kristen Hansen and the panel discuss:
⦿ What do we mean when we say patent quality?
⦿ Why is patent quality important?
⦿ How to balance quality and budget
⦿ The importance of searching, continuations, and draftsperson domain expertise
⦿ Very practical tips, tricks, examples, and Kristen’s Musts for drafting quality applications
https://www.aurorapatents.com/patently-strategic-podcast.html
GDG Cloud Southlake #34: Neatsun Ziv: Automating AppsecJames Anderson
The lecture titled "Automating AppSec" delves into the critical challenges associated with manual application security (AppSec) processes and outlines strategic approaches for incorporating automation to enhance efficiency, accuracy, and scalability. The lecture is structured to highlight the inherent difficulties in traditional AppSec practices, emphasizing the labor-intensive triage of issues, the complexity of identifying responsible owners for security flaws, and the challenges of implementing security checks within CI/CD pipelines. Furthermore, it provides actionable insights on automating these processes to not only mitigate these pains but also to enable a more proactive and scalable security posture within development cycles.
The Pains of Manual AppSec:
This section will explore the time-consuming and error-prone nature of manually triaging security issues, including the difficulty of prioritizing vulnerabilities based on their actual risk to the organization. It will also discuss the challenges in determining ownership for remediation tasks, a process often complicated by cross-functional teams and microservices architectures. Additionally, the inefficiencies of manual checks within CI/CD gates will be examined, highlighting how they can delay deployments and introduce security risks.
Automating CI/CD Gates:
Here, the focus shifts to the automation of security within the CI/CD pipelines. The lecture will cover methods to seamlessly integrate security tools that automatically scan for vulnerabilities as part of the build process, thereby ensuring that security is a core component of the development lifecycle. Strategies for configuring automated gates that can block or flag builds based on the severity of detected issues will be discussed, ensuring that only secure code progresses through the pipeline.
Triaging Issues with Automation:
This segment addresses how automation can be leveraged to intelligently triage and prioritize security issues. It will cover technologies and methodologies for automatically assessing the context and potential impact of vulnerabilities, facilitating quicker and more accurate decision-making. The use of automated alerting and reporting mechanisms to ensure the right stakeholders are informed in a timely manner will also be discussed.
Identifying Ownership Automatically:
Automating the process of identifying who owns the responsibility for fixing specific security issues is critical for efficient remediation. This part of the lecture will explore tools and practices for mapping vulnerabilities to code owners, leveraging version control and project management tools.
Three Tips to Scale the Shift Left Program:
Finally, the lecture will offer three practical tips for organizations looking to scale their Shift Left security programs. These will include recommendations on fostering a security culture within development teams, employing DevSecOps principles to integrate security throughout the development
Coordinate Systems in FME 101 - Webinar SlidesSafe Software
If you’ve ever had to analyze a map or GPS data, chances are you’ve encountered and even worked with coordinate systems. As historical data continually updates through GPS, understanding coordinate systems is increasingly crucial. However, not everyone knows why they exist or how to effectively use them for data-driven insights.
During this webinar, you’ll learn exactly what coordinate systems are and how you can use FME to maintain and transform your data’s coordinate systems in an easy-to-digest way, accurately representing the geographical space that it exists within. During this webinar, you will have the chance to:
- Enhance Your Understanding: Gain a clear overview of what coordinate systems are and their value
- Learn Practical Applications: Why we need datams and projections, plus units between coordinate systems
- Maximize with FME: Understand how FME handles coordinate systems, including a brief summary of the 3 main reprojectors
- Custom Coordinate Systems: Learn how to work with FME and coordinate systems beyond what is natively supported
- Look Ahead: Gain insights into where FME is headed with coordinate systems in the future
Don’t miss the opportunity to improve the value you receive from your coordinate system data, ultimately allowing you to streamline your data analysis and maximize your time. See you there!
2. Overview INFORMATION_SCHEMA overview Plugin Overview Developing a simple Hello World I_S table Building and installing Interacting with another program Interacting with another library
3. INFORMATION_SCHEMA Specified within the SQL Standard (ISO/IEC 9075-11:2003) Virtual tables which give database metadata MySQL implements a subset of the Standard http://dev.mysql.com/doc/refman/5.1/en/information-schema.html http://www. xcdsql .org/MySQL/information_schema/5.1/MySQL_5_1_INFORMATION_SCHEMA.html
4.
5. Plugins A means to load shared libraries in to a running MySQL instance Developed in C/C++ http://dev.mysql.com/doc/refman/5.1/en/plugin-api.html User Defined Functions Storage Engines Fulltext parsers Daemons INFORMATION_SCHEMA Tables!
6. Located in include/mysql/plugin.h The Plugin Interface struct st_mysql_plugin { int type; /* the plugin type (a MYSQL_XXX_PLUGIN value) */ void *info; /* pointer to type-specific plugin descriptor */ const char *name; /* plugin name */ const char *author; /* plugin author (for SHOW PLUGINS) */ const char *descr; /* general descriptive text (for SHOW PLUGINS ) */ int license; /* the plugin license (PLUGIN_LICENSE_XXX) */ int (*init)( void *); /* the function to invoke when plugin is loaded */ int (*deinit)( void *) /* the function to invoke when plugin is unloaded */ unsigned int version; /* plugin version (for SHOW PLUGINS) */ struct st_mysql_show_var *status_vars; struct st_mysql_sys_var **system_vars; void * __reserved1; /* reserved for dependency checking */ };
7. Plugin Types Define the plugin type (types listed below) Used within plugin functions such as plugin_foreach() MYSQL_UDF_PLUGIN 0 /* User-defined function */ MYSQL_STORAGE_ENGINE_PLUGIN 1 /* Storage Engine */ MYSQL_FTPARSER_PLUGIN 2 /* Full-text parser plugin */ MYSQL_DAEMON_PLUGIN 3 /* The daemon/raw plugin type */ MYSQL_INFORMATION_SCHEMA_PLUGIN 4 /* The I_S plugin type */ I_S plugins loaded within sql/sql_show.cc int schema_tables_add(THD *thd, List<LEX_STRING> *files, const char *wild) { … if (plugin_foreach(thd, add_schema_table, MYSQL_INFORMATION_SCHEMA_PLUGIN, &add_data)) DBUG_RETURN( 1 );
8. Starting a HELLO_WORLD Table Must have MySQL source tree Create a new plugin/hello_world/hello_world.cc file plugin.h and mysql_priv.h includes required Add a prototype for schema_table_store_record() /* Required for schema_table_store_record() * / #include "mysql_priv.h" #include <mysql/plugin.h> bool schema_table_store_record(THD *thd, TABLE *table);
9. Define the Table Structure Uses an array of ST_FIELD_INFO structs field_name Column name field_length Column length or display length field_type Column datatype value Not used within I_S plugins field_flags Set NULL / UNSIGNED attributes old_name Internal mapping for I_S tables to SHOW output open_method Open table using supplied method Last entry in the array is an end marker ST_FIELD_INFO hello_world_fields[]= { { "HELLO" , 10 , MYSQL_TYPE_STRING, 0 , 0 , "Hello" , 0 }, { "WORLD" , 10 , MYSQL_TYPE_STRING, 0 , 0 , "World" , 0 }, { 0 , 0 , MYSQL_TYPE_NULL, 0 , 0 , 0 , 0 } };
11. Define Function to Fill Table Called every time the table is accessed Fills the virtual table with data int fill_hello_world(THD *thd, TABLE_LIST *tables, COND *cond) { DBUG_ENTER( "fill_hello_world_is_plugin" ); CHARSET_INFO *scs= system_charset_info; TABLE *table= tables->table; int rc= 0 ; table->field[ 0 ]->store( "Hello" , strlen( "Hello" ), scs); table->field[ 1 ]->store( "World" , strlen( "World" ), scs); if (schema_table_store_record(thd, table)) rc= 1 ; DBUG_RETURN(rc); }
12. Create the Init Function Runs when the plugin is installed/loaded ST_SCHEMA_TABLE is an internal table representation Points to the ST_FIELD_INFO struct / table definition Points to the function to fill the table Manages any other init needed for the plugin int hello_world_plugin_init( void *p) { DBUG_ENTER( "init_hello_world_is_plugin" ); ST_SCHEMA_TABLE *schema= (ST_SCHEMA_TABLE*) p; schema->fields_info= hello_world_fields; schema->fill_table= fill_hello_world; DBUG_RETURN( 0 ); }
13. Create the Deinit Function Run when the plugin is unloaded Does nothing for HELLO_WORLD Use this function to do any clean up in your plugin int hello_world_plugin_deinit( void *p) { DBUG_ENTER( "deinit_info_schema_example_plugin" ); DBUG_RETURN( 0 ); }
14. Create the Plugin Definition Info struct points to the interface version built against struct st_mysql_information_schema hello_world_plugin_info= { MYSQL_INFORMATION_SCHEMA_INTERFACE_VERSION }; mysql_declare_plugin(hello_world_plugin) { MYSQL_INFORMATION_SCHEMA_PLUGIN, &hello_world_plugin_info, /* Pointer to info struct */ "HELLO_WORLD" , /* Plugin Name (used in INSTALL PLUGIN) */ "Mark Leith, MySQL AB" , /* Plugin Author */ "HELLO_WORLD example plugin" , /* Plugin Description */ PLUGIN_LICENSE_GPL, /* _GPL, _BSD or _PROPRIETARY */ hello_world_plugin_init, /* Pointer to plugin init function */ hello_world_plugin_deinit, /* Pointer to plugin deinit function */ 0x0100 , /* 1.0 */ NULL , /* status variables */ NULL , /* system variables */ NULL /* config options */ } mysql_declare_plugin_end;
15. Build the Plugin Define MYSQL_DYNAMIC_PLUGIN Make shared Include the sql and include source directories g++ -DMYSQL_DYNAMIC_PLUGIN -shared > -I/home/leithal/mysql/mysql-5.1/include > -I/home/leithal/mysql/mysql-5.1/sql > -o is_hello_world.so hello_world.cc ls -l total 16 -rw-r--r-- 1 leithal leithal 1712 2008-04-11 14:20 hello_world.cc -rwxr-xr-x 1 leithal leithal 8226 2008-04-11 14:27 is_hello_world.so cp is_hello_world.so /usr/local/mysql/lib/mysql/plugin
16. Install and Use! mysql> INSTALL PLUGIN HELLO_WORLD SONAME 'is_hello_world.so'; Query OK, 0 rows affected (0.01 sec) mysql> USE INFORMATION_SCHEMA; Database changed mysql> SHOW TABLES LIKE 'HELL%'; +--------------------------------------+ | Tables_in_information_schema (HELL%) | +--------------------------------------+ | HELLO_WORLD | +--------------------------------------+ 1 row in set (0.00 sec) mysql> SELECT * FROM HELLO_WORLD; +-------+-------+ | HELLO | WORLD | +-------+-------+ | Hello | World | +-------+-------+ 1 row in set (0.00 sec)
17. So We'll Do Something Interesting How's the disk space doing on my db server? root@achilles:~# df -h Filesystem Size Used Avail Use% Mounted on /dev/hda1 4.6G 3.5G 886M 81% / varrun 126M 84K 125M 1% /var/run varlock 126M 0 126M 0% /var/lock procbususb 10M 76K 10M 1% /proc/bus/usb udev 10M 76K 10M 1% /dev devshm 126M 0 126M 0% /dev/shm lrm 126M 18M 108M 14% /lib/modules/2.6.17-12-generic/volatile If I can get this in a table I can track it over time I can also report on it easily How about an I_S table with events to catalog?
19. Running Other Programs Open with popen() and read in the results /* get filesystem information from df on linux like systems */ FILE *f; char buf[ 128 ]; char *c, *s, *size; const char delim[]= " " ; unsigned long long uli; double d; if ( NULL != (f= popen( "/bin/df -h" , "r" ))) { int ln= 0 ; while (!feof(f)) { fgets(buf, sizeof (buf), f); switch (ln++) {
20. Tokenize and Push Results Can do this how you like /* skip the header line of df */ case 0 : break ; default : c= buf; /* hack to stop processing when falling off the end of output */ if (strchr(c, ' ' ) == NULL ) break ; /* Filesystem */ s= strtok(c, delim); table->field[ 0 ]->store(s, strlen(s), scs); /* Size */ s= strtok( NULL , delim); d= strtod(s, &size); uli= get_bytes(d, size); table->field[ 1 ]->store(uli, TRUE ); … .
21. Store the Row and Finish up /* Use% */ s= strtok( NULL , delim); table->field[ 4 ]->store(s, strlen(s), scs); /* Mountpoint */ s= strtok( NULL , delim); stripnl(s); table->field[ 5 ]->store(s, strlen(s), scs); /* store the row */ if (schema_table_store_record(thd, table)) rc= 1 ; break ; } } pclose(f); } else rc= 1 ; DBUG_RETURN(rc); }
22. Build, Install, Try.. Build as before and try it out! mysql> select * from file_system_mountpoints; +------------+------------+------------+-----------+----------+-----------------------------------------+ | FILESYSTEM | SIZE | USED | AVAILABLE | CAPACITY | MOUNTED_ON | +------------+------------+------------+-----------+----------+-----------------------------------------+ | /dev/hda1 | 4939212390 | 3758096384 | 930086912 | 81% | / | | varrun | 132120576 | 86016 | 131072000 | 1% | /var/run | | varlock | 132120576 | 0 | 132120576 | 0% | /var/lock | | procbususb | 10485760 | 77824 | 10485760 | 1% | /proc/bus/usb | | udev | 10485760 | 77824 | 10485760 | 1% | /dev | | devshm | 132120576 | 0 | 132120576 | 0% | /dev/shm | | lrm | 132120576 | 18874368 | 113246208 | 14% | /lib/modules/2.6.17-12-generic/volatile | +------------+------------+------------+-----------+----------+-----------------------------------------+ 7 rows in set (0.06 sec) mysql> desc file_system_mountpoints; +------------+--------------+------+-----+---------+-------+ | Field | Type | Null | Key | Default | Extra | +------------+--------------+------+-----+---------+-------+ | FILESYSTEM | varchar(120) | NO | | | | | SIZE | bigint(11) | NO | | 0 | | | USED | bigint(11) | NO | | 0 | | | AVAILABLE | bigint(11) | NO | | 0 | | | CAPACITY | varchar(4) | NO | | | | | MOUNTED_ON | varchar(120) | NO | | | | +------------+--------------+------+-----+---------+-------+ 6 rows in set (0.01 sec)
23. Now Let's Use another Library The SIGAR library from Hyperic Lets us do cross platform OS stats monitoring Released under GPL Again, start with the same base functions etc. as before
24. Include Lib Header, Use Lib in Fill sigar_t *t; sigar_open(&t); sigar_file_system_list_t fslist; sigar_file_system_list_get(t, &fslist); for (uint i = 0 ; i < fslist.number; i++) { sigar_file_system_t fs = fslist.data[i]; sigar_file_system_usage_t fsusage; rc= sigar_file_system_usage_get(t, fs.dir_name, &fsusage); if (fs.type == 2 || fs.type == 3 ) { table->field[ 0 ]->store(fs.dir_name, strlen(fs.dir_name), scs); table->field[ 1 ]->store(fsusage.total, TRUE ); table->field[ 2 ]->store(fsusage.used, TRUE ); table->field[ 3 ]->store(fsusage.free, TRUE ); table->field[ 4 ]->store(fsusage.files, TRUE ); if (schema_table_store_record(thd, table)) rc= 1 ; } } sigar_file_system_list_destroy(t, &fslist); sigar_close(t);
25. Building and Including the Library -lsigar links the library Use -rpath to pass in library location This is for runtime Can also use LD_LIBRARY_PATH -L (linker) and -I (include) paths -L points to the directory with the built library g++ -DMYSQL_DYNAMIC_PLUGIN -Wall -shared -lsigar -Wl,-rpath -Wl,/home/leithal/os_stats_info_schema/sigar/ -L/home/leithal/os_stats_info_schema/sigar/ -I/home/leithal/os_stats_info_schema/sigar/include/ -I/home/leithal/mysql/mysql-5.1/include -I/home/leithal/mysql/mysql-5.1/sql -o os_stats_info_schema.so os_stats_info_schema.cc
26. Try it out! mysql> INSTALL PLUGIN os_disk_usage SONAME 'os_stats_info_schema.so'; Query OK, 0 rows affected (0.00 sec) mysql> SHOW TABLES LIKE 'OS%'; +------------------------------------+ | Tables_in_information_schema (OS%) | +------------------------------------+ | OS_DISK_USAGE | +------------------------------------+ 1 row in set (0.00 sec) mysql> SELECT * FROM OS_DISK_USAGE; +------------+---------+---------+---------+--------+ | FILESYSTEM | SIZE | USED | FREE | FILES | +------------+---------+---------+---------+--------+ | / | 4799024 | 3656800 | 1142224 | 610432 | +------------+---------+---------+---------+--------+ 1 row in set (0.00 sec)
27. Resources and Questions! http://www.markleith.co.uk/?p=18 http://rpbouman.blogspot.com/2008/02/mysql-information-schema-plugins-best.html http://rpbouman.blogspot.com/2008/02/reporting-mysql-internals-with.html (Great resource for monitoring server internals) Questions?