1. Kiểm tra tablespace hiện tại:
SELECT table_name, tablespace_name FROM dba_tables WHERE table_name IN ('AUD$', 'FGA_LOG$');
TABLE_NAME TABLESPACE_NAME
---------- -----------------
AUD$ SYSTEM
FGA_LOG$ SYSTEM
2. Kiểm tra size tablespace
column segment_name for a10
select segment_name,bytes/1024/1024 size_in_megabytes from dba_segments where segment_name in ('AUD$','FGA_LOG$');
SEGMENT_NA SIZE_IN_MEGABYTES
---------- -----------------
AUD$ .0625
FGA_LOG$ .0625
3. Kiểm tra vị trí các datafiles
select file_name from dba_data_files;
FILE_NAME
------------------------------------------------
D:\ORACLEXE\APP\ORACLE\ORADATA\XE\USERS.DBF
D:\ORACLEXE\APP\ORACLE\ORADATA\XE\UNDOTBS1.DBF
D:\ORACLEXE\APP\ORACLE\ORADATA\XE\SYSAUX.DBF
D:\ORACLEXE\APP\ORACLE\ORADATA\XE\SYSTEM.DBF
4. Tạo tablespace mới lưu log audit
create tablespace audit_tbs datafile 'D:\ORACLEXE\APP\ORACLE\ORADATA\XE\audit_db.dbf' size 100M autoextend on;
5. Chuyển bảng audit trail sang tablespace mới:--Bảng audit trail
BEGIN
DBMS_AUDIT_MGMT.set_audit_trail_location(
audit_trail_type => DBMS_AUDIT_MGMT.AUDIT_TRAIL_AUD_STD,
audit_trail_location_value => 'AUDIT_TBS');
END;
/
-- Bảng FGA_LOG$
BEGIN
DBMS_AUDIT_MGMT.set_audit_trail_location(
audit_trail_type => DBMS_AUDIT_MGMT.AUDIT_TRAIL_FGA_STD,--this moves table FGA_LOG$
audit_trail_location_value => 'AUDIT_TBS');
END;
/
6. Kiểm tra lại sau khi chuyển
SQL> SELECT table_name, tablespace_name FROM dba_tables WHERE table_name IN ('AUD$', 'FGA_LOG$');
TABLE_NAME TABLESPACE_NAME
----------- ---------------
FGA_LOG$ AUDIT_TBS
AUD$ AUDIT_TBS
KẾT NỐI VỚI CHUYÊN GIA TRẦN VĂN BÌNH:
📧 Mail: binhoracle@gmail.com
☎️ Mobile: 0902912888
⚡️ Skype: tranbinh48ca
👨 Facebook: https://www.facebook.com/BinhOracleMaster
👨 Inbox Messenger: https://m.me/101036604657441 (profile)
👨 Fanpage: https://www.facebook.com/tranvanbinh.vn
👨 Inbox Fanpage: https://m.me/tranvanbinh.vn
👨👩 Group FB: https://www.facebook.com/groups/DBAVietNam
👨 Website: https://www.tranvanbinh.vn
👨 Blogger: https://tranvanbinhmaster.blogspot.com
🎬 Youtube: http://bit.ly/ytb_binhoraclemaster
👨 Tiktok: https://www.tiktok.com/@binhoraclemaster?lang=vi
👨 Linkin: https://www.linkedin.com/in/binhoracle
👨 Twitter: https://twitter.com/binhoracle
👨 Địa chỉ: Tòa nhà Sun Square - 21 Lê Đức Thọ - Phường Mỹ Đình 1 - Quận Nam Từ Liêm - TP.Hà Nội
#OracleTutorial #OracleDBA #OracleDatabaseAdministration #học oracle database #oca #ocp #tự học oracle