Wednesday, March 15, 2017

ORA-27054: NFS file system where the file is created or resides is not mounted with correct options


issue:
whenever we used to take the control file backup ,we used to get the below failure error
RMAN-03009: failure of Control File and SPFILE Autobackup command on ORA_DISK_1 channel at 03/14/2017 14:42:00
ORA-19504: failed to create file "/tmp/DD_Backup/DBname/database/DB_ctl_spfile_c-4186713025-20170314-02"
ORA-27054: NFS file system where the file is created or resides is not mounted with correct options
Additional information: 5
Additional information: 20

Solution:
mount the data domain with proper configuration settings
nointr,llock,rsize=32768,wsize=32768,NFSv3 

Monday, March 6, 2017

unable to start Db after SGA upgrade.

we are trying to upgrade SGA on 12.1 DB on Linux but unfortunately after the SGA upgrade ,we  could not bring up the database and got the below error.


ORA-27137: unable to allocate Large Pages to create a shared memory segment

ERROR:
  Failed to allocate shared global region with large pages, unix errno = 1.
  Aborting Instance startup.
  ORA-27137: unable to allocate Large Pages to create a shared memory segment

ACTION:
1. Check the permission to access system large pages.
2. Large pages are automatically locked into physical memory.

Increase the per process memlock (soft) limit to at least 14 GB to lock

cause:
we noticed that huge-pages enabled on the server and we need to adjust huge pages related parameter to accommodate new SGA memory.

Solution:
1)check and update limits.conf hard/soft  values based on new SGA values
2)VM.NR-huge-pages values derive from oracle provided script.

pitfalls,
we cant use AMM


Thursday, January 26, 2017

what are the scenarios oracle database will become hung state?

what are the scenarios oracle database will become hung/crash state?
oracle database will become to hung/crashed status due to various reasons,Please find here.

1)when the archive file system 100% utilized.
2)When the oracle binary file system 100 % utilized
3)when the redo files corrupted
4)When the RAC nodes not able to communicate from private IP's
5) Dataguard Db down ,when the primary  DB in MAX protection mode.
6)when the SYSTEM related TBS running out of space
7)when the network failure on server



Friday, January 6, 2017

ORA-00700: soft internal error, arguments: [kskvmstatact: excessive swapping observed], [], [], [], [], [], [], [], [], [], [], []

issue:
ORA-00700: soft internal error, arguments: [kskvmstatact: excessive swapping observed], [], [], [], [], [], [], [], [], [], [], []

Description:
we recently got this error on 12c  database and it generated lot of trc file to incident directory and checked with oracle and they confirmed it's normal behavior of 12c database and its not a bug.

Given both the alert log message and ORA-700 are expected behavior for 12c, no action is required.

Saturday, December 31, 2016

Oracle Database internal interview questions

Oracle Database internal interview questions
1.How the user session established in oracle database?
2.How the user fetching the data from data file in oracle DB?
3.what are sequence of activities happening during insert/update/delete in oracle DB?
4.how the data selection happening in oracle RAC DB?
5.what happen to uncommitted transactions on UNDO in oracle DB?
6.How Database & ASM communicates when you select query run on database?
7.How oracle applies redo changes to physical standby?
8.what is the sequence of steps to generate the archive log in oracle DB?
9.what will happen internal ,when you update the oracle database?
10.what are internal changes will happen,when you do switch over in physical standby?
11.How oracle RAC provides service availability when the nodes fail-over on one of the 2 node RAC?
12.how oracle internally allocates space to system object extension?
13.what will happen when you rebuild index online?
14.what will happen ,when you do re-balance on ASM DISK?
15.what will happen when you kill the flashback process in oracle database?
16.what is the   use of OS kernal parameter in oracle database server?
17.How to allocate memory for the database in oracle database?
18.can flashback database brings dropped datafile in database?
19,what is the object sequence for export/import in oracle database?
20.what will happen when you apply CPU & PSU on oracle home?
21.what is the startup sequence of oracle RAC database?
22.what will happen when you kill the archive process in oracle database?
23.How the user session established in oracle RAC database?
24.what will happen when you try to create object on ASM instance?
24.How do you backup ASM instance?
25.what is the use of begin backup mode in oracle hot backup?
26.will RMAN hot backup put the database to begin backup mode ?

Monday, December 19, 2016

Limitation of oracle database flash back feature



Limitations of Flashback Database


  • Flashback Database can only undo changes to a data file made by Oracle Database. It cannot be used to repair media failures, or to recover from accidental deletion of data files.
  • You cannot use Flashback Database to undo a shrink data file operation.
  • You cannot use Flashback Database alone to retrieve a dropped data file. If you flash back a database to a time when a dropped data file existed in the database, only the data file entry is added to the control file. You can only recover the dropped data file by using RMAN to fully restore and recover the data file.
  • If the database control file is restored from backup or re-created, all accumulated flashback log information is discarded. You cannot use FLASHBACK DATABASE to return to a point in time before the restore or re-creation of a control file.



Prerequisites for Flashback Database and Guaranteed Restore Points



  •  database must be running in ARCHIVELOG mode, because archived logs are used in the Flashback Database operation.
  • You must have a fast recovery area enabled, because flashback logs can only be stored in the fast recovery area.


Guaranteed Restore Points

To use guaranteed restore points, the database must satisfy the following additional prerequisite: the COMPATIBLE initialization parameter must be set to 10.2.0 or greater

Note:
There are no special prerequisites to set before using normal restore points.
Using Normal and Guaranteed Restore Points
This section describes the various commands and monitoring capabilities you use with normal and guaranteed restore points.

Creating Normal and Guaranteed Restore Points
To create normal or guaranteed restore points, use the CREATE RESTORE POINT SQL statement, providing a name for the restore point and specifying whether it is to be a guaranteed restore point or a normal one (the default).

To create a restore point:

Connect SQL*Plus to a target database.


Run the CREATE RESTORE POINT statement.

The following example shows how to create a normal restore point in SQL*Plus:

SQL> CREATE RESTORE POINT before_upgrade;
This example shows how to create a guaranteed restore point:

SQL> CREATE RESTORE POINT before_upgrade GUARANTEE FLASHBACK DATABASE;
See Also:
Oracle Database SQL Language Reference for reference information about the SQL CREATE RESTORE POINT statement

"Listing Restore Points" to learn how to list restore point

"Dropping Restore Points" to learn how to delete restore points

Listing Restore Points
You can use the LIST command to list either a specific restore point or all restore points known to the RMAN repository. The variations of the command are as follows:

LIST RESTORE POINT restore_point_name;
LIST RESTORE POINT ALL;
RMAN indicates the SCN and time of the restore point, the type of restore point, and the name of the restore point. The following example shows sample output:

RMAN> LIST RESTORE POINT ALL;

using target database control file instead of recovery catalog
SCN              RSP Time  Type       Time      Name
---------------- --------- ---------- --------- ----
341859           28-JUL-06            28-JUL-06 NORMAL_RS
343690           28-JUL-06 GUARANTEED 28-JUL-06 GUARANTEED_RS
To see a list of all currently defined restore points (normal and guaranteed), use the V$RESTORE_POINT control file view with the following query:

SQL> SELECT NAME, SCN, TIME, DATABASE_INCARNATION#,
        GUARANTEE_FLASHBACK_DATABASE,STORAGE_SIZE
        FROM V$RESTORE_POINT;


What happens if RVWR cannot write to disk?
A: It depends on the context where the write error occurs:

If there’s a Guaranteed Restore Point, the database crashes to ensure the restore point guarantee is not voided.
If there isn’t a Guaranteed Restore Point and it’s a primary database, the Flashback Mode will be automatically turned off for the database, which will continued to operate normally.
If there isn’t a Guaranteed Restore Point and it’s a standby database, the database will hang until the cause of the write failure is fixed.



When are the flashback logs deleted?
A: Flashback logs are managed by Oracle only. Oracle will try to keep as much Flashback logs as needed to satisfy the DB_FLASHBACK_RETENTION_TARGET parameter. However, if there’s space pressure in the Flash Recovery Area (FRA), flashback logs may be deleted to make room for other things, like backups and archived logs, for example.

If the fast recovery area has enough space, then a flashback log is created whenever necessary to satisfy the flashback retention target.
If a flashback log is old enough that it is no longer needed to satisfy the flashback retention target, then a flashback log is reused.
If the database must create a new flashback log and the fast recovery area is full or there is no disk space, then the oldest flashback log is reused instead.
If the fast recovery area is full, then an archived redo log that is reclaimable according to the FRA rules may be automatically deleted by the fast recovery area to make space for other files. In this case, any flashback logs that would require the use of that redo log file for the use of FLASHBACK DATABASE are also deleted.
No file in the fast recovery area is eligible for deletion if it is required to satisfy a guaranteed restore point. Thus, retention of flashback logs and other files required to satisfy the guaranteed restore point, in addition to files required to satisfy the backup retention policy, can cause the fast recovery area to fill completely.

Tuesday, December 13, 2016

user creation on oracle 12c database

we have two kind of users available on oracle 12c database

1)local users       --> only for specific PDBS
2)common users --> users on CDB with hass to all PDBS

1)local users creation steps

SQL> alter session set container=pdb1;

Session altered.

SQL> create user user1_pdb1 identified by XXXXX;

User created.

SQL> grant pdb_dba to user1_pdb1;(its a special role for PDB)

Grant succeeded.


SQL> conn user1_pdb1/XXXX@pdb1
connected.

2)common user always start with c###
SQL> conn / as sysdba
SQL> create user c##bala identified by XXXXX;

User created.

SQL> grant dba to  c##bala;

Grant succeeded.

SQL> conn c##bala/XXXX;
Connected.
SQL> create table test_11dec2016_dba_obj as select * from dba_objects;


Table created.


How to enable flahsback on oracle database?

Steps to enable flahsback on oracle database:

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

set the recovery file dest location & size & set the flashback retention

SQL> alter system set db_recovery_file_dest='/media/sf_12cR1/flashback' scope=both;

System altered.

SQL> alter system set db_recovery_file_dest_size=100g scope=both;

System altered.

SQL> show parameter db_recovery_file_dest

NAME                                 TYPE        VALUE
------------------------------------ ----------- ------------------------------
db_recovery_file_dest                string      /media/sf_12cR1/flashback
db_recovery_file_dest_size           big integer 100G

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

Total System Global Area 2137886720 bytes
Fixed Size                  2290416 bytes
Variable Size            1711279376 bytes
Database Buffers          419430400 bytes
Redo Buffers                4886528 bytes
Database mounted.
SQL>  alter database flashback on;

Database altered.


SQL> alter system set db_flashback_retention_target=6000;

System altered.

SQL>  SELECT NAME, FLASHBACK_ON FROM V$DATABASE;

NAME      FLASHBACK_ON
--------- ------------------
CDB1      YES


SQL> alter database open;


Database altered.

PDB database recovery in oracle 12c

container database (CDB) recovery is same as normal database recovery .

Pluggable Database (PDB) Complete Recovery

There are two ways to restore and recover PDBs. From to root containers, you can restore and recover one or more PDBs using the following script.

$ rman target=/

RUN {
  ALTER PLUGGABLE DATABASE pdb1 CLOSE;
  RESTORE PLUGGABLE DATABASE pdb1 ;
  RECOVER PLUGGABLE DATABASE pdb1 ;
  ALTER PLUGGABLE DATABASE pdb1 OPEN;
}

SQL> alter session set container=pdb1;

Session altered.

SQL> create table test_dba_objec as select * from dba_objects;

Table created.

SQL> select count(*) from test_dba_objec;

  COUNT(*)
----------
     90780

RMAN> BACKUP PLUGGABLE DATABASE pdb1;

Starting backup at 11-DEC-16
using target database control file instead of recovery catalog
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=275 device type=DISK
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=/u01/app/oracle/oradata/cdb1/pdb1/sysaux01.dbf


RMAN> ALTER PLUGGABLE DATABASE pdb1 CLOSE;

Statement processed

RMAN> RESTORE PLUGGABLE DATABASE pdb1 ;

Starting restore at 11-DEC-16
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=270 device type=DISK

channel ORA_DISK_1: starting datafile backup set restore
channel ORA_DISK_1: specifying datafile(s) to restore from backup set
channel ORA_DISK_1: restoring datafile 00007 to /u01/app/oracle/oradata/cdb1/pdb1/system01.dbf
channel ORA_DISK_1: restoring datafile 00008 to /u01/app/oracle/oradata/cdb1/pdb1/sysaux01.dbf
channel ORA_DISK_1: restoring datafile 00009 to /u01/app/oracle/oradata/cdb1/pdb1/pdb1_users01.dbf
channel ORA_DISK_1: reading from backup piece /media/sf_12cR1/backup/0drn72lv_1_1
channel ORA_DISK_1: piece handle=/media/sf_12cR1/backup/0drn72lv_1_1 tag=TAG20161211T135718
channel ORA_DISK_1: restored backup piece 1
channel ORA_DISK_1: restore complete, elapsed time: 00:00:26
Finished restore at 11-DEC-16

RMAN> RECOVER PLUGGABLE DATABASE pdb1 ;

Starting recover at 11-DEC-16
using channel ORA_DISK_1

starting media recovery
media recovery complete, elapsed time: 00:00:00

Finished recover at 11-DEC-16

RMAN> ALTER PLUGGABLE DATABASE pdb1 OPEN;

Statement processed

SQL> alter session set container=pdb1;

Session altered.


SQL> select count(*) from test_dba_objec;

  COUNT(*)
----------
     90780


Backup container database in oracle 12c



Container Database (CDB) Backup

Backup of a Container Database (CDB) is essentially the same as a non-Container Database. The main thing to remember is, by doing a full backup of the CDB you are also doing a full backup of all PDBs.

Connect to RMAN using OS authentication and take a full backup using the following command. This means you are connecting to the root container with "AS SYSDBA" privilege.

RMAN> backup database plus archivelog;

PDB database backup

Pluggable Database (PDB) Backup

There are two ways to back up pluggable databases. When connected to RMAN as the root container, you can backup one or more PDBs using the following command.

$ rman target=/

RMAN> BACKUP PLUGGABLE DATABASE pdb1;


Starting backup at 11-DEC-16
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=00008 name=/u01/app/oracle/oradata/cdb1/pdb1/sysaux01.dbf
input datafile file number=00007 name=/u01/app/oracle/oradata/cdb1/pdb1/system01.dbf
input datafile file number=00009 name=/u01/app/oracle/oradata/cdb1/pdb1/pdb1_users01.dbf
channel ORA_DISK_1: starting piece 1 at 11-DEC-16
channel ORA_DISK_1: finished piece 1 at 11-DEC-16
piece handle=/media/sf_12cR1/backup/0brn71t3_1_1 tag=TAG20161211T134403 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:45
Finished backup at 11-DEC-16