圖文解說DG災(zāi)備環(huán)境搭建步驟講訴_第1頁(yè)
圖文解說DG災(zāi)備環(huán)境搭建步驟講訴_第2頁(yè)
圖文解說DG災(zāi)備環(huán)境搭建步驟講訴_第3頁(yè)
圖文解說DG災(zāi)備環(huán)境搭建步驟講訴_第4頁(yè)
圖文解說DG災(zāi)備環(huán)境搭建步驟講訴_第5頁(yè)
已閱讀5頁(yè),還剩176頁(yè)未讀 繼續(xù)免費(fèi)閱讀

下載本文檔

版權(quán)說明:本文檔由用戶提供并上傳,收益歸屬內(nèi)容提供方,若內(nèi)容存在侵權(quán),請(qǐng)進(jìn)行舉報(bào)或認(rèn)領(lǐng)

文檔簡(jiǎn)介

1、前言為了學(xué)習(xí)DG,我們需要有學(xué)習(xí)環(huán)境來支持,因此搭建DG環(huán)境是學(xué)習(xí)DG的第一步。在搭建GC的文檔里,有介紹虛擬機(jī)模板的搭建,這里就直接用這個(gè)虛擬機(jī)模板來搭建DG,搭建之前先下載11201的數(shù)據(jù)庫(kù)軟件,為了后面的滾動(dòng)升級(jí)實(shí)驗(yàn)。下面就來介紹怎么搭建DG學(xué)習(xí)環(huán)境! 第一章 制作DG虛擬機(jī)模板下載11201數(shù)據(jù)庫(kù)軟件點(diǎn)擊接受,下載32bit或者64bit軟件本人下載的是64bit的軟件把兩個(gè)壓縮包都下載下來還原虛擬機(jī)模板把在搭建GC環(huán)境時(shí)的虛擬機(jī)模板還原出來改名為prod裝載虛擬機(jī)右鍵rename為prod啟動(dòng)虛擬機(jī)先登錄進(jìn)去cd /etc/sysconfig/network-scriptslsvi

2、ifcfg-eth0.bak把HWADDR刪除掉,然后改一下IPADDR保存退出mv ifcfg-eth0.bak ifcfg-eth0lsservice network restartifconfigexit用secureCRT創(chuàng)建新連接這個(gè)提示用同樣的方法解決設(shè)置好顏色字體,prod的會(huì)話連接創(chuàng)建完畢vi /etc/sysconfig/network把主機(jī)名改成prod.localdomain修改好之后保存退出hostname prod.localdomain退出后再登錄修改hostsvi /etc/hosts127.0.0.1 localhost.localdomain localhos

3、t:1 localhost6.localdomain localhost6192.168.75.61 prod.localdomain prod192.168.75.62 standby.localdomain standby保存退出安裝oracle軟件先安裝10201的軟件來搭建DG后面有滾動(dòng)升級(jí)成11201的方法把10201的oracle軟件傳送到/u01目錄下傳輸好之后修改軟件屬于者為oraclecd /u01ls -lrtchown -R oracle:oinstall *ls -lrt設(shè)置oracle環(huán)境變量su - oraclevi .bash_profile把下面內(nèi)容復(fù)制到.ba

4、sh_profile最后export PATHexport TMP=/tmpexport TMPDIR=$TMPexport ORACLE_BASE=/u01export ORACLE_SID=prodexport ORACLE_HOME=/u01/oracle/db_1export ORACLE_TERM=xtermexport PATH=$PATH:$ORACLE_HOME/bin:$HOME/binexport LD_LIBRARY_PATH=$ORACLE_HOME/lib:/bin:/usr/bin:/usr/local/bin:/usr/X11R6/bin/export CLASS

5、PATH=$ORACLE_HOME/JRE:$ORACLE_HOME/jlib:$ORACLE_HOME/rdbms/jlibexport DISPLAY=192.168.75.1:0.0stty erase halias sqlplus=rlwrap sqlplusalias rman=rlwrap rman保存后退出執(zhí)行. .bash_profile讓環(huán)境變量生效解壓縮oracle軟件cd /u01ls -lrtgzip -dc 10201_database_linux_x86_64.cpio.gz | cpio -icvdBumls -lrtcd database在windows端打開x

6、manager的passive來接收遠(yuǎn)程圖形雙擊它就可以了看到右下角有圖標(biāo)且是:0.0端口就行./runInstaller另開一個(gè)窗口用root用戶執(zhí)行上面腳本10201軟件安裝完成!把安裝軟件刪除,節(jié)省空間cd .ls -lrtrm -f 10201_database_linux_x86_64.cpio.gzrm -fR databasels -lrtdf -h備份復(fù)制模板至此,完成了虛擬機(jī)模板的制作,可以把虛擬機(jī)目錄拷貝一份保存起來關(guān)機(jī),然后復(fù)制一份作為備庫(kù)使用第二章 搭建物理備庫(kù)配置standby服務(wù)器把復(fù)制好的虛擬機(jī)改名為standby裝載虛擬機(jī)右鍵rename為standby打開虛擬

7、機(jī)先登錄進(jìn)去cd /etc/sysconfig/network-scriptsls因?yàn)閜rod虛擬機(jī)沒開,所以IP地址沒有發(fā)生沖突,但是還是要改一下vi ifcfg-eth0改成192.168.75.62保存退出service network restartifconfigexit用secureCRT創(chuàng)建新連接這個(gè)提示用同樣的方法解決設(shè)置好顏色字體,standby的會(huì)話連接創(chuàng)建完畢vi /etc/sysconfig/network把主機(jī)名改成standby.localdomain修改好之后保存退出hostname standby.localdomain退出后再登錄查看hostscat /etc

8、/hosts一切正常!修改ORACLE_SIDsu - oraclevi .bash_profile把環(huán)境變量ORACLE_SID的值修改成standby修改好之后保存退出. .bash_profile讓環(huán)境變量生效創(chuàng)建主數(shù)據(jù)庫(kù)prod啟動(dòng)prod虛擬機(jī)然后用netca命令配置監(jiān)聽su - oraclenetca這個(gè)就設(shè)置成默認(rèn)監(jiān)聽,用1521端口看一下信息用dbca命令創(chuàng)建prod數(shù)據(jù)庫(kù)要和.bash_profile里配置的ORACLE_SID參數(shù)一樣不安裝DB Control的em設(shè)置sys用戶的密碼不使用flash recovery area字符集選ZHS16GBK,當(dāng)然你選AL32UT

9、F8也可以開始創(chuàng)建數(shù)據(jù)庫(kù)解鎖幾個(gè)用戶prod數(shù)據(jù)庫(kù)創(chuàng)建完畢!設(shè)置prod庫(kù)登陸到sqlplus檢查一下歸檔模式和force loggingsqlplus / as sysdbaselect log_mode,force_logging from v$database;如果是非歸檔就要關(guān)閉數(shù)據(jù)庫(kù)修改shutdown immediatestartup mount干凈地關(guān)閉數(shù)據(jù)庫(kù)再啟動(dòng)到mount狀態(tài)改成歸檔模式和強(qiáng)制loggingalter database archivelog;alter database force logging;select log_mode,force_logging

10、from v$database;archive log list更改歸檔目錄!mkdir /u01/oradata/prod/archivelogls -l /u01/oradata/prodexitalter system set log_archive_dest_1=location=/u01/oradata/prod/archivelog;archive log listalter database open;創(chuàng)建pfilecreate pfile from spfile;alter database create standby controlfile as /u01/oracle/s

11、tandby.ctl;把pfile文件、口令文件和備控制文件傳輸?shù)絪tandbyexitcd /u01/oracle/db_1/dbsls -lrtscp orapwprod 192.168.75.62:/u01/oracle/db_1/dbsscp initprod.ora 192.168.75.62:/u01/oracle/db_1/dbsscp /u01/oracle/standby.ctl 192.168.75.62:/u01/oracle需要輸入oracle用戶密碼備控制文件只要復(fù)制到與prod庫(kù)的路徑相同就行,兩邊都是/u01/oracle/standby.ctlprod設(shè)置先告一

12、段落設(shè)置standby數(shù)據(jù)庫(kù)cd /u01/oracle/db_1/dbsls -lrt把口令文件和pfile名字改成standby的mv orapwprod orapwstandbymv initprod.ora initstandby.oravi initstandby.ora把最上面幾行去掉,然后把上面標(biāo)注的prod都改成standby注意db_name的prod值不要修改在最后添加以下參數(shù)*.db_unique_name=standby*.db_file_name_convert=/u01/oradata/prod,/u01/oradata/standby*.log_file_name

13、_convert=/u01/oradata/prod,/u01/oradata/standby*.log_archive_config=dg_config=(prod,standby)*.log_archive_dest_1=location=/u01/oradata/standby/archivelog valid_for=(all_logfiles,all_roles) db_unique_name=standby*.log_archive_dest_2=service=prod lgwr async valid_for=(online_logfiles,primary_role) db_

14、unique_name=prod*.log_archive_dest_state_1=enable*.log_archive_dest_state_2=enable*.log_archive_max_processes=10*.fal_server=prod*.fal_client=standby*.standby_file_management=auto保存退出創(chuàng)建一些目錄mkdir -p /u01/admin/standby/adumpmkdir -p /u01/admin/standby/bdumpmkdir -p /u01/admin/standby/cdumpmkdir -p /u0

15、1/admin/standby/udumpmkdir -p /u01/admin/standby/dpdumpls -l /u01/admin/standbymkdir -p /u01/oradata/standby/archivelogls -l /u01/oradata/standby配置standby庫(kù)的listener和靜態(tài)服務(wù)名netmgr再添加靜態(tài)服務(wù)名選擇save network configuration,保存一下關(guān)閉lsnrctl start配置連接到prod的網(wǎng)絡(luò)服務(wù)名netcatnsping prod用pfile啟動(dòng)到nomount狀態(tài)env | grep ORA登陸sq

16、lplus之前先檢查一下環(huán)境變量sqlplus / as sysdbacreate spfile from pfile=?/dbs/initstandby.ora;startup nomountstandby庫(kù)的配置告一段落,重新回到prod庫(kù)的配置配置prod數(shù)據(jù)庫(kù)再次回到prod庫(kù)的設(shè)置配置連接到standby的網(wǎng)絡(luò)服務(wù)名netca備庫(kù)的地址,備庫(kù)監(jiān)聽用的是1521端口tnsping standby配置prod庫(kù)參數(shù)sqlplus / as sysdbaalter system set log_archive_config=dg_config=(prod,standby);alter sy

17、stem set log_archive_dest_1=location=/u01/oradata/prod/archivelog valid_for=(all_logfiles,all_roles) db_unique_name=prod;alter system set log_archive_dest_2=service=standby lgwr async valid_for=(online_logfiles,primary_role) db_unique_name=standby;alter system set log_archive_dest_state_1=enable;alt

18、er system set log_archive_dest_state_2=enable;alter system set log_archive_max_processes=10;alter system set fal_server=standby;alter system set fal_client=prod;alter system set standby_file_management=auto;還有三需要重啟才生效的參數(shù)也設(shè)置一下alter system set db_unique_name=prodscope=spfile;alter system set db_file_n

19、ame_convert=/u01/oracle/standby,/u01/oracle/prod scope=spfile;alter system set log_file_name_convert=/u01/oracle/standby,/u01/oracle/prod scope=spfile;備份prod庫(kù)exitmkdir -p /u01/backupsetls -l /u01創(chuàng)建了備份目錄登陸到rman開始備份rman target /runallocate channel d1 type disk format /u01/backupset/%U;backup database;

20、release channel d1;把備份集目錄傳輸?shù)絪tandby的/u01目錄下exitscp -r /u01/backupset 192.168.75.62:/u01可以在standby上檢查一下ls -l /u01開始克隆standby庫(kù),在prod上運(yùn)行rman target / auxiliary sys/oraclestandbyrunallocate auxiliary channel d1 type disk;duplicate target database for standby nofilenamecheck;release channel d1;還原了standby

21、庫(kù)!配置standby數(shù)據(jù)庫(kù)查詢standby庫(kù)狀態(tài)select status from v$instance;現(xiàn)在數(shù)據(jù)庫(kù)為mount狀態(tài)創(chuàng)建備庫(kù)的standby日志alter database add standby logfile (/u01/oradata/standby/standby01.log) size 50m;alter database add standby logfile (/u01/oradata/standby/standby02.log) size 50m;alter database add standby logfile (/u01/oradata/standb

22、y/standby03.log) size 50m;alter database add standby logfile (/u01/oradata/standby/standby04.log) size 50m;日志大小和主庫(kù)的一樣都是50M,數(shù)量比主庫(kù)多一組在prod庫(kù)切換幾個(gè)日志exitsqlplus / as sysdbaalter system switch logfile;在standby庫(kù)查看一下是否有歸檔日志了exitls -l /u01/oradata/standby/archivelog日志可以傳輸了就ok!備庫(kù)執(zhí)行日志應(yīng)用同步語(yǔ)句,開始運(yùn)行物理DGsqlplus / as

23、 sysdbaalter database recover managed standby database using current logfile disconnect from session;因?yàn)橛袀渲刈鋈罩?,所以可以加using current logfile語(yǔ)句,實(shí)現(xiàn)實(shí)時(shí)應(yīng)用select sequence#, applied from v$archived_log where applied=YES order by sequence#;yes說明日志同步了在prod庫(kù)上執(zhí)行:conn scott/tigercreate table t(i int);insert into t

24、values(1);commit;conn / as sysdbaalter system switch logfile;在standby庫(kù)上執(zhí)行:alter database recover managed standby database cancel;alter database open;conn scott/tigerselect * from t;數(shù)據(jù)已經(jīng)同步,物理DG搭建成功!看一下數(shù)據(jù)庫(kù)的open狀態(tài)conn / as sysdbaselect open_mode from v$database;注意:物理備庫(kù)open是默認(rèn)read only模式的alter database

25、recover managed standby database using current logfile disconnect from session;select open_mode from v$database;啟動(dòng)數(shù)據(jù)同步語(yǔ)句后,數(shù)據(jù)庫(kù)又變?yōu)閙ounted狀態(tài)注意:在測(cè)試數(shù)據(jù)同步的時(shí)候請(qǐng)不要用sys用戶,不然可能同步不了,這里測(cè)試都是用scott用戶切換物理備庫(kù)在prod庫(kù)上執(zhí)行:select switchover_status from v$database;alter database commit to switchover to physical standby;這個(gè)命令

26、要執(zhí)行蠻長(zhǎng)時(shí)間,請(qǐng)耐心等待注意:上面switchover_status的值如果是TO STANDBY,可以直接switchover,如果是sessions active,則需要在switchover的命令后面加上with session shutdown,比如alter database commit to switchover to physical standby with session shutdown;select status from v$instance;檢查一下數(shù)據(jù)庫(kù)狀態(tài)shutdown immediatestartup nomountalter database mount

27、 standby database;這條命令就是把主庫(kù)切成備庫(kù)在standby庫(kù)上執(zhí)行:select sequence#, applied from v$archived_log where applied=YES order by sequence#;已經(jīng)和剛才的主庫(kù)同步完日志select switchover_status from v$database;alter database commit to switchover to primary;這條命令就是把備庫(kù)切成主庫(kù)select status from v$instance;查看一下數(shù)據(jù)庫(kù)狀態(tài)shutdown immediatest

28、artup在prod庫(kù)上執(zhí)行:創(chuàng)建備日志alter database add standby logfile (/u01/oradata/prod/standby01.log) size 50m;alter database add standby logfile (/u01/oradata/prod/standby02.log) size 50m;alter database add standby logfile (/u01/oradata/prod/standby03.log) size 50m;alter database add standby logfile (/u01/orada

29、ta/prod/standby04.log) size 50m;執(zhí)行同步語(yǔ)句alter database recover managed standby database using current logfile disconnect from session;select sequence#, applied from v$archived_log where applied=YESorder by sequence#;在standby庫(kù)上執(zhí)行:conn scott/tigerinsert into t values(2);commit;conn / as sysdbaalter syst

30、em switch logfile;在prod庫(kù)上執(zhí)行:alter database recover managed standby database cancel;alter database open;conn scott/tigerselect * from t;物理DG切換成功!conn / as sysdbaselect open_mode from v$database;alter database recover managed standby database using current logfile disconnect from session;select open_m

31、ode from v$database;恢復(fù)成同步模式再切換一次,切換來原來的狀態(tài),步驟是一樣的這里只是為了驗(yàn)證是否ok在standby庫(kù)上執(zhí)行:select switchover_status from v$database;alter database commit to switchover to physical standby;shutdown immediatestartup nomountalter database mount standby database;在prod庫(kù)上執(zhí)行:select sequence#, applied from v$archived_log whe

32、re applied=YES order by sequence#;select switchover_status from v$database;alter database commit to switchover to primary;select status from v$instance;查看一下數(shù)據(jù)庫(kù)狀態(tài)shutdown immediatestartup在standby庫(kù)上執(zhí)行:alter database recover managed standby database using current logfile disconnect from session;在prod庫(kù)上

33、執(zhí)行:conn scott/tigerinsert into t values(3);commit;conn / as sysdbaalter system switch logfile;在standby庫(kù)上執(zhí)行:alter database recover managed standby database cancel;alter database open;conn scott/tigerselect * from t;conn / as sysdbaalter database recover managed standby database using current logfile

34、disconnect from session;select open_mode from v$database;恢復(fù)到了原來的狀態(tài),即prod是主庫(kù),standby是備庫(kù)第三章 搭建邏輯備庫(kù)配置邏輯備庫(kù) 邏輯備庫(kù)是在物理備庫(kù)的基礎(chǔ)上配置的,所以要搭建邏輯備庫(kù)先要?jiǎng)?chuàng)建好物理備庫(kù)才行在standby庫(kù)上執(zhí)行:停止備庫(kù)的applyalter database recover managed standby database cancel;注意:一定要先停止日志應(yīng)用,不然下面build的時(shí)候會(huì)有問題在prod庫(kù)上執(zhí)行:創(chuàng)建prod庫(kù)作為邏輯備庫(kù)時(shí)的在線日志歸檔路徑exitmkdir -p /u01/

35、oradata/prod/lgarchivels -l /u01/oradata/prod修改log_archive_dest_3參數(shù),當(dāng)prod切換成備庫(kù)時(shí)起作用,即在線日志歸檔的路徑sqlplus / as sysdbaalter system set log_archive_dest_3=location=/u01/oradata/prod/lgarchive valid_for=(standby_logfiles,standby_role) db_unique_name=prod;alter system set log_archive_dest_state_3=enable; 然后執(zhí)

36、行execute dbms_logstdby.build;在standby庫(kù)上執(zhí)行:創(chuàng)建standby庫(kù)作為邏輯備庫(kù)時(shí)的在線日志歸檔路徑exitmkdir -p /u01/oradata/standby/lgarchivels -l /u01/oradata/standbysqlplus / as sysdbaalter system set log_archive_dest_3=location=/u01/oradata/standby/lgarchive valid_for=(standby_logfiles,standby_role) db_unique_name=standby;alt

37、er system set log_archive_dest_state_3=enable; 檢查standby庫(kù)的臨時(shí)表空間數(shù)據(jù)文件select * from v$tempfile;有臨時(shí)文件信息,如果沒有,要添加臨時(shí)文件alter tablespace temp add tempfile xxxxxx.select status from v$instance;查看一下數(shù)據(jù)庫(kù)角色select database_role from v$database;startup mount forcealter database recover to logical standby standby;把

38、備庫(kù)轉(zhuǎn)換成邏輯備庫(kù),后一個(gè)standby是備庫(kù)名select status from v$instance;startup mount forceselect database_role from v$database;alter database open resetlogs;show parameter db_name此時(shí)備庫(kù)的db_name已經(jīng)改成standby是一個(gè)新庫(kù)了稍等片刻后在prod庫(kù)上執(zhí)行:alter system switch logfile;查看prod庫(kù)的alert信息查看standby的alert信息在standby庫(kù)上執(zhí)行:查看歸檔日志是否傳輸?shù)絺鋷?kù)exitls -

39、l /u01/oradata/standby/archivelog啟用實(shí)時(shí)日志應(yīng)用sqlplus / as sysdbaalter database start logical standby apply immediate;此時(shí)standby庫(kù)的alert日志里會(huì)產(chǎn)生大量信息prod庫(kù)的alert日志信息:配置完成,開始驗(yàn)證在prod庫(kù)上執(zhí)行:conn scott/tigercreate table a(a varchar2(10);insert into a values(a);commit;在standby庫(kù)上執(zhí)行:conn scott/tigerselect * from a;邏輯備庫(kù)

40、配置成功!切換邏輯備庫(kù) 先把prod庫(kù)和standby庫(kù)的undo_retention參數(shù)都設(shè)置成3600conn / as sysdbaalter system set undo_retention=3600;開始切換邏輯備庫(kù)在prod庫(kù)上執(zhí)行:select switchover_status from v$database;alter database prepare to switchover to logical standby;select switchover_status from v$database;在standby庫(kù)上執(zhí)行:select switchover_status

41、from v$database;alter database prepare to switchover to primary;select switchover_status from v$database;在prod庫(kù)上執(zhí)行:這個(gè)時(shí)候觀察prod庫(kù)的switchover_status會(huì)發(fā)現(xiàn)select switchover_status from v$database;如果上述查詢的返回結(jié)果不是TO LOGICAL STANDBY 的話,你可能就需要取消此次轉(zhuǎn)換,檢查原因,然后再重新操作了取消轉(zhuǎn)換的命令為:alter database prepare to switchover cance

42、l;prod庫(kù)繼續(xù)執(zhí)行alter database commit to switchover to logical standby;在standby庫(kù)上執(zhí)行:再檢查standby庫(kù)的switchover_status會(huì)發(fā)現(xiàn)select switchover_status from v$database;alter database commit to switchover to primary;在prod庫(kù)上執(zhí)行:alter database start logical standby apply immediate;在standby庫(kù)上執(zhí)行:conn scott/tigerinsert in

43、to a values(b);commit;conn / as sysdba在prod庫(kù)上執(zhí)行:conn scott/tigerselect * from a;conn / as sysdba邏輯備庫(kù)切換成功!再切換回去在standby庫(kù)上執(zhí)行:select switchover_status from v$database;alter database prepare to switchover to logical standby;select switchover_status from v$database;在prod庫(kù)上執(zhí)行:select switchover_status from

44、 v$database;alter database prepare to switchover to primary;select switchover_status from v$database;在standby庫(kù)上執(zhí)行:select switchover_status from v$database;alter database commit to switchover to logical standby;select switchover_status from v$database;在prod庫(kù)上執(zhí)行:select switchover_status from v$databas

45、e;alter database commit to switchover to primary;select switchover_status from v$database;在standby庫(kù)上執(zhí)行:alter database start logical standby apply immediate;開始實(shí)時(shí)應(yīng)用日志在prod庫(kù)上執(zhí)行:conn scott/tigerinsert into a values(c);commit;conn / as sysdba在standby庫(kù)上執(zhí)行:conn scott/tigerselect * from a;conn / as sysdba恭喜

46、又一次轉(zhuǎn)換成功!如果數(shù)據(jù)沒有同步要稍等會(huì),大概在10秒鐘,起決于機(jī)器的性能第四章 使用邏輯備庫(kù)滾動(dòng)升級(jí)升級(jí)邏輯備庫(kù)到10204把10204和11201的數(shù)據(jù)庫(kù)軟件傳輸?shù)絪tandby的/u01目錄用root用戶執(zhí)行cd /u01ls -lrtchown oracle:oinstall *ls -lrtsu - oraclecd /u01ls -lrt解壓10204升級(jí)包軟件unzip p6810189_10204_Linux-x86-64.zipls -lrt刪除軟件壓縮包,節(jié)省空間rm -f p6810189_10204_Linux-x86-64.zip停止邏輯備庫(kù)同步sqlplus / a

47、s sysdbaalter database stop logical standby apply;修改一下數(shù)據(jù)庫(kù)的SGA大小為512M,不然可能在升級(jí)過程中一直會(huì)報(bào)4031錯(cuò)誤說內(nèi)存不夠,這個(gè)記錄報(bào)錯(cuò)信息的trc文件會(huì)把磁盤撐滿導(dǎo)致升級(jí)失敗alter system set sga_max_size=512M scope=spfile;alter system set sga_target=512M scope=spfile;關(guān)閉數(shù)據(jù)庫(kù)shutdown immediate升級(jí)數(shù)據(jù)庫(kù)軟件在standby庫(kù)上執(zhí)行exitcd /u01/Disk1./runInstaller另開一個(gè)會(huì)話把liste

48、ner關(guān)了su - oraclelsnrctl stop在root用戶下執(zhí)行刪除安裝軟件,節(jié)省空間cd .rm -fR Disk1rm -f README.htmlls -lrt開始升級(jí)數(shù)據(jù)庫(kù)sqlplus / as sysdbastartup upgrade?/rdbms/admin/catupgrd.sql這個(gè)步驟要持續(xù)很久,請(qǐng)耐心等待,此時(shí)可以另開一個(gè)會(huì)話查看歸檔日志信息,因?yàn)樯?jí)過程中會(huì)產(chǎn)生大量的日志,所以要定時(shí)刪除歸檔日志防止磁盤空間不夠cd /u01/oradata/standby/archivelogls -lrtrm -f *_768842401.dbfls -lrt上面這些是

49、prod傳送過來的歸檔日志也關(guān)注一下磁盤剩余空間df -h等到sqlplus顯示如下信息sqlplus / as sysdbaselect * from v$version;10204升級(jí)完畢!升級(jí)邏輯備庫(kù)到11201解壓11gr2軟件exitunzip linux.x64_11gR2_database_1of2.zipunzip linux.x64_11gR2_database_2of2.zip刪除軟件壓縮包節(jié)省空間rm -f linux.x64_11gR2_database_*ls -lrtrm -fR backupsetls -lrtdf -h配置11g的環(huán)境變量文件cdcp .bash

50、_profile .bash_profile11vi .bash_profile11把ORACLE_HOME改成db_2,還有下面3個(gè)參數(shù)都要$ORACLE_HOME寫在最前面,不然sqlplus無法登陸保存退出到root用戶下修改適合11g的內(nèi)核參數(shù)exitvi /etc/sysctl.confkernel.core_uses_pid = 1fs.aio-max-nr = 1048576fs.file-max = 6815744kernel.shmall = 2097152kernel.shmmax = 536870912kernel.shmmni = 4096kernel.sem = 25

51、0 32000 100 128net.ipv4.ip_local_port_range = 9000 65500net.core.rmem_default = 262144net.core.rmem_max = 4194304net.core.wmem_default = 262144net.core.wmem_max = 1048576保存退出sysctl -p讓它生效vi /etc/security/limits.conforacle soft stack 10240在最后添加這行參數(shù)保存退出su - oracle. .bash_profile11使用11g的環(huán)境變量,開始安裝11201軟

52、件cd /u01/database./runInstaller如果提示空間不夠就清除一點(diǎn)內(nèi)容騰出空間來內(nèi)存大小問題忽略它11201軟件安裝完畢刪除安裝軟件,節(jié)省空間cd .rm -fR databasels -lrtdf -h復(fù)制參數(shù)文件到11201的dbs下sqlplus / as sysdbacreate pfile from spfile=/u01/oracle/db_1/dbs/spfilestandby.ora;exitcd $ORACLE_HOME/dbsllvi initstandby.ora把上面幾個(gè)參數(shù)去掉,保存退出sqlplus / as sysdbacreate spfile from pfile;另開一個(gè)窗口,用10204軟件登陸sqlplussu - oracleenv | grep ORAsqlplus / as sysdbaselect status from v$instance;備庫(kù)還是在升級(jí)狀態(tài),給備庫(kù)打上升級(jí)到11gr2之前的補(bǔ)丁,這個(gè)是安裝好11201軟件之后才有的

溫馨提示

  • 1. 本站所有資源如無特殊說明,都需要本地電腦安裝OFFICE2007和PDF閱讀器。圖紙軟件為CAD,CAXA,PROE,UG,SolidWorks等.壓縮文件請(qǐng)下載最新的WinRAR軟件解壓。
  • 2. 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請(qǐng)聯(lián)系上傳者。文件的所有權(quán)益歸上傳用戶所有。
  • 3. 本站RAR壓縮包中若帶圖紙,網(wǎng)頁(yè)內(nèi)容里面會(huì)有圖紙預(yù)覽,若沒有圖紙預(yù)覽就沒有圖紙。
  • 4. 未經(jīng)權(quán)益所有人同意不得將文件中的內(nèi)容挪作商業(yè)或盈利用途。
  • 5. 人人文庫(kù)網(wǎng)僅提供信息存儲(chǔ)空間,僅對(duì)用戶上傳內(nèi)容的表現(xiàn)方式做保護(hù)處理,對(duì)用戶上傳分享的文檔內(nèi)容本身不做任何修改或編輯,并不能對(duì)任何下載內(nèi)容負(fù)責(zé)。
  • 6. 下載文件中如有侵權(quán)或不適當(dāng)內(nèi)容,請(qǐng)與我們聯(lián)系,我們立即糾正。
  • 7. 本站不保證下載資源的準(zhǔn)確性、安全性和完整性, 同時(shí)也不承擔(dān)用戶因使用這些下載資源對(duì)自己和他人造成任何形式的傷害或損失。

最新文檔

評(píng)論

0/150

提交評(píng)論