migrating-oracle-to-postgres-stored-procedures
Skill này làm gì
Công cụ này giúp chuyển đổi mã của các thủ tục (gọi là 'stored procedures') từ cơ sở dữ liệu Oracle sang PostgreSQL. Nó chuyển đổi ngôn ngữ và quy tắc riêng của Oracle để chúng hoạt động trong PostgreSQL.
Khi nào nên dùng
- ✓Khi bạn chuyển một hệ thống từ Oracle sang PostgreSQL.
- ✓Khi bạn cần viết lại các thủ tục cũ cho cơ sở dữ liệu mới.
- ✓Khi bạn muốn đảm bảo logic mã vẫn đúng sau khi đổi cơ sở dữ liệu.
Liên kết skill
https://github.com/github/awesome-copilot/blob/main/skills/migrating-oracle-to-postgres-stored-procedures/SKILL.mdSao chép rồi dán vào AI của bạn (Claude, ChatGPT hoặc Cursor) và nhờ nó làm theo hướng dẫn.
Cách dùng
Cách dễ nhất: sao chép tin nhắn và dán vào AI của bạn. AI sẽ đọc skill và làm theo hướng dẫn.
Tin nhắn có sẵn để dán
Dành cho Claude Code, Codex hoặc Cursor: chạy lệnh trong thư mục dự án của bạn và skill sẽ được cài đặt.
Tải tệp SKILL.md về và thả vào thư mục skill của agent.
Ví dụ cách nhờ AI
“Chuyển thủ tục Oracle này sang PostgreSQL: [dán mã thủ tục vào đây]”
5 skill mới mỗi tuần. Đọc chỉ 1 phút.
Cách hoạt động
Công cụ đọc mã Oracle gốc, áp dụng các quy tắc để chuyển ngôn ngữ và cấu trúc sang định dạng PostgreSQL, rồi lưu mã mới vào một file.
Nội dung kỹ thuật (SKILL.md gốc)
Lấy nguyên văn từ GitHub, do tác giả viết bằng tiếng Anh.
Migrating Stored Procedures from Oracle to PostgreSQL
Translate Oracle PL/SQL stored procedures and functions to PostgreSQL PL/pgSQL equivalents.
Workflow
Progress:
- [ ] Step 1: Read the Oracle source procedure
- [ ] Step 2: Translate to PostgreSQL PL/pgSQL
- [ ] Step 3: Write the migrated procedure to Postgres output directory
Step 1: Read the Oracle source procedure
Read the Oracle stored procedure from .github/oracle-to-postgres-migration/DDL/Oracle/Procedures and Functions/. Consult the Oracle table/view definitions at .github/oracle-to-postgres-migration/DDL/Oracle/Tables and Views/ for type resolution.
Step 2: Translate to PostgreSQL PL/pgSQL
Apply these translation rules:
- Translate all Oracle-specific syntax to PostgreSQL equivalents.
- Preserve original functionality and control flow logic.
- Keep type-anchored input parameters (e.g.,
PARAM_NAME IN table_name.column_name%TYPE). - Use explicit types (
NUMERIC,VARCHAR,INTEGER) for output parameters passed to other procedures — do not type-anchor these. - Do not alter method signatures.
- Do not prefix object names with schema names unless already present in the Oracle source.
- Leave exception handling and rollback logic unchanged.
- Do not generate
COMMENTorGRANTstatements. - Apply collation intentionally when ordering text:
- Use
COLLATE "C"only when Oracle-compatible binary ordering is required and no other sort order is specified. - If Oracle used explicit linguistic sorting (for example
NLS_SORT = French), map to an explicit PostgreSQL locale collation instead of"C". - Use
SELECT collname, collprovider, collcollate, collctype FROM pg_collation ORDER BY collname;to discover collations in the target environment.
- Use
- Treat
UNION ALLas a review checkpoint. Validate plan quality per branch and restructure if combined-branch planning causes regressions (for example, unexpected sequential scans on large tables). - Leverage the
orafceextension when it improves clarity or fidelity.
Consult the PostgreSQL table/view definitions at .github/oracle-to-postgres-migration/DDL/Postgres/{ProjectName}/Tables and Views/ for target schema details.
Step 3: Write the migrated procedure to Postgres output directory
Place each migrated procedure in its own file under .github/oracle-to-postgres-migration/DDL/Postgres/{ProjectName}/Procedures and Functions/{PACKAGE_NAME_IF_APPLICABLE}/. One procedure per file.
{ProjectName}is the project's assembly/folder name with spaces normalized to-(e.g.MyApp.DataAccess). This matches the path used by the agent and other migration skills.
Câu hỏi thường gặp
“Stored procedures” là gì?
Đó là các tập lệnh cơ sở dữ liệu được lưu sẵn trong chính cơ sở dữ liệu, để thực thi khi được gọi. Giống như các “hàm” nhỏ nằm trong cơ sở dữ liệu.
Vì sao tôi cần chuyển đổi mã?
Mỗi cơ sở dữ liệu (như Oracle và PostgreSQL) có ngôn ngữ và quy tắc riêng. Mã viết cho cái này sẽ không chạy trực tiếp trên cái kia.
Công cụ có sao chép y nguyên mọi thứ không?
Công cụ cố gắng giữ nguyên chức năng và cấu trúc mã gốc, nhưng thực hiện các điều chỉnh cần thiết cho PostgreSQL, chẳng hạn như kiểu dữ liệu và quy tắc sắp xếp văn bản.
Chi tiết
Mô tả gốc của tác giả
Migrates Oracle PL/SQL stored procedures to PostgreSQL PL/pgSQL. Translates Oracle-specific syntax, preserves method signatures and type-anchored parameters, leverages orafce where appropriate, and applies explicit collation mapping (`COLLATE "C"` only when appropriate, locale collations when required). Use when converting Oracle stored procedures or functions to PostgreSQL equivalents during a da
repo: github/awesome-copilot
Độ phổ biến
- Sao GitHub
- 40k
- Vị trí xếp hạng
- #7295
- Giấy phép
- MIT
- Cập nhật
- 15/10/2026
Bình luận
- …
Thêm skill từ kho mã này
acquire-codebase-knowledge
40kGiúp agent của bạn hiểu và ghi tài liệu cho một dự án mã nguồn có sẵn. Hữu ích khi đón thành viên mới hoặc nắm tổng quan về kiến trúc.
acreadiness-assess
40kGiúp agent của bạn đánh giá mức độ sẵn sàng cho AI của dự án và tạo báo cáo. Hữu ích để biết dự án đã sẵn sàng dùng công cụ AI đến đâu.
acreadiness-generate-instructions
40kGiúp agent của bạn tạo hướng dẫn cho công cụ AI dựa trên kết quả đánh giá. Hữu ích để cải thiện cách AI làm việc với mã và khắc phục các khoảng trống.
acreadiness-policy
40kGiúp agent của bạn xác định hoặc áp dụng chính sách đánh giá dự án bằng AI. Hữu ích để chuẩn hóa cách đánh giá dự án và đảm bảo tuân thủ.
Skill tương tự
api-connector-builder
280kGiúp agent của bạn xây dựng kết nối API mới theo đúng mẫu đã có, dùng khi bạn cần thêm một tích hợp mà không tạo cách làm mới.
api-design
280kGiúp agent của bạn thiết kế REST API theo các thực hành tốt nhất, hữu ích để định nghĩa cách API giao tiếp, hiển thị lỗi và tổ chức dữ liệu.
backend-patterns
280kGiúp agent của bạn với các mẫu kiến trúc phía máy chủ và tối ưu cơ sở dữ liệu, hữu ích khi xây dựng hoặc rà soát code chạy trên máy chủ.