Skip to main content

Step By Step Dataguard Implementation (oracle 10g)


Step By Step Dataguard Implementation (oracle 10g)


Your Pfile in primary should have entries like the following entries:


** init File for primary

PRIM.__db_cache_size=4194304000
PRIM.__java_pool_size=16777216
PRIM.__large_pool_size=16777216
PRIM.__shared_pool_size=872415232
PRIM.__streams_pool_size=0
*.audit_file_dest='AUDIT_FILE_LOCATION/PRIM/adump'
*.background_dump_dest='AUDIT_FILE_LOCATION/PRIM/bdump'
*.compatible='10.2.0.1.0'
*.control_files='DATAFILE_LOCATION/PRIM/control01.ctl','DATAFILE_LOCATION/PRIM/control02.ctl','DATAFILE_LOCATION/PRIM/control03.ctl'
*.core_dump_dest='AUDIT_FILE_LOCATION/PRIM/cdump'
*.db_block_size=8192
*.db_domain=''
*.db_file_multiblock_read_count=16
*.db_name='PRIM'
db_unique_name='PRIM'
LOG_ARCHIVE_CONFIG='DG_CONFIG=(PRIM,STAN)'
*.db_recovery_file_dest_size=536870912000
*.db_recovery_file_dest='RECOVERY_DESTINATION

log_archive_dest_10='LOCATION=USE_DB_RECOVERY_FILE_DEST'
LOG_ARCHIVE_DEST_2=
'SERVICE=STAN LGWR ASYNC
VALID_FOR=(ONLINE_LOGFILES,PRIMARY_ROLE)
DB_UNIQUE_NAME=STAN'
LOG_ARCHIVE_DEST_STATE_1=ENABLE
LOG_ARCHIVE_DEST_STATE_2=ENABLE
LOG_ARCHIVE_FORMAT=%t_%s_%r.arc
LOG_ARCHIVE_MAX_PROCESSES=30
*.dispatchers='(PROTOCOL=TCP) (SERVICE=PRIMXDB)'
*.job_queue_processes=10
*.open_cursors=300
*.pga_aggregate_target=1704984576
*.processes=150
*.remote_login_passwordfile='EXCLUSIVE'
FAL_SERVER=STAN
FAL_CLIENT=PRIM
STANDBY_FILE_MANAGEMENT=AUTO
DB_FILE_NAME_CONVERT='DATAFILE_LOCATION/STAN/','DATAFILE_LOCATION /PRIM/'
LOG_FILE_NAME_CONVERT='DATAFILE_LOCATION/STAN/','DATAFILE_LOCATION /PRIM/'
*.sga_target=5117050880
*.undo_management='AUTO'
*.undo_tablespace='UNDOTBS1'
*.user_dump_dest='AUDIT_FILE_LOCATION/PRIM/udump'


Your tnsnames.ora in primary should have entries like the following entries:
Tnsnames.ora

STAN =
  (DESCRIPTION =
    (ADDRESS_LIST =
      (ADDRESS = (PROTOCOL = TCP)(HOST = 172.17.1.202)(PORT = 10521))
    )
    (CONNECT_DATA =
      (SERVICE_NAME = STAN)
    )
  )
PRIM =
  (DESCRIPTION =
    (ADDRESS_LIST =
      (ADDRESS = (PROTOCOL = TCP)(HOST = 172.17.1.201)(PORT = 10521))
    )
    (CONNECT_DATA =
      (SERVICE_NAME = PRIM)
    )
  )


Your listener.ora in primary should have entries like the following entries:
Tnsname.ora



Listener.ora
# listener.ora Network Configuration File:
# Generated by Oracle configuration tools.

SID_LIST_LISTENER_STAN =
  (SID_LIST =
    (SID_DESC =
      (SID_NAME = PLSExtProc)
      (ORACLE_HOME = $ORACLE_HOME)
      (PROGRAM = extproc)
    )
    (SID_DESC =
      (SID_NAME = STAN)
      (GLOBAL_DBNAME = STAN)
      (ORACLE_HOME = $ORACLE_HOME)
    )
  )
LISTENER_STAN =
  (DESCRIPTION_LIST =
    (DESCRIPTION =
      (ADDRESS = (PROTOCOL = TCP)(HOST = 172.17.1.202)(PORT = 10521))
      (ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC0))
    )
  )
SID_LIST_LISTENER_PRIM =
  (SID_LIST =
    (SID_DESC =
      (SID_NAME = PLSExtProc)
      (ORACLE_HOME = $ORACLE_HOME)
      (PROGRAM = extproc)
    )
    (SID_DESC =
      (SID_NAME = PRIM)
      (GLOBAL_DBNAME = PRIM)
      (ORACLE_HOME = $ORACLE_HOME)
    )
  )

LISTENER_PRIM =
  (DESCRIPTION_LIST =
    (DESCRIPTION =
      (ADDRESS = (PROTOCOL = TCP)(HOST = 172.17.1.201)(PORT = 10521))
      (ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC0))
    )
  )


Tasks must perform on PRIMARY :

On Primary site

1. Install oracle
2. Create database by dbca
3. Create archivelog location
4. Turn on force logging on primary database:

ALTER DATABASE FORCE LOGGING;

select * from v$pwfile_users;

select bytes from v$log;

select group#, member from v$logfile;

5. Adding standby redo log group.

ALTER DATABASE ADD STANDBY LOGFILE GROUP 5(‘DATAFILE_LOCATION/ULTIMUS/redo07.log’) SIZE 100M;

ALTER DATABASE ADD STANDBY LOGFILE GROUP 6 (‘DATAFILE_LOCATION/ULTIMUS/redo08.log’)SIZE 100M;

ALTER DATABASE ADD STANDBY LOGFILE GROUP 7 ('DATAFILE_LOCATION/ULTIMUS/redo09.log')SIZE 100M;

select * from v$standby_log;


6. shutdown immediate;
7. startup mount;
8. alter database archivelog;
9. alter database open;
    archive log list;
10. startup mount;

11. Create standby control file and transfer it to Standby.
alter database create standby controlfile as ‘DATAFILE_LOCATION/ULTIMUS/STAN.ctl’;
12. ALTER DATABASE OPEN;
13. Recheck init file,tnsname,listener file.
14. create spfile.
15. start listener
16. tnsping
17. shutdown




 Init file in standby server

STAN.__db_cache_size=3087007744
STAN.__java_pool_size=16777216
STAN.__large_pool_size=16777216
STAN.__shared_pool_size=704643072
STAN.__streams_pool_size=0
*.audit_file_dest='AUDIT_FILE_LOCATION/STAN/adump'
*.background_dump_dest='AUDIT_FILE_LOCATION/STAN/bdump'
*.compatible='10.2.0.1.0'
*.control_files='DATAFILE_LOCATION/STAN/STAN.ctl'
*.core_dump_dest='AUDIT_FILE_LOCATION/STAN/cdump'
*.db_block_size=8192
*.db_domain=''
*.db_file_multiblock_read_count=16
*.db_name='PRIM'
DB_UNIQUE_NAME=STAN
LOG_ARCHIVE_CONFIG='DG_CONFIG=(PRIM,STAN)'
log_archive_dest_1='LOCATION=RECOVERY_DESTINATION/STAN/archivelog
valid_for=(ALL_LOGFILES,PRIMARY_ROLE)
DB_UNIQUE_NAME=STAN'
LOG_ARCHIVE_DEST_2=
'SERVICE=PRIM LGWR ASYNC
VALID_FOR=(ONLINE_LOGFILES,PRIMARY_ROLE)
DB_UNIQUE_NAME=PRIM'
LOG_ARCHIVE_DEST_STATE_1=ENABLE
LOG_ARCHIVE_DEST_STATE_2=ENABLE
LOG_ARCHIVE_FORMAT=%t_%s_%r.arc
LOG_ARCHIVE_MAX_PROCESSES=30
DB_FILE_NAME_CONVERT='DATAFILE_LOCATION/PRIM/','DATAFILE_LOCATION/STAN/'
LOG_FILE_NAME_CONVERT'DATAFILE_LOCATION/PRIM/','DATAFILE_LOCATION/STAN/'
*.dispatchers='(PROTOCOL=TCP) (SERVICE=STANXDB)'
*.job_queue_processes=10
*.open_cursors=300
*.pga_aggregate_target=1276116992
*.processes=150
*.remote_login_passwordfile='EXCLUSIVE'
*.sga_target=3829399552
*.undo_management='AUTO'
*.undo_tablespace='UNDOTBS1'
*.user_dump_dest='AUDIT_FILE_LOCATION/STAN/udump'
STANDBY_FILE_MANAGEMENT=AUTO


 On standby site

1. install oracle
2. create database by dbca,
3. shutdown.delete datafile
3. create archivelog location
4. copy datafile,tnsname.ora,lIstener.ora
5. delete control file except standby,delete standby redo file
5. recheck pfile.
6. startup mount pfile
OR. startup   mount pfile='$ORACLE_HOME/dbs/initSTAN.ora'

7. if necessary:

ALTER DATABASE DROP LOGFILE GROUP 5;
ALTER DATABASE DROP LOGFILE GROUP 6;
ALTER DATABASE DROP LOGFILE GROUP 7;

8. Add stanby redo log group:

ALTER DATABASE ADD STANDBY LOGFILE GROUP 5(‘DATAFILE_LOCATION/STAN/redo07.log’) SIZE  100M;

ALTER DATABASE ADD STANDBY LOGFILE GROUP  6(‘DATAFILE_LOCATION/STAN/redo08.log’) SIZE  100M;

ALTER DATABASE ADD STANDBY LOGFILE GROUP  7(‘DATAFILE_LOCATION/STAN/redo09.log’) SIZE  100M;

select * from v$standby_log;

9. start listener
10. tnsping
11. shutdown immediate
12. startup mout pfile

13. to start log applying to secondary:

alter database recover managed standby database disconnect; ---apply cuurent logfile

* To check archives are applied to secondary, issue the following command.

select sequence#,first_time,applied from v$archived_log order by first_time;

* To check if the process MRPO exists in secondary, issue the command.
SELECT PROCESS FROM V$MANAGED_STANDBY WHERE PROCESS LIKE 'MRP%';





-----------------------------------------------------------------------
Happy to Help !!!





Comments

Popular posts from this blog

ORACLE FLASH RECOVERY AREA USAGE QUERY

FINDING ORACLE FLASH RECOVERY AREA USAGE SELECT NAME,        (SPACE_LIMIT / 1024 / 1024 / 1024) SPACE_LIMIT_GB,          ((SPACE_LIMIT - SPACE_USED + SPACE_RECLAIMABLE) / 1024 / 1024 / 1024) AS SPACE_AVAILABLE_GB,        ROUND((SPACE_USED - SPACE_RECLAIMABLE) / SPACE_LIMIT * 100, 1) AS PERCENT_FULL   FROM V$RECOVERY_FILE_DEST;

Shared Pool Tuning: Cursor Tuning (Tuning Open_Cursors, Session_Cached_Cursors, Cursor_Space_For_Time)

Shared Pool Tuning: Cursor Tuning The three most important parameter for shared pool tuning are OPEN_CURSORS , SESSION_CACHED_CURSORS and CURSOR_SPACE_FOR_TIME. But most of the time we see that these two parameters SESSION_CACHED_CURSORS and CURSOR_SPACE_FOR_TIME are ignored or unused . OPEN CURSORS Open cursors take up space in the shared pool, in the library cache. OPEN_CURSORS sets the maximum number of cursors each session can have open, per session. For example, if OPEN_CURSORS is set to 1000, then each session can have up to 1000 cursors open at one time. V$open_cursor shows cached cursors, not currently open cursors, by session. If you’re wondering how many cursors a session has open, don’t look in v$open_cursor. It shows the cursors in the session cursor cache for each session, not cursors that are actually open.  To monitor open cursors, query v$sesstat where name= ’opened cursors current’ . This will give the number of currently opened cursors, by session:

How to delete/remove Management Agent from Oracle Enterprise Manager 12C

  1. Before you deinstall a Management Agent, do the following:     a. Stop the Agent using command from Management Agent home:                 cd /u01/oemcc_latest/core/12.1.0.2.0/bin/                 $ emctl stop agent     b. Wait for the Management Agent to go to the unreachable state in the Cloud Control console.     c. It is mandatory to delete the Management Agent and their monitored targets using any of the following methods: Remove the Agent target manually from the console: 1. Login to 12C Cloud Control 2. Navigate to Setup => Manage Cloud Control => Agents 3. Go to the Home page of the Agent that you want to remove 4. Expand the drop-down menu near the " Agent " 5. Expand the " Target Setup " option 6. Select " Remove Target "            In Cloud Control Release 12.1.0.2, the following dialog box will be displayed if the Agent is still monitoring targets. Click Continue. You can then remove all targets (usin