Tuesday, December 1, 2015

IMPORTANT RAC COMMANDS

$crsctl check cluster              check the status for a local node
$crsctl check cluster -all         check the status for all nodes

#crsctl stop cluster                stops the cluster on local nodes

#crsctl stop cluster -all           stops the cluster on all the  nodes
#crsctl start cluster                starts the cluster on local nodes
#crsctl start cluster  -all        starts the cluster on all nodes
#crsctl stop crs                stops the cluster including OHAS
#crsctl start crs               start the cluster stack
#crsctl quert css votedisk      check the status of voting disk
#crsctl quert crs activeversion      check the status of crs version
#crsctl status resource -t            list of resources running on the cluster
#crsctl status resource -t -init            list of background process for the resources
#crs_stat-t-v            list of resources running on the cluster


OCR RELATED COMMANDS
==================
#ocrcheck    check the status of OCR
#ocrdump     takes the dump of the OCR
#ocrconfig -export Take the export of OCR
#ocrconfig-showbackup     shows the OCR backup
#ocrconfig manual backup    take the OCR manual backup
#ocrconfig - replace ocr<filename>  Add OCR
#ocrconfig - replace ocrmirror<filename>  Add OCR mirror
#ocrconfig - delete  delete a file

RESOURCE RELATED COMMANDS
=======================
$srvctl config database  -d <databasename>    describes the database configuration
$srvctl status scan-lister
$srvctl status listener
srvctl start/stop  listener/scan-listener
$srvctl status database -d <databasename>     status of database
$srvctl stop database -d <databasename>     stops database
$srvctl start database -d <databasename>     starts database
$srvctl start instance -i <instance>  -d <databasename>     start instance
$srvctl stop instance -i <instance>  -d <databasename>     stops instance

SERVICE RELATED COMMANDS

$srvctl status service -d <dbname>
$srvctl stop service -s servicename -d <dbname>
$srvctl start service -s servicename -d <dbname>
$srvctl config service -s servicename -d <dbname>
$srvctl relocate service
$srvctl modify service



=====================================================================================






Thursday, September 10, 2015

removed backup

[oracle@wysheid11gr54 ~]$ find / -size "+100000000c" -print

00508T124043_5yb3p9co_.bkp
[oracle@wysheid11gr54 ~]$ rm -rf /wysheid/oracle/fast_recovery_area/PRIMARY/85E9BDFB93584EC3E0433639110A5D90/backupset/2010_05_08/o1_mf_nnndf_TAG20100508T124043_5yb3p9co_.bkp
[oracle@wysheid11gr54 ~]$ rm -rf /wysheid/oracle/fast_recovery_area/PRIMARY/85E9C746859F516EE0433639110AD051/backupset/2010_05_08/o1_mf_nnndf_TAG20100508T124043_5yb3rt1j_.bkp
[oracle@wysheid11gr54 ~]$ rm -rf /wysheid/oracle/fast_recovery_area/PRIMARY/85E9C352DFD45005E0433639110A06B6/backupset/2010_05_08/o1_mf_nnndf_TAG20100508T124043_5yb3qdmg_.bkp
[oracle@wysheid11gr54 ~]$ rm -rf /wysheid/oracle/fast_recovery_area/PRIMARY/backupset/2010_05_08/o1_mf_annnn_TAG20100508T060212_5y9d8qn4_.bkp
[oracle@wysheid11gr54 ~]$ rm -rf /wysheid/oracle/fast_recovery_area/PRIMARY/backupset/2010_05_08/o1_mf_nnndf_TAG20100508T124043_5yb3mn0g_.bkp
[oracle@wysheid11gr54 ~]$ rm -rf /wysheid/oracle/fast_recovery_area/PRIMARY/backupset/2010_05_08/o1_mf_annnn_TAG20100508T123927_5yb3k8fd_.bkp


[oracle@wysheid11gr54 ~]$ df -h
Filesystem            Size  Used Avail Use% Mounted on
/dev/sda1              41G   31G  8.6G  78% /
tmpfs                 2.3G     0  2.3G   0% /dev/shm
[oracle@wysheid11gr54 ~]$ find / -size "+100000000c" -print




Recovery Manager complete.
[oracle@wysheid11gr54 ~]$ df -h
Filesystem            Size  Used Avail Use% Mounted on
/dev/sda1              41G   31G  8.6G  78% /
tmpfs                 2.3G     0  2.3G   0% /dev/shm
[oracle@wysheid11gr54 ~]$ quit
-bash: quit: command not found

DATA GUARD CONFIGURATION ON 12c


primary DB_NAME=primary                      ip=10.17.57.54
primary DB_unique_name=primary     
  


stanby DB_NAME=primary                      ip=10.17.57.55
standbyDB_unique_name=standby    
  

show parameter db_name

show parametr db_unique_name


Note :db_name should be same on both side



PING MACHINE

With the Partitioning, Oracle Label Security, OLAP, Advanced Analytics
and Real Application Testing options
[oracle@wysheid11gr54 ~]$ ping 10.17.57.55
PING 10.17.57.55 (10.17.57.55) 56(84) bytes of data.
64 bytes from 10.17.57.55: icmp_seq=1 ttl=64 time=2.37 ms
64 bytes from 10.17.57.55: icmp_seq=2 ttl=64 time=0.519 ms
64 bytes from 10.17.57.55: icmp_seq=3 ttl=64 time=0.435 ms

--- 10.17.57.55 ping statistics ---
3 packets transmitted, 3 received, 0% packet loss, time 2000ms
rtt min/avg/max/mdev = 0.435/1.109/2.375/0.896 ms
[oracle@wysheid11gr54 ~]$ 


SQL> quit    
Disconnected from Oracle Database 12c Enterprise Edition Release 12.1.0.2.0 - 64bit Production
With the Partitioning, Oracle Label Security, OLAP, Advanced Analytics
and Real Application Testing options
[oracle@wysheid11gr54 ~]$ ping 10.17.57.55
PING 10.17.57.55 (10.17.57.55) 56(84) bytes of data.
64 bytes from 10.17.57.55: icmp_seq=1 ttl=64 time=2.37 ms
64 bytes from 10.17.57.55: icmp_seq=2 ttl=64 time=0.519 ms
64 bytes from 10.17.57.55: icmp_seq=3 ttl=64 time=0.435 ms

--- 10.17.57.55 ping statistics ---
3 packets transmitted, 3 received, 0% packet loss, time 2000ms
rtt min/avg/max/mdev = 0.435/1.109/2.375/0.896 ms
[oracle@wysheid11gr54 ~]$ ps -eaf |grep smon
oracle     728 27747  0 12:27 pts/1    00:00:00 grep smon
oracle   19924     1  0 May06 ?        00:00:10 ora_smon_primary
[oracle@wysheid11gr54 ~]$ . oraenv
ORACLE_SID = [primary] ? primary
The Oracle base remains unchanged with value /wysheid/oracle
[oracle@wysheid11gr54 ~]$ sqlplus / as sysdba

SQL*Plus: Release 12.1.0.2.0 Production on Fri May 7 12:28:27 2010

Copyright (c) 1982, 2014, Oracle.  All rights reserved.


Connected to:
Oracle Database 12c Enterprise Edition Release 12.1.0.2.0 - 64bit Production
With the Partitioning, Oracle Label Security, OLAP, Advanced Analytics
and Real Application Testing options

SQL> 


SQL> archive log list;
Database log mode              Archive Mode
Automatic archival             Enabled
Archive destination            USE_DB_RECOVERY_FILE_DEST
Oldest online log sequence     181
Next log sequence to archive   183
Current log sequence           183
SQL> show con_name

CON_NAME
------------------------------
CDB$ROOT
SQL> ALTER DATABASE FORCE LOGGING;

Database altered.

MAKE SURE YOU ARE USING PASSWORD FILE;

SQL> select * from v$pwfile_users;

USERNAME                       SYSDB SYSOP SYSAS SYSBA SYSDG SYSKM     CON_ID
------------------------------ ----- ----- ----- ----- ----- ----- ----------
SYS                            TRUE  TRUE  FALSE FALSE FALSE FALSE          0
SYSDG                          FALSE FALSE FALSE FALSE TRUE  FALSE          1
SYSBACKUP                      FALSE FALSE FALSE TRUE  FALSE FALSE          1
SYSKM                          FALSE FALSE FALSE FALSE FALSE TRUE           1


Disconnected from Oracle Database 12c Enterprise Edition Release 12.1.0.2.0 - 64bit Production
With the Partitioning, Oracle Label Security, OLAP, Advanced Analytics
and Real Application Testing options
[oracle@wysheid11gr54 ~]$ cd $ORACLE_HOME/dbs
[oracle@wysheid11gr54 dbs]$ ls -altr
total 17616
-rw-r-----  1 oracle oinstall     3584 May  4 06:42 spfileprimedb.ora.old
-rw-rw----  1 oracle oinstall     1544 May  4 14:06 hc_primedb.dat
-rw-rw----  1 oracle oinstall     1544 May  6 08:50 hc_primary.dat
-rw-r-----  1 oracle oinstall       24 May  6 08:51 lkPRIMARY
-rw-r-----  1 oracle oinstall     7680 May  6 13:53 orapwprimary
drwxr-xr-x  2 oracle oinstall     4096 May  6 14:09 .
-rw-r-----  1 oracle oinstall 17973248 May  6 14:09 snapcf_primary.f
drwxr-xr-x 70 oracle oinstall     4096 May  6 22:57 ..
-rw-r-----  1 oracle oinstall     3584 May  6 23:30 spfileprimary.ora
-rw-r--r--  1 oracle oinstall     2992 Feb  3  2012 init.ora
[oracle@wysheid11gr54 dbs]$ 


MAKE SURE LISTENER IS WORKING

[oracle@wysheid11gr54 dbs]$ lsnrctl status

LSNRCTL for Linux: Version 12.1.0.2.0 - Production on 07-MAY-2010 12:41:27

Copyright (c) 1991, 2014, Oracle.  All rights reserved.

Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=wysheid11gr54)(PORT=1521)))
STATUS of the LISTENER
------------------------
Alias                     LISTENER
Version                   TNSLSNR for Linux: Version 12.1.0.2.0 - Production
Start Date                06-MAY-2010 00:45:30
Uptime                    1 days 11 hr. 55 min. 57 sec
Trace Level               off
Security                  ON: Local OS Authentication
SNMP                      OFF
Listener Parameter File   /wysheid/oracle/11c_home/network/admin/listener.ora
Listener Log File         /wysheid/oracle/diag/tnslsnr/wysheid11gr54/listener/alert/log.xml
Listening Endpoints Summary...
  (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=wysheid11gr54)(PORT=1521)))
  (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC1521)))
  (DESCRIPTION=(ADDRESS=(PROTOCOL=tcps)(HOST=wysheid11gr54)(PORT=5500))(Security=(my_wallet_directory=/wysheid/oracle/admin/primary/xdb_wallet))(Presentation=HTTP)(Session=RAW))
Services Summary...
Service "pdb1" has 1 instance(s).
  Instance "primary", status READY, has 1 handler(s) for this service...
Service "pdb2" has 1 instance(s).
  Instance "primary", status READY, has 1 handler(s) for this service...
Service "pdb3" has 1 instance(s).
  Instance "primary", status READY, has 1 handler(s) for this service...
Service "primary" has 1 instance(s).
  Instance "primary", status READY, has 1 handler(s) for this service...
Service "primaryXDB" has 1 instance(s).
  Instance "primary", status READY, has 1 handler(s) for this service...
The command completed successfully
[oracle@wysheid11gr54 dbs]$ 


VARIFY PROPER TNS ENTRY FOR PRIMARY DATABASE
===============================================
# tnsnames.ora Network Configuration File: /wysheid/oracle/11c_home/network/admin/tnsnames.ora
# Generated by Oracle configuration tools.

PRIMARY =
  (DESCRIPTION =
    (ADDRESS = (PROTOCOL = TCP)(HOST = wysheid11gr54)(PORT = 1521))
    (CONNECT_DATA =
      (SERVER = DEDICATED)
      (SERVICE_NAME = primary)
    )
  )
PDB1 =
  (DESCRIPTION =
    (ADDRESS = (PROTOCOL = TCP)(HOST = wysheid11gr54)(PORT = 1521))
    (CONNECT_DATA =
      (SERVER = DEDICATED)
      (SERVICE_NAME =PDB1)
    )
  )


PDB2 =
  (DESCRIPTION =
    (ADDRESS = (PROTOCOL = TCP)(HOST = wysheid11gr54)(PORT = 1521))
    (CONNECT_DATA =
      (SERVER = DEDICATED)
      (SERVICE_NAME = PDB2)
    )
  )
PDB3 =
  (DESCRIPTION =
    (ADDRESS = (PROTOCOL = TCP)(HOST = wysheid11gr54)(PORT = 1521))
    (CONNECT_DATA =
      (SERVER = DEDICATED)
      (SERVICE_NAME = PDB3)
    )
  )


LISTENER_PRIMARY =
  (ADDRESS = (PROTOCOL = TCP)(HOST = wysheid11gr54)(PORT = 1521))


[oracle@wysheid11gr54 admin]$ 


SQL> show parameter db_name;

NAME                                 TYPE        VALUE
------------------------------------ ----------- ------------------------------
db_name                              string      primary
SQL> 


SQL> show parameter db_unique_name;

NAME                                 TYPE        VALUE
------------------------------------ ----------- ------------------------------
db_unique_name                       string      primary
SQL> 


SQL> alter system set log_archive_config='dg_config=(primary,standby)' scope=both;

System altered.

SQL>show parameter log_archive_dest_1

NAME                                 TYPE        VALUE
------------------------------------ ----------- ------------------------------
log_archive_dest_1                   string
log_archive_dest_10                  string
log_archive_dest_11                  string
log_archive_dest_12                  string
log_archive_dest_13                  string
log_archive_dest_14                  string
log_archive_dest_15                  string
log_archive_dest_16                  string
log_archive_dest_17                  string
log_archive_dest_18                  string
log_archive_dest_19                  string
SQL> 

SQL> alter system set log_archive_dest_1='location=/primary/arch valid_for=(all_logfiles,all_roles) db_unique_name=primary' scope=both;

System altered.

SQL> alter system set log_archive_dest_2='service=standby valid_for=(online_logfile,primary_role) db_unique_name=standby' scope=both; 

System altered.

SQL> show parameter log_archive_dest_state_2;

NAME                                 TYPE        VALUE
------------------------------------ ----------- ------------------------------
log_archive_dest_state_2             string      enable
log_archive_dest_state_20            string      enable
log_archive_dest_state_21            string      enable
log_archive_dest_state_22            string      enable
log_archive_dest_state_23            string      enable
log_archive_dest_state_24            string      enable
log_archive_dest_state_25            string      enable
log_archive_dest_state_26            string      enable
log_archive_dest_state_27            string      enable
log_archive_dest_state_28            string      enable
log_archive_dest_state_29            string      enable


alter system set log_archive_dest_2='defer' scope=spfile;
alter system set log_archive_dest_2='defer' scope=both;






SQL> alter system set log_archive_dest_state_2='defer' scope=both;

System altered.

SQL>  show parameter fal;

NAME                                 TYPE        VALUE
------------------------------------ ----------- ------------------------------
fal_client                           string
fal_server                           string
SQL> 

SQL> alter system set fal_server=standby scope =both;

System altered.

SQL> alter system set fal_client=primary scope =both;

System altered.

SQL> show parameter service 

NAME                                 TYPE        VALUE
------------------------------------ ----------- ------------------------------
service_names                        string      primary
SQL> 

SQL> show parameter remote;

NAME                                 TYPE        VALUE
------------------------------------ ----------- ------------------------------
remote_dependencies_mode             string      TIMESTAMP
remote_listener                      string
remote_login_passwordfile            string      EXCLUSIVE
remote_os_authent                    boolean     FALSE
remote_os_roles                      boolean     FALSE
result_cache_remote_expiration       integer     0



SQL> show parameter standby

NAME                                 TYPE        VALUE
------------------------------------ ----------- ------------------------------
standby_archive_dest                 string      ?/dbs/arch
standby_file_management              string      MANUAL
SQL> 

SQL> alter system set standby_file_management='AUTO' scope=both;

System altered.

SQL> show parameter convert;

NAME                                 TYPE        VALUE
------------------------------------ ----------- ------------------------------
db_file_name_convert                 string
log_file_name_convert                string
pdb_file_name_convert                string

15 rows selected.

SQL> alter system set db_file_name_convert='standby','primary' scope=spfile;

System altered.

SQL> alter system set log_file_name_convert='standby','primary' scope=spfile; 

System altered.

SQL> alter system set pdb_file_name_convert='standby','primary' scope=spfile;
System altered

wyshied/oradata/wyshied/redo
SQL> alter database add standby logfile group 4 ('/home/oracle/primary/stand1.log') size 50M;

Database altered.

SQL> alter database add standby logfile group 5 ('/home/oracle/primary/stand2.log') size 50M;

Database altered.

SQL> alter database add standby logfile group 6('/home/oracle/primary/stand3.log') size 50M;

Database altered.

SQL> alter database add standby logfile group 7 ('/home/oracle/primary/stand4.log') size 50M;

Database altered.

CONFIRM ENOUGH REDOLOGILE ARE CREATED
SQL>select member from v$logfile where type='STANDBY';




SQL> select member from v$logfile where type='STANDBY';

MEMBER
--------------------------------------------------------------------------------
/home/oracle/primary/stand1.log
/home/oracle/primary/stand2.log
/home/oracle/primary/stand3.log
/home/oracle/primary/stand4.log

CREATE PARAMETER FROM SPFILE;
==============================
SQL> create pfile='/tmp/initstanby.ora' from spfile;

File created.


REATE PARAMETER FROM SPFILE;
==============================
SQL> create pfile='/tmp/initstanby.ora' from spfile;

File created.

File created.
and Real Application Testing options
[oracle@wysheid11gr54 ~]$ rman target /

Recovery Manager: Release 12.1.0.2.0 - Production on Mon May 10 01:29:59 2010

Copyright (c) 1982, 2014, Oracle and/or its affiliates.  All rights reserved.

connected to target database: PRIMARY (DBID=1555757753)

RMAN> delete backup;

using target database control file instead of recovery catalog
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=1 device type=DISK

List of Backup Pieces
BP Key  BS Key  Pc# Cp# Status      Device Type Piece Name
------- ------- --- --- ----------- ----------- ----------
2       2       1   1   AVAILABLE   DISK        /wysheid/oracle/fast_recovery_area/PRIMARY/autobackup/2010_05_08/o1_mf_s_718437006_5y9ckqyv_.bkp
3       3       1   1   AVAILABLE   DISK        /wysheid/oracle/fast_recovery_area/PRIMARY/backupset/2010_05_08/o1_mf_annnn_TAG20100508T060212_5y9d8qn4_.bkp
6       6       1   1   AVAILABLE   DISK        /wysheid/oracle/fast_recovery_area/PRIMARY/backupset/2010_05_08/o1_mf_annnn_TAG20100508T123927_5yb3k8fd_.bkp
7       7       1   1   AVAILABLE   DISK        /wysheid/oracle/fast_recovery_area/PRIMARY/backupset/2010_05_08/o1_mf_nnndf_TAG20100508T124043_5yb3mn0g_.bkp
8       8       1   1   AVAILABLE   DISK        /wysheid/oracle/fast_recovery_area/PRIMARY/85E9BDFB93584EC3E0433639110A5D90/backupset/2010_05_08/o1_mf_nnndf_TAG20100508T124043_5yb3p9co_.bkp
9       9       1   1   AVAILABLE   DISK        /wysheid/oracle/fast_recovery_area/PRIMARY/85E9C352DFD45005E0433639110A06B6/backupset/2010_05_08/o1_mf_nnndf_TAG20100508T124043_5yb3qdmg_.bkp
10      10      1   1   AVAILABLE   DISK        /wysheid/oracle/fast_recovery_area/PRIMARY/85E9C746859F516EE0433639110AD051/backupset/2010_05_08/o1_mf_nnndf_TAG20100508T124043_5yb3rt1j_.bkp
11      11      1   1   AVAILABLE   DISK        /wysheid/oracle/fast_recovery_area/PRIMARY/backupset/2010_05_10/o1_mf_annnn_TAG20100510T011707_5yg49wpb_.bkp
12      12      1   1   AVAILABLE   DISK        /wysheid/oracle/fast_recovery_area/PRIMARY/backupset/2010_05_10/o1_mf_annnn_TAG20100510T012619_5yg4v43z_.bkp

Do you really want to delete the above objects (enter YES or NO)? yes
deleted backup piece
backup piece handle=/wysheid/oracle/fast_recovery_area/PRIMARY/autobackup/2010_05_08/o1_mf_s_718437006_5y9ckqyv_.bkp RECID=2 STAMP=718437007
deleted backup piece
backup piece handle=/wysheid/oracle/fast_recovery_area/PRIMARY/backupset/2010_05_10/o1_mf_annnn_TAG20100510T011707_5yg49wpb_.bkp RECID=11 STAMP=718593428
deleted backup piece
backup piece handle=/wysheid/oracle/fast_recovery_area/PRIMARY/backupset/2010_05_10/o1_mf_annnn_TAG20100510T012619_5yg4v43z_.bkp RECID=12 STAMP=718593980
Deleted 3 objects

RMAN-06207: WARNING: 6 objects could not be deleted for DISK channel(s) due
RMAN-06208:          to mismatched status.  Use CROSSCHECK command to fix status
RMAN-06210: List of Mismatched objects
RMAN-06211: ==========================
RMAN-06212:   Object Type   Filename/Handle
RMAN-06213: --------------- ---------------------------------------------------
RMAN-06214: Backup Piece    /wysheid/oracle/fast_recovery_area/PRIMARY/backupset/2010_05_08/o1_mf_annnn_TAG20100508T060212_5y9d8qn4_.bkp
RMAN-06214: Backup Piece    /wysheid/oracle/fast_recovery_area/PRIMARY/backupset/2010_05_08/o1_mf_annnn_TAG20100508T123927_5yb3k8fd_.bkp
RMAN-06214: Backup Piece    /wysheid/oracle/fast_recovery_area/PRIMARY/backupset/2010_05_08/o1_mf_nnndf_TAG20100508T124043_5yb3mn0g_.bkp
RMAN-06214: Backup Piece    /wysheid/oracle/fast_recovery_area/PRIMARY/85E9BDFB93584EC3E0433639110A5D90/backupset/2010_05_08/o1_mf_nnndf_TAG20100508T124043_5yb3p9co_.bkp
RMAN-06214: Backup Piece    /wysheid/oracle/fast_recovery_area/PRIMARY/85E9C352DFD45005E0433639110A06B6/backupset/2010_05_08/o1_mf_nnndf_TAG20100508T124043_5yb3qdmg_.bkp
RMAN-06214: Backup Piece    /wysheid/oracle/fast_recovery_area/PRIMARY/85E9C746859F516EE0433639110AD051/backupset/2010_05_08/o1_mf_nnndf_TAG20100508T124043_5yb3rt1j_.bkp


RMAN> delete archivlog all;

RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-00558: error encountered while parsing input commands
RMAN-01009: syntax error: found "identifier": expecting one of: "archivelog, backuppiece, backupset, backup, controlfilecopy, copy, datafilecopy, expired, force, foreign, global, noprompt, obsolete, proxy, script"
RMAN-01008: the bad identifier was: archivlog
RMAN-01007: at line 1 column 8 file: standard input

RMAN> delete archivelog all;

released channel: ORA_DISK_1
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=1 device type=DISK
RMAN-08137: WARNING: archived log not deleted, needed for standby or upstream capture process
archived log file name=/primary/arch/1_190_718275065.dbf thread=1 sequence=190
RMAN-08137: WARNING: archived log not deleted, needed for standby or upstream capture process
archived log file name=/primary/arch/1_191_718275065.dbf thread=1 sequence=191
RMAN-08137: WARNING: archived log not deleted, needed for standby or upstream capture process
archived log file name=/primary/arch/1_192_718275065.dbf thread=1 sequence=192
RMAN-08137: WARNING: archived log not deleted, needed for standby or upstream capture process
archived log file name=/primary/arch/1_193_718275065.dbf thread=1 sequence=193
RMAN-08137: WARNING: archived log not deleted, needed for standby or upstream capture process
archived log file name=/primary/arch/1_194_718275065.dbf thread=1 sequence=194
RMAN-08137: WARNING: archived log not deleted, needed for standby or upstream capture process
archived log file name=/primary/arch/1_195_718275065.dbf thread=1 sequence=195
RMAN-08137: WARNING: archived log not deleted, needed for standby or upstream capture process
archived log file name=/primary/arch/1_196_718275065.dbf thread=1 sequence=196
RMAN-08137: WARNING: archived log not deleted, needed for standby or upstream capture process
archived log file name=/primary/arch/1_197_718275065.dbf thread=1 sequence=197
RMAN-08137: WARNING: archived log not deleted, needed for standby or upstream capture process
archived log file name=/primary/arch/1_198_718275065.dbf thread=1 sequence=198
RMAN-08137: WARNING: archived log not deleted, needed for standby or upstream capture process
archived log file name=/primary/arch/1_199_718275065.dbf thread=1 sequence=199
RMAN-08137: WARNING: archived log not deleted, needed for standby or upstream capture process
archived log file name=/primary/arch/1_200_718275065.dbf thread=1 sequence=200
RMAN-08137: WARNING: archived log not deleted, needed for standby or upstream capture process
archived log file name=/primary/arch/1_201_718275065.dbf thread=1 sequence=201
RMAN-08137: WARNING: archived log not deleted, needed for standby or upstream capture process
archived log file name=/primary/arch/1_202_718275065.dbf thread=1 sequence=202

RMAN> backup database plus archivelog;


Starting backup at 10-MAY-10
current log archived
using channel ORA_DISK_1
channel ORA_DISK_1: starting archived log backup set
channel ORA_DISK_1: specifying archived log(s) in backup set
input archived log thread=1 sequence=190 RECID=21 STAMP=718432602
input archived log thread=1 sequence=191 RECID=22 STAMP=718437723
input archived log thread=1 sequence=192 RECID=23 STAMP=718438209
input archived log thread=1 sequence=193 RECID=24 STAMP=718441821
input archived log thread=1 sequence=194 RECID=25 STAMP=718456427
input archived log thread=1 sequence=195 RECID=26 STAMP=718460404
input archived log thread=1 sequence=196 RECID=27 STAMP=718461566
input archived log thread=1 sequence=197 RECID=28 STAMP=718462897
input archived log thread=1 sequence=198 RECID=29 STAMP=718462909
input archived log thread=1 sequence=199 RECID=30 STAMP=718462983
input archived log thread=1 sequence=200 RECID=31 STAMP=718466428
input archived log thread=1 sequence=201 RECID=32 STAMP=718593425
input archived log thread=1 sequence=202 RECID=33 STAMP=718593979
input archived log thread=1 sequence=203 RECID=34 STAMP=718594289
channel ORA_DISK_1: starting piece 1 at 10-MAY-10
channel ORA_DISK_1: finished piece 1 at 10-MAY-10
piece handle=/wysheid/oracle/fast_recovery_area/PRIMARY/backupset/2010_05_10/o1_mf_annnn_TAG20100510T013129_5yg54sgz_.bkp tag=TAG20100510T013129 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:03
Finished backup at 10-MAY-10

Starting backup at 10-MAY-10
using channel ORA_DISK_1
channel ORA_DISK_1: starting full datafile backup set
channel ORA_DISK_1: specifying datafile(s) in backup set
input datafile file number=00001 name=/home/oracle/primary/system01.dbf
input datafile file number=00003 name=/home/oracle/primary/sysaux01.dbf
input datafile file number=00005 name=/home/oracle/primary/undotbs01.dbf
input datafile file number=00006 name=/home/oracle/primary/users01.dbf
channel ORA_DISK_1: starting piece 1 at 10-MAY-10
channel ORA_DISK_1: finished piece 1 at 10-MAY-10
piece handle=/wysheid/oracle/fast_recovery_area/PRIMARY/backupset/2010_05_10/o1_mf_nnndf_TAG20100510T013132_5yg54wyx_.bkp tag=TAG20100510T013132 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:01:36
channel ORA_DISK_1: starting full datafile backup set
channel ORA_DISK_1: specifying datafile(s) in backup set
input datafile file number=00008 name=/home/oracle/primary/pdb1/sysaux01.dbf
input datafile file number=00007 name=/home/oracle/primary/pdb1/system01.dbf
input datafile file number=00009 name=/home/oracle/primary/pdb1/pdb1_users01.dbf
channel ORA_DISK_1: starting piece 1 at 10-MAY-10
channel ORA_DISK_1: finished piece 1 at 10-MAY-10
piece handle=/wysheid/oracle/fast_recovery_area/PRIMARY/85E9BDFB93584EC3E0433639110A5D90/backupset/2010_05_10/o1_mf_nnndf_TAG20100510T013132_5yg57wh6_.bkp tag=TAG20100510T013132 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:35
channel ORA_DISK_1: starting full datafile backup set
channel ORA_DISK_1: specifying datafile(s) in backup set
input datafile file number=00011 name=/home/oracle/primary/pdb2/sysaux01.dbf
input datafile file number=00010 name=/home/oracle/primary/pdb2/system01.dbf
input datafile file number=00012 name=/home/oracle/primary/pdb2/pdb2_users01.dbf
channel ORA_DISK_1: starting piece 1 at 10-MAY-10
channel ORA_DISK_1: finished piece 1 at 10-MAY-10
piece handle=/wysheid/oracle/fast_recovery_area/PRIMARY/85E9C352DFD45005E0433639110A06B6/backupset/2010_05_10/o1_mf_nnndf_TAG20100510T013132_5yg58zqh_.bkp tag=TAG20100510T013132 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:45
channel ORA_DISK_1: starting full datafile backup set
channel ORA_DISK_1: specifying datafile(s) in backup set
input datafile file number=00014 name=/home/oracle/primary/pdb3/sysaux01.dbf
input datafile file number=00013 name=/home/oracle/primary/pdb3/system01.dbf
input datafile file number=00015 name=/home/oracle/primary/pdb3/pdb3_users01.dbf
channel ORA_DISK_1: starting piece 1 at 10-MAY-10
channel ORA_DISK_1: finished piece 1 at 10-MAY-10
piece handle=/wysheid/oracle/fast_recovery_area/PRIMARY/85E9C746859F516EE0433639110AD051/backupset/2010_05_10/o1_mf_nnndf_TAG20100510T013132_5yg5bf3v_.bkp tag=TAG20100510T013132 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:45
channel ORA_DISK_1: starting full datafile backup set
channel ORA_DISK_1: specifying datafile(s) in backup set
input datafile file number=00004 name=/home/oracle/primary/pdbseed/sysaux01.dbf
input datafile file number=00002 name=/home/oracle/primary/pdbseed/system01.dbf
channel ORA_DISK_1: starting piece 1 at 10-MAY-10
channel ORA_DISK_1: finished piece 1 at 10-MAY-10
piece handle=/wysheid/oracle/fast_recovery_area/PRIMARY/85E56F4EF96B56C5E0433639110A0ED5/backupset/2010_05_10/o1_mf_nnndf_TAG20100510T013132_5yg5ctbb_.bkp tag=TAG20100510T013132 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:55
Finished backup at 10-MAY-10

Starting backup at 10-MAY-10
current log archived
using channel ORA_DISK_1
channel ORA_DISK_1: starting archived log backup set
channel ORA_DISK_1: specifying archived log(s) in backup set
input archived log thread=1 sequence=204 RECID=35 STAMP=718594569
channel ORA_DISK_1: starting piece 1 at 10-MAY-10
channel ORA_DISK_1: finished piece 1 at 10-MAY-10
piece handle=/wysheid/oracle/fast_recovery_area/PRIMARY/backupset/2010_05_10/o1_mf_annnn_TAG20100510T013610_5yg5flms_.bkp tag=TAG20100510T013610 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:01
Finished backup at 10-MAY-10

Starting Control File and SPFILE Autobackup at 10-MAY-10
piece handle=/wysheid/oracle/fast_recovery_area/PRIMARY/autobackup/2010_05_10/o1_mf_s_718594572_5yg5fo3b_.bkp comment=NONE
Finished Control File and SPFILE Autobackup at 10-MAY-10

RMAN> backup current controlfile for standby;

Starting backup at 10-MAY-10
using channel ORA_DISK_1
channel ORA_DISK_1: starting full datafile backup set
channel ORA_DISK_1: specifying datafile(s) in backup set
including standby control file in backup set
channel ORA_DISK_1: starting piece 1 at 10-MAY-10
channel ORA_DISK_1: finished piece 1 at 10-MAY-10
piece handle=/wysheid/oracle/fast_recovery_area/PRIMARY/backupset/2010_05_10/o1_mf_ncnnf_TAG20100510T013848_5yg5lkn0_.bkp tag=TAG20100510T013848 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:01
Finished backup at 10-MAY-10

Starting Control File and SPFILE Autobackup at 10-MAY-10
piece handle=/wysheid/oracle/fast_recovery_area/PRIMARY/autobackup/2010_05_10/o1_mf_s_718594730_5yg5lm13_.bkp comment=NONE
Finished Control File and SPFILE Autobackup at 10-MAY-10

RMAN> quit


SCP following
1)backup set
2)spfile
3)pfile what we have copied
4)tnsname.ora
5)password file
scp -r /wyshied/oracle/flash_recovery_area

[oracle@wysheid11gr54 ~]$ scp -r /wysheid/oracle/fast_recovery_area/PRIMARY/backupset/2010_05_10/* oracle@10.17.57.55:/wysheid/

COPY INIT.ORA

[oracle@wysheid11gr54 tmp]$ scp initstandby.ora oracle@10.17.57.55:/u02/app/oracle/product/12.1.0/dbhome_1/dbs/
initstandby.ora                                                                                                                      100% 1603     1.6KB/s   00:00  

COPY PASSORDFILE;
[oracle@wysheid11gr54 ~]$ scp /wysheid/oracle/11c_home/dbs/orapwprimary oracle@10.17.57.55:/u02/app/oracle/product/12.1.0/dbhome_1/dbs/

COPY TNSNAMES.ORA
[oracle@wysheid11gr54 ~]$ scp/wysheid/oracle/11c_home/network/admin/tnsnames.ora oracle@10.17.57.55:/u02/app/oracle/product/12.1.0/dbhome_1/dbs/


MAKE AN ENTRY ON ORATAB FILE ON STANDBY DATABASE INSTANCE


standby:/u02/app/oracle/product/12.1.0/dbhome_1/:N


[oracle@wysheid11gr55 /]$ . oraenv
ORACLE_SID = [oracle] ? standby
The Oracle base has been set to /u02/app/oracle
[oracle@wysheid11gr55 /]$cd $ORALCE_HOME/dbs
[oracle@wysheid11gr55 vi initstandby.ora

make changes to initstandby.ora
where ever primary is there change to standby
1, $ s#primary#standby#g

standby.__data_transfer_cache_size=0
standby.__db_cache_size=486539264
standby.__java_pool_size=16777216
standby.__large_pool_size=33554432
standby.__oracle_base='/wysheid/oracle'#ORACLE_BASE set from environment
standby.__pga_aggregate_target=486539264
standby.__sga_target=1426063360
standby.__shared_io_pool_size=67108864
standby.__shared_pool_size=805306368
standby.__streams_pool_size=0
*.audit_file_dest='/wysheid/oracle/admin/standby/adump'
*.audit_trail='db'
*.compatible='12.1.0.2.0'
*.control_files='/home/oracle/standby/control01.ctl','/wysheid/oracle/fast_recovery_area/standby/control02.ctl'
*.db_block_size=8192
*.db_domain=''
*.db_file_name_convert='standby','standby'
*.db_name='standby'
*.db_recovery_file_dest='/wysheid/oracle/fast_recovery_area'
*.db_recovery_file_dest_size=4815m
*.diagnostic_dest='/wysheid/oracle'
*.dispatchers='(PROTOCOL=TCP) (SERVICE=standbyXDB)'
                                                              1,1           Top

MAKE MODIFICATION TO INIT. ORA FILE


1 )DB NAME SHOULD BE PRIMARY DATABASE NAME
          *.db_name='primary'

        2)DB_FILE_NAME_C0NVERT
        *.db_file_name_convert='primary','standby'


          *.fal_client='standby'
          *.fal_server='primary'
           *.log_archive_config='dg_config=(primary,standby)'

*.log_file_name_convert='primary','standby'
log_archive_dest_1='location=/primary/arch valid_for=(all_logfiles,all_roles) db_unique_name=standby'
.log_archive_dest_2='service=primary valid_for=(online_logfile,standby_role) db_unique_name=primary'


CREATE DIRECTORY STRUCTURE
==============================
cat /initstanby.ora
standby.__data_transfer_cache_size=0
standby.__db_cache_size=486539264
standby.__java_pool_size=16777216
standby.__large_pool_size=33554432
standby.__oracle_base='/wysheid/oracle'#ORACLE_BASE set from environment
standby.__pga_aggregate_target=486539264
standby.__sga_target=1426063360
standby.__shared_io_pool_size=67108864
standby.__shared_pool_size=805306368
standby.__streams_pool_size=0
*.audit_file_dest='/wysheid/oracle/admin/standby/adump'
*.audit_trail='db'
*.compatible='12.1.0.2.0'
*.control_files='/home/oracle/standby/control01.ctl','/wysheid/oracle/fast_recovery_area/standby/control02.ctl'
*.db_block_size=8192
*.db_domain=''
*.db_file_name_convert='primary','standby'
*.db_name='primary'
*.db_recovery_file_dest='/wysheid/oracle/fast_recovery_area'
*.db_recovery_file_dest_size=4815m
*.diagnostic_dest='/wysheid/oracle'
*.dispatchers='(PROTOCOL=TCP) (SERVICE=standbyXDB)'
*.enable_pluggable_database=true
*.fal_client='standby'
*.fal_server='primary'
*.local_listener='LISTENER_PRIMARY'
*.log_archive_config='dg_config=(primary,standby)'
*.log_archive_dest_1='location=/primary/arch valid_for=(all_logfiles,all_roles) db_unique_name=standby'
*.log_archive_dest_2='service=primary valid_for=(online_logfile,standby_role) db_unique_name=primary'
*.log_archive_dest_state_2='defer'
*.log_archive_format='%t_%s_%r.dbf'
*.log_file_name_convert='primary','standby'
*.open_cursors=300
*.pdb_file_name_convert='standby','standby'
*.pga_aggregate_target=450m
*.processes=300
*.remote_login_passwordfile='EXCLUSIVE'
*.sga_target=1350m
*.standby_file_management='AUTO'
*.undo_tablespace='UNDOTBS1'
[oracle@wysheid11gr55 dbs]$

MAKE DIRECTORY STRUCTURE AS PER initstanby.ora


mkdir -p /wysheid/oracle/admin/standby/adump
mkdir -p /home/oracle/standby/
mkdir -p /wysheid/oracle/fast_recovery_area/standby/





COPY PASSWORDFILE FROM orapwprimary to orapwstandby
[oracle@wysheid11gr55 dbs]$ cp orapwprimary orapwstandby



[oracle@wysheid11gr55 dbs]$ sqlplus / as sysdba

SQL*Plus: Release 12.1.0.2.0 Production on Mon May 10 11:47:22 2010

Copyright (c) 1982, 2014, Oracle.  All rights reserved.

Connected to an idle instance.

SQL> startup nomount;
ORACLE instance started.

Total System Global Area 1426063360 bytes
Fixed Size                  2924400 bytes
Variable Size             486539408 bytes
Database Buffers          922746880 bytes
Redo Buffers               13852672 bytes
SQL> show parameter db_name;

NAME                                 TYPE        VALUE
------------------------------------ ----------- ------------------------------
db_name                              string      primary
SQL> show parameter db_unique_name

NAME                                 TYPE        VALUE
------------------------------------ ----------- ------------------------------
db_unique_name                       string      primary
SQL> create spfile from pfile;

File created.

SQL> shutdown immediate;
ORA-01507: database not mounted


ORACLE instance shut down.
SQL> exit
Disconnected from Oracle Database 12c Enterprise Edition Release 12.1.0.2.0 - 64bit Production
With the Partitioning, OLAP, Advanced Analytics and Real Application Testing options
[oracle@wysheid11gr55 dbs]$ sqlplus / as sysdba

SQL*Plus: Release 12.1.0.2.0 Production on Mon May 10 11:51:53 2010

Copyright (c) 1982, 2014, Oracle.  All rights reserved.

Connected to an idle instance.

SQL> startup nomount;
ORACLE instance started.

Total System Global Area 1426063360 bytes
Fixed Size                  2924400 bytes
Variable Size             486539408 bytes
Database Buffers          922746880 bytes
Redo Buffers               13852672 bytes
SQL> alter system set db_unique_name='standby' scope=spfile;

System altered.

SQL> shutdown immediate;
ORA-01507: database not mounted


ORACLE instance shut down.
SQL> startup;
ORACLE instance started.

Total System Global Area 1426063360 bytes
Fixed Size                  2924400 bytes
Variable Size             486539408 bytes
Database Buffers          922746880 bytes
Redo Buffers               13852672 bytes
ORA-00205: error in identifying control file, check alert log for more info


SQL> show parameter control;

NAME                                 TYPE        VALUE
------------------------------------ ----------- ------------------------------
control_file_record_keep_time        integer     7
control_files                        string      /home/oracle/standby/control01
                                                 .ctl, /wysheid/oracle/fast_rec
                                                 overy_area/standby/control02.c
                                                 tl
control_management_pack_access       string      DIAGNOSTIC+TUNING
SQL>

oracle@wysheid11gr55 dbs]$ cd  /home/oracle/standby/
[oracle@wysheid11gr55 standby]$ ls -al
total 8
drwxr-xr-x 2 oracle oinstall 4096 May 10 08:43 .
drwx------ 9 oracle oinstall 4096 May 10 11:30




[oracle@wysheid11gr55 standby]$ ls -ltr
total 0
[oracle@wysheid11gr55 standby]$ pwd
/wysheid/oracle/fast_recovery_area/standby
[oracle@wysheid11gr55 standby]$ ls -altr
total 8
drwxr-xr-x 3 oracle oinstall 4096 May 10 08:43 ..
drwxr-xr-x 2 oracle oinstall 4096 May 10 08:43 .

[oracle@wysheid11gr55 standby]$ sqlplus / as sysdba

SQL*Plus: Release 12.1.0.2.0 Production on Mon May 10 12:08:18 2010

Copyright (c) 1982, 2014, Oracle.  All rights reserved.


Connected to:
Oracle Database 12c Enterprise Edition Release 12.1.0.2.0 - 64bit Production
With the Partitioning, OLAP, Advanced Analytics and Real Application Testing options

SQL> show parameter db_unique_name

NAME                                 TYPE        VALUE
------------------------------------ ----------- ------------------------------
db_unique_name                       string      standby
SQL> show parameter service;

NAME                                 TYPE        VALUE
------------------------------------ ----------- ------------------------------
service_names                        string      standby
SQL> quit
Disconnected from Oracle Database 12c Enterprise Edition Release 12.1.0.2.0 - 64bit Production
With the Partitioning, OLAP, Advanced Analytics and Real Application Testing options
[oracle@wysheid11gr55 standby]$ lsnrctl start

LSNRCTL for Linux: Version 12.1.0.2.0 - Production on 10-MAY-2010 12:10:55

Copyright (c) 1991, 2014, Oracle.  All rights reserved.

Starting /u02/app/oracle/product/12.1.0/dbhome_1//bin/tnslsnr: please wait...

TNSLSNR for Linux: Version 12.1.0.2.0 - Production
System parameter file is /u02/app/oracle/product/12.1.0/dbhome_1/network/admin/listener.ora
Log messages written to /u02/app/oracle/product/12.1.0/dbhome_1/network/log/listener.log
Listening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=10.17.57.55)(PORT=1521)))
TNS-01201: Listener cannot find executable /wysheid/oracle/11c_home/bin/oracle for SID primary
 NL-08014: Failed to initialize Diagnosability framework, falling back to old network tracing/logging

  NL-08002: Diagnosability  context creation failed

Listener failed to start. See the error message(s) above...

[oracle@wysheid11gr55 standby]$