{"id":397,"date":"2015-11-16T13:22:31","date_gmt":"2015-11-16T13:22:31","guid":{"rendered":"http:\/\/onlinelab.info\/?p=397"},"modified":"2015-11-16T13:22:31","modified_gmt":"2015-11-16T13:22:31","slug":"tong-quan-kien-truc-database-vat-ly-cua-oracle","status":"publish","type":"post","link":"https:\/\/www.asianux.org.vn\/index.php\/2015\/11\/16\/tong-quan-kien-truc-database-vat-ly-cua-oracle\/","title":{"rendered":"T\u1ed5ng quan ki\u1ebfn tr\u00fac database v\u1eadt l\u00fd c\u1ee7a Oracle"},"content":{"rendered":"<h3>T\u1ed5ng quan ki\u1ebfn tr\u00fac database v\u1eadt l\u00fd c\u1ee7a Oracle<\/h3>\n<p>Ph\u1ea7n n\u00e0y s\u1ebd m\u00f4 t\u1ea3 ki\u1ebfn tr\u00fac v\u1eadt l\u00fd c\u1ee7a database Oracle sau khi \u0111\u00e3 m\u00f4 t\u1ea3 ki\u1ebfn tr\u00fac \u1ee9ng d\u1ee5ng c\u1ee7a Oracle trong b\u00e0i tr\u01b0\u1edbc. C\u00e1c v\u1ea5n \u0111\u1ec1 \u0111\u1ec1 c\u1eadp \u0111\u1ebfn bao g\u1ed3m datafiles, redo log files v\u00e0 control files. Ph\u1ea7n n\u00e0y s\u1ebd kh\u00f3 hi\u1ec3u h\u01a1n m\u00f4 h\u00ecnh \u1ee9ng d\u1ee5ng v\u00e0 \u0111\u00f2i h\u1ecfi ph\u1ea3i c\u00f3 n\u1ec1n t\u1ea3ng nh\u1ea5t \u0111\u1ecbnh \u0111\u1ec3 c\u00f3 th\u1ec3 \u0111\u1ecdc hi\u1ec3u.<\/p>\n<h3>Datafiles<\/h3>\n<p>M\u1ed7i Oracle database \u0111\u1ec1u c\u00f3 m\u1ed9t ho\u1eb7c nhi\u1ec1u datafile v\u1eadt l\u00fd. Datafiles l\u01b0u gi\u1eef t\u1ea5t c\u1ea3 c\u00e1c d\u1eef li\u1ec7u c\u1ee7a database. C\u00e1c ki\u1ec3u d\u1eef li\u1ec7u logic nh\u01b0 table, index, view, sequence \u0111\u01b0\u1ee3c l\u01b0u tr\u1eef v\u1eadt l\u00fd tr\u00ean datafiles \u0111\u01b0\u1ee3c c\u1ea5p ph\u00e1t cho database.<\/p>\n<p>C\u00e1c t\u00ednh ch\u1ea5t c\u1ee7a datafiles l\u00e0:<\/p>\n<p>\u2013 M\u1ed9t datafile ch\u1ec9 c\u00f3 th\u1ec3 thu\u1ed9c duy nh\u1ea5t 1 db<\/p>\n<p>\u2013 Datafiles c\u00f3 th\u1ec3 c\u00f3 m\u1ed9t v\u00e0i thu\u1ed9c t\u00ednh nh\u01b0 t\u1ef1 \u0111\u1ed9ng m\u1edf r\u1ed9ng khi database h\u1ebft dung l\u01b0\u1ee3ng<\/p>\n<p>\u2013 M\u1ed9t ho\u1eb7c m\u1ed9t v\u00e0i datafiles s\u1ebd t\u1ea1o th\u00e0nh m\u1ed9t \u0111\u1ed1i t\u01b0\u1ee3ng l\u01b0u tr\u1eef logic c\u1ee7a db g\u1ecdi l\u00e0 tablespace.<\/p>\n<p>V\u1ec1 c\u01a1 b\u1ea3n, d\u1eef li\u1ec7u trong datafiles s\u1ebd \u0111\u01b0\u1ee3c \u0111\u1ecdc n\u1ebfu c\u1ea7n v\u00e0 s\u1ebd \u0111\u01b0\u1ee3c l\u01b0u tr\u1eef v\u00e0o trong cache c\u1ee7a oracle. V\u00e0 nh\u01b0 v\u1eady, gi\u1ea3 s\u1eed m\u1ed9t user th\u1ef1c hi\u1ec7n request d\u1eef li\u1ec7u t\u1eeb m\u1ed9t b\u1ea3ng trong DB m\u00e0 d\u1eef li\u1ec7u n\u00e0y ch\u01b0a c\u00f3 trong cache c\u1ee7a db th\u00ec n\u00f3 s\u1ebd \u0111\u01b0\u1ee3c \u0111\u1ecdc t\u1eeb datafiles t\u01b0\u01a1ng \u1ee9ng sau \u0111\u00f3 l\u01b0u tr\u1eef l\u1ea1i trong b\u1ed9 nh\u1edb.<\/p>\n<p>Vi\u1ec7c ch\u1ec9nh s\u1eeda d\u1eef li\u1ec7u kh\u00f4ng nh\u1ea5t thi\u1ebft ph\u1ea3i ghi v\u00e0o datafile ngay l\u1eadp t\u1ee9c. \u0110\u1ec3 gi\u1ea3m thi\u1ec3u vi\u1ec7c truy nh\u1eadp \u1ed5 c\u1ee9ng th\u01b0\u1eddng xuy\u00ean \u0111\u1ed3ng th\u1eddi t\u0103ng performance, d\u1eef li\u1ec7u \u0111\u01b0\u1ee3c pooled trong b\u1ed9 nh\u1edb v\u00e0 \u0111\u01b0\u1ee3c ghi l\u00ean datafiles t\u01b0\u01a1ng \u1ee9ng c\u00f9ng l\u00fac v\u00e0o m\u1ed9t th\u1eddi \u0111i\u1ec3m (\u0111\u01b0\u1ee3c x\u00e1c \u0111\u1ecbnh b\u1edfi DBWn).<\/p>\n<h3>Control Files<\/h3>\n<p>M\u1ed7i Oracle DB s\u1ebd c\u00f3 <strong>m\u1ed9t control file<\/strong>. Control file s\u1ebd l\u01b0u tr\u1eef th\u00f4ng tin v\u1ec1 c\u1ea5u tr\u00fac v\u1eadt l\u00fd c\u1ee7a DB. V\u00ed d\u1ee5 c\u00e1c th\u00f4ng tin nh\u01b0 sau:<\/p>\n<p>\u2013 T\u00ean db<\/p>\n<p>\u2013 T\u00ean v\u00e0 \u0111\u1ecba ch\u1ec9 \u0111\u01b0\u1eddng d\u1eabn c\u1ee7a c\u00e1c datafiles v\u00e0 c\u00e1c redo log files<\/p>\n<p>\u2013 Timestamp t\u1ea1o DB<\/p>\n<p>\u0110\u1ec3 \u0111\u1ec1 ph\u00f2ng c\u00e1c tr\u01b0\u1eddng h\u1ee3p h\u1ecfng file, oracle s\u1ebd qu\u1ea3n l\u00fd m\u1ed9t s\u1ed1 nh\u00e2n b\u1ea3n c\u1ee7a control file \u0111\u1ed3ng th\u1eddi.<\/p>\n<p>M\u1ed7i khi m\u1ed9t instance c\u1ee7a Oracle DB \u0111\u01b0\u1ee3c kh\u1edfi \u0111\u1ed9ng th\u00ec control file c\u1ee7a n\u00f3 s\u1ebd x\u00e1c \u0111\u1ecbnh database, redo log files c\u1ea7n ph\u1ea3i m\u1edf cho c\u00e1c y\u00eau c\u1ea7u truy xu\u1ea5t DB. Khi database c\u00f3 thay \u0111\u1ed5i nh\u01b0 th\u00eam m\u1edbi datafile ho\u1eb7c redo log file \u0111\u01b0\u1ee3c t\u1ea1o ra, \u2026 th\u00ec control file s\u1ebd t\u1ef1 \u0111\u1ed9ng ch\u1ec9nh s\u1eeda theo thay \u0111\u1ed5i n\u00e0y. V\u00e0 v\u1edbi c\u00e1c ch\u1ee9c n\u0103ng tr\u00ean, control file c\u0169ng \u0111\u01b0\u1ee3c s\u1eed d\u1ee5ng trong qu\u00e1 tr\u00ecnh ph\u1ee5c h\u1ed3i DB.<\/p>\n<h3>Redo Log Files<\/h3>\n<p>M\u1ed7i Oracle DB \u0111\u1ec1u c\u00f3 <strong>\u00edt nh\u1ea5t 2 redo log files<\/strong>. T\u1eadp h\u1ee3p c\u00e1c redo log files n\u00e0y \u0111\u01b0\u1ee3c g\u1ecdi l\u00e0 redo log c\u1ee7a db. M\u1ed9t redo log \u0111\u01b0\u1ee3c t\u1ea1o th\u00e0nh t\u1eeb c\u00e1c redo records.<\/p>\n<p>Ch\u1ee9c n\u0103ng ch\u00ednh c\u1ee7a redo log l\u00e0 ghi l\u1ea1i t\u1ea5t c\u1ea3 c\u00e1c thay \u0111\u1ed5i v\u1edbi d\u1eef li\u1ec7u. N\u1ebfu nh\u01b0 c\u00f3 l\u1ed7i trong qu\u00e1 tr\u00ecnh thay \u0111\u1ed5i d\u1eef li\u1ec7u th\u00ec v\u1edbi redo log ta c\u00f3 th\u1ec3 ph\u1ee5c h\u1ed3i l\u1ea1i d\u1eef li\u1ec7u \u0111\u00e3 m\u1ea5t.<\/p>\n<p>\u0110\u1ec3 b\u1ea3o v\u1ec7 ch\u00ednh redo log b\u1ecb h\u01b0 h\u1ea1i, Oracle th\u1ef1c hi\u1ec7n <strong>nh\u00e2n b\u1ea3n redo log<\/strong>v\u00e0 do \u0111\u00f3 s\u1ebd c\u00f3 \u00edt nh\u1ea5t 2 b\u1ea3n copy c\u1ee7a redo log n\u1eb1m tr\u00ean c\u00e1c \u0111\u0129a kh\u00e1c nhau.<\/p>\n<p>C\u00e1c th\u00f4ng tin trong redo log files \u0111\u01b0\u1ee3c d\u00f9ng \u0111\u1ec3 ph\u1ee5c h\u1ed3i d\u1eef li\u1ec7u t\u1eeb h\u1ec7 th\u1ed1ng trong tr\u01b0\u1eddng h\u1ee3p v\u00ed d\u1ee5 khi c\u00e1c d\u1eef li\u1ec7u trong b\u1ed9 nh\u1edb ch\u01b0a k\u1ecbp ghi v\u00e0o datafiles th\u00ec m\u1ea5t \u0111i\u1ec7n, khi n\u00e0y, d\u1eef li\u1ec7u s\u1ebd \u0111\u01b0\u1ee3c ph\u1ee5c h\u1ed3i khi database \u0111\u01b0\u1ee3c m\u1edf l\u1ea1i. B\u1eb1ng vi\u1ec7c s\u1eed d\u1ee5ng c\u00e1c th\u00f4ng tin trong redo log file g\u1ea7n nh\u1ea5t ta c\u00f3 th\u1ec3 kh\u00f4i ph\u1ee5c d\u1eef li\u1ec7u tr\u1edf v\u00ea th\u1eddi gian khi m\u1ea5t \u0111i\u1ec7n x\u1ea3y ra.<\/p>\n<p>Qu\u00e1 tr\u00ecnh kh\u00f4i ph\u1ee5c n\u00e0y \u0111\u01b0\u1ee3c g\u1ecdi l\u00e0 <em><strong>rolling forward<\/strong><\/em>.<\/p>\n<p>B\u00ean c\u1ea1nh c\u00e1c lo\u1ea1i tr\u00ean c\u00f2n c\u00f3 Archive log files, Parameter files, Alert and Trace log files v\u00e0 Backup files. C\u00e1c lo\u1ea1i files n\u00e0y s\u1ebd \u0111\u01b0\u1ee3c \u0111\u1ec1 c\u1eadp \u0111\u1ebfn trong c\u00e1c b\u00e0i kh\u00e1c c\u00f3 li\u00ean quan.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>T\u1ed5ng quan ki\u1ebfn tr\u00fac database v\u1eadt l\u00fd c\u1ee7a Oracle Ph\u1ea7n n\u00e0y s\u1ebd m\u00f4 t\u1ea3 ki\u1ebfn tr\u00fac v\u1eadt l\u00fd c\u1ee7a database Oracle sau khi \u0111\u00e3 m\u00f4 t\u1ea3 ki\u1ebfn tr\u00fac \u1ee9ng d\u1ee5ng c\u1ee7a Oracle trong b\u00e0i tr\u01b0\u1edbc.&hellip;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[2],"tags":[],"class_list":["post-397","post","type-post","status-publish","format-standard","hentry","category-database"],"_links":{"self":[{"href":"https:\/\/www.asianux.org.vn\/index.php\/wp-json\/wp\/v2\/posts\/397","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.asianux.org.vn\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.asianux.org.vn\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.asianux.org.vn\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.asianux.org.vn\/index.php\/wp-json\/wp\/v2\/comments?post=397"}],"version-history":[{"count":0,"href":"https:\/\/www.asianux.org.vn\/index.php\/wp-json\/wp\/v2\/posts\/397\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.asianux.org.vn\/index.php\/wp-json\/wp\/v2\/media?parent=397"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.asianux.org.vn\/index.php\/wp-json\/wp\/v2\/categories?post=397"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.asianux.org.vn\/index.php\/wp-json\/wp\/v2\/tags?post=397"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}