Control file trong Oracle Database là một thành phần quan trọng chứa các thông tin metadata về cấu trúc cơ sở dữ liệu. Nó bao gồm thông tin về các tệp dữ liệu (data files), tệp redo log, checkpoint, và thông tin về việc sao lưu. Việc quản trị control file là rất quan trọng để đảm bảo tính toàn vẹn và khả năng phục hồi của cơ sở dữ liệu.
Dưới đây là các bước chi tiết để cấu hình và quản trị control file trong Oracle Database:
1. Kiểm tra hiện trạng của control file
Bạn có thể kiểm tra vị trí và trạng thái của các control file hiện tại bằng lệnh SQL sau:
SELECT NAME FROM V$CONTROLFILE;

2. Cấu hình nhiều bản sao của control file
Việc sử dụng nhiều bản sao của control file là một thực hành tốt để đảm bảo tính an toàn dữ liệu. Bạn có thể cấu hình nhiều bản sao của control file bằng cách chỉnh sửa tham số CONTROL_FILES trong tệp cấu hình init.ora hoặc spfile.
Khuyến cáo: Ít nhất là 2 controlfile trong database, lưu ở 2 phân vùng khác nhau, thường xuyên backup.
Sử dụng init.ora:
Mở và chỉnh sửa tệp init.ora, thêm hoặc cập nhật dòng sau:
CONTROL_FILES = (‘/u01/app/oracle/oradata/ORCL/control01.ctl’,
‘/u02/app/oracle/oradata/ORCL/control02.ctl’,
‘/u03/app/oracle/oradata/ORCL/control03.ctl’)
Sử dụng spfile:
Nếu bạn đang sử dụng spfile, bạn có thể thay đổi tham số CONTROL_FILES bằng lệnh SQL:
ALTER SYSTEM SET CONTROL_FILES = ‘/u01/app/oracle/oradata/ORCL/control01.ctl’,
‘/u02/app/oracle/oradata/ORCL/control02.ctl’,
‘/u03/app/oracle/oradata/ORCL/control03.ctl’
SCOPE=SPFILE;
3. Tạo các bản sao của control file
Khi thêm các đường dẫn mới vào tham số CONTROL_FILES, bạn cần phải tạo các bản sao của control file hiện tại để đặt vào các đường dẫn mới. Thực hiện các bước sau:
cp /u01/app/oracle/oradata/ORCL/control01.ctl /u02/app/oracle/oradata/ORCL/control02.ctl
cp /u01/app/oracle/oradata/ORCL/control01.ctl /u03/app/oracle/oradata/ORCL/control03.ctl
4. Tạo control file mới
Trong trường hợp control file bị hỏng và không có bản sao lưu, bạn có thể tạo mới control file. Trước khi tạo control file mới, hãy chắc chắn bạn có các thông tin cần thiết như các tệp dữ liệu, tệp redo log, và các tham số cơ sở dữ liệu.
STARTUP NOMOUNT;
CREATE CONTROLFILE REUSE DATABASE “ORCL” RESETLOGS ARCHIVELOG
MAXLOGFILES 16
MAXLOGMEMBERS 3
MAXDATAFILES 100
MAXINSTANCES 1
MAXLOGHISTORY 292
LOGFILE
GROUP 1 (‘/u01/app/oracle/oradata/ORCL/redo01.log’) SIZE 50M,
GROUP 2 (‘/u01/app/oracle/oradata/ORCL/redo02.log’) SIZE 50M
DATAFILE
‘/u01/app/oracle/oradata/ORCL/system01.dbf’,
‘/u01/app/oracle/oradata/ORCL/undotbs01.dbf’,
‘/u01/app/oracle/oradata/ORCL/sysaux01.dbf’,
‘/u01/app/oracle/oradata/ORCL/users01.dbf’;
ALTER DATABASE OPEN RESETLOGS;
Backkup controlfile:
RMAN> BACKUP CURRENT CONTROLFILE;
ALTER DATABASE BACKUP CONTROLFILE TO ‘/path/to/backup/controlfile.bkp’;
ALTER DATABASE BACKUP CONTROLFILE TO TRACE;
- Bitcoin và Khả Năng Sử Dụng Làm Phương Tiện Thanh Toán Vi Mô
- Q7. Which three capabilities require the use of the RMAN recovery catalog?
- Q88. Which two are true about backup encryption?
- Q155 Which four statements are true regarding primary and foreign key constraints and the effect they can have on table data?
- Q120. Which two are true about gathering optimizer statistics?

Stockholm - Elementor Theme for Creative Business & WooCommerce
Shopkeeper - Multi-Purpose WooCommerce Theme
JupiterX - Multipurpose WordPress & WooCommerce Theme
Bookory - Book Store WooCommerce Theme
Baby Toys And Accessories Store Shopify Theme
Rank Math SEO Pro
Sober - WooCommerce WordPress Theme
Duplicate Page - nhân bản page post nhanh chóng
Babyza - Kids Fashion Responsive Shopify Theme
The7 - Ultimate Website & Online Store Builder for WordPress and WooCommerce
Essentials - Multipurpose WordPress Theme
YITH WooCommerce Role Based Prices Premium
Careera - Recruitment agency Elementor Template Kit
Dropper - Sropshipping & Logistic Elementor Template Kit
Nandur - Environment Elementor Template Kit
Ronneby - High-Performance WordPress Theme
Porto | Multipurpose & WooCommerce Theme
Total - Responsive Multi-Purpose WordPress Theme
YITH Event Tickets for WooCommerce Premium
LayerSlider Premium
Avada Theme
Ave - Responsive Multi-Purpose WordPress Theme
WooCommerce Custom Fields
Sensei Content Drip
Boxstore - Multipurpose Magento Theme
WooCommerce Notification | Boost Your Sales
All in One SEO Pack Pro
YITH WooCommerce Email Templates Premium
Amely - Clean & Modern Magento 2 Theme
Angara - Responsive Magento X & X Theme
WooCommerce Aramex
MinimogWP - The High Converting eCommerce WordPress Theme
The Retailer - Premium WooCommerce Theme
WooCommerce Australia Post Shipping Method
Haxico - Technology Responsive Magento Theme
Go Pricing
WooCommerce Group Coupons
Martfury - WooCommerce Marketplace WordPress Theme
Mina - Responsive Furniture, Handmade Shop Magento 2 Theme