Escolar Documentos
Profissional Documentos
Cultura Documentos
============================
primary side
------------
sql>shut immediate;
sql>exit
go to prd directory
]$cd /home/prd
prd]$ls
prd]$mkdir dg
prd]$cd dg
dg]$ls
everything fine
go to dbs direcory
dbs]$vi initprd.ora
-------------------------------------------------
inactive log_archive_dest=/home/prd/arch
i.e #log_archive_dest=/home/prd/arch
log_archive_dest_1='location=/home/prd/arch'
log_archive_dest_2='service=to_standby'
standby_file_management=auto
:wq
------------------------------------------------------
dbs]$orapwd file=orapwprd password=sys
Take backup of parameter file and the password file
dbs]$cp initprd.ora orapwprd /home/prd/dg/
go to dg directory and check it whether the paramter file and
password file is exist or not
]$cd /home/prd/dg
dg]$ls
initprd.ora orapwprd and .dbf and .log files exist
dg]$cd
sql>startup mount;
database altered
dg]$cd
]$ pwd
/home
In standby database /home folder
create prd folder
and transfer all files into /home/prd folder
dg]$scp * 192.168.100.2:/home/prd
-----------------------------------------------------
note:
if any error comes check network
]$vi /home/.ssh/known_hosts
------------------------------------------
here we have to keep target hostname
-------------------------------------------
-------------------------------------------------------
enter password: oracle (os password)
dg]$
dbs]$ls
nothing
control_files=/home/prd/stdcont.ctl
user_dump_dest=/home/prd/udump
core_dump_dest=/home/prd/cdump
background_dump_dest=/home/prd/bdump
#comment the below lines bcz we will get from primary database server
#log_archive_dest=/home/prd/arch
#log_archive_dest_1='location=/home/prd/arch'
#log_archive_dest_2='service=to_standby'
#standby_file_management=auto
standby_archive_dest=/home/prd/arch
----------------------------------------------------
go to prd directory
prd]$cd
]$cd $ORACLE_HOME/network/admin
admin]$netca
listenername is LISTENER
PORT: 1521 all default
admin]$vi listener.ora
-------------------------------------------------------------
SID_LIST_LISTENER =
(SID_LIST =
(SID_DESC =
(SID_NAME = prd
(ORACLE_HOME = /home/oracle/product/10.2.0/db_1)
)
)
LISTENER =
(DESCRIPTION_LIST =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP) (HOST = 192.168.100.2)(PORT=1521)
)
)
------------------------------------------------------
admin]$lsnrctl start
listener started
]$cd $ORACLE_HOME/network/admin
admin]$netca
tcp
hostname: 192.168.100.2
port: 1521
no test
admin]$tnsping to_standby
working fine
In stand by database
sql>startup nomount;
sql>alter database mount standby database;
database altered
-------------------------------------------------------------
sql>alter database recover managed standby database;
(Here it will stay like that only)
go to primary side
---------------------
]$sqlplus '/as sysdba'
This is in mount stage
----------------------------------------------------------------------
Note:
How do we know whether it is in mounted stage or not ?
use the following query
sql> select status from v$database;
mounted
------------------------------------------------------------------------
sql>alter database open;
sql>/
--------------------------------------
In stand by database
]$cd /home/prd/arch
arch]$ls
archives are generating
----------------------------------------------------------
Note:
go to /home/prd/arch
check it is whether is generating or not
yes generating
-----------------------------------------------------------
go to prmary side:
---------------------
sql>conn amit/amit;
sql>show user;
SYS
sql>conn amit/amit;
connected
standbyside
--------------
again how to put in recover mode
sql>show user;
SYS
stand by side
----------------
sql>shut immediate;
sql>starup nomount;
----------------------------@@@@@@@@@@____________________
]$lsnrctl stop
-------------------done--------------
sql>startup;
sql>
Done