This presentation covers all aspects of PostgreSQL administration, including installation, security, file structure, configuration, reporting, backup, daily maintenance, monitoring activity, disk space computations, and disaster recovery. It shows how to control host connectivity, configure the server, find the query being run by each session, and find the disk space used by each database.
Bài 2 : Các đối tượng trong CSDL - SQL serverMasterCode.vn
Khái niệm về cơ sở dữ liệu
• Database dùng để
− Chứa các bảng, bảng ảo, thủ tục nội,…
− Mỗi database có một danh sách các người dùng
• Người dùng phải có quyền truy cập database
• Có thể phân nhóm người dùng để cấp quyền
• Tử phiên bản SQL Server 2000 hỗ trợ Application Role
• Các database hệ thống
− Master, Model, Tempdb, msdb
• Các database ví dụ
− AdventureWorks
− AdventureWorkDWs
This presentation covers all aspects of PostgreSQL administration, including installation, security, file structure, configuration, reporting, backup, daily maintenance, monitoring activity, disk space computations, and disaster recovery. It shows how to control host connectivity, configure the server, find the query being run by each session, and find the disk space used by each database.
Bài 2 : Các đối tượng trong CSDL - SQL serverMasterCode.vn
Khái niệm về cơ sở dữ liệu
• Database dùng để
− Chứa các bảng, bảng ảo, thủ tục nội,…
− Mỗi database có một danh sách các người dùng
• Người dùng phải có quyền truy cập database
• Có thể phân nhóm người dùng để cấp quyền
• Tử phiên bản SQL Server 2000 hỗ trợ Application Role
• Các database hệ thống
− Master, Model, Tempdb, msdb
• Các database ví dụ
− AdventureWorks
− AdventureWorkDWs
Presentation that I gave as a guest lecture for a summer intensive development course at nod coworking in Dallas, TX. The presentation targets beginning web developers with little, to no experience in databases, SQL, or PostgreSQL. I cover the creation of a database, creating records, reading/querying records, updating records, destroying records, joining tables, and a brief introduction to transactions.
Bài 1: Làm quen với SQL Server 2008 - Giáo trình FPTMasterCode.vn
Truy cập tới CSDL qua mạng
Hỗ trợ mô hình Client/Server
Kho dữ liệu (Data WareHouse)
Tương thích với chuẩn ANSI/ISO SQL -92
Hỗ trợ tìm kiếm Full- Text (Full- Text Search)
Hỗ trợ tìm kiếm thông tin trực tuyến (Books Online)
Các kiểu dữ liệu mới và các hàm thư viện làm việc với
các kiểu dữ liệu này như XML, Các kiểu dữ liệu giá trị lớn
(lưu ảnh, video…)
Hỗ trợ FileStream để thao tác với các đối tượng nhị phân
lớn (BLOB)
Language-Integrated Query (LINQ)
Hỗ trợ DotNet 3.5
……
Một số tính năng của SQL Server 2008
Các kiểu dữ liệu mới và các hàm thư viện làm việc với
các kiểu dữ liệu này như XML, Các kiểu dữ liệu giá trị lớn
(lưu ảnh, video…)
Hỗ trợ FileStream để thao tác với các đối tượng nhị phân
lớn (BLOB)
Language-Integrated Query (LINQ)
Hỗ trợ DotNet 3.5
……
Bài 6: Bảo mật trong SQL SERVER 2008 - Giáo trình FPTMasterCode.vn
Quản trị viên CSDL là người chịu trách nhiệm về hiệu
năng, tính toàn vẹn dữ liệu và bảo mật cho CSDL. Đồng
thời người quản trị có vai trò lập kế hoạch, phát triển,
khắc phục sự cố xảy ra với CSDL.
Các tác vụ quản trị thường thực hiện
Giới thiệu, khái niệm, cú pháp, demo của Cursor và Function
trong hệ quản trị CSDL
Tham khảo demo vui lòng liên hệ email: pinuit11@gmail.com
Chúc các bạn học tập thật tốt!
My talk for "MySQL, MariaDB and Friends" devroom at Fosdem on February 2, 2019
Born in 2010 in MySQL 5.5.3 as "a feature for monitoring server execution at a low level," grown in 5.6 times with performance fixes and DBA-faced features, in MySQL 5.7 Performance Schema is a mature tool, used by humans and more and more monitoring products. It becomes more popular over the years. In this talk I will give an overview of Performance Schema, focusing on its tuning, performance, and usability.
Performance Schema helps to troubleshoot query performance, complicated locking issues, memory leaks, resource usage, problematic behavior, caused by inappropriate settings and much more. It comes with hundreds of options which allow precisely tune what to instrument. More than 100 consumers store collected data.
Performance Schema is a potent tool. And very complicated at the same time. It does not affect performance in most cases and can slow down server dramatically if configured without care. It collects a lot of data, and sometimes this data is hard to read.
This talk will start from the introduction of how Performance Schema designed, and you will understand why it slowdowns server in some cases and does not affect your queries in others. Then we will discuss which information you can retrieve from Performance Schema and how to do it effectively.
I will cover its companion sys schema and graphical monitoring tools.
PostgreSQL is designed to be easily extensible. For this reason, extensions loaded into the database can function just like features that are built in. In this session, we will learn more about PostgreSQL extension framework, how are they built, look at some popular extensions, management of these extensions in your deployments.
Presentation that I gave as a guest lecture for a summer intensive development course at nod coworking in Dallas, TX. The presentation targets beginning web developers with little, to no experience in databases, SQL, or PostgreSQL. I cover the creation of a database, creating records, reading/querying records, updating records, destroying records, joining tables, and a brief introduction to transactions.
Bài 1: Làm quen với SQL Server 2008 - Giáo trình FPTMasterCode.vn
Truy cập tới CSDL qua mạng
Hỗ trợ mô hình Client/Server
Kho dữ liệu (Data WareHouse)
Tương thích với chuẩn ANSI/ISO SQL -92
Hỗ trợ tìm kiếm Full- Text (Full- Text Search)
Hỗ trợ tìm kiếm thông tin trực tuyến (Books Online)
Các kiểu dữ liệu mới và các hàm thư viện làm việc với
các kiểu dữ liệu này như XML, Các kiểu dữ liệu giá trị lớn
(lưu ảnh, video…)
Hỗ trợ FileStream để thao tác với các đối tượng nhị phân
lớn (BLOB)
Language-Integrated Query (LINQ)
Hỗ trợ DotNet 3.5
……
Một số tính năng của SQL Server 2008
Các kiểu dữ liệu mới và các hàm thư viện làm việc với
các kiểu dữ liệu này như XML, Các kiểu dữ liệu giá trị lớn
(lưu ảnh, video…)
Hỗ trợ FileStream để thao tác với các đối tượng nhị phân
lớn (BLOB)
Language-Integrated Query (LINQ)
Hỗ trợ DotNet 3.5
……
Bài 6: Bảo mật trong SQL SERVER 2008 - Giáo trình FPTMasterCode.vn
Quản trị viên CSDL là người chịu trách nhiệm về hiệu
năng, tính toàn vẹn dữ liệu và bảo mật cho CSDL. Đồng
thời người quản trị có vai trò lập kế hoạch, phát triển,
khắc phục sự cố xảy ra với CSDL.
Các tác vụ quản trị thường thực hiện
Giới thiệu, khái niệm, cú pháp, demo của Cursor và Function
trong hệ quản trị CSDL
Tham khảo demo vui lòng liên hệ email: pinuit11@gmail.com
Chúc các bạn học tập thật tốt!
My talk for "MySQL, MariaDB and Friends" devroom at Fosdem on February 2, 2019
Born in 2010 in MySQL 5.5.3 as "a feature for monitoring server execution at a low level," grown in 5.6 times with performance fixes and DBA-faced features, in MySQL 5.7 Performance Schema is a mature tool, used by humans and more and more monitoring products. It becomes more popular over the years. In this talk I will give an overview of Performance Schema, focusing on its tuning, performance, and usability.
Performance Schema helps to troubleshoot query performance, complicated locking issues, memory leaks, resource usage, problematic behavior, caused by inappropriate settings and much more. It comes with hundreds of options which allow precisely tune what to instrument. More than 100 consumers store collected data.
Performance Schema is a potent tool. And very complicated at the same time. It does not affect performance in most cases and can slow down server dramatically if configured without care. It collects a lot of data, and sometimes this data is hard to read.
This talk will start from the introduction of how Performance Schema designed, and you will understand why it slowdowns server in some cases and does not affect your queries in others. Then we will discuss which information you can retrieve from Performance Schema and how to do it effectively.
I will cover its companion sys schema and graphical monitoring tools.
PostgreSQL is designed to be easily extensible. For this reason, extensions loaded into the database can function just like features that are built in. In this session, we will learn more about PostgreSQL extension framework, how are they built, look at some popular extensions, management of these extensions in your deployments.
Giới thiệu nền tảng Phalcon PHP. Phalcon hiện có benchmark cao nhất trong số các framework PHP. Năng suất lập trình cao, đầy đủ thư viện, cộng đồng phát triển này. Kinh nghiệm chia sẻ trong bài từ các dự án mà Techmaster.vn đã thực hiện
Hướng dẫn tạo ra slide trình bày hiệu quả, chuyên nghiệp và cách thức lan truyền chia sẻ slide. Bài trình bày của giảng viên Techmaster tại hội nghị NGO Connection do Microsoft tài trợ tại Việt nam này 29/5/2013. Các điểm chính cần lưu ý:
- Thông điệp
- Ít chữ - nhiều hình
- Phối màu
- Font chữ
- Cảm hứng
- Lan truyềb
3. http://techmaster.vn
Một số khái niệm cơ bản
• Database – Cơ sở dữ liệu
• Table – Bảng dữ liệu
• SQL (Structured Query Language): Ngôn ngữ
truy vấn và thao tác dữ liệu
– Thêm, sửa, xóa dữ liệu
– Truy vấn dữ liệu
4. http://techmaster.vn
Chuẩn hóa dữ liệu
1. First Normal Form (1NF)
2. Second Normal Form (2NF)
3. Third Normal Form (3NF)
Chuẩn hóa dữ liệu giúp giảm thiểu dữ liệu dư thừa
và giúp dễ dàng thao tác với dữ liệu.
5. http://techmaster.vn
Chuẩn hóa dữ liệu
Ví dụ một bảng dữ liệu chưa chuẩn hóa về
thông tin của các sinh viên và môn học
Cột Subject có chứa các nhóm thông tin trên cùng 1 dòng (Biology, Maths)
=> Gây khó khăn khi truy vấn, cập nhật CSDL
6. http://techmaster.vn
First Normal Form (1NF)
Chuẩn hóa lại theo chuẩn 1NF
Sử dụng cả 2 cột Student và Subject để làm khóa chính, tách dữ liệu ra nhiều dòng
=> Dễ cập nhật, truy vấn CSDL nhưng làm tăng dữ liệu dư thừa
7. http://techmaster.vn
Second Normal Form (2NF)
Theo chuẩn 2NF: Tách bảng Student ra làm 2 bảng
Chứa thông tin về
tuổi của student
Chứa thông tin về
môn học của student
8. http://techmaster.vn
Third Normal Form (3NF)
Ví dụ một bảng dữ liệu theo chuẩn 2NF, có chứa
thông tin về sinh viên và địa chỉ của sinh viên
Bảng có khóa chính là Student_id. Tuy nhiên các thuộc tính Street,
City, State lại phụ thuộc vào Zip
9. http://techmaster.vn
Third Normal Form (3NF)
Theo chuẩn 3NF, các thuộc tính trong bảng đều phải
phụ thuộc vào khóa chính => Tách làm 2 bảng
Bảng Student có khóa chính là Student_id
Bảng Address có khóa chính là Zip, liên kết với bảng Student qua trường Zip
10. http://techmaster.vn
Cài đặt Postgres
• Tải Postgres tại:
http://www.postgresql.org/download/
• Với MacOSX có thể sử dụng Postgres App:
http://postgresapp.com/
11. http://techmaster.vn
Postgres App
Open psql command và sử dụng
lệnh create user để tạo thêm user
và gán quyền truy cập cho user đó
Tạo tài khoản techmaster với mật khẩu là 123456 và có quyền tạo cơ sở dữ liệu (createdb)
14. http://techmaster.vn
Kiểu dữ liệu trong Postgres
• http://www.postgresql.org/docs/9.4/static/datatype.html
• Một số kiểu dữ liệu cơ bản thường dùng:
– Kiểu số: integer, smallint, bigint, serial, smallserial, bigserial, double
precision
– Kiểu ký tự: character, character varying, text
– Kiểu datetime: date, timestamp with time zone, timestamp without time
zone
– Kiểu boolean: boolean
– Kiểu json: json, jsonb
23. http://techmaster.vn
Truy vấn dữ liệu
SELECT [ ALL | DISTINCT [ ON ( expression [, ...] ) ] ] * | expression [ [ AS ] output_name ] [, ...]
[ FROM from_item [, ...] ]
[ WHERE condition ]
[ GROUP BY expression [, ...] ]
[ HAVING condition [, ...] ]
[ ORDER BY expression [ ASC | DESC | USING operator ] [ NULLS { FIRST | LAST } ] [, ...] ]
[ LIMIT { count | ALL } ]
[ OFFSET start [ ROW | ROWS ] ]
24. http://techmaster.vn
Truy vấn dữ liệu sử dụng JOIN query
• INNER JOIN (Viết tắt là JOIN)
• FULL OUTER JOIN (Viết tắt là OUTER JOIN)
• LEFT OUTER JOIN (Viết tắt là LEFT JOIN)
• RIGHT OUTER JOIN (Viết tắt là RIGHT JOIN)
• CROSS JOIN
25. http://techmaster.vn
Aggregate Functions
• Danh sách Aggregate functions trong Postgres:
http://www.postgresql.org/docs/9.4/static/functions-aggregate.html
• Một số Aggregate functions hay dùng:
– Count(expression)
– Sum(expression)
– Avg(expresssion)
– Min(expression), Max(expression)