【INSTALL】在11gR2資料庫環境下同時部署10gR2資料庫實踐(OEL環境)
在捉襟見肘的硬體環境下,可以考慮透過在同一臺物理伺服器上部署多版本資料庫軟體的方法來達到多套資料庫環境的模擬。現將在OEL5.5(Oracle Enterprise Linux 5.5)環境下詳細部署實踐過程整理如下。
1.確認作業系統及當前資料庫版本
1)確認作業系統版本
ora11g@secdb /home/oracle$ cat /etc/redhat-release
Red Hat Enterprise Linux Server release 5.5 (Tikanga)
ora11g@secdb /home/oracle$ uname -a
Linux secdb 2.6.18-194.el5 #1 SMP Mon Mar 29 20:06:41 EDT 2010 i686 i686 i386 GNU/Linux
這是一套32位的OEL5.5(Oracle Enterprise Linux 5.5)的作業系統。
2)確認資料庫版本
ora11g@secdb /home/oracle$ ps -ef | grep smon | grep -v grep
oracle 8468 1 0 21:30 ? 00:00:00 ora_smon_ora11g
sys@ora11g> select * from v$version;
BANNER
--------------------------------------------------------------------------------
Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - Production
PL/SQL Release 11.2.0.1.0 - Production
CORE 11.2.0.1.0 Production
TNS for Linux: Version 11.2.0.1.0 - Production
NLSRTL Version 11.2.0.1.0 - Production
伺服器上僅部署了一套資料庫例項,版本是Oracle 11.2.0.1.0。
2.上傳對應的Oracle安裝介質
1)從本地將對應的安裝介質上傳到伺服器上
$ scp 10201_database_linux32.zip oracle@172.17.192.183:/software/ora10g
The authenticity of host '172.17.192.183 (172.17.192.183)' can't be established.
RSA key fingerprint is d8:42:21:d3:4c:9d:f2:e3:f1:1d:45:1f:71:5f:ca:5c.
Are you sure you want to continue connecting (yes/no)? yes
Warning: Permanently added '172.17.192.183' (RSA) to the list of known hosts.
oracle@172.17.192.183's password:
10201_database_linux32.zip 100% 638MB 11.4MB/s 00:56
2)在伺服器端解壓安裝介質
ora11g@secdb /software/ora10g$ chmod 777 10201_database_linux32.zip
ora11g@secdb /software/ora10g$ unzip 10201_database_linux32.zip
…… 這裡省略解壓過程……
解壓之後會生成對應的database目錄,這個目錄中便存放著Oracle 10.2.0.1的資料庫安裝介質。
ora11g@secdb /software/ora10g$ ls -tlr
total 639M
drwxr-xr-x 6 oracle oinstall 4.0K Oct 21 2008 database/
-rwxrwxrwx 1 oracle oinstall 638M Jan 19 21:13 10201_database_linux32.zip*
3.停止伺服器上監聽和資料庫例項
1)停止監聽程式
ora11g@secdb /home/oracle$ lsnrctl stop
LSNRCTL for Linux: Version 11.2.0.1.0 - Production on 19-JAN-2011 21:25:16
Copyright (c) 1991, 2009, Oracle. All rights reserved.
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=IPC)(KEY=EXTPROC1521)))
The command completed successfully
2)停止資料庫例項
ora11g@secdb /home/oracle$ sqlplus / as sysdba
SQL*Plus: Release 11.2.0.1.0 Production on Wed Jan 19 21:25:59 2011
Copyright (c) 1982, 2009, Oracle. All rights reserved.
Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
sys@ora11g> shutdown immediate;
Database closed.
Database dismounted.
ORACLE instance shut down.
4.調整資料庫伺服器的環境變數
由於不同版本的資料庫軟體必須部署在不同的目錄下,因此在安裝10g版本資料庫軟體之前需要先調整一下系統的環境變數。
需要調整的環境變數是:必須調整的環境變數是ORACLE_HOME和ORACLE_SID,其他環境變數可以視情況進行調整。
透過修改.bash_profile檔案可以達到調整環境變數的目的。
看一下這個調整過程。
1)現有.bash_profile檔案的內容如下
ora11g@secdb /home/oracle$ cat ~/.bash_profile
# .bash_profile
# Get the aliases and functions
if [ -f ~/.bashrc ]; then
. ~/.bashrc
fi
# User specific environment and startup programs
PATH=$PATH:$HOME/bin
export PATH
export TMP=/tmp
export TMPDIR=$TMP
export ORACLE_BASE=/oracle/ora11gR2
export ORACLE_HOME=$ORACLE_BASE/product/11.2.0/dbhome_1
export ORACLE_SID=ora11g
export ORACLE_TERM=xterm
export PATH=/usr/sbin:$PATH
export PATH=$ORACLE_HOME/bin:$PATH
export LD_LIBRARY_PATH=$ORACLE_HOME/lib:/lib64:/usr/lib64:/usr/local/lib64:/usr/X11R6/lib64/
export CLASSPATH=$ORACLE_HOME/JRE:$ORACLE_HOME/jlib:$ORACLE_HOME/rdbms/jlib
export LD_ASSUME_KERNEL=2.6.18
umask 022
if [ $USER = "oracle" ]; then
if [ $SHELL = "/bin/ksh" ]; then
ulimit -p 16384
ulimit -n 65536
else
ulimit -u 16384 -n 65536
fi
fi
2)環境變數調整
由於原有11g環境的ORACLE_BASE指向了“/oracle/ora11gR2”路徑,為防止混淆,這裡我重新指定了ORACLE_BASE環境變數。(ORACLE_BASE環境變數亦可不用調整)
(1)建立ORACLE_BASE對應的目錄
ora11g@secdb /oracle$ mkdir -p /oracle/ora10gR2
ora11g@secdb /oracle$ mkdir -p /oracle/ora10gR2/oradata
(2)調整的環境變數如下
export ORACLE_BASE=/oracle/ora10gR2
export ORACLE_HOME=$ORACLE_BASE/product/10.2.0/db_1
export ORACLE_SID=ora10g
(3)調整完環境變數後使其生效
ora11g@secdb /home/oracle$ vi ~/.bash_profile
ora11g@secdb /home/oracle$ . ~/.bash_profile
(4)再次確認環境變數是否調整正確
ora10g@secdb /home/oracle$ echo $ORACLE_BASE;echo $ORACLE_HOME;echo $ORACLE_SID
/oracle/ora10gR2
/oracle/ora10gR2/product/10.2.0/db_1
ora10g
5.部署Oracle 10gR2軟體
1)使用VNC遠端連線到資料庫伺服器
2)開啟Terminal,重新初始化環境變數,進入到安裝介質目錄
確保所需要的系統rpm包都安裝完畢。
ora11g@secdb /home/oracle$ . ~/.bash_profile
ora10g@secdb /home/oracle$ cd /software/ora10g/database/
ora10g@secdb /software/ora10g/database$ chmod -R 777 *
ora10g@secdb /software/ora10g/database$ .runInstaller -ignoreSysPrereqs
後續的圖形化安裝過程這裡不贅述。相信大家都輕車熟路。
注意在安裝過程中,有一個步驟提示需要注意:“Upgrade an Existing Database”,這裡需要選擇預設的“No”,因為我們的目標是安裝新的資料庫,不是升級。再者,原有的資料庫是11g,現在安裝的是10g,也無法進行更新。
6.使用dbca工具建立資料庫例項
資料庫建立過程不贅述。
注意一下例項名字為ora10g即可。
當dbca資料庫例項建立完成之後,整個環境部署便完成了。
此時,該伺服器上同時並存了兩個版本的資料庫軟體和資料庫例項。
調整環境變數,啟動原有Oracle 11g版本的例項後,可見該環境下並存了兩個版本的資料庫例項。
ora10g@secdb /home/oracle$ ps -ef | grep smon | grep -v grep
oracle 8468 1 0 21:30 ? 00:00:00 ora_smon_ora11g
oracle 14100 1 0 22:45 ? 00:00:00 ora_smon_ora10g
注意,這裡顯示的“ora11g”和“ora10g”不僅僅是例項名稱的區別,而是在兩套資料庫版本環境下的獨立資料庫例項。
7.小結
經實踐證明,在Linux環境下同一伺服器完成多版本Oracle軟體安裝是可行的,同時表明在Linux環境下多個資料庫版本部署的先後順序上沒有必須從低版本到高版本部署的限制(從資料庫安裝原理角度上來看這點很容易明白)。如果需要的話,還可以使用這種方法在此伺服器下另外部署一套Oracle 9i的資料庫環境。
最後需要提請注意的是:由於在Oracle不同版本軟體安裝時所需的作業系統安裝包有所不同,在安裝過程中請確保所需的系統包都安裝妥當。
Good luck.
secooler
11.01.19
-- The End --
1.確認作業系統及當前資料庫版本
1)確認作業系統版本
ora11g@secdb /home/oracle$ cat /etc/redhat-release
Red Hat Enterprise Linux Server release 5.5 (Tikanga)
ora11g@secdb /home/oracle$ uname -a
Linux secdb 2.6.18-194.el5 #1 SMP Mon Mar 29 20:06:41 EDT 2010 i686 i686 i386 GNU/Linux
這是一套32位的OEL5.5(Oracle Enterprise Linux 5.5)的作業系統。
2)確認資料庫版本
ora11g@secdb /home/oracle$ ps -ef | grep smon | grep -v grep
oracle 8468 1 0 21:30 ? 00:00:00 ora_smon_ora11g
sys@ora11g> select * from v$version;
BANNER
--------------------------------------------------------------------------------
Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - Production
PL/SQL Release 11.2.0.1.0 - Production
CORE 11.2.0.1.0 Production
TNS for Linux: Version 11.2.0.1.0 - Production
NLSRTL Version 11.2.0.1.0 - Production
伺服器上僅部署了一套資料庫例項,版本是Oracle 11.2.0.1.0。
2.上傳對應的Oracle安裝介質
1)從本地將對應的安裝介質上傳到伺服器上
$ scp 10201_database_linux32.zip oracle@172.17.192.183:/software/ora10g
The authenticity of host '172.17.192.183 (172.17.192.183)' can't be established.
RSA key fingerprint is d8:42:21:d3:4c:9d:f2:e3:f1:1d:45:1f:71:5f:ca:5c.
Are you sure you want to continue connecting (yes/no)? yes
Warning: Permanently added '172.17.192.183' (RSA) to the list of known hosts.
oracle@172.17.192.183's password:
10201_database_linux32.zip 100% 638MB 11.4MB/s 00:56
2)在伺服器端解壓安裝介質
ora11g@secdb /software/ora10g$ chmod 777 10201_database_linux32.zip
ora11g@secdb /software/ora10g$ unzip 10201_database_linux32.zip
…… 這裡省略解壓過程……
解壓之後會生成對應的database目錄,這個目錄中便存放著Oracle 10.2.0.1的資料庫安裝介質。
ora11g@secdb /software/ora10g$ ls -tlr
total 639M
drwxr-xr-x 6 oracle oinstall 4.0K Oct 21 2008 database/
-rwxrwxrwx 1 oracle oinstall 638M Jan 19 21:13 10201_database_linux32.zip*
3.停止伺服器上監聽和資料庫例項
1)停止監聽程式
ora11g@secdb /home/oracle$ lsnrctl stop
LSNRCTL for Linux: Version 11.2.0.1.0 - Production on 19-JAN-2011 21:25:16
Copyright (c) 1991, 2009, Oracle. All rights reserved.
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=IPC)(KEY=EXTPROC1521)))
The command completed successfully
2)停止資料庫例項
ora11g@secdb /home/oracle$ sqlplus / as sysdba
SQL*Plus: Release 11.2.0.1.0 Production on Wed Jan 19 21:25:59 2011
Copyright (c) 1982, 2009, Oracle. All rights reserved.
Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
sys@ora11g> shutdown immediate;
Database closed.
Database dismounted.
ORACLE instance shut down.
4.調整資料庫伺服器的環境變數
由於不同版本的資料庫軟體必須部署在不同的目錄下,因此在安裝10g版本資料庫軟體之前需要先調整一下系統的環境變數。
需要調整的環境變數是:必須調整的環境變數是ORACLE_HOME和ORACLE_SID,其他環境變數可以視情況進行調整。
透過修改.bash_profile檔案可以達到調整環境變數的目的。
看一下這個調整過程。
1)現有.bash_profile檔案的內容如下
ora11g@secdb /home/oracle$ cat ~/.bash_profile
# .bash_profile
# Get the aliases and functions
if [ -f ~/.bashrc ]; then
. ~/.bashrc
fi
# User specific environment and startup programs
PATH=$PATH:$HOME/bin
export PATH
export TMP=/tmp
export TMPDIR=$TMP
export ORACLE_BASE=/oracle/ora11gR2
export ORACLE_HOME=$ORACLE_BASE/product/11.2.0/dbhome_1
export ORACLE_SID=ora11g
export ORACLE_TERM=xterm
export PATH=/usr/sbin:$PATH
export PATH=$ORACLE_HOME/bin:$PATH
export LD_LIBRARY_PATH=$ORACLE_HOME/lib:/lib64:/usr/lib64:/usr/local/lib64:/usr/X11R6/lib64/
export CLASSPATH=$ORACLE_HOME/JRE:$ORACLE_HOME/jlib:$ORACLE_HOME/rdbms/jlib
export LD_ASSUME_KERNEL=2.6.18
umask 022
if [ $USER = "oracle" ]; then
if [ $SHELL = "/bin/ksh" ]; then
ulimit -p 16384
ulimit -n 65536
else
ulimit -u 16384 -n 65536
fi
fi
2)環境變數調整
由於原有11g環境的ORACLE_BASE指向了“/oracle/ora11gR2”路徑,為防止混淆,這裡我重新指定了ORACLE_BASE環境變數。(ORACLE_BASE環境變數亦可不用調整)
(1)建立ORACLE_BASE對應的目錄
ora11g@secdb /oracle$ mkdir -p /oracle/ora10gR2
ora11g@secdb /oracle$ mkdir -p /oracle/ora10gR2/oradata
(2)調整的環境變數如下
export ORACLE_BASE=/oracle/ora10gR2
export ORACLE_HOME=$ORACLE_BASE/product/10.2.0/db_1
export ORACLE_SID=ora10g
(3)調整完環境變數後使其生效
ora11g@secdb /home/oracle$ vi ~/.bash_profile
ora11g@secdb /home/oracle$ . ~/.bash_profile
(4)再次確認環境變數是否調整正確
ora10g@secdb /home/oracle$ echo $ORACLE_BASE;echo $ORACLE_HOME;echo $ORACLE_SID
/oracle/ora10gR2
/oracle/ora10gR2/product/10.2.0/db_1
ora10g
5.部署Oracle 10gR2軟體
1)使用VNC遠端連線到資料庫伺服器
2)開啟Terminal,重新初始化環境變數,進入到安裝介質目錄
確保所需要的系統rpm包都安裝完畢。
ora11g@secdb /home/oracle$ . ~/.bash_profile
ora10g@secdb /home/oracle$ cd /software/ora10g/database/
ora10g@secdb /software/ora10g/database$ chmod -R 777 *
ora10g@secdb /software/ora10g/database$ .runInstaller -ignoreSysPrereqs
後續的圖形化安裝過程這裡不贅述。相信大家都輕車熟路。
注意在安裝過程中,有一個步驟提示需要注意:“Upgrade an Existing Database”,這裡需要選擇預設的“No”,因為我們的目標是安裝新的資料庫,不是升級。再者,原有的資料庫是11g,現在安裝的是10g,也無法進行更新。
6.使用dbca工具建立資料庫例項
資料庫建立過程不贅述。
注意一下例項名字為ora10g即可。
當dbca資料庫例項建立完成之後,整個環境部署便完成了。
此時,該伺服器上同時並存了兩個版本的資料庫軟體和資料庫例項。
調整環境變數,啟動原有Oracle 11g版本的例項後,可見該環境下並存了兩個版本的資料庫例項。
ora10g@secdb /home/oracle$ ps -ef | grep smon | grep -v grep
oracle 8468 1 0 21:30 ? 00:00:00 ora_smon_ora11g
oracle 14100 1 0 22:45 ? 00:00:00 ora_smon_ora10g
注意,這裡顯示的“ora11g”和“ora10g”不僅僅是例項名稱的區別,而是在兩套資料庫版本環境下的獨立資料庫例項。
7.小結
經實踐證明,在Linux環境下同一伺服器完成多版本Oracle軟體安裝是可行的,同時表明在Linux環境下多個資料庫版本部署的先後順序上沒有必須從低版本到高版本部署的限制(從資料庫安裝原理角度上來看這點很容易明白)。如果需要的話,還可以使用這種方法在此伺服器下另外部署一套Oracle 9i的資料庫環境。
最後需要提請注意的是:由於在Oracle不同版本軟體安裝時所需的作業系統安裝包有所不同,在安裝過程中請確保所需的系統包都安裝妥當。
Good luck.
secooler
11.01.19
-- The End --
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/519536/viewspace-684339/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- Docker環境Oracle資料庫搭建DockerOracle資料庫
- uat環境停不了資料庫資料庫
- Mysql5.7在CentOs環境下定時備份資料庫MySqlCentOS資料庫
- rac環境下standby資料庫的實現資料庫
- 在Linux環境下安裝Progres資料庫Linux資料庫
- RAC環境中的資料庫部署技術——RAC部署和效能資料庫
- python環境連結Oracle資料庫PythonOracle資料庫
- 教小白搭建sybase資料庫環境資料庫
- Mac環境下安裝MongoDB資料庫MacMongoDB資料庫
- centos環境下如何匯出資料庫CentOS資料庫
- SequoiaDB資料庫之環境介紹資料庫
- ORACLE RAC資料庫配置Dataguard環境(3)Oracle資料庫
- ORACLE RAC資料庫配置Dataguard環境(2)Oracle資料庫
- ORACLE RAC資料庫配置Dataguard環境(1)Oracle資料庫
- Win環境至Linux環境Oracle資料庫遷移全過程LinuxOracle資料庫
- MySQL資料庫生產環境安全規範MySql資料庫
- 資料庫名,資料庫例項名,資料庫域名,作業系統環境變數資料庫作業系統變數
- 資料庫環境中的shell指令碼應用資料庫指令碼
- 成功恢復無備份RAC環境資料庫資料庫
- 生產環境資料庫恢復一例資料庫
- RAC環境只啟動單例項資料庫單例資料庫
- RAC環境的STANDBY資料庫備份報錯資料庫
- linux系統資料庫開發環境搭建Linux資料庫開發環境
- 神通資料庫測試環境調優過程資料庫
- 【資料庫資料恢復】LINUX環境下ORACLE資料庫誤刪除的資料恢復資料庫資料恢復LinuxOracle
- rman 可否克隆rac資料庫到另外一個rac環境的資料庫中?資料庫
- 使用RMAN進行同名資料庫異地環境搭建實驗資料庫
- Nutanix支援超融合環境中部署大資料大資料
- 使用Ambari快速部署Hadoop大資料環境Hadoop大資料
- Oracle資料庫9i在AIX環境下的效能調整Oracle資料庫AI
- 資料庫應有與之匹配的基礎環境資料庫
- openGauss資料庫JDBC環境連線配置(Eclipse)資料庫JDBCEclipse
- oracle 資料庫搭建高可用環境 容災參考。Oracle資料庫
- 【ARCHIVE】單機環境修改資料庫為歸檔模式Hive資料庫模式
- RAC環境利用備份恢復RAC資料庫(五)資料庫
- RAC環境利用備份恢復RAC資料庫(四)資料庫
- RAC環境利用備份恢復RAC資料庫(三)資料庫
- RAC環境利用備份恢復RAC資料庫(二)資料庫