Escolar Documentos
Profissional Documentos
Cultura Documentos
LISTENER.ORA
listener.ora Network Configuration File:
/u01/oracle/11g/network/admin/listene
r.ora
# Generated by Oracle configuration tools.
SID_LIST_LISTENER =
(SID_LIST =
(SID_DESC =
(SID_NAME = PLSExtProc)
(ORACLE_HOME = /u01/oracle/11g)
(PROGRAM = extproc)
)
(SID_DESC =
(SID_NAME = APRDEV)
(ORACLE_HOME = /u01/oracle/11g)
(GLOBAL_NAME = APRDEV)
)
(SID_DESC =
(SID_NAME = APRTEST)
(ORACLE_HOME = /u01/oracle/11g)
(GLOBAL_NAME = APRTEST)
)
)
LISTENER =
(DESCRIPTION_LIST =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = un01.aprdev.com)(PORT =
1521))
)
)
ADR_BASE_LISTENER = /u01/oracle
TNSNAMES.ORA
# tnsnames.ora Network Configuration File:
/u01/oracle/11g/network/admin/tnsname
s.ora
# Generated by Oracle configuration tools.
APRDEV_BCKP =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST = 10.122.1.15)(PORT = 1521))
)
(CONNECT_DATA =
(SERVICE_NAME = APRDEV)
)
)
APRTEST =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST = un01.aprdev.com)(PORT =
1521))
)
(CONNECT_DATA =
(SERVICE_NAME = APRTEST)
)
)
after the tnsnames.ora and listener.ora already configured, then you need to
start the listener service by typing this command lsnrctl.start
7. login to the physical standby database using sqlplus and start the database:
bash~ > sqlplus sys as sysdba
SQL > startup nomount pfile=/path/to/initfile;
SQL > alter database mount standby database;
SQL > create spfile from pfile=/path/to/initfile;
8. after the physical standby database started, then you need to start copying
all the archive log files that is needed to start applying the log from primary
to physical standby database. in solaris you can synchronize the folder where
archivelog stored between two different server using rsync
9. To apply the archivelog for the first time the required command is:
SQL >recover standby database;
after that type AUTO.
10.To apply the archivelog after that it can be done by this command:
alter database recover automatic standby database; --lewati step ini
11.This process can be combined using shell script so that every 15 minutes the
archivelog from primary server are being send to the physical standby
database and those archivelogs are being applied every one hour.
12.To prove whether the database being updated or not you can make the
physical standby database opened in read only status. that can be done by
typing:
SQL >alter database open read only;
13.to make this database back to standby mode (after opening it open read
only) it can be done by typing:
SQL >shutdown immediate;
SQL >startup nomount;
SQL >alter database mount standby database;
14.While to create the log from the primary server, it can be done by doing:
SQL >alter system archive log current;
SQL >alter system switch logfile;
15.From the above script the archivelog are stored in one directory, that is
specified in the init file, log_archive_dest_1 To be able to send the archivelog
from the primary to standby database, we can use ssh script to utilize scp, or
we can use rsync tools for solaris.
16.If in any case the standby database wanted to be opened as a read write
database it can be done, the first thing that need to be done is to enable
flashback area and create a restore point.
17.To check whether your databases flashback area already configured or not,
you can check in init file if there are parameter db_recovery_file_dest and
.db_recovery_file_dest_size , if not then you need to add it first, by typing:
alter system set db_recovery_file_dest='/path/to/flashback/area' scope=both;
alter system set db_recovery_file_dest_size=2g scope=both;
18.
Then to activate flashback area, you need to do:
shutdown immediate;
startup nomount;
alter database mount standby database;
alter database flashback on; -- ORA-00439: feature not enabled:
Flashback Database (on standart edition)
19.Before activating this you need to be sure that your standby database is
already able to apply some logs, otherwise you will get ora-38788 more
standby database recovery is needed
20.After this we need to create restore point, that will be used when we want to
convert back the standby database that already becomes primary database,
back to standby database again. it can be done by typing :
SQL >create restore point restore_point_name guarantee flashback database;
21.Before creating restore point you need to makes sure that all archivelogs are
already being sent from primary to standby in event of failover.
22.Now you need to activate the standby database and open it for read/write
operations, it can be done by:
SQL >alter database activate standby database;