Thursday, November 29, 2012

PRCD-1229 : An attempt to access configuration of database mydb was rejected because its version 11.2.0.3.0 differs from the program version 11.2.0.2.0. Instead run the program from /u01/app/oracle/product/11.2/db_11.



##########################
## Error
##########################

mydb_1 @ siodserver4:/u01/app/oracle/diag/rdbms/mydb/mydb_1/trace
> srvctl status database -d mydb
PRCD-1027 : Failed to retrieve database mydb
PRCD-1229 : An attempt to access configuration of database mydb was rejected because its version 11.2.0.3.0 differs from the program version 11.2.0.2.0. Instead run the program from /u01/app/oracle/product/11.2/db_11.


##########################
## Cause
##########################

Error occured while trying to check the status of the database using srvctl command in 11.2.0.3.0 version

##########################
## Command Executed
##########################

srvctl status database -d mydb

##########################
## Solution
##########################

### 11.2.0.3.0

The above error has occurred because of the environment settings. Recently we have upgraded this database from 11.2.0.2.0 version to 11.2.0.3.0 version.

Eventhough CRS is updated with the latest 11.2.0.3.0 home, oratab file is still pointing to 11.2.0.2.0 home. so i have modified it to use 11.2.0.3.0 home and srvctl commands worked like a charm.

mydb_1 @ siodserver4:/u01/app/oracle/diag/rdbms/mydb/mydb_1/trace
> cat /etc/oratab |grep -i mydb
#mydb:/u01/app/oracle/product/11.2/db_4:N             # line added by Agent
#mydb_1:/u01/app/oracle/product/11.2/db_4:N   ## Commented by Sri on 30-nov-2012
#mydb_2:/u01/app/oracle/product/11.2/db_4:N   ## Commented by Sri on 30-nov-2012

mydb:/u01/app/oracle/product/11.2/db_11:N             # line added by Agent
mydb_1:/u01/app/oracle/product/11.2/db_11:N
mydb_2:/u01/app/oracle/product/11.2/db_11:N

mydb_1 @ siodserver4:/u01/app/oracle/diag/rdbms/mydb/mydb_1/trace
> srvctl status database -d mydb
Instance mydb_1 is running on node siodserver4
Online relocation: INACTIVE

If Oracle clusterware keys are not updated then use below command to update this information in cluster.

<11 .2.0.3_home=".2.0.3_home">/bin/srvctl upgrade database -d -o <11 .2.0.3_home=".2.0.3_home">

Command to check the database home :
-------------------------------------

+ASM2 @ siodserver4:/u01/app/oracle/diag/rdbms/mydb/mydb_1/trace
> srvctl config database -d mydb
Database unique name: mydb
Database name: mydb
Oracle home: /u01/app/oracle/product/11.2/db_11
Oracle user: oracle
Spfile: +mydb_DATA/mydb/spfilemydb.ora
Domain: corp.mycompany.com
Start options: open
Stop options: immediate
Database role: PRIMARY
Management policy: AUTOMATIC
Server pools: mydb
Database instances:
Disk Groups: mydb_DATA,mydb_RECO
Mount point paths:
Services: mydb_svc
Type: RACOneNode
Online relocation timeout: 10
Instance name prefix: mydb
Candidate servers: siodserver3,siodserver4
Database is administrator managed

Tuesday, November 27, 2012

Tailor made DBA Hands on Training.


Hi All,

We offer Tailor made Oracle DBA Hands on Training with most of the real time scenarios.

Instead of giving you a list of topics to learn we offer you to Choose the topic you want to learn.

Attend ORACLE DBA trainings in Weekends and become an professional ORACLE DBA.

Trainings are conducted by Real time ORACLE DBA's. And also will help to easily crack the ORACLE DBA interview.

By,

StepIntoOracleDBA

Location  : Chennai
Mobile     : 9600156001

Trainings Offered :

1) Dataguard and its Techniques ( DG 1)
2) Dataguard - Advanced Concepts ( DG 2)
3) Oracle 11g New Features
4) Oracle 11g DB Administration
5) Oracle 10g DB Administration

Thursday, November 22, 2012

Password File



How to Find location of Password File?
============================================================

Location & Naming in Windows :

$ORACLE_HOME/database/PWDdb_name.ora

Location & Naming in Unix :

$ORACLE_HOME/dbs/orapwdb_name.ora

Find Whether Password File is Available or not :

Select * from v$pwfile_users;

USERNAME                       SYSDB SYSOP SYSAS
------------------------------ ----- ----- -----
SYS                            TRUE  TRUE  FALSE

If V$pwfile_users shows output then password file is available and its being used. No Output means no Password file.

#########################################
# Test to Confirm this
#########################################

Now i'm going to rename the password file. In windows you will not be able to rename the file because it will be used. For testing purpose i shutdown the database and rename the file.

SQL> shu immediate
Database closed.
Database dismounted.
ORACLE instance shut down.
SQL> exit
Disconnected from Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options

Renamed the Password File.

C:\Users\Administrator>set oracle_sid=ora11g

C:\Users\Administrator>sqlplus / as sysdba

SQL*Plus: Release 11.2.0.1.0 Production on Thu Nov 22 20:04:23 2012

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

Connected to an idle instance.

SQL> startup
ORACLE instance started.

Total System Global Area  753278976 bytes
Fixed Size                  1374724 bytes
Variable Size             251659772 bytes
Database Buffers          494927872 bytes
Redo Buffers                5316608 bytes
Database mounted.
Database opened.

Now quering v$pwfile_users didnt show any output.

SQL> select * from v$pwfile_users;

no rows selected

I have renamed the password file to its original name and queried the database. Now its shows the output.

SQL> select * from v$pwfile_users;

USERNAME                       SYSDB SYSOP SYSAS
------------------------------ ----- ----- -----
SYS                            TRUE  TRUE  FALSE

Thursday, November 15, 2012

ORA-01274 - Resolve Archive Gaps in Standby Database




ORA-01274 Resolve Gaps in Standby Database when STANDBY_FILE_MANAGEMENT is set to MANUAL

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

************** Step By Step Procedure **************


#########################################

# Issue
#########################################

Standby was not in SYNC with primary because STANDBY_FILE_MANAGEMENT is set to MANUAL. On 09-Nov-2012 two new datafiles were added in Primary, because of this manual


settings the files got created in $ORACLE_HOME/dbs location instead of Diskgroup.


#########################################

# Alert Log Errors
#########################################

Fri Nov 09 11:19:20 2012

File #6 added to control file as 'UNNAMED00006' because
the parameter STANDBY_FILE_MANAGEMENT is set to MANUAL
The file should be manually created to continue.
MRP0: Background Media Recovery terminated with error 1274
Errors in file /u01/app/oracle/diag/rdbms/STDBY_gvl/STDBY_1/trace/STDBY_1_pr00_22594.trc:
ORA-01274: cannot add datafile '+STDBY_DATA/STDBY_stl/datafile/STDBY_data01.272.798895157' - file could not be created


#########################################

# 1) Database name & Mode
#########################################

set lines 200

col name for a15
col instance_name for a15
col log_mode for a10
col open_mode for a10
col database_Role for a20
col protection_mode for a20
col protection_level for a20
col remote_archive for a15
col flashback_on for a12

Select name,instance_name,dbid,log_mode,open_mode,database_role,protection_mode,protection_level,remote_archive,flashback_on from v$database,v$instance;


NAME            INSTANCE_NAME         DBID LOG_MODE   OPEN_MODE  DATABASE_ROLE        PROTECTION_MODE      PROTECTION_LEVEL     REMOTE_ARCHIVE  FLASHBACK_ON

--------------- --------------- ---------- ---------- ---------- -------------------- -------------------- -------------------- --------------- ------------
STDBY        STDBY_1      1579933494 ARCHIVELOG MOUNTED    PHYSICAL STANDBY     MAXIMUM PERFORMANCE  MAXIMUM PERFORMANCE  ENABLED         NO

SQL> select * from v$dataguard_config;


DB_UNIQUE_NAME

------------------------------
STDBY_gvl
STDBY_stl


#########################################

# 2) Gaps in Primary & Standby
#########################################

###############

 Primary   >>>>>>>
###############

### Find GAps


SELECT THREAD# "Thread",SEQUENCE# "Last Sequence Generated" FROM V$ARCHIVED_LOG WHERE (THREAD#,FIRST_TIME ) IN (SELECT THREAD#,MAX(FIRST_TIME) FROM V$ARCHIVED_LOG GROUP


BY THREAD#) ORDER BY 1;


Select thread#,max(sequence#) from v$archived_log group by thread#;


   THREAD# MAX(SEQUENCE#)

---------- --------------
         1             97


###############

 Standby   >>>>>>>
###############

SELECT ARCH.THREAD# "Thread", ARCH.SEQUENCE# "Last Sequence Received", APPL.SEQUENCE# "Last Sequence Applied", (ARCH.SEQUENCE# - APPL.SEQUENCE#) "Difference" FROM

(SELECT THREAD# ,SEQUENCE# FROM V$ARCHIVED_LOG WHERE (THREAD#,FIRST_TIME ) IN (SELECT THREAD#,MAX(FIRST_TIME) FROM V$ARCHIVED_LOG GROUP BY THREAD#)) ARCH,
(SELECT THREAD# ,SEQUENCE# FROM V$LOG_HISTORY WHERE (THREAD#,FIRST_TIME ) IN (SELECT THREAD#,MAX(FIRST_TIME) FROM V$LOG_HISTORY GROUP BY THREAD#)) APPL
WHERE ARCH.THREAD# = APPL.THREAD# ORDER BY 1;

    Thread Last Sequence Received Last Sequence Applied Difference

---------- ---------------------- --------------------- ----------
         1                     97                    83         14

#########################################

# 3) Place Standby in MRP mode
#########################################

SQL> alter database recover managed standby database disconnect from session;


Database altered.


MRP process termined with the below error in Alert log.



Wed Nov 14 04:58:33 2012

MRP0: Background Media Recovery terminated with error 1111
Errors in file /u01/app/oracle/diag/rdbms/STDBY_gvl/STDBY_1/trace/STDBY_1_pr00_32449.trc:
ORA-01111: name for data file 6 is unknown - rename to correct file
ORA-01110: data file 6: '/u01/app/oracle/product/11.2/db_6/dbs/UNNAMED00006'
ORA-01157: cannot identify/lock data file 6 - see DBWR trace file
ORA-01111: name for data file 6 is unknown - rename to correct file
ORA-01110: data file 6: '/u01/app/oracle/product/11.2/db_6/dbs/UNNAMED00006'
Slave exiting with ORA-1111 exception


#########################################

# 4) Check datafile Status
#########################################

###############

 Primary   >>>>>>>
###############

set lines 200

col name for a75
Select file#,name,bytes/1024/1024 "Size in MB",creation_time,status,last_time from v$datafile;

     FILE# NAME                                                                        Size in MB CREATION_ STATUS  LAST_TIME

---------- --------------------------------------------------------------------------- ---------- --------- ------- ---------
         1 +STDBY_DATA/STDBY_stl/datafile/system.256.796313651                          760 17-SEP-11 SYSTEM
         2 +STDBY_DATA/STDBY_stl/datafile/sysaux.257.796313653                          840 17-SEP-11 ONLINE
         3 +STDBY_DATA/STDBY_stl/datafile/undotbs1.258.796313653                         80 17-SEP-11 ONLINE
         4 +STDBY_DATA/STDBY_stl/datafile/users.259.796313653                             5 17-SEP-11 ONLINE
         5 +STDBY_DATA/STDBY_stl/datafile/undotbs2.266.796313803                         25 10-OCT-12 ONLINE
         6 +STDBY_DATA/STDBY_stl/datafile/STDBY_omcbc_data01.272.798895451                   1024 09-NOV-12 ONLINE
         7 +STDBY_DATA/STDBY_stl/datafile/STDBY_omcbc_indx01.273.798895897                   1024 09-NOV-12 ONLINE


###############

 Standby   >>>>>>>
###############


set lines 200

col name for a75
Select file#,name,bytes/1024/1024 "Size in MB",creation_time,status,last_time from v$datafile;

     FILE# NAME                                                                        Size in MB CREATION_ STATUS  LAST_TIME

---------- --------------------------------------------------------------------------- ---------- --------- ------- ---------
         1 +STDBY_DATA/STDBY_gvl/datafile/system.259.796323701                          750 17-SEP-11 SYSTEM
         2 +STDBY_DATA/STDBY_gvl/datafile/sysaux.262.796323701                          830 17-SEP-11 RECOVER
         3 +STDBY_DATA/STDBY_gvl/datafile/undotbs1.260.796323701                         80 17-SEP-11 ONLINE
         4 +STDBY_DATA/STDBY_gvl/datafile/users.263.796323701                             5 17-SEP-11 ONLINE
         5 +STDBY_DATA/STDBY_gvl/datafile/undotbs2.261.796323701                         25 10-OCT-12 ONLINE
         6 /u01/app/oracle/product/11.2/db_6/dbs/UNNAMED00006                                   0 09-NOV-12 RECOVER


#########################################

# 5) Check the file which is wrongly created
#########################################


set lines 200

col name for a75
select file#, name, status, creation_time from v$datafile where name like '%UNNAMED%';

     FILE# NAME                                                                        STATUS  CREATION_

---------- --------------------------------------------------------------------------- ------- ---------
         6 /u01/app/oracle/product/11.2/db_6/dbs/UNNAMED00006                          RECOVER 09-NOV-12

SQL> sho parameter standby


NAME                                 TYPE        VALUE

------------------------------------ ----------- ------------------------------
standby_file_management              string      MANUAL


select name,total_mb,free_mb from v$asm_diskgroup where state='CONNECTED';


NAME                                                                          TOTAL_MB    FREE_MB

--------------------------------------------------------------------------- ---------- ----------
STDBY_DATA                                                                   245823     242064
STDBY_RECO                                                                    65602      58545

#########################################

# 6) Rename/create Datafile to the correct Filename (Diskgroup)
#########################################

SQL>  alter database create datafile '/u01/app/oracle/product/11.2/db_6/dbs/UNNAMED00006' as '+STDBY_DATA\' size 1024m;


Database altered.


Verify the Filename is changed or not



set lines 200

col name for a75
Select file#,name,bytes/1024/1024 "Size in MB",creation_time,status,last_time from v$datafile;

     FILE# NAME                                                                        Size in MB CREATION_ STATUS  LAST_TIME

---------- --------------------------------------------------------------------------- ---------- --------- ------- ---------
         6 +STDBY_DATA/STDBY_gvl/datafile/STDBY_omcbc_data01.281.799315125                   1024 09-NOV-12 ONLINE



#########################################

# 7) Change the STANDBY_FILE_MANAGMENT to AUTO
#########################################

ALTER SYSTEM SET STANDBY_FILE_MANAGEMENT=AUTO scope=both;


SQL> ALTER SYSTEM SET STANDBY_FILE_MANAGEMENT=AUTO scope=both;


System altered.



#########################################

# 8) Start the MRP
#########################################

Alter database recover managed standby database disconnect from session;


SQL> Alter database recover managed standby database disconnect from session;


Database altered.



#########################################

# 9) Check the MRP status
#########################################

set lines 200


Select process,client_process,thread#,sequence#,block#,blocks,status from v$managed_standby order by status;


PROCESS   CLIENT_P    THREAD#  SEQUENCE#     BLOCK#     BLOCKS STATUS

--------- -------- ---------- ---------- ---------- ---------- ------------
MRP0      N/A               1         84     106642     122977 APPLYING_LOG
ARCH      ARCH              1         97     124928       1886 CLOSING
ARCH      ARCH              1         96     131072        969 CLOSING
ARCH      ARCH              1         98     122880         98 CLOSING
ARCH      ARCH              0          0          0          0 CONNECTED
RFS       ARCH              0          0          0          0 IDLE
RFS       LGWR              1         99       1090          1 IDLE
RFS       UNKNOWN           0          0          0          0 IDLE

Now the logs started applying and GAPS are resolved now.


#########################################

# 10) Check the datafile status
#########################################

set lines 200

col name for a75
Select file#,name,bytes/1024/1024 "Size in MB",creation_time,status,last_time from v$datafile;

     FILE# NAME                                                                        Size in MB CREATION_ STATUS  LAST_TIME

---------- --------------------------------------------------------------------------- ---------- --------- ------- ---------
         1 +STDBY_DATA/STDBY_gvl/datafile/system.259.796323701                          760 17-SEP-11 SYSTEM
         2 +STDBY_DATA/STDBY_gvl/datafile/sysaux.262.796323701                          840 17-SEP-11 ONLINE
         3 +STDBY_DATA/STDBY_gvl/datafile/undotbs1.260.796323701                         80 17-SEP-11 ONLINE
         4 +STDBY_DATA/STDBY_gvl/datafile/users.263.796323701                             5 17-SEP-11 ONLINE
         5 +STDBY_DATA/STDBY_gvl/datafile/undotbs2.261.796323701                         25 10-OCT-12 ONLINE
         6 +STDBY_DATA/STDBY_gvl/datafile/STDBY_omcbc_data01.281.799315125                   1024 09-NOV-12 ONLINE
         7 +STDBY_DATA/STDBY_gvl/datafile/STDBY_omcbc_indx01.282.799315233                   1024 09-NOV-12 ONLINE



###############

 Standby   >>>>>>>
###############

SELECT ARCH.THREAD# "Thread", ARCH.SEQUENCE# "Last Sequence Received", APPL.SEQUENCE# "Last Sequence Applied", (ARCH.SEQUENCE# - APPL.SEQUENCE#) "Difference" FROM

(SELECT THREAD# ,SEQUENCE# FROM V$ARCHIVED_LOG WHERE (THREAD#,FIRST_TIME ) IN (SELECT THREAD#,MAX(FIRST_TIME) FROM V$ARCHIVED_LOG GROUP BY THREAD#)) ARCH,
(SELECT THREAD# ,SEQUENCE# FROM V$LOG_HISTORY WHERE (THREAD#,FIRST_TIME ) IN (SELECT THREAD#,MAX(FIRST_TIME) FROM V$LOG_HISTORY GROUP BY THREAD#)) APPL
WHERE ARCH.THREAD# = APPL.THREAD# ORDER BY 1;

    Thread Last Sequence Received Last Sequence Applied Difference

---------- ---------------------- --------------------- ----------
         1                     98                    98          0


SQL> sho parameter standby


NAME                                 TYPE        VALUE

------------------------------------ ----------- ------------------------------
standby_archive_dest                 string      ?/dbs/arch
standby_file_management              string      AUTO

Sunday, November 11, 2012

Duplicate controlfile when files are in ASM





Duplicating a controlfile into ASM when Original controlfile is stored in ASM
============================================


 ******** Step By Step Procedure ********

#########################################
# 1) Database name & Disk Groups
#########################################

SQL> select name,open_mode,log_mode from v$database;

NAME      OPEN_MODE            LOG_MODE
--------- -------------------- ------------
MYDB   READ WRITE           ARCHIVELOG

Select name,total_mb,free_mb from v$asm_diskgroup where state='CONNECTED';

SQL> Select name,total_mb,free_mb from v$asm_diskgroup where state='CONNECTED';

NAME                             TOTAL_MB    FREE_MB
------------------------------ ---------- ----------
MYDB_DATA                      1167455    1144193
MYDB_RECO                       102518     100036

#########################################
# 2) Control files in the database
#########################################

SQL> sho parameter control

NAME                                 TYPE                             VALUE
------------------------------------ --------------------------------
control_files                        string                           +MYDB_RECO/MYDB/controlfile/current.258.798205861,
     +MYDB_RECO/MYDB/controlfile/current.259.798205863

#########################################
# 3) Add New controlfile to spfile
#########################################

SQL> sho parameter spfile

NAME                                 TYPE                             VALUE
------------------------------------ --------------------------------
spfile                               string                           +MYDB_DATA/MYDB/spfileMYDB.ora
     
If using spfile to start the instance:


Modify the spfile specifically the parameter control_files. In this example, a thrid controlfile is going to be created on different diskgroup MYDB_DATA.

alter system set control_files='+MYDB_RECO/MYDB/controlfile/current.258.798205861','+MYDB_RECO/MYDB/controlfile/current.259.798205863','+MYDB_DATA'
scope=spfile sid='*';

SQL> alter system set control_files='+MYDB_RECO/MYDB/controlfile/current.258.798205861','+MYDB_RECO/MYDB/controlfile/current.259.798205863','+MYDB_DATA'
scope=spfile sid='*';

System altered.

#########################################
# 4) Shutdown & Startup in Nomount
#########################################

Shutdown and Start the instance in NOMOUNT mode.

SQL>
SQL> shutdown immediate
Database closed.
Database dismounted.
ORACLE instance shut down.
SQL> startup nomount
ORACLE instance started.

Total System Global Area 4409401344 bytes
Fixed Size                  2235528 bytes
Variable Size            2667578232 bytes
Database Buffers         1694498816 bytes
Redo Buffers               45088768 bytes
SQL>

#########################################
# 5) Duplicate Controlfile using RMAN
#########################################

restore controlfile from '+MYDB_RECO/MYDB/controlfile/current.258.798205861';

> rman target /

Recovery Manager: Release 11.2.0.3.0 - Production on Mon Nov 12 00:00:42 2012

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

connected to target database: MYDB (not mounted)

RMAN>

restore controlfile from '+MYDB_RECO/MYDB/controlfile/current.258.798205861';

RMAN> restore controlfile from '+MYDB_RECO/MYDB/controlfile/current.258.798205861';

Starting restore at 12-NOV-12
using target database control file instead of recovery catalog
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=507 instance=MYDB_1 device type=DISK

channel ORA_DISK_1: copied control file copy
output file name=+MYDB_RECO/MYDB/controlfile/current.258.798205861
output file name=+MYDB_RECO/MYDB/controlfile/current.259.798205863
output file name=+MYDB_DATA/MYDB/controlfile/current.281.799113673
Finished restore at 12-NOV-12

RMAN>

Note that the command prints the name of the new created file: +MYDB_DATA/MYDB/controlfile/current.281.799113673

#########################################
# 6) Modify Controlfile parameter
#########################################

 Modify the control_file parameter with the complete path of the new file:

SQL> sho parameter control

NAME                                 TYPE                             VALUE
------------------------------------ --------------------------------
control_files                        string                           +MYDB_RECO/MYDB/controlfile/current.258.798205861,
     +MYDB_RECO/MYDB/controlfile/current.259.798205863,
     +MYDB_DATA

alter system set control_files='+MYDB_RECO/MYDB/controlfile/current.258.798205861','+MYDB_RECO/MYDB/controlfile/current.259.798205863',
'+MYDB_DATA/MYDB/controlfile/current.281.799113673' scope=spfile sid='*';

SQL> alter system set control_files='+MYDB_RECO/MYDB/controlfile/current.258.798205861','+MYDB_RECO/MYDB/controlfile/current.259.798205863',
'+MYDB_DATA/MYDB/controlfile/current.281.799113673' scope=spfile sid='*';

System altered.

SQL> sho parameter control

NAME                                 TYPE                             VALUE
------------------------------------ --------------------------------
control_files                        string                           +MYDB_RECO/MYDB/controlfile/current.258.798205861,
     +MYDB_RECO/MYDB/controlfile/current.259.798205863,
     +MYDB_DATA/MYDB/controlfile/current.281.799113673

#########################################
# 7) Mount and Open Database
#########################################

 Mount and Open the database

SQL> alter database mount;

Database altered.

SQL> alter database open;

Database altered.

#########################################
# 8) Validate controlfiles
#########################################

 Validate both controlfiles are present

select name from v$controlfile;

SQL> select name from v$controlfile;

NAME
------------------------------------------------------------------------------------------------------------
+MYDB_RECO/MYDB/controlfile/current.258.798205861
+MYDB_RECO/MYDB/controlfile/current.259.798205863
+MYDB_DATA/MYDB/controlfile/current.281.799113673
SQL>

Next time instance are restarted, will pick all the three control files.


SQL> shu immediate
Database closed.
Database dismounted.
ORACLE instance shut down.
SQL> startup
ORACLE instance started.

Total System Global Area 4409401344 bytes
Fixed Size                  2235528 bytes
Variable Size            2667578232 bytes
Database Buffers         1694498816 bytes
Redo Buffers               45088768 bytes
Database mounted.
Database opened.

SQL> select name,open_mode,log_mode from v$database;

NAME      OPEN_MODE            LOG_MODE
--------- -------------------- ------------
MYDB   READ WRITE           ARCHIVELOG

SQL> sho parameter spfile

NAME                                 TYPE                             VALUE
------------------------------------ -------------------------------- ------------------------------
spfile                               string                           +MYDB_DATA/MYDB/spfileMYDB.ora

SQL> sho parameter control

NAME                                 TYPE                             VALUE
------------------------------------ --------------------------------
control_files                        string                           +MYDB_RECO/MYDB/controlfile/current.258.798205861,
     +MYDB_RECO/MYDB/controlfile/current.259.798205863,
     +MYDB_DATA/MYDB/controlfile/current.281.799113673

Tuesday, July 24, 2012

Things to Check / Ask before taking Personal Loan




Things to Check / Ask before taking Personal Loan :
----------------------------------------------------------------

1) Rate of Interest

2) Floating interest or Diminishing

3) Processing Fees

4) Minimum & Maximum Tenure

5) Is pre-closure can be done, if yes what is the % charges for doing pre-closure

6) Is Part Payments allowed, if yes any charges for that and also what is the minimum amount can be paid partly?

7) When can i start doing part payments

8) Is insurance is applicable for this Loan

9) How many days it will take to process the loan?

10) How much extra i'm paying after the tenure chose by us?

11) What will be the final amount which will be credited to my account? (Believe me this varies from the calculation we make.)

12) Documents needs to be produced for loan processing.

13) If you have other loans say personal loan, and if it get bounced in last 3 months then banks will not provide loan. Please check this too.

Note :
-----------

1. Check with the bank person for the lowest Rate of Interest. Banks give low interest for employees who work in Tier 1 companies and sometimes banks offers low

interest. Please check before accepting what they says.

2. Always compare with two to three banks atleast and decide which one will be best suits as per your needs.

3. Check for waiver in processing fees, banks give discount in processing fees if they own bank accounts in that bank.

Leave your comments if something can be added up to the above list.

Sunday, May 30, 2010

Start or Stop a database Using Command in Windows

There are two methods to start a database service in windows Environment.

1. Go the run prompt and type, services.msc

This will open the services window. Choose the database service you want to start or stop.

2. Using the command.

Let our database name as "TEST"

Start a Database service

Oradim -startup -sid test

Stop a database service

Oradim -shudown -sid test


Start or Stop a Windows service using command.

To start a database service, Use any one of the below commands,

SC START ORACLESERVICETEST

NET START ORACLESERVICETEST

To Stop a database service, Use any one of the below commands,

SC STOP ORACLESERVICETEST

NET STOP ORACLESERVICETEST


Note:

The above commands just starts the service. The database still needs to be opened.

To find the status of a service.

SC QUERY ORACLESERVICETEST

OUTPUT:


C:\SEENU>SC QUERY ORACLESERVICETEST

SERVICE_NAME: ORACLESERVICETEST
TYPE : 10 WIN32_OWN_PROCESS
STATE : 4 RUNNING
(STOPPABLE, PAUSABLE, ACCEPTS_SHUTDOWN)
WIN32_EXIT_CODE : 0 (0x0)
SERVICE_EXIT_CODE : 0 (0x0)
CHECKPOINT : 0x0
WAIT_HINT : 0x0

Data Guard Interview Questions.

-->

Hi, The below interview questions and answers are taken from other websites. If you come across any other questions please comment. I will add it to this.
Comments are always welcomed.

1. Can Oracle's Data Guard be used on Standard Edition, and if so how? How can you test that the standby database is in sync?

Oracle's Data Guard technology is a layer of software and automation built on top of the standby database facility. In Oracle Standard Edition it is possible to be a standby database, and update it *manually*. Roughly, put your production database in archivelog mode. Create a hotbackup of the database and move it to the standby machine. Then create a standby controlfile on the production machine, and ship that file, along with all the archived redolog files to the standby server. Once you have all these files assembled, place them in their proper locations, recover the standby database, and you're ready to roll. From this point on, you must manually ship, and manually apply those archived redologs to stay in sync with production.

To test your standby database, make a change to a table on the production server, and commit the change. Then manually switch a logfile so those changes are archived. Manually ship the newest archived redolog file, and manually apply it on the standby database. Then open your standby database in read-only mode, and select from your changed table to verify those changes are available. Once you're done, shutdown your standby and startup again in standby mode.


2. What is the difference between Active Dataguard, and the Logical Standby implementation of 10g dataguard?

Active dataguard is mostly about the physical standby.

Use physical standby for testing without compromising protection of the production system. You can open the physical standby read/write - do some destructive things in it (drop tables, change data, whatever - run a test - perhaps with real application testing). While this is happening, redo is still streaming from production, if production fails - you are covered. Use physical standby for reporting while in managed recovery mode. Since physical standby supports all of the datatypes - and logical standby does not (11g added broader support, but not 100%) - there are times when logical standby isn’t sufficient. It also permits fast incremental backups when offloading backups to a physical standby database.

3. What is a Dataguard?

Oracle Dataguard is a disaster recovery solution from Oracle Corporation that has been utilized in the industry extensively at times of Primary site failure, failover, switchover scenarios.


4. What are the uses of Oracle Data Guard?

a) Oracle Data Guard ensures high availability, data protection, and disaster recovery for enterprise data.

b) Data Guard provides a comprehensive set of services that create, maintain, manage, and monitor one or more standby databases to enable production Oracle databases to survive disasters and data corruptions.

c) With Data Guard, administrators can optionally improve production database performance by offloading resource-intensive backup and reporting operations to standby systems.


5. What is Redo Transport Services?

It control the automated transfer of redo data from the production database to one or more archival destinations.

Redo transport services perform the following tasks:

a) Transmit redo data from the primary system to the standby systems in the configuration.
b) Manage the process of resolving any gaps in the archived redo log files due to a network failure.
c) Automatically detect missing or corrupted archived redo log files on a standby system and automatically retrieve replacement archived redo log files from the
primary database or another standby database.


6. What is apply services?

Apply redo data on the standby database to maintain transactional synchronization with the primary database. Redo data can be applied either from archived redo log files, or, if real-time apply is enabled, directly from the standby redo log files as they are being filled, without requiring the redo data to be archived first at the standby database. It also allows read-only access to the data.

7. What is difference between physical and standby databases?

The main difference between physical and logical standby databases is the manner in
which apply services apply the archived redo data:

a) For physical standby databases, Data Guard uses Redo Apply technology, which applies redo data on the standby database using standard recovery techniques of
an Oracle database.

b) For logical standby databases, Data Guard uses SQL Apply technology, which first transforms the received redo data into SQL statements and then executes the
generated SQL statements on the logical standby database.


8. What is Data Guard Broker?

Data guard Broker manage primary and standby databases using the SQL command-line interfaces or the Data Guard broker interfaces, including a command-line interface (DGMGRL) and a graphical user interface that is integrated in Oracle Enterprise Manager. It can be used to perform:

a) Create and enable Data Guard configurations, including setting up redo transport services and apply services
b) Manage an entire Data Guard configuration from any system in the configuration
c) Manage and monitor Data Guard configurations that contain Oracle RAC primary or standby databases
d) Simplify switchovers and failovers by allowing you to invoke them using either a single key click in Oracle Enterprise Manager or a single command in the DGMGRL command-line interface.
e) Enable fast-start failover to fail over automatically when the primary database becomes unavailable. When fast-start failover is enabled, the Data Guard broker determines if a failover is necessary and initiates the failover to the specified target standby database automatically, with no need for DBA intervention.

9. What are the Data guard Protection modes and summarize each?

Go for Dataguard Concept and administration Guide for good definition of each modes. Page no 33

Maximum availability :

This protection mode provides the highest level of data protection that is possible without compromising the availability of a primary database. Transactions do not commit until all redo data needed to recover those transactions has been written to the online redo log and to at least one standby database.

Maximum performance :

This is the default protection mode. It provides the highest level of data protection that is possible without affecting the performance of a primary database. This is accomplished by allowing transactions to commit as soon as all redo data generated by those transactions has been written to the online log.

Maximum protection :

This protection mode ensures that no data loss will occur if the primary database fails. To provide this level of protection, the redo data needed to recover a transaction must be written to both the online redo log and to at least one standby database before the transaction commits. To ensure that data loss cannot occur, the primary database will shut down, rather than continue processing transactions.

Steps to Change the database mode from NOARCHIVE to ARCHIVE log mode.

## To place a database in archive log mode.

1. First shutdown the database with any one of the options apart from shutdown abort.

SQL> shutdown immediate;
Database closed.
Database dismounted.
ORACLE instance shut down.


2. Place the database in Mount Stage.

SQL> startup mount;
ORACLE instance started.

Total System Global Area 1241513984 bytes
Fixed Size 778976 bytes
Variable Size 333716768 bytes
Database Buffers 905969664 bytes
Redo Buffers 1048576 bytes
Database mounted.


3. Place the database in Archive mode.

SQL> alter database archivelog;

Database altered.

SQL> alter database open;

Database altered.

4. Now check the log_mode by using the below,
a. SQL> Archive log list

b. select log_mode from v$database.

5. Check the log_archive_dest is set properly to correct destination.

Commands Used:

1.SQL> shutdown immediate;
2.SQL> startup mount;
3.SQL> alter database archivelog;
4.SQL> alter database open;