一、linux(以dell_rma為例)
1.oracle for linux setup
a.groupadd dba b.groupadd oper c.useradd -g dba -G oper oracle d.passwd oraclee.chown oracle:dba /u01
f.chown -R oracle:dba oracle
g./etc/passwd更改shell的配置(dell_rma使用bash)。
h.copy .profile/.bash_profile(dell_rma使用.bash_profile) 到/home/oracle下
i.copy oracle8161_tar.gz安裝文件到/u01下,使用tar -xvzf/-xvf解壓。
j.cd /u01/Oracle8iR2運行 sh runInstaller安裝oracle(參考oracle安裝)
2.建立standby database.
a.初始文件拷貝:先將正在使用的oracle的數據庫的oracle/dbs兩個文件initrma.ora, orapwrma拷貝到你要建立數據庫相同的文件夾下(dell_rma 是/u01/product/oracle/dbs)
b. 表空間拷貝在toad或者select file_name,tablespace_name from dba_data_files
察看表空間對應的數據文件。 在正式機toad下執行下列命令: Select ‘alter tablespace ‘||name||’ beging backup;’ from v$tablespace;在選出的行上右 鍵 save as 選擇Clipboard後,再打開一個editor,paste.
在正式DB上使用alter tablespace tools begin backup; 點擊Execute as script.
登錄到sty上用mget把/u01/product/oradaba把正式DB上的*.dbf、/data/SID/*.dbf archive文件 copy到sty對應目錄上。
ftp 拷貝tools.dbf到新建的數據庫的同樣的目錄下。
在正式DB上使用alter tablespace tools end backup;還原。
使用同樣的方法,拷貝出所有的表空間數據文件。c. 控制文件拷貝/product/oradata/orcl (dell_rma 是/u01/product/oradata/rma)
在正式DB上使用使用命令:alter database create standby controlfile as '/u01/standby.ctl' ;
Standby上執行:mv standby.ctl control01.ctl
cp control01.ctl control02.ctl cp control01.ctl control03.ctl 即拷貝standby.ctl文件到Stand By DB 控制文件目錄 ,並且複製三份 ,分別起名為control01.ctl, control02.ctl , control03.ctl
d.alter system switch logfile; 在正式DB上強行歸檔
e.product/oracle/network/admin的拷貝(listener.ora及tnsnames.ora)
f.startup nomount (在Stand By DB上)
alter database mount standby database recover standby database ; auto ;
来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/12137615/viewspace-605969/ ,如需转载,请注明出处,否则将追究法律责任。