posts - 241,  comments - 116,  trackbacks - 0
          面對(duì)一個(gè)全新的環(huán)境,作為一個(gè)Oracle DBA,首先應(yīng)該了解什么?
            在這里,不談那些大的方面,比如了解整個(gè)IT環(huán)境整體情況,假設(shè)你已經(jīng)知道了這些,接下來需要面對(duì)的就是這些一個(gè)個(gè)活生生的database了.這里總結(jié)了一些一般的思路來面對(duì)一個(gè)全先的database,從而快速了解你面對(duì)的環(huán)境概要.
            這也不是教科書,只是一些心得和體會(huì),對(duì)于這種問題,每個(gè)人的認(rèn)識(shí)的角度是不一樣的.歡迎大家繼續(xù)補(bǔ)充完善.
            1、先要了解當(dāng)前的Oracle 數(shù)據(jù)庫的版本和平臺(tái)和相關(guān)信息
            這個(gè)很重要,忙乎了半天還知道你的數(shù)據(jù)庫是哪個(gè)版本,跑在什么系統(tǒng)上,那豈不是很悲哀,所以我個(gè)人認(rèn)為這是第一步需要了解的。下面的這些腳本可以幫助你獲取你需要的相關(guān)信息。
            select * from v$version;
            select * from dba_registry_database;
            select dbid, name, open_mode, database_role, platform_name from v$instance;
            select dbms_utility.port_string from dual;
            set serveroutput on;
            declare海運(yùn)股滯漲是因?yàn)楹_\(yùn)行業(yè)運(yùn)力過剩
            ver VARCHAR2(100);
            compat VARCHAR2(100);
            begin
            dbms_utility.db_version(ver, compat);
            dbms_output.put_line('Version: ' || ver ||' Compatible: ' || compat);
            end;
            /
            2、其次要了解你的數(shù)據(jù)庫中裝了哪些組件
            select * from dba_registry;
            3、搞清楚這個(gè)環(huán)境是單機(jī)還是集群?
            這個(gè)判斷方法很多,我這里給出一個(gè)借助dbms_utility來判斷的方法。
            set serveroutput on
            declare
            inst_tab dbms_utility.instance_table;
            inst_cnt NUMBER;
            begin
            if dbms_utility.is_cluster_database then
            dbms_utility.active_instances(inst_tab, inst_cnt);
            dbms_output.put_line('-' || inst_tab.FIRST);ubuntu手動(dòng)安裝jdk+文件link設(shè)置
            dbms_output.put_line(TO_CHAR(inst_cnt));
            else
            dbms_output.put_line('Not A Clustered Database');
            end if;
            end;
            /
            4、是否配置了DataGuard?
            select protection_mode, protection_level, remote_archive, database_role, dataguard_broker,guard_status
            from v$database;
            5、是否起用了歸檔模式?
            conn /as sysdba
            archive log list;
            select log_mode from v$database;
            6、是否起用了flashback database特性?
            select flashback_on from v$database;
            如果是,再進(jìn)一步查看FRA的配置情況
            7、是否起用了force logging和補(bǔ)充日志?
            select force_logging,supplemental_log_data_min, supplemental_log_data_pk, supplemental_log_data_ui,
            supplemental_log_data_fk, supplemental_log_data_all
            from v$database;
            8、了解控制文件的組成
            select * from v$controlfile;
            9、了解日志文件的組成
            select l.group#, lf.type, lf.member, l.bytes, l.status LOG_STATUS, lf.status LOGFILE_STATUS
            from v$log l, v$logfile lf
            where l.group# = lf.group#
            order by 1,3;
            10、了解參數(shù)文件的組成和位置
            show parameter spfile
            create spfile from pfile...
            create pfile from spfile;
            create spfile from memory;
            create pfile from memory;
            11、了解instance的相關(guān)信息
            select instance_name, host_name, status, archiver, database_status, instance_role, active_state
            from v$instance;
            12、用戶和密碼相關(guān)
            是否使用了缺省密碼?
            是否使用了profile?
            是否起用了密碼驗(yàn)證函數(shù)?
            用戶身份驗(yàn)證的方法?
            密碼是否區(qū)分大小寫等。
            select name, value from gv$parameter where name = 'resource_limit';
            select profile, resource_name, limit from dba_profiles order by 1,2;
            select username, profile from dba_users where account_status = 'OPEN' order by 1;
            select d.username, u.account_status
            from dba_users_with_defpwd d, dba_users u
            where d.username = u.username and account_status = 'OPEN'
            order by 2,1;
            13、是否打開了BLOCK CHANGE TRACKING
            select filename, status, bytes from v$block_change_tracking;
            14、起用了那些特性(Feature)?
            DBMS_FEATURE_USAGE_REPORT
            15、表空間和數(shù)據(jù)文件的規(guī)劃
            這個(gè)大家都很熟悉,就不寫了
            16、字符集相關(guān)
            select * from database_properties;
            17、系統(tǒng)中是否存在invalid對(duì)象
            select owner, object_type, COUNT(*)
            from dba_objects
            where status = 'INVALID'
            group by owner, object_type;
            18、更進(jìn)一步的
            是否使用了ASM?
            當(dāng)前系統(tǒng)的備份方法和策略是什么?
            網(wǎng)絡(luò)文件的配置是如何的?
            19、查看一下最近的alert日志,獲取一些有用的信息
            20、跑幾個(gè)性能分析報(bào)告,看看最近系統(tǒng)的運(yùn)行狀態(tài)如何
            21、跑一個(gè)RDA報(bào)告,收集完整的系統(tǒng)狀態(tài)報(bào)告
          posted on 2011-09-01 10:15 墻頭草 閱讀(376) 評(píng)論(1)  編輯  收藏

          只有注冊(cè)用戶登錄后才能發(fā)表評(píng)論。


          網(wǎng)站導(dǎo)航:
           
          人人游戲網(wǎng) 軟件開發(fā)網(wǎng) 貨運(yùn)專家
          主站蜘蛛池模板: 临漳县| 泰兴市| 保定市| 高碑店市| 高淳县| 镶黄旗| 赞皇县| 宾阳县| 开远市| 阿克| 正镶白旗| 海盐县| 清丰县| 昭平县| 洛扎县| 明星| 洛南县| 黎平县| 安阳县| 铁力市| 梨树县| 满洲里市| 深水埗区| 玉溪市| 竹山县| 股票| 广元市| 明光市| 五家渠市| 水城县| 读书| 廉江市| 沿河| 黑龙江省| 拉孜县| 安多县| 宜阳县| 清丰县| 习水县| 琼海市| 象州县|