版權(quán)說(shuō)明:本文檔由用戶(hù)提供并上傳,收益歸屬內(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)境來(lái)支持,因此搭建DG環(huán)境是學(xué)習(xí)DG的第一步。在搭建GC的文檔里,有介紹虛擬機(jī)模板的搭建,這里就直接用這個(gè)虛擬機(jī)模板來(lái)搭建DG,搭建之前先下載11201的數(shù)據(jù)庫(kù)軟件,為了后面的滾動(dòng)升級(jí)實(shí)驗(yàn)。下面就來(lái)介紹怎么搭建DG學(xué)習(xí)環(huán)境!有什么問(wèn)題的可以聯(lián)系我。作者:will QQ:185954265第一章 制作DG虛擬機(jī)模板下載11201數(shù)據(jù)庫(kù)軟件點(diǎn)擊接受,下載32bit或者64bit軟件本人下載的是64bit的軟件把兩個(gè)壓縮包都下載下來(lái)還原虛擬機(jī)模板把在搭建GC環(huán)境時(shí)的虛擬機(jī)模板還原出來(lái)改名為prod裝載虛擬機(jī)右鍵rename為prod啟動(dòng)虛擬機(jī)先登錄進(jìn)去cd /etc
2、/sysconfig/network-scriptslsvi ifcfg-eth0.bak把HWADDR刪除掉,然后改一下IPADDR保存退出mv ifcfg-eth0.bak ifcfg-eth0lsservice network restartifconfigexit用secureCRT創(chuàng)建新連接這個(gè)提示用同樣的方法解決設(shè)置好顏色字體,prod的會(huì)話(huà)連接創(chuàng)建完畢vi /etc/sysconfig/network把主機(jī)名改成prod.localdomain修改好之后保存退出hostname prod.localdomain退出后再登錄修改hostsvi /etc/hosts127.0.0.1
3、 localhost.localdomain localhost:1 localhost6.localdomain localhost6192.168.75.61 prod.localdomain prod192.168.75.62 standby.localdomain standby保存退出安裝oracle軟件先安裝10201的軟件來(lái)搭建DG后面有滾動(dòng)升級(jí)成11201的方法把10201的oracle軟件傳送到/u01目錄下傳輸好之后修改軟件屬于者為oraclecd /u01ls -lrtchown -R oracle:oinstall *ls -lrt設(shè)置oracle環(huán)境變量su - or
4、aclevi .bash_profile把下面內(nèi)容復(fù)制到.bash_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/
5、bin:/usr/X11R6/bin/export CLASSPATH=$ORACLE_HOME/JRE:$ORACLE_HOME/jlib:$ORACLE_HOME/rdbms/jlibexport DISPLAY=192.168.75.1:0.0stty erase halias sqlplus='rlwrap sqlplus'alias rman='rlwrap rman'保存后退出執(zhí)行. .bash_profile讓環(huán)境變量生效解壓縮oracle軟件cd /u01ls -lrtgzip -dc 10201_database_linux_x86_64.cp
6、io.gz | cpio -icvdBumls -lrtcd database在windows端打開(kāi)xmanager的passive來(lái)接收遠(yuǎn)程圖形雙擊它就可以了看到右下角有圖標(biāo)且是:0.0端口就行./runInstaller另開(kāi)一個(gè)窗口用root用戶(hù)執(zhí)行上面腳本10201軟件安裝完成!把安裝軟件刪除,節(jié)省空間cd .ls -lrtrm -f 10201_database_linux_x86_64.cpio.gzrm -fR databasels -lrtdf -h備份復(fù)制模板至此,完成了虛擬機(jī)模板的制作,可以把虛擬機(jī)目錄拷貝一份保存起來(lái)關(guān)機(jī),然后復(fù)制一份作為備庫(kù)使用第二章 搭建物理備庫(kù)配置st
7、andby服務(wù)器把復(fù)制好的虛擬機(jī)改名為standby裝載虛擬機(jī)右鍵rename為standby打開(kāi)虛擬機(jī)先登錄進(jìn)去cd /etc/sysconfig/network-scriptsls因?yàn)閜rod虛擬機(jī)沒(méi)開(kāi),所以IP地址沒(méi)有發(fā)生沖突,但是還是要改一下vi ifcfg-eth0改成192.168.75.62保存退出service network restartifconfigexit用secureCRT創(chuàng)建新連接這個(gè)提示用同樣的方法解決設(shè)置好顏色字體,standby的會(huì)話(huà)連接創(chuàng)建完畢vi /etc/sysconfig/network把主機(jī)名改成standby.localdomain修改好之后保存
8、退出hostname standby.localdomain退出后再登錄查看hostscat /etc/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)聽(tīng)su - oraclenetca這個(gè)就設(shè)置成默認(rèn)監(jiān)聽(tīng),用1521端口看一下信息用dbca命令創(chuàng)建prod數(shù)據(jù)庫(kù)要和.bash_profile里配置的ORACLE_SID參數(shù)一樣不安裝DB Control的em設(shè)置sy
9、s用戶(hù)的密碼不使用flash recovery area字符集選ZHS16GBK,當(dāng)然你選AL32UTF8也可以開(kāi)始創(chuàng)建數(shù)據(jù)庫(kù)解鎖幾個(gè)用戶(hù)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 da
10、tabase force logging;select log_mode,force_logging 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 spfil
11、e;alter database create standby controlfile as '/u01/oracle/standby.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需要輸入o
12、racle用戶(hù)密碼備控制文件只要復(fù)制到與prod庫(kù)的路徑相同就行,兩邊都是/u01/oracle/standby.ctlprod設(shè)置先告一段落設(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
13、39;*.db_file_name_convert='/u01/oradata/prod','/u01/oradata/standby'*.log_file_name_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=(a
14、ll_logfiles,all_roles) db_unique_name=standby'*.log_archive_dest_2='service=prod lgwr async valid_for=(online_logfiles,primary_role) db_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*.
15、standby_file_management=auto保存退出創(chuàng)建一些目錄mkdir -p /u01/admin/standby/adumpmkdir -p /u01/admin/standby/bdumpmkdir -p /u01/admin/standby/cdumpmkdir -p /u01/admin/standby/udumpmkdir -p /u01/admin/standby/dpdumpls -l /u01/admin/standbymkdir -p /u01/oradata/standby/archivelogls -l /u01/oradata/standby配置stan
16、dby庫(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登陸sqlplus之前先檢查一下環(huán)境變量sqlplus / as sysdbacreate spfile from pfile='?/dbs/initstandby.ora'startup nomountstandby庫(kù)的配置告一段落,重新回到prod庫(kù)的配置配置prod數(shù)據(jù)庫(kù)再次回到prod
17、庫(kù)的設(shè)置配置連接到standby的網(wǎng)絡(luò)服務(wù)名netca備庫(kù)的地址,備庫(kù)監(jiān)聽(tīng)用的是1521端口tnsping standby配置prod庫(kù)參數(shù)sqlplus / as sysdbaalter system set log_archive_config='dg_config=(prod,standby)'alter system set log_archive_dest_1='location=/u01/oradata/prod/archivelog valid_for=(all_logfiles,all_roles) db_unique_name=prod'alt
18、er 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;alter system set log_archive_dest_state_2=enable;alter system set log_archive_max_processes=10;alter system set fal_se
19、rver=standby;alter system set fal_client=prod;alter system set standby_file_management=auto;還有三需要重啟才生效的參數(shù)也設(shè)置一下alter system set db_unique_name='prod'scope=spfile;alter system set db_file_name_convert='/u01/oracle/standby','/u01/oracle/prod' scope=spfile;alter system set log_fi
20、le_name_convert='/u01/oracle/standby','/u01/oracle/prod' scope=spfile;備份prod庫(kù)exitmkdir -p /u01/backupsetls -l /u01創(chuàng)建了備份目錄登陸到rman開(kāi)始備份rman target /runallocate channel d1 type disk format '/u01/backupset/%U'backup database;release channel d1;把備份集目錄傳輸?shù)絪tandby的/u01目錄下exitscp -r /u
21、01/backupset 192.168.75.62:/u01可以在standby上檢查一下ls -l /u01開(kāi)始克隆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庫(kù)!配置standby數(shù)據(jù)庫(kù)查詢(xún)standby庫(kù)狀態(tài)select status from v$instance;
22、現(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/standby/standby03.log') size 50m;
23、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ǔ)句,開(kāi)始運(yùn)行物理DGsqlplus / as sysdbaalter dat
24、abase recover managed standby database using current logfile disconnect from session;因?yàn)橛袀渲刈鋈罩荆钥梢约觰sing current logfile語(yǔ)句,實(shí)現(xiàn)實(shí)時(shí)應(yīng)用select sequence#, applied from v$archived_log where applied='YES' order by sequence#;yes說(shuō)明日志同步了在prod庫(kù)上執(zhí)行:conn scott/tigercreate table t(i int);insert into t values
25、(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 recove
26、r 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用戶(hù),不然可能同步不了,這里測(cè)試都是用scott用戶(hù)切換物理備庫(kù)在prod庫(kù)上執(zhí)行:select switchover_status from v$database;alter database commit to switchover to physical standby;這個(gè)命令要執(zhí)行蠻長(zhǎng)時(shí)
27、間,請(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 stand
28、by 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 immedia
29、testartup在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 databa
30、se add standby logfile ('/u01/oradata/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='YES'order by sequence#;在standby庫(kù)上執(zhí)行:conn scott/tigerins
31、ert into t values(2);commit;conn / as sysdbaalter system 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
32、 current logfile disconnect from session;select open_mode from v$database;恢復(fù)成同步模式再切換一次,切換來(lái)原來(lái)的狀態(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
33、庫(kù)上執(zhí)行:select sequence#, applied from v$archived_log where 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 standb
34、y database using current logfile disconnect from session;在prod庫(kù)上執(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
35、database recover managed standby database using current logfile disconnect from session;select open_mode from v$database;恢復(fù)到了原來(lái)的狀態(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)用,不然下
36、面build的時(shí)候會(huì)有問(wèn)題在prod庫(kù)上執(zhí)行:創(chuàng)建prod庫(kù)作為邏輯備庫(kù)時(shí)的在線(xiàn)日志歸檔路徑exitmkdir -p /u01/oradata/prod/lgarchivels -l /u01/oradata/prod修改log_archive_dest_3參數(shù),當(dāng)prod切換成備庫(kù)時(shí)起作用,即在線(xiàn)日志歸檔的路徑sqlplus / as sysdbaalter system set log_archive_dest_3='location=/u01/oradata/prod/lgarchive valid_for=(standby_logfiles,standby_role) db_u
37、nique_name=prod'alter system set log_archive_dest_state_3=enable; 然后執(zhí)行execute dbms_logstdby.build;在standby庫(kù)上執(zhí)行:創(chuàng)建standby庫(kù)作為邏輯備庫(kù)時(shí)的在線(xiàn)日志歸檔路徑exitmkdir -p /u01/oradata/standby/lgarchivels -l /u01/oradata/standbysqlplus / as sysdbaalter system set log_archive_dest_3='location=/u01/oradata/standby/
38、lgarchive valid_for=(standby_logfiles,standby_role) db_unique_name=standby'alter system set log_archive_dest_state_3=enable; 檢查standby庫(kù)的臨時(shí)表空間數(shù)據(jù)文件select * from v$tempfile;有臨時(shí)文件信息,如果沒(méi)有,要添加臨時(shí)文件alter tablespace temp add tempfile xxxxxx.select status from v$instance;查看一下數(shù)據(jù)庫(kù)角色select database_role from
39、 v$database;startup mount forcealter database recover to logical standby standby;把備庫(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
40、 switch logfile;查看prod庫(kù)的alert信息查看standby的alert信息在standby庫(kù)上執(zhí)行:查看歸檔日志是否傳輸?shù)絺鋷?kù)exitls -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日志信息:配置完成,開(kāi)始驗(yàn)證在prod庫(kù)上執(zhí)行:conn scott/tigercreate table a(a varchar2(10
41、);insert into a values('a');commit;在standby庫(kù)上執(zhí)行:conn scott/tigerselect * from a;邏輯備庫(kù)配置成功!切換邏輯備庫(kù) 先把prod庫(kù)和standby庫(kù)的undo_retention參數(shù)都設(shè)置成3600conn / as sysdbaalter system set undo_retention=3600;開(kāi)始切換邏輯備庫(kù)在prod庫(kù)上執(zhí)行:select switchover_status from v$database;alter database prepare to switchover to log
42、ical standby;select switchover_status from v$database;在standby庫(kù)上執(zhí)行:select switchover_status 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;如果上述查詢(xún)的返回結(jié)果不是TO LOGI
43、CAL STANDBY 的話(huà),你可能就需要取消此次轉(zhuǎn)換,檢查原因,然后再重新操作了取消轉(zhuǎn)換的命令為:alter database prepare to switchover cancel;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í)行
44、:alter database start logical standby apply immediate;在standby庫(kù)上執(zhí)行:conn scott/tigerinsert into 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 switchov
45、er to logical standby;select switchover_status from v$database;在prod庫(kù)上執(zhí)行:select switchover_status from 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 logi
46、cal standby;select switchover_status from v$database;在prod庫(kù)上執(zhí)行:select switchover_status from v$database;alter database commit to switchover to primary;select switchover_status from v$database;在standby庫(kù)上執(zhí)行:alter database start logical standby apply immediate;開(kāi)始實(shí)時(shí)應(yīng)用日志在prod庫(kù)上執(zhí)行:conn scott/tigerinsert i
47、nto a values('c');commit;conn / as sysdba在standby庫(kù)上執(zhí)行:conn scott/tigerselect * from a;conn / as sysdba恭喜又一次轉(zhuǎn)換成功!如果數(shù)據(jù)沒(méi)有同步要稍等會(huì),大概在10秒鐘,起決于機(jī)器的性能第四章 使用邏輯備庫(kù)滾動(dòng)升級(jí)升級(jí)邏輯備庫(kù)到10204把10204和11201的數(shù)據(jù)庫(kù)軟件傳輸?shù)絪tandby的/u01目錄用root用戶(hù)執(zhí)行cd /u01ls -lrtchown oracle:oinstall *ls -lrtsu - oraclecd /u01ls -lrt解壓10204升級(jí)包軟件
48、unzip p6810189_10204_Linux-x86-64.zipls -lrt刪除軟件壓縮包,節(jié)省空間rm -f p6810189_10204_Linux-x86-64.zip停止邏輯備庫(kù)同步sqlplus / as sysdbaalter database stop logical standby apply;修改一下數(shù)據(jù)庫(kù)的SGA大小為512M,不然可能在升級(jí)過(guò)程中一直會(huì)報(bào)4031錯(cuò)誤說(shuō)內(nèi)存不夠,這個(gè)記錄報(bào)錯(cuò)信息的trc文件會(huì)把磁盤(pán)撐滿(mǎn)導(dǎo)致升級(jí)失敗alter system set sga_max_size=512M scope=spfile;alter system set sg
49、a_target=512M scope=spfile;關(guān)閉數(shù)據(jù)庫(kù)shutdown immediate升級(jí)數(shù)據(jù)庫(kù)軟件在standby庫(kù)上執(zhí)行exitcd /u01/Disk1./runInstaller另開(kāi)一個(gè)會(huì)話(huà)把listener關(guān)了su - oraclelsnrctl stop在root用戶(hù)下執(zhí)行刪除安裝軟件,節(jié)省空間cd .rm -fR Disk1rm -f README.htmlls -lrt開(kāi)始升級(jí)數(shù)據(jù)庫(kù)sqlplus / as sysdbastartup upgrade?/rdbms/admin/catupgrd.sql這個(gè)步驟要持續(xù)很久,請(qǐng)耐心等待,此時(shí)可以另開(kāi)一個(gè)會(huì)話(huà)查看歸檔日志
50、信息,因?yàn)樯?jí)過(guò)程中會(huì)產(chǎn)生大量的日志,所以要定時(shí)刪除歸檔日志防止磁盤(pán)空間不夠cd /u01/oradata/standby/archivelogls -lrtrm -f *_768842401.dbfls -lrt上面這些是prod傳送過(guò)來(lái)的歸檔日志也關(guān)注一下磁盤(pá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_datab
51、ase_2of2.zip刪除軟件壓縮包節(jié)省空間rm -f linux.x64_11gR2_database_*ls -lrtrm -fR backupsetls -lrtdf -h配置11g的環(huán)境變量文件cdcp .bash_profile .bash_profile11vi .bash_profile11把ORACLE_HOME改成db_2,還有下面3個(gè)參數(shù)都要$ORACLE_HOME寫(xiě)在最前面,不然sqlplus無(wú)法登陸保存退出到root用戶(hù)下修改適合11g的內(nèi)核參數(shù)exitvi /etc/sysctl.confkernel.core_uses_pid = 1fs.aio-max-nr =
52、 1048576fs.file-max = 6815744kernel.shmall = 2097152kernel.shmmax = 536870912kernel.shmmni = 4096kernel.sem = 250 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讓它生效v
53、i /etc/security/limits.conforacle soft stack 10240在最后添加這行參數(shù)保存退出su - oracle. .bash_profile11使用11g的環(huán)境變量,開(kāi)始安裝11201軟件cd /u01/database./runInstaller如果提示空間不夠就清除一點(diǎn)內(nèi)容騰出空間來(lái)內(nèi)存大小問(wèn)題忽略它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;另開(kāi)一個(gè)窗口,用10204軟件登陸sqlplussu - oracleenv | grep ORAsqlplus / as sysdbaselect status from v$insta
溫馨提示
- 1. 本站所有資源如無(wú)特殊說(shuō)明,都需要本地電腦安裝OFFICE2007和PDF閱讀器。圖紙軟件為CAD,CAXA,PROE,UG,SolidWorks等.壓縮文件請(qǐng)下載最新的WinRAR軟件解壓。
- 2. 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請(qǐng)聯(lián)系上傳者。文件的所有權(quán)益歸上傳用戶(hù)所有。
- 3. 本站RAR壓縮包中若帶圖紙,網(wǎng)頁(yè)內(nèi)容里面會(huì)有圖紙預(yù)覽,若沒(méi)有圖紙預(yù)覽就沒(méi)有圖紙。
- 4. 未經(jīng)權(quán)益所有人同意不得將文件中的內(nèi)容挪作商業(yè)或盈利用途。
- 5. 人人文庫(kù)網(wǎng)僅提供信息存儲(chǔ)空間,僅對(duì)用戶(hù)上傳內(nèi)容的表現(xiàn)方式做保護(hù)處理,對(duì)用戶(hù)上傳分享的文檔內(nèi)容本身不做任何修改或編輯,并不能對(duì)任何下載內(nèi)容負(fù)責(zé)。
- 6. 下載文件中如有侵權(quán)或不適當(dāng)內(nèi)容,請(qǐng)與我們聯(lián)系,我們立即糾正。
- 7. 本站不保證下載資源的準(zhǔn)確性、安全性和完整性, 同時(shí)也不承擔(dān)用戶(hù)因使用這些下載資源對(duì)自己和他人造成任何形式的傷害或損失。
最新文檔
- 合模機(jī)項(xiàng)目安全風(fēng)險(xiǎn)評(píng)價(jià)報(bào)告
- 無(wú)源液封水表行業(yè)行業(yè)發(fā)展趨勢(shì)及投資戰(zhàn)略研究分析報(bào)告
- 大學(xué)護(hù)理畢業(yè)生自我鑒定5篇
- 關(guān)于幼師自我鑒定模板錦集9篇
- 私人借款協(xié)議書(shū)
- 綜合執(zhí)法網(wǎng)絡(luò)課程設(shè)計(jì)
- 測(cè)量專(zhuān)業(yè)實(shí)習(xí)報(bào)告范文七篇
- 艱苦的軍訓(xùn)心得體會(huì)600字
- 旅游管理實(shí)習(xí)心得體會(huì)8篇
- 文員類(lèi)實(shí)習(xí)報(bào)告模板集合六篇
- 花藝師年度工作總結(jié)
- 新目標(biāo)漢語(yǔ)口語(yǔ)課本2課件-第2單元
- 二手車(chē)買(mǎi)賣(mài)合同(標(biāo)準(zhǔn)版范本)
- 新產(chǎn)品的試制與導(dǎo)入
- 聚酰胺酰亞胺實(shí)驗(yàn)報(bào)告
- 污水處理廠污泥處理處置投標(biāo)方案
- 智能包裝設(shè)計(jì)智慧樹(shù)知到課后章節(jié)答案2023年下湖南工業(yè)大學(xué)
- 抖音快手短視頻創(chuàng)業(yè)項(xiàng)目融資商業(yè)計(jì)劃書(shū)模板(完整版)
- 上海市交大二附中2024屆數(shù)學(xué)七年級(jí)第一學(xué)期期末質(zhì)量跟蹤監(jiān)視模擬試題含解析
- 豐田工作方法精髓-問(wèn)題解決法(八步法)課件
- 自考《獸醫(yī)法規(guī)》考前精練題庫(kù)(300題)
評(píng)論
0/150
提交評(píng)論