單機上快速搭建乙個Data Guard環境

2021-08-30 11:54:16 字數 3063 閱讀 9808

保證主庫test在database logging,archive狀態下,並能正常執行狀態。

一.修改$oracle_home/dbs/inittest.ora

*.db_name='test'

*.db_unique_name='test'

*.local_listener='(address=(protocol=tcp)(host=blliu)(port=1521))'

*.log_archive_dest_state_1=enable

*.log_archive_format='%t_%s_%r.arc'

*.streams_pool_size=12582912

*.undo_management='auto'

*.undo_tablespace='undotbs1'

*.log_archive_config='dg_config=(test,test222)'

*.log_archive_dest_2='service=test222 lgwr async valid_for=(online_logfiles,primary_roles) db_unique_name=test222'

*.log_archive_dest_state_2=enable

*.compatible=10.2.0.4.0

fal_server='test'

fal_client='test222'

standby_file_management=auto

二.修改$oracle_home/dbs/inittest222.ora

三.建立相應目錄:

四.建立密碼檔案:

orapwd file=$oracle_home/dbs/orapwtest password=oracle entries=5

orapwd file=$oracle_home/dbs/orapwtest222 password=oracle entries=5

五.修改$oracle_home/network/admin/listener.ora

完成後重啟監聽!

六.修改$oracle_home/network/admin/tnsnames.ora

test222 =

(description =

(address_list =

(address = (protocol = tcp)(host = 127.0.0.1)(port = 1521))

)(connect_data =

(service_name = test222)))

test =

(description =

(address_list =

(address = (protocol = tcp)(host = 127.0.0.1)(port = 1521))

)(connect_data =

(service_name = test)))

七.啟動standby到nomount模式:

[oracle@blliu admin]$ export oracle_sid=test222

[oracle@blliu admin]$ sqlplus / as sysdba

sql*plus: release 10.2.0.4.0 - production on thu jan 28 23:28:29 2010

oracle

connected to an idle instance.

sql> startup nomount

oracle instance started.

total system global area  171966464 bytes

fixed size                  2082496 bytes

variable size             125831488 bytes

database buffers           37748736 bytes

redo buffers                6303744 bytes

八.利用rman工具中的duplicate進行standby控制檔案、資料檔案的建立:

[oracle@blliu dbs]$ echo $oracle_sid

test

[oracle@blliu dbs]$ rman target / auxiliary

sys/oracle@test222

recovery manager: release 10.2.0.4.0 - production on thu jan 28 23:31:38 2010

connected to target database: test (dbid=2003741378)

connected to auxiliary database: test (not mounted)

rman> backup database include current controlfile for standby;

rman> duplicate target database for standby;

九.啟動standby到管理

模式(第八步完成後,standby已經是mount狀態):

[oracle@blliu dbs]$ export oracle_sid=test222

[oracle@blliu dbs]$ sqlplus / as sysdba

sql> alter database recover managed standby database disconnect from session;

database altered.

十.重啟主資料庫

:[oracle@blliu dbs]$ export oracle_sid=test

[oracle@blliu dbs]$ sqlplus / as sysdba

sql> shutdown immediate

sql> startup

如果有以下文字表示standby建立成功,並開始正常執行了:

至此,單機

上乙個最簡單的data guard環境搭建

完畢。

單機上快速搭建乙個Data Guard環境

保證主庫test在database logging,archive狀態下,並能正常執行狀態。一.修改 oracle home dbs inittest.ora db name test db unique name test local listener address protocol tcp h...

單機上快速搭建乙個Data Guard環境

保證主庫test在database logging,archive狀態下,並能正常執行狀態。一.修改 二.修改 三.建立相應目錄 四.建立密碼檔案 orapwd file oracle home dbs orapwtest password oracle entries 5 orapwd file ...

nodejs express 快速搭建乙個專案過程

每次新搭建乙個專案總是忘記以往的步驟,查閱網上資料又跟自己的步驟不太像,所以記錄一下 1.安裝nodejs 4.4.7及其以上 yarn 有要求 2.window下安裝yarn npm install g yarn 3.安裝express生成器 npm install express generat...