Dataguard commands and SQL scripts


PHYSICAL STANDBY COMMANDS

To start redo apply in foreground:

SQL> ALTER DATABASE RECOVER MANAGED STANDBY DATABASE;

To stop redo apply process on the Standby database (to stop MRP):

SQL> ALTER DATABASE RECOVER MANAGED STANDBY DATABASE CANCEL;

To start real-time redo apply:

SQL> ALTER DATABASE RECOVER MANAGED STANDBY DATABASE USING CURRENT LOGFILE DISCONNECT FROM SESSION;

To start redo apply in background:

SQL> ALTER DATABASE RECOVER MANAGED STANDBY DATABASE DISCONNECT FROM SESSION;
or
SQL> RECOVER MANAGED STANDBY DATABASE DISCONNECT;

To check redo apply service status:

SQL> SELECT THREAD#, SEQUENCE#, PROCESS, CLIENT_PROCESS, STATUS, BLOCKS FROM V$MANAGED_STANDBY;

If managed standby recovery is not running or not started with real-time apply, restart managed recovery with real-time apply enabled:

SQL> ALTER DATABASE RECOVER MANAGED STANDBY DATABASE CANCEL;
SQL> ALTER DATABASE RECOVER MANAGED STANDBY DATABASE USING CURRENT LOGFILE DISCONNECT;

To gather Data Guard configuration information(standby)

SQL> SELECT DATABASE_ROLE,OPEN_MODE, PROTECTION_MODE FROM V$DATABASE 

DATABASE_ROLE OPEN_MODE PROTECTION_MODE
---------------- -------------------- --------------------
PHYSICAL STANDBY MOUNTED MAXIMUM PERFORMANCE

SQL> SELECT RECOVERY_MODE FROM V$ARCHIVE_DEST_STATUS WHERE RECOVERY_MODE!='IDLE';

RECOVERY_MODE
-----------------------
MANAGED REAL TIME APPLY

To calculate the Redo bytes per second

SQL> SELECT SUM (BLOCKS * BLOCK_SIZE) / 1024 / 1024 / 60 / 60 / 30 REDO_MB_PER_SEC
 FROM GV$ARCHIVED_LOG
 WHERE FIRST_TIME BETWEEN TO_DATE ('01.05.2016', 'DD.MM.YYYY')
 AND TO_DATE ('01.06.2016', 'DD.MM.YYYY')

To check status of Data Guard synchronization(standby):

SQL> SELECT NAME, VALUE FROM V$DATAGUARD_STATS;

NAME VALUE
--------------------- -------------------------------
transport lag          +00 00:00:00
apply lag              +00 00:00:00
apply finish time      +00 00:00:00.000
estimated startup time 32

To verify there is no log file gap between the primary and the standby database:

SQL> SELECT STATUS, GAP_STATUS FROM V$ARCHIVE_DEST_STATUS WHERE DEST_ID = 3;

STATUS GAP_STATUS
--------- ------------------------
VALID NO GAP

 

To verify that the primary database can be switched to the standby role:

A value of TO STANDBY or SESSIONS ACTIVE indicates that the primary database can be switched to the standby role. If neither of these values is returned, a switchover is not possible because redo transport is either misconfigured or is not functioning properly.

SQL> SELECT SWITCHOVER_STATUS FROM V$DATABASE; 

SWITCHOVER_STATUS
--------------------
TO STANDBY

To convert the primary database into a physical standby :

Before switchover the current control file is backed up to the current SQL session trace file and it possible to reconstruct a current control file, if necessary.

SQL> ALTER DATABASE COMMIT TO SWITCHOVER TO PHYSICAL STANDBY WITH SESSION SHUTDOWN;

Database altered.

To verify Managed Recovery is running on the standby :

SQL> SELECT PROCESS FROM V$MANAGED_STANDBY WHERE PROCESS LIKE 'MRP%'; 

PROCESS
---------
MRP0

To show information about the protection mode, the protection level, the role of the database, and switchover status:

SQL> SELECT DATABASE_ROLE, DB_UNIQUE_NAME INSTANCE, OPEN_MODE, PROTECTION_MODE, PROTECTION_LEVEL, SWITCHOVER_STATUS FROM V$DATABASE;

DATABASE_ROLE     INSTANCE    OPEN_MODE    PROTECTION_MODE     PROTECTION_LEVEL     SWITCHOVER_STATUS
---------------- ---------- ------------ -------------------- -------------------- -------------------- --------------------
PRIMARY           TESTCDB    READ WRITE    MAXIMUM PERFORMANCE MAXIMUM PERFORMANCE   TO STANDBY

On the standby database, query the V$ARCHIVED_LOG view to identify existing files in the archived redo log.

SQL> SELECT SEQUENCE#, FIRST_TIME, NEXT_TIME FROM V$ARCHIVED_LOG ORDER BY SEQUENCE#;
Or
SQL> SELECT THREAD#, MAX(SEQUENCE#) AS "LAST_APPLIED_LOG" FROM V$LOG_HISTORY GROUP BY THREAD#;

On the standby database, query the V$ARCHIVED_LOG view to verify the archived redo log files were applied.

SELECT SEQUENCE#,APPLIED FROM V$ARCHIVED_LOG ORDER BY SEQUENCE#;

 

 

To determine which log files were not received by the standby site.

SQL> SELECT LOCAL.THREAD#, LOCAL.SEQUENCE#
FROM (SELECT THREAD#, SEQUENCE#
FROM V$ARCHIVED_LOG
WHERE DEST_ID = 1) LOCAL
WHERE LOCAL.SEQUENCE# NOT IN (SELECT SEQUENCE#
FROM V$ARCHIVED_LOG
WHERE DEST_ID = 2 AND THREAD# = LOCAL.THREAD#);

 

Archivelog difference: Run this on the primary database. (not for real-time apply):

SQL> ALTER SESSION SET NLS_DATE_FORMAT = 'DD-MON-YYYY HH24:MI:SS';
SQL> 
SELECT A.THREAD#,
 B.LAST_SEQ,
 A.APPLIED_SEQ,
 A.LAST_APP_TIMESTAMP,
 B.LAST_SEQ - A.APPLIED_SEQ ARC_DIFF
 FROM ( SELECT THREAD#,
 MAX (SEQUENCE#) APPLIED_SEQ,
 MAX (NEXT_TIME) LAST_APP_TIMESTAMP
 FROM GV$ARCHIVED_LOG
 WHERE APPLIED = 'YES'
 GROUP BY THREAD#) A,
 ( SELECT THREAD#, MAX (SEQUENCE#) LAST_SEQ
 FROM GV$ARCHIVED_LOG
 GROUP BY THREAD#) B
 WHERE A.THREAD# = B.THREAD#;

 THREAD#   LAST_SEQ    APPLIED_SEQ  LAST_APP_TIMESTAMP   ARC_DIFF
---------- ---------- -----------   --------------------- ----------
 1         21282      21281         09-IYUL-2016 12:06:5     1
 2         23747      23746         09-IYUL-2016 12:16:13    1

2 rows selected.

 

To check archive log apply  on primary database:

SQL> SET LINESIZE 150
SET PAGESIZE 999
COL NAME FORMAT A60
COL DEST_TYPE FORMAT A10
COL ARCHIVED FORMAT A10
COL APPLIED FORMAT A10

SELECT SEQUENCE#,
NAME,
DEST_ID ,
CASE WHEN STANDBY_DEST = 'YES' THEN 'Standby' ELSE 'Local' END
AS DEST_TYPE ,
ARCHIVED ,
APPLIED
FROM V$ARCHIVED_LOG
WHERE SEQUENCE# > (SELECT MAX (SEQUENCE#)
FROM V$ARCHIVED_LOG
WHERE STANDBY_DEST = 'YES' AND APPLIED = 'YES')
ORDER BY SEQUENCE# , DEST_ID ;


 SEQUENCE#  NAME                                                          DEST_ID  DEST_TYPE  ARCHIVED APPLIED
---------- -------------------------------------------------------------- -------  ---------- -------- --------
 23748      +FRA/TESTCDB/ARCHIVELOG/2016_07_09/thread_2_seq_23748.10041.9   1      Local        YES       NO
 23748      +DATA/TESTCDB/ARCHIVELOG/2016_07_09/thread_2_seq_23748.10062.   2      Local        YES       NO
 23748      TESTSTB                                                         3      Standby      YES       NO

3 rows selected.


 

DG BROKER COMMANDS

 

How to configure Data Guard broker:

1.Start the DMON process on both the primary and standby databases:

SQL> ALTER SYSTEM SET DG_BROKER_START=TRUE SCOPE=BOTH;
System altered.

2.Set the log_archive_dest_2 settings from both the Primary and Standby databases
to be nothing , then try to create the broker configuration (it will automatically 
set the log_archive_dest_n when you'll add a database to the configuration)

SQL> ALTER SYSTEM SET LOG_ARCHIVE_DEST_2='';
System altered.

Connect DGMGRL on the primary DB and create the configuration 

[oracle@primary ~]$ dgmgrl
DGMGRL for Linux: Version 12.1.0.2.0 - 64bit Production
Copyright (c) 2000, 2013, Oracle. All rights reserved.
Welcome to DGMGRL, type "help" for information.
DGMGRL> connect sys/test
Connected as SYSDG.

DGMGRL> CREATE CONFIGURATION 'TEST' AS PRIMARY DATABASE IS 'DB12C' CONNECT IDENTIFIER IS DB12C;
Configuration "TEST" created with primary database "DB12C"

Next add a standby database to the Data Guard broker configuration:

DGMGRL> ADD DATABASE 'db12c_stby' AS CONNECT IDENTIFIER IS 'db12c_stby';
Database "db12c" added

Enable dataguard broker configuration 

DGMGRL> enable configuration;
Enabled.

DGMGRL> show configuration;

Configuration - TEST

 Protection Mode: MaxPerformance
 Members:
 db12c - Primary database
 DB12C_STBY - Physical standby database 

Fast-Start Failover: DISABLED

Configuration Status:
SUCCESS (status updated 40 seconds ago)

 

To remove DG broker configuration:

DGMGRL> remove configuration;
Removed configuration

Rename the database name in the Data Guard broker as follows:

DGMGRL> edit database 'db12c_stby' rename to 'STBY';

To turn off redo transport to all remote destinations on the primary database:

 DGMGRL> edit database 'DB12C' SET STATE="LOG-TRANSPORT-OFF";

To stop and start redo transport services to specific standby databases:

DGMGRL> edit database 'db12c_stby' SET PROPERTY 'LogShipping'='OFF';
Property "LogShipping" updated
DGMGRL> SHOW DATABASE 'db12c_stby' 'LogShipping';
 LogShipping = 'OFF'
DGMGRL> edit database 'db12c_stby' SET PROPERTY 'LogShipping'='ON';
Property "LogShipping" updated
DGMGRL> SHOW DATABASE 'db12c_stby' 'LogShipping';
 LogShipping = 'ON'

To change the state of the standby database to read-only and back APPLY-ON:

DGMGRL> EDIT DATABASE 'db12c' SET STATE='READ-ONLY';
Succeeded.
DGMGRL> show database db12c

Database - db12c

 Role: PHYSICAL STANDBY
 Intended State: READ-ONLY
<<OUTPUT TRIMMED>>
Database Status:
SUCCESS

To change back:

DGMGRL> shutdown 
DGMGRL> startup mount;
DGMGRL> show database db12c

Database - db12c
 Role: PHYSICAL STANDBY
 Intended State: OFFLINE
  <<OUTPUT TRIMMED>>

DGMGRL> EDIT DATABASE DB12C SET STATE = APPLY-ON;
Succeeded.
DGMGRL> show database db12c

Database - db12c

 Role: PHYSICAL STANDBY
 Intended State: APPLY-ON
 <<OUTPUT TRIMMED>>

 

 



LOGICAL STANDBY COMMANDS

To Restart SQL apply on logical standby

SQL> ALTER DATABASE START LOGICAL STANDBY APPLY IMMEDIATE;

To Stop SQL apply on logical standby

SQL> ALTER DATABASE STOP LOGICAL STANDBY APPLY;

Run the following SQL against the logical standby to start real-time SQL apply if the SQL apply failed with an error, and you are 100% certain that the transaction is safe to skip

SQL> ALTER DATABASE START LOGICAL STANDBY APPLY IMMEDIATE SKIP FAILED TRANSACTION;

To see unsupported tables for logical standby:

SQL> SELECT * FROM DBA_LOGSTDBY_UNSUPPORTED_TABLE ORDER BY OWNER, TABLE_NAME;

To know which archive log sequences are at what stage for logical standby?

SQL> SELECT 'RESTART' "TYPE",
 P.RESTART_SCN "SCN",
 TO_CHAR (P.RESTART_TIME, 'yyyy/mm/dd hh24:mi:ss') "TIME",
 L.SEQUENCE# "SEQ#"
 FROM V$LOGSTDBY_PROGRESS P, DBA_LOGSTDBY_LOG L
 WHERE P.RESTART_SCN >= L.FIRST_CHANGE# AND P.RESTART_SCN < L.NEXT_CHANGE#
UNION
SELECT 'RESTART',
 P.RESTART_SCN,
 TO_CHAR (P.RESTART_TIME, 'yyyy/mm/dd hh24:mi:ss'),
 L.SEQUENCE#
 FROM V$LOGSTDBY_PROGRESS P, V$STANDBY_LOG L
 WHERE P.RESTART_SCN >= L.FIRST_CHANGE# AND P.LATEST_SCN <= L.LAST_CHANGE#
UNION
SELECT 'APPLIED',
 P.APPLIED_SCN,
 TO_CHAR (P.APPLIED_TIME, 'yyyy/mm/dd hh24:mi:ss'),
 L.SEQUENCE#
 FROM V$LOGSTDBY_PROGRESS P, DBA_LOGSTDBY_LOG L
 WHERE P.APPLIED_SCN >= L.FIRST_CHANGE# AND P.APPLIED_SCN < L.NEXT_CHANGE#
UNION
SELECT 'APPLIED',
 P.APPLIED_SCN,
 TO_CHAR (P.APPLIED_TIME, 'yyyy/mm/dd hh24:mi:ss'),
 L.SEQUENCE#
 FROM V$LOGSTDBY_PROGRESS P, V$STANDBY_LOG L
 WHERE P.APPLIED_SCN >= L.FIRST_CHANGE# AND P.LATEST_SCN <= L.LAST_CHANGE#
UNION
SELECT 'MINING',
 P.MINING_SCN,
 TO_CHAR (P.MINING_TIME, 'yyyy/mm/dd hh24:mi:ss'),
 L.SEQUENCE#
 FROM V$LOGSTDBY_PROGRESS P, DBA_LOGSTDBY_LOG L
 WHERE P.MINING_SCN >= L.FIRST_CHANGE# AND P.MINING_SCN < L.NEXT_CHANGE#
UNION
SELECT 'MINING',
 P.MINING_SCN,
 TO_CHAR (P.MINING_TIME, 'yyyy/mm/dd hh24:mi:ss'),
 L.SEQUENCE#
 FROM V$LOGSTDBY_PROGRESS P, V$STANDBY_LOG L
 WHERE P.MINING_SCN >= L.FIRST_CHANGE# AND P.LATEST_SCN <= L.LAST_CHANGE#
UNION
SELECT 'SHIPPED',
 P.LATEST_SCN,
 TO_CHAR (P.LATEST_TIME, 'yyyy/mm/dd hh24:mi:ss'),
 L.SEQUENCE#
 FROM V$LOGSTDBY_PROGRESS P, DBA_LOGSTDBY_LOG L
 WHERE P.LATEST_SCN >= L.FIRST_CHANGE# AND P.LATEST_SCN < L.NEXT_CHANGE#
UNION
SELECT 'SHIPPED',
 P.LATEST_SCN,
 TO_CHAR (P.LATEST_TIME, 'yyyy/mm/dd hh24:mi:ss'),
 L.SEQUENCE#
 FROM V$LOGSTDBY_PROGRESS P, V$STANDBY_LOG L
 WHERE P.LATEST_SCN >= L.FIRST_CHANGE# AND P.LATEST_SCN <= L.LAST_CHANGE#;

To know is the SQL Apply up to date

SQL> SELECT TO_CHAR(LATEST_TIME,'yyyy/mm/dd hh24:mi:ss') "LATEST_TIME", 
TO_CHAR(APPLIED_TIME,'yyyy/mm/dd hh24:mi:ss') "APPLIED_TIME", 
APPLIED_SCN, LATEST_SCN 
FROM V$LOGSTDBY_PROGRESS;

To know is the Logical standby applying changes? Run the following SQL against the Logical standby database:

SQL> SELECT REALTIME_APPLY, STATE FROM V$LOGSTDBY_STATE;

If the value of STATE is “NULL” or “SQL APPLY NOT ON” then the Sql Apply is not running.The value of REALTIME_APPLY should be Y to allow for real time apply from the standby redo logs. To know what major Sql Apply events have occurred, run the following SQL against the Logical standby database:

SQL> SELECT TO_CHAR (EVENT_TIME, 'YYYY/MM/DD HH24:MI:SS') "EVENT_TIME",
STATUS, EVENT
FROM DBA_LOGSTDBY_EVENTS
ORDER BY EVENT_TIME;

To know what major Dataguard events have occurred, run the following SQL against the Logical standby database:

SQL> SELECT TO_CHAR (TIMESTAMP, 'yyyy/mm/dd hh24:mi:ss') "TIME",
ERROR_CODE "ERROR", DEST_ID "DEST", MESSAGE
FROM V$DATAGUARD_STATUS
WHERE timestamp > TRUNC (SYSDATE + 6 / 24)
ORDER BY timestamp DESC;

 

To know where are the archive logs going and are there any achieving issues, run the following SQL against either the logical standby or primary database:

SQL> SELECT DEST_ID "DID",
STATUS, DESTINATION, ARCHIVER, VALID_NOW, VALID_TYPE, VALID_ROLE, ERROR
FROM V$ARCHIVE_DEST
WHERE STATUS <> 'INACTIVE';


 

Useful Oracle RAC Commands


Shutdown and Start sequence of Oracle RAC 

 

STOP ORACLE RAC (11g)
1. emctl stop dbconsole
2. srvctl stop listener -n racnode1
3. srvctl stop database -d RACDB
4. srvctl stop asm -n racnode1 -f
5. srvctl stop asm -n racnode2 -f
6. srvctl stop nodeapps -n racnode1 -f
7. crsctl stop crs

START ORACLE RAC (11g)
1. crsctl start crs
2. crsctl start res ora.crsd -init
3. srvctl start nodeapps -n racnode1
4. srvctl start nodeapps -n racnode2
5. srvctl start asm -n racnode1
6. srvctl start asm -n racnode2
7. srvctl start database -d RACDB
8. srvctl start listener -n racnode1
9. emctl start dbconsole

 

To start and stop oracle clusterware (run as the superuser) :

[root@node1 ~]# crsctl stop crs

[root@node1 ~]# crsctl start crs

 

To start and stop oracle cluster resources running on all nodes :

[root@node1 ~]#  crsctl stop cluster -all

[root@node1 ~]#  crsctl start cluster -all

 

To check the current status of a cluster :

[oracle@node1~]$ crsctl check cluster
CRS-4537: Cluster Ready Services is online
CRS-4529: Cluster Synchronization Services is online
CRS-4533: Event Manager is online

 

To check the current status of CRS :

[oracle@node1 ~]$ crsctl check crs
CRS-4638: Oracle High Availability Services is online
CRS-4537: Cluster Ready Services is online
CRS-4529: Cluster Synchronization Services is online
CRS-4533: Event Manager is online

 

To display the status cluster resources :

[oracle@node1 ~]$ crsctl stat res -t

 

To check version of  Oracle Clusterware :

[oracle@node1 ~]$ crsctl query crs softwareversion
Oracle Clusterware version on node [node1] is [11.2.0.4.0]
[oracle@node1 ~]$ 
[oracle@node1 ~]$ crsctl query crs activeversion
Oracle Clusterware active version on the cluster is [11.2.0.4.0]
[oracle@node1 ~]$ crsctl query crs releaseversion
Oracle High Availability Services release version on the local node is [11.2.0.4.0]

 

To check current status of OHASD (Oracle High Availability Services) daemon :

[oracle@node1 ~]$ crsctl check has
CRS-4638: Oracle High Availability Services is onli

 

Forcefully deleting resource :

[oracle@node1 ~]$ crsctl delete resource testresource -f

 

Enabling and disabling CRS daemons (run as the superuser) :

[root@node1 ~]# crsctl enable crs
CRS-4622: Oracle High Availability Services autostart is enabled.
[root@node1 ~]# 
[root@node1 ~]# crsctl disable crs
CRS-4621: Oracle High Availability Services autostart is disabled.

 

To check the status of Oracle CRS :

[oracle@node1 ~]$ olsnodes
node1
node2

 

To print node name with node number :

[oracle@node1 ~]$ olsnodes -n
node1	1
node2	2

 

To print private interconnect address for the local node :

[oracle@node1 ~]$ olsnodes -l -p
node1	192.168.1.101

 

To print virtual IP address with node name :

[oracle@node1 ~]$ olsnodes -i
node1	node1-vip
node2	node2-vip
[oracle@node1 ~]$ olsnodes -i node1
node1	node1-vip

 

To print information for the local node :

[oracle@node1 ~]$ olsnodes -l
node1
pl

 

To print node status (active or inactive) :

[oracle@node1 ~]$ olsnodes -s
node1	Active
node2	Active
[oracle@node1 ~]$ olsnodes -l -s
node1	Active

 

To print node type (pinned or unpinned) :

[oracle@node1 ~]$ olsnodes -t
node1	Unpinned
node2	Unpinned
[oracle@node1 ~]$ olsnodes -l -t
node1	Unpinned

 

To print clusterware name :

[oracle@node1 ~]$ olsnodes -c
rac-scan

 

To display global public and global cluster_interconnect :

[oracle@node1 ~]$ oifcfg getif
eth0  192.168.100.0  global  public
eth1  192.168.1.0  global  cluster_interconnect

 

To display the database registered in the repository :

[oracle@gpp4 ~]$ srvctl config database
TESTRACDB

 

To display the configuration details of the database :

[oracle@TEST4 ~]$ srvctl config database -d TESTRACDB
Database unique name: TESTRACDB
Database name: TESTRACDB
Oracle home: /home/oracle/product/11.2.0/db_home1
Oracle user: oracle
Spfile: +DATA/TESTRACDB/spfileTESTRACDB.ora
Domain: 
Start options: open
Stop options: immediate
Database role: PRIMARY
Management policy: AUTOMATIC
Server pools: TESTRACDB
Database instances: TESTRACDB1,TESTRACDB2
Disk Groups: DATA,ARCH
Mount point paths: 
Services: SRV_TESTRACDB
Type: RAC
Database is administrator managed

 

To change  policy of database from automatic to manual :

[oracle@TEST4 ~]$ srvctl modify database -d TESTRACDB -y MANUAL

 

To change  the startup option of database from open to mount :

[oracle@TEST4 ~]$ srvctl modify database -d TESTDB -s mount

 

To start RAC listener :

[oracle@TEST4 ~]$ srvctl start listener

 

To display the status of the database :

[oracle@TEST4 ~]$ srvctl status database -d TESTRACDB
Instance TESTRACDB1 is running on node TEST4
Instance TESTRACDB2 is running on node TEST5

 

To display the status services running in the database :

[oracle@TEST4 ~]$ srvctl status service -d TESTRACDB
Service SRV_TESTRACDB is running on instance(s) TESTRACDB1,TESTRACDB2

 

To check nodeapps running on a node :

[oracle@TEST4 ~]$ srvctl status nodeapps
VIP TEST4-vip is enabled
VIP TEST4-vip is running on node: TEST4
VIP TEST5-vip is enabled
VIP TEST5-vip is running on node: TEST5
Network is enabled
Network is running on node: TEST4
Network is running on node: TEST5
GSD is enabled
GSD is not running on node: TEST4
GSD is not running on node: TEST5
ONS is enabled
ONS daemon is running on node: TEST4
ONS daemon is running on node: TEST5
 

 
[oracle@TEST4 ~]$  srvctl status nodeapps -n TEST4
VIP TEST4-vip is enabled
VIP TEST4-vip is running on node: TEST4
Network is enabled
Network is running on node: TEST4
GSD is enabled
GSD is not running on node: TEST4
ONS is enabled
ONS daemon is running on node: TEST4

 

To start or stop all instances associated with a database. This command also starts services and listeners on each node :

[oracle@TEST4 ~]$ srvctl start database -d TESTRACDB

 

To shut down instances and services (listeners not stopped):

[oracle@TEST4 ~]$ srvctl stop database -d TESTRACDB

 

You can use -o option to specify startup/shutdown options.
To shutdown immediate database – srvctl stop database -d TESTRACDB -o immediate
To startup force all instances – srvctl start database -d TESTRACDB -o force
To perform normal shutdown – srvctl stop database -d TESTRACDB -i instance racnode1

To start or stop the ASM instance on racnode01 cluster node :

[oracle@TEST4 ~]$ srvctl start asm -n racnode1
[oracle@TEST4 ~]$ srvctl stop asm -n racnode1

 

To display current configuration of the SCAN VIP’s :

[oracle@test4 ~]$ srvctl config scan
SCAN name: vmtestdb.exo.local, Network: 1/192.168.5.0/255.255.255.0/eth0
SCAN VIP name: scan1, IP: /vmtestdb.exo.local/192.168.5.100
SCAN VIP name: scan2, IP: /vmtestdb.exo.local/192.168.5.101
SCAN VIP name: scan3, IP: /vmtestdb.exo.local/192.168.5.102

 

Refreshing  SCAN VIP’s with new IP addresses from DNS :

[oracle@test4 ~]$ srvctl modify scan -n your-scan-name.example.com

 

To stop or start SCAN listener and the  SCAN VIP resources :

[oracle@test4 ~]$ srvctl stop scan_listener 
[oracle@test4 ~]$ srvctl start scan_listener 
[oracle@test4 ~]$ srvctl stop scan
[oracle@test4 ~]$ srvctl start scan

 

To display the status of SCAN VIP’s and SCAN listeners :

[oracle@test4 ~]$ srvctl status scan
SCAN VIP scan1 is enabled
SCAN VIP scan1 is running on node test4
SCAN VIP scan2 is enabled
SCAN VIP scan2 is running on node test5
SCAN VIP scan3 is enabled
SCAN VIP scan3 is running on node test5
 
 
[oracle@test4 ~]$ srvctl status scan_listener
SCAN Listener LISTENER_SCAN1 is enabled
SCAN listener LISTENER_SCAN1 is running on node test4
SCAN Listener LISTENER_SCAN2 is enabled
SCAN listener LISTENER_SCAN2 is running on node test5
SCAN Listener LISTENER_SCAN3 is enabled
SCAN listener LISTENER_SCAN3 is running on node test5

 

To add/remove/modify SCAN :

[oracle@test4 ~]$ srvctl add scan -n your-scan
[oracle@test4 ~]$ srvctl remove scan
[oracle@test4 ~]$ srvctl modify scan -n new-scan

 

To add/remove SCAN listener :

[oracle@test4 ~]$ srvctl add scan_listener
[oracle@test4 ~]$ srvctl remove scan_listener

 

To modify SCAN listener port :

srvctl modify scan_listener -p <port_number>
srvctl modify scan_listener -p <port_number>  (reflect changes to the current SCAN listener only)

To start the ASM instnace in mount state :

ASMCMD> startup --mount

 

To shut down ASM instance immediately(database instance must be shut down before the ASM instance is shut down) :

ASMCMD> shutdown --immediate

 

Use lsop command on ASMCMD to list ASM operations :

ASMCMD > lsop

 

To perform quick health check of OCR :

[oracle@test4 ~]$ ocrcheck
Status of Oracle Cluster Registry is as follows :
	 Version                  :          3
	 Total space (kbytes)     :     262120
	 Used space (kbytes)      :       3304
	 Available space (kbytes) :     258816
	 ID                       : 1555543155
	 Device/File Name         :      +DATA
                                    Device/File integrity check succeeded
	 Device/File Name         :       +OCR
                                    Device/File integrity check succeeded

                                    Device/File not configured

                                    Device/File not configured

                                    Device/File not configured

	 Cluster registry integrity check succeeded

	 Logical corruption check bypassed due to non-privileged user

 

To dump content of OCR file into an xml :

[oracle@test4 ~]$ ocrdump testdump.xml -xml

 

To add or relocate the OCR mirror file to the specified location :

[oracle@test4 ~]$ ocrconfig -replace ocrmirror ‘+TESTDG’
[oracle@test4 ~]$ ocrconfig -replace +CURRENTOCRDG -replacement +NEWOCRDG

 

To relocate existing OCR file :

[oracle@test4 ~]$ ocrconfig  -replce ocr ‘+TESTDG’

 

To add mirrod disk group for OCR :

[oracle@test4 ~]$ ocrconfig -add +TESTDG

 

To remove OCR mirror :

ocrconfig -delete +TESTDG

 

To remove the OCR or the OCR mirror :

[oracle@test4 ~]$ ocrconfig -replace ocr

[oracle@test4 ~]$ ocrconfig replace ocrmirror

 

To list ocrbackup list :

[oracle@test4 ~]$ ocrconfig -showbackup

test5     2016/04/16 17:30:29     /home/oracle/app/11.2.0/grid/cdata/vmtestdb/backup00.ocr

test5     2016/04/16 13:30:29     /home/oracle/app/11.2.0/grid/cdata/vmtestdb/backup01.ocr

test5     2016/04/16 09:30:28     /home/oracle/app/11.2.0/grid/cdata/vmtestdb/backup02.ocr

test5     2016/04/15 13:30:26     /home/oracle/app/11.2.0/grid/cdata/vmtestdb/day.ocr

test5     2016/04/08 09:30:03     /home/oracle/app/11.2.0/grid/cdata/vmtestdb/week.ocr

 

Performs OCR backup manually :

[root@testdb1 ~]# ocrconfig -manualbackup

testdb1     2016/04/16 17:31:42     /votedisk/backup_20160416_173142.ocr     0  

 

Changes OCR autobackup directory

[root@testdb1 ~]# ocrconfig -backuploc /backups/ocr

 

To verify the integrity of all the cluster nodes:

[oracle@node1]$ cluvfy comp ocr -n all -verbose
Verifying OCR integrity 
Checking OCR integrity...

Checking the absence of a non-clustered configuration...
All nodes free of non-clustered, local-only configurations

Checking daemon liveness...

Check: Liveness for "CRS daemon"
  Node Name                             Running?                
  ------------------------------------  ------------------------
  node2                                yes                     
  node1                                yes                     
Result: Liveness check passed for "CRS daemon"

Checking OCR config file "/etc/oracle/ocr.loc"...
OCR config file "/etc/oracle/ocr.loc" check successful

Disk group for ocr location "+DATA/testdb-scan/OCRFILE/registry.255.903592771" is available on all the nodes
Disk group for ocr location "+CRS/testdb-scan/OCRFILE/registry.255.903735431" is available on all the nodes
Disk group for ocr location "+MULTIPLEX/testdb-scan/OCRFILE/registry.255.903735561" is available on all the nodes

Checking OCR backup location "/bkpdisk"
OCR backup location "/bkpdisk" check passed
Checking OCR dump functionality
OCR dump check passed

NOTE: 
This check does not verify the integrity of the OCR contents. Execute 'ocrcheck' as a privileged user to verify the contents of OCR.
OCR integrity check passed
Verification of OCR integrity was successful. 

.

Enable Cluster Time Synchronization Service on Oracle 11gr2 RAC


1) If Synchronization Service works with NTP   then CTSS must be in Observer mode. Lets check it:

[oracle@node1 ~]$grid_env
[oracle@node1 ~]$ crsctl check ctss
CRS-4700: The Cluster Time Synchronization Service is in Observer mode.

[oracle@node2 ~]$ grid_env
[oracle@node2 ~]$ crsctl check ctss
CRS-4700: The Cluster Time Synchronization Service is in Observer mode.

This means RAC works with NTP.

2) Now lets disable NTP

[oracle@node1 ~]$ su -
Password:
[root@node1 ~]# grid_env
[root@node1 ~]# crsctl stop crs
<<<output trimmed>>>
CRS-2793: Shutdown of Oracle High Availability Services-managed resources on 'node1' has completed
CRS-4133: Oracle High Availability Services has been stopped.
[root@node2 ~]# crsctl stop crs
<<<output trimmed>>>
CRS-2793: Shutdown of Oracle High Availability Services-managed resources on 'node2' has completed
CRS-4133: Oracle High Availability Services has been stopped.
[oracle@node1 ~]$ /sbin/service ntpd stop
[root@node1 ~]# chkconfig ntpd off
[oracle@node2 ~]$ /sbin/service ntpd stop
[root@node2 ~]# chkconfig ntpd off
[root@node1 ~]# mv /etc/ntp.conf /tmp/
[root@node2 ~]# mv /etc/ntp.conf /tmp/

3. Start the cluster on all nodes

[root@node1 ~]# crsctl start crs
CRS-4123: Oracle High Availability Services has been started.
[root@node2 ~]# crsctl start crs
CRS-4123: Oracle High Availability Services has been started.

4. Now let’s check ctss .  And we saw that ctss starts in active mode :

[oracle@node1 ~]$ crsctl check ctss
CRS-4701: The Cluster Time Synchronization Service is in Active mode.
CRS-4702: Offset (in msec): 0
[root@node2 ~]# crsctl check ctss
CRS-4701: The Cluster Time Synchronization Service is in Active mode.
CRS-4702: Offset (in msec): 0

How to create OCR mirror diskgroup and OCR backup


İlk olaraq Virtualbox-da 2 ədəd disk yaradırıq. Bunun üçün VirtualBoxManager-i açıb diski əlavə edəcəyimiz nod-lardan birini seçirik, daha sonra Settings->Storage->Create new disk seçirik:

Image

Hadrd drive tipi kimi vdi(virtual box image) seçirik

vdi

Növbəti pəncərədə fixed size seçirik və next vuraraq davam edirik
fixed
Yaradacağımız diskin adını, yerləşəcəyi yeri və diskin olçüsünü təyin edib, create düyməsini sıxaraq diskimizi yaradırıq
path
disc1
Bu qayda ilə ikinci diskimizidə yaradırıq
d2
Daha sonra disklərimizi paylaşıla bilən etmək üçün File->Virtual Media Manager-ə daxil oluruq
sharable
Bu pəncərədə yuxarıda yaratdığımız diskləri bir bir seçib modify düyməsini sıxmaqla açılan pəncərədən Shareable seçməklə disklərimizi paylaşıla bilən edirik.
sh
Daha sonra 2-ci nod-a bu shared diskləri əlavə edirik storage bölməsindən əlavə edirik
Daha sonra hər iki nodumuzu start edirik
root user-nin adından aşağıdakı komandaları icra edərək təzə əlavə olunmuş disklərimizi görürük

[pcsh lang=”bash” tab_size=”4″ message=”” hl_lines=”” provider=”manual”]

[root@node1 ~]# cd /dev
[root@node1 dev]# ls sd*
sda  sda1  sda2   sdh  sdi

[/pcsh]

Daha sonra Fdisk əmrindən istifadə edərək sdhsdi disklərini partition-lara ayırırıq
Hər iki disk üçün aşağıdakı arcıllığı icra etmək lazımdır: 

[pcsh lang=”bash” tab_size=”4″ message=”” hl_lines=”” provider=”manual”]

fdisk/dev/sdh
n
p
1
1
Enter
w

[/pcsh]

[pcsh lang=”bash” tab_size=”4″ message=”” hl_lines=”” provider=”manual”]

[root@node1 dev]# fdisk /dev/sdh
Device contains neither a valid DOS partition table, nor Sun, SGI or OSF disklabel
Building a new DOS disklabel with disk identifier 0xa67a97e6.
Changes will remain in memory only, until you decide to write them.
After that, of course, the previous content won't be recoverable.

Warning: invalid flag 0x0000 of partition table 4 will be corrected by w(rite)

WARNING: DOS-compatible mode is deprecated. It's strongly recommended to
switch off the mode (command 'c') and change display units to
sectors (command 'u').

Command (m for help): n
Command action
e extended
p primary partition (1-4)
p
Partition number (1-4): 1
First cylinder (1-522, default 1): 1
Last cylinder, +cylinders or +size{K,M,G} (1-522, default 522):
Using default value 522

Command (m for help): w
The partition table has been altered!

[/pcsh]

Bütün disklər müvəffəqiyyətlə partitionlara ayrıldıqdan sonra  /dev direktoriyasına daxil olub ls komandası ilə aşağıdakı nəticəni  almalıyıq:

[pcsh lang=”bash” tab_size=”4″ message=”” hl_lines=”” provider=”manual”]

[root@node1 dev]# ls sd*
sda sda1 sda2 sdh sdh1 sdi sdi1

[/pcsh]

Aşağıdakı əmri yeni disklərimiz üçün işlədib onlarin SCSI ID-lərini götürüb 99-oracle-asmdevices.rules faylının içinə aşağıdakı kimi yazırıq (hər iki nod-da)

[pcsh lang=”bash” tab_size=”4″ message=”” hl_lines=”” provider=”manual”]

[root@node1 dev]# /sbin/scsi_id -g -u -d /dev/sdi1
1ATA_VBOX_HARDDISK_VBec9d247a-6a947164
[root@node1 dev]# /sbin/scsi_id -g -u -d /dev/sdh1
1ATA_VBOX_HARDDISK_VBc245e63c-5fc4ab9a

[root@node1 dev]# vi /etc/udev/rules.d/99-oracle-asmdevices.rules
KERNEL=="sd?1", BUS=="scsi", PROGRAM=="/sbin/scsi_id -g -u -d /dev/$parent", RESULT=="1ATA_VBOX_HARDDISK_VBc245e63c-5fc4ab9a", NAME="test-disk1", OWNER="oracle", GROUP="dba", MODE="0660"
KERNEL=="sd?1", BUS=="scsi", PROGRAM=="/sbin/scsi_id -g -u -d /dev/$parent", RESULT=="1ATA_VBOX_HARDDISK_VBec9d247a-6a947164", NAME="test-disk2", OWNER="oracle", GROUP="dba", MODE="0660"

[/pcsh]

Dəyişikliklər olunmuş partionları yükləyirik:

[pcsh lang=”bash” tab_size=”4″ message=”” hl_lines=”” provider=”manual”]

[root@node1 dev]# /sbin/partprobe /dev/sdh1
[root@node1 dev]# /sbin/partprobe /dev/sdi1

[/pcsh]

 UDEV qaydalarını yenidən yükləyib start edirik

[pcsh lang=”bash” tab_size=”4″ message=”” hl_lines=”” provider=”manual”]

[root@node1 dev]# /sbin/udevadm control --reload-rules
[root@node1 dev]# /sbin/start_udev
Starting udev: [ OK ]

[/pcsh]

Daha sonra SYSASM adından login olub aşağıdakı əmri icra etmək asm diskstringlərimiz barədə məlumatı ala bilərik:

[pcsh lang=”bash” tab_size=”4″ message=”” hl_lines=”” provider=”manual”]

[oracle@node1 Desktop]$ sqlplus / as sysasm
SQL> show parameter asm_diskstring

NAME TYPE VALUE
---------------------- ----------- ------------------------------
asm_diskstring string /dev/asm*, /dev/ocr*

[/pcsh]

Daha sonra aşağıdakı əmri icra etməklə asm_disktring-ə  yeni disklərimizin yolunu əlavə edirik

[pcsh lang=”bash” tab_size=”4″ message=”” hl_lines=”” provider=”manual”]

SQL> alter system set asm_diskstring='/dev/asm*','/dev/ocr*','/dev/test*' scope=both;

System altered.

SQ> show parameter asm_diskstring

NAME TYPE VALUE
------------------------ ----------- ------------------------------
asm_diskstring string /dev/asm*, /dev/ocr*, /dev/test*

[/pcsh]

Oracle userinin adından girib Grid eviroment dəyişənlərini təyin ediririk və asmca komandasını işlədirik. Aşağıdakı pəncərə açılır və bu alətin vasitəsilə aşağıdakı ardıcıllıqla diskqrup yaradırıq:
asmca
Create düyməsini vururuq açılan pəncərədən yaratdığımız diskləri, redundancy növünü seçirik, disk qrupumuza ad verib, yeni diskqrupu yaradırıq:
cdq
OCRCHECK komandasını işlətməklə OCR faylının vəziyyəti barədə lazımi məlumatları alırıq:
ocrcheck
OCR faylımız üçün mirror diskgroup əlavə etmək üçün aşağıdakı komandanı icra edirik

[pcsh lang=”bash” tab_size=”4″ message=”” hl_lines=”” provider=”manual”]

[root@node1 ~]# ocrconfig -add +TESTDG

[/pcsh]

Daha sonra bir daha ocrcheck komandasını işlətməklə mirorumuzun əlavə olunduğunu görürük. Bu şəkildə 2 mirror var, ümumilikdə 5 mirorr disk qrupu əlavə etmək olar.
chchk2
Hər hansı OCR mirroru silmək üçün aşağıdakı komandanı işlədirik

[pcsh lang=”bash” tab_size=”4″ message=”” hl_lines=”” provider=”manual”]

[root@node1 ~]# ocrconfig -delete +TESTDG

[/pcsh]

ocrcheck komandasını icra etməklə biz mirrorun silindiyinə əmin ola bilərik

rmdg

 OCR və ya OCRMIRROR-u dəyişək üçün aşağıdakı komanda icra olunur

[pcsh lang=”bash” tab_size=”4″ message=”” hl_lines=”” provider=”manual”]

[root@node1 ~]# ocrconfig -replace +DGOCRMIRROR -replacement +TESTDG

[/pcsh]

ocrconfig -showbackup komandasi icra edərək biz ocr backuplarımıza baxa bilərik:

 1cc594b124e1b1bae5e00eedf82fa40d

 ocrconfig –manualbackup komandası vasitəsilə OCR faylımızın manual backupını ala bilərik:

[pcsh lang=”bash” tab_size=”4″ message=”” hl_lines=”” provider=”manual”]

[root@node1 ~]# ocrconfig -manualbackup
node1 2015/01/09 12:27:52 /u01/app/11.2.0/grid/cdata/rac-scan/backup_20150109_122752.ocr
node2 2015/01/08 18:59:45 /u01/app/11.2.0/grid/cdata/rac-scan/backup_20150108_185945.ocr

[/pcsh]

First at all we create two discs on VirtualBox. For it we opening VirtualBoxManager and select one of the nodes where we need to add disc, then select  Settings->Storage->Create new disk seçirik:

Image

Select  vdi (virtual box image) for hard drive type

vdi

Select fixed size and click  next to continue
fixed
Define name, location and size of the disc, then click create button to create the disc.
path
disc1
Bu qayda ilə ikinci diskimizidə yaradırıq
d2
To make disks sharable, go to File->Virtual Media Manager 
sharable
Bu pəncərədə yuxarıda yaratdığımız diskləri bir bir seçib modify düyməsini sıxmaqla açılan pəncərədən Shareable seçməklə disklərimizi paylaşıla bilən edirik.
sh
Daha sonra 2-ci nod-a bu shared diskləri əlavə edirik storage bölməsindən əlavə edirik
Daha sonra hər iki nodumuzu start edirik
root user-nin adından aşağıdakı komandaları icra edərək təzə əlavə olunmuş disklərimizi görürük

[pcsh lang=”bash” tab_size=”4″ message=”” hl_lines=”” provider=”manual”]

[root@node1 ~]# cd /dev
[root@node1 dev]# ls sd*
sda  sda1  sda2   sdh  sdi

[/pcsh]

Daha sonra Fdisk əmrindən istifadə edərək sdhsdi disklərini partition-lara ayırırıq
Hər iki disk üçün aşağıdakı arcıllığı icra etmək lazımdır: 

[pcsh lang=”bash” tab_size=”4″ message=”” hl_lines=”” provider=”manual”]

fdisk/dev/sdh
n
p
1
1
Enter
w

[/pcsh]

[pcsh lang=”bash” tab_size=”4″ message=”” hl_lines=”” provider=”manual”]

[root@node1 dev]# fdisk /dev/sdh
Device contains neither a valid DOS partition table, nor Sun, SGI or OSF disklabel
Building a new DOS disklabel with disk identifier 0xa67a97e6.
Changes will remain in memory only, until you decide to write them.
After that, of course, the previous content won't be recoverable.

Warning: invalid flag 0x0000 of partition table 4 will be corrected by w(rite)

WARNING: DOS-compatible mode is deprecated. It's strongly recommended to
switch off the mode (command 'c') and change display units to
sectors (command 'u').

Command (m for help): n
Command action
e extended
p primary partition (1-4)
p
Partition number (1-4): 1
First cylinder (1-522, default 1): 1
Last cylinder, +cylinders or +size{K,M,G} (1-522, default 522):
Using default value 522

Command (m for help): w
The partition table has been altered!

[/pcsh]

Bütün disklər müvəffəqiyyətlə partitionlara ayrıldıqdan sonra  /dev direktoriyasına daxil olub ls komandası ilə aşağıdakı nəticəni  almalıyıq:

[pcsh lang=”bash” tab_size=”4″ message=”” hl_lines=”” provider=”manual”]

[root@node1 dev]# ls sd*
sda sda1 sda2 sdh sdh1 sdi sdi1

[/pcsh]

Aşağıdakı əmri yeni disklərimiz üçün işlədib onlarin SCSI ID-lərini götürüb 99-oracle-asmdevices.rules faylının içinə aşağıdakı kimi yazırıq (hər iki nod-da)

[pcsh lang=”bash” tab_size=”4″ message=”” hl_lines=”” provider=”manual”]

[root@node1 dev]# /sbin/scsi_id -g -u -d /dev/sdi1
1ATA_VBOX_HARDDISK_VBec9d247a-6a947164
[root@node1 dev]# /sbin/scsi_id -g -u -d /dev/sdh1
1ATA_VBOX_HARDDISK_VBc245e63c-5fc4ab9a

[root@node1 dev]# vi /etc/udev/rules.d/99-oracle-asmdevices.rules
KERNEL=="sd?1", BUS=="scsi", PROGRAM=="/sbin/scsi_id -g -u -d /dev/$parent", RESULT=="1ATA_VBOX_HARDDISK_VBc245e63c-5fc4ab9a", NAME="test-disk1", OWNER="oracle", GROUP="dba", MODE="0660"
KERNEL=="sd?1", BUS=="scsi", PROGRAM=="/sbin/scsi_id -g -u -d /dev/$parent", RESULT=="1ATA_VBOX_HARDDISK_VBec9d247a-6a947164", NAME="test-disk2", OWNER="oracle", GROUP="dba", MODE="0660"

[/pcsh]

Dəyişikliklər olunmuş partionları yükləyirik:

[pcsh lang=”bash” tab_size=”4″ message=”” hl_lines=”” provider=”manual”]

[root@node1 dev]# /sbin/partprobe /dev/sdh1
[root@node1 dev]# /sbin/partprobe /dev/sdi1

[/pcsh]

 UDEV qaydalarını yenidən yükləyib start edirik

[pcsh lang=”bash” tab_size=”4″ message=”” hl_lines=”” provider=”manual”]

[root@node1 dev]# /sbin/udevadm control --reload-rules
[root@node1 dev]# /sbin/start_udev
Starting udev: [ OK ]

[/pcsh]

Daha sonra SYSASM adından login olub aşağıdakı əmri icra etmək asm diskstringlərimiz barədə məlumatı ala bilərik:

[pcsh lang=”bash” tab_size=”4″ message=”” hl_lines=”” provider=”manual”]

[oracle@node1 Desktop]$ sqlplus / as sysasm
SQL> show parameter asm_diskstring

NAME TYPE VALUE
---------------------- ----------- ------------------------------
asm_diskstring string /dev/asm*, /dev/ocr*

[/pcsh]

Daha sonra aşağıdakı əmri icra etməklə asm_disktring-ə  yeni disklərimizin yolunu əlavə edirik

[pcsh lang=”bash” tab_size=”4″ message=”” hl_lines=”” provider=”manual”]

SQL> alter system set asm_diskstring='/dev/asm*','/dev/ocr*','/dev/test*' scope=both;

System altered.

SQ> show parameter asm_diskstring

NAME TYPE VALUE
------------------------ ----------- ------------------------------
asm_diskstring string /dev/asm*, /dev/ocr*, /dev/test*

[/pcsh]

Oracle userinin adından girib Grid eviroment dəyişənlərini təyin ediririk və asmca komandasını işlədirik. Aşağıdakı pəncərə açılır və bu alətin vasitəsilə aşağıdakı ardıcıllıqla diskqrup yaradırıq:
asmca
Create düyməsini vururuq açılan pəncərədən yaratdığımız diskləri, redundancy növünü seçirik, disk qrupumuza ad verib, yeni diskqrupu yaradırıq:
cdq
OCRCHECK komandasını işlətməklə OCR faylının vəziyyəti barədə lazımi məlumatları alırıq:
ocrcheck
OCR faylımız üçün mirror diskgroup əlavə etmək üçün aşağıdakı komandanı icra edirik

[pcsh lang=”bash” tab_size=”4″ message=”” hl_lines=”” provider=”manual”]

[root@node1 ~]# ocrconfig -add +TESTDG

[/pcsh]

Daha sonra bir daha ocrcheck komandasını işlətməklə mirorumuzun əlavə olunduğunu görürük. Bu şəkildə 2 mirror var, ümumilikdə 5 mirorr disk qrupu əlavə etmək olar.
chchk2
Hər hansı OCR mirroru silmək üçün aşağıdakı komandanı işlədirik

[pcsh lang=”bash” tab_size=”4″ message=”” hl_lines=”” provider=”manual”]

[root@node1 ~]# ocrconfig -delete +TESTDG

[/pcsh]

ocrcheck komandasını icra etməklə biz mirrorun silindiyinə əmin ola bilərik

rmdg

 OCR və ya OCRMIRROR-u dəyişək üçün aşağıdakı komanda icra olunur

[pcsh lang=”bash” tab_size=”4″ message=”” hl_lines=”” provider=”manual”]

[root@node1 ~]# ocrconfig -replace +DGOCRMIRROR -replacement +TESTDG

[/pcsh]

ocrconfig -showbackup komandasi icra edərək biz ocr backuplarımıza baxa bilərik:

 1cc594b124e1b1bae5e00eedf82fa40d

 ocrconfig –manualbackup komandası vasitəsilə OCR faylımızın manual backupını ala bilərik:

[pcsh lang=”bash” tab_size=”4″ message=”” hl_lines=”” provider=”manual”]

[root@node1 ~]# ocrconfig -manualbackup
node1 2015/01/09 12:27:52 /u01/app/11.2.0/grid/cdata/rac-scan/backup_20150109_122752.ocr
node2 2015/01/08 18:59:45 /u01/app/11.2.0/grid/cdata/rac-scan/backup_20150108_185945.ocr

[/pcsh]