Thứ Năm, 8 tháng 6, 2023

Restore pfile/spfile trong Oracle Database

Mục đích: Chia sẻ cách Restore pfile/spfile trong Oracle Database an toàn, nhanh chóng. Chú ý nên đặt autobackup = on trong RMAN để backup tự động controlfile/spfile mỗi lần backup bất kỳ (có thể backup datafile, backup DB)

Câu lệnh hay dùng:

RMAN> RESTORE SPFILE;

RMAN> RESTORE SPFILE FROM AUTOBACKUP;

RMAN> RESTORE SPFILE FROM '/backupdb/spfile_xxx.txt';


CÁC TÌNH HUỐNG HAY DÙNG

Restore Server Parameter File (SPFILE) từ Backup

1. % rman TARGET /

2. RMAN> STARTUP FORCE NOMOUNT;

3. RMAN> RESTORE SPFILE FROM AUTOBACKUP; (or RESTORE SPFILE TO '/tmp/spfileTEMP.ora' FROM AUTOBACKUP;)

4. create a file /tmp/init.ora which contains the single line: SPFILE=/tmp/spfileTEMP.ora STARTUP FORCE PFILE=/tmp/init.ora; # startup with /tmp/spfileTEMP.ora

Restore SPFILE từ Control File Autobackup (khi backup control file backup luôn cả spfile)

RMAN> SET DBID 320066378; RMAN> RUN { SET CONTROLFILE AUTOBACKUP FORMAT FOR DEVICE TYPE DISK TO 'autobackup_format'; RESTORE SPFILE FROM AUTOBACKUP; }

Tạo Client-Side Initialization Parameter File (PFILE) với RMAN/SQL

RMAN> RESTORE SPFILE TO PFILE '/tmp/initTEMP.ora'; RMAN> STARTUP FORCE PFILE='/tmp/initTEMP.ora';

RMAN> RESTORE SPFILE TO PFILE '/tmp/initTEMP.ora';


SQL> create spfile from pfile;

SQL> create pfile='/tmp/pfile_dbaviet' from pfile;

THAM KHẢO THÊM

https://docs.oracle.com/cd/B19306_01/backup.102/b14192/recov004.htm


=============================
* KHOÁ HỌC ORACLE DATABASE A-Z ENTERPRISE trực tiếp từ tôi giúp bạn bước đầu trở thành những chuyên gia DBA, đủ kinh nghiệm đi thi chứng chỉ OA/OCP, đặc biệt là rất nhiều kinh nghiệm, bí kíp thực chiến trên các hệ thống Core tại VN chỉ sau 1 khoá học.
* CÁCH ĐĂNG KÝ: Gõ (.) hoặc để lại số điện thoại hoặc inbox https://m.me/tranvanbinh.vn hoặc Hotline/Zalo 090.29.12.888
* Chi tiết tham khảo:
https://bit.ly/oaz_w
=============================
KẾT NỐI VỚI CHUYÊN GIA TRẦN VĂN BÌNH:
📧 Mail: binhoracle@gmail.com
☎️ Mobile/Zalo: 0902912888
👨 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: https://www.youtube.com/@binhguru
👨 Tiktok: https://www.tiktok.com/@binhguru
👨 Linkin: https://www.linkedin.com/in/binhoracle
👨 Twitter: https://twitter.com/binhguru
👨 Podcast: https://www.podbean.com/pu/pbblog-eskre-5f82d6
👨 Đị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

=============================
oracle tutorial, học oracle database, Tự học Oracle, Tài liệu Oracle 12c tiếng Việt, Hướng dẫn sử dụng Oracle Database, Oracle SQL cơ bản, Oracle SQL là gì, Khóa học Oracle Hà Nội, Học chứng chỉ Oracle ở đầu, Khóa học Oracle online,sql tutorial, khóa học pl/sql tutorial, học dba, học dba ở việt nam, khóa học dba, khóa học dba sql, tài liệu học dba oracle, Khóa học Oracle online, học oracle sql, học oracle ở đâu tphcm, học oracle bắt đầu từ đâu, học oracle ở hà nội, oracle database tutorial, oracle database 12c, oracle database là gì, oracle database 11g, oracle download, oracle database 19c, oracle dba tutorial, oracle tunning, sql tunning , oracle 12c, oracle multitenant, Container Databases (CDB), Pluggable Databases (PDB), oracle cloud, oracle security, oracle fga, audit_trail,oracle RAC, ASM, oracle dataguard, oracle goldengate, mview, oracle exadata, oracle oca, oracle ocp, oracle ocm , oracle weblogic, postgresql tutorial, mysql tutorial, mariadb tutorial, sql server tutorial, nosql, mongodb tutorial, oci, cloud, middleware tutorial, hoc solaris tutorial, hoc linux tutorial, hoc aix tutorial, unix tutorial, securecrt, xshell, mobaxterm, putty

ĐỌC NHIỀU

Trần Văn Bình - Oracle Database Master