Tuesday, 18 July 2017

ORA-12162: TNS:net service name is incorrectly specified

Cause: The connect descriptor corresponding to the net service name in 
TNSNAMES.ORA or 
in the directory server (Oracle Internet Directory) is incorrectly specified.
Action: If using local naming make sure there are no syntax errors in the
 corresponding connect
descriptor in the TNSNAMES.ORA file. If using directory naming check the 
information 
provided through the administration used for directory naming.

Example:
oracle@hostname:~$ sqlplus scott
SQL*Plus: Release 11.2.0.1.0 Production on Wed Feb 26 15:34:14 2014
Copyright (c) 1982, 2009, Oracle.  All rights reserved.
Enter password:
ERROR:
ORA-12162: TNS:net service name is incorrectly specified

Solution:
Windows:
set ORACLE_SID=PROD
Linux:
Set oracle home if not set, you can check it by “echo $ORACLE_HOME”
oracle@hostname:~$ export ORACLE_HOME=/opt/oracle/product/ora12r2
oracle@hostname:~$ export ORACLE_SID=PROD
oracle@hostname:~$ sqlplus scott
SQL*Plus: Release 11.2.0.1.0 Production on Wed Feb 26 15:39:22 2014
Copyright (c) 1982, 2009, Oracle.  All rights reserved.
Enter password:
Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - 64bit Production
With the Partitioning and Automatic Storage Management options
SQL>

Oracle startup not possible - ORA-00845: MEMORY_TARGET not supported on this system


When i was doing 12CR2 isntallation on my VM. I have this error during startup..

Here it is..

ISSUE :

>startup
ORA-00845: MEMORY_TARGET not supported on this system 

SOLUTION:

The shared memory file system should have enough space to accommodate the MEMORY_TARGET and MEMORY_MAX_TARGET values.
To verify:
SQL> show parameter memory

NAME                                 TYPE        VALUE
------------------------------------ ----------- ------------------------------
hi_shared_memory_address             integer     0
memory_max_target                    big integer 6096M
memory_target                        big integer 6096M
shared_memory_address                integer     0
In UNIX/Linux, you will have to set the shared memory file system accordingly.
Verify:
$ df -h /dev/shm
Set:
$ mount -t tmpfs shmfs -o size=some_value_in_number_with_size /dev/shm
For example,
mount -t tmpfs shmfs -o size=4096m /dev/shm

Sunday, 16 July 2017


HOW TO ACCESS SHARED FOLDERS IN VIRTUAL MACHINE:
********************************************************************

First make sure you are running guest Additions succcessfully in your guest OS .

After that simply follow below (y).


Within VirtualBox, select the guest machine you wish to contain the shared folder.
Press the Settings button.
  1. In the Settings dialog, press Shared Folders tab.
  2. Click the Add Shared Folder button.
  3. In the popup dialog, select the directory you want to share with the guest machine. In my case I will be choosing the directory c:\users\karuna\downloads.
  4. Give the share a simple, but descriptive name.
  5. I would suggest selecting the Read-only checkbox. This will mean the guest operating system will not be able to modify any files or directories on within the shared folder.
  6. OR u can also check permanent box if you need read write access on that.




Once this is done. Then do the below as a root user:


sharename="donotshare"
sudo mkdir /mnt/$sharename
sudo chmod 777 /mnt/$sharename
sudo mount -t vboxsf -o uid=1000,gid=1000 $sharename /mnt/$sharename
ln -s /mnt/$sharename $HOME/Desktop/$sharename



If you still need any help during installation, please feel free to comment below or you can refer to my installation related posts here:  

http://karunadba.blogspot.in/2014/05/installation-of-oracle-linux-6-in.html


WHAT IS SCN ?? WHERE IT IS STORED ?? TYPES OF SCN ??

 SCN :

             Internal timestamp used by the Oracle Database which is necessary to satisfy the ACID properties of a transaction.

The database uses SCNs to query and track changes

In order to understand SCN purpose in database. First learn how many types of SCN 's exist and their purpose.

Each type of SCN and their location and what they have been called and its purpose
PlacestoredCalled asVisible as columnRelated ViewPurpose
ControlFileSystem SCNcheckpoint
_change#
V$databaseFor recover database using backup control file
ControlFileindividual datafile SCNcheckpoint
_change#
v$datafileWe need this individual SCN for each datafile since there are some datafiles which need recovery due to offline status, this is different from the System SCN above
ControlFileStop SCNlast_change#v$datafileFor Instance Recovery
DatafileStart SCNcheckpoint
_change#
v$datafile_headerThe start of the SCn when the instance started
RedofileHighSCNNext_change#V$log_historyThe last scn recorded in the redo log files.
RedofileLowSCNFIRST_CHANGE#V$logThe oldest recorded SCN from where the next redo log file starts.
BlockBlockSCNEx: scn: 0x0000.
00046911
Dump the block
alter system
dump datafile
3 block min
10 block
max 12;
Every data block also has block SCN (aka block version).  to match up the redo records before applying it
RedofileCommitSCNITL
List header
v$database
current_scn
dbms_flashback.
get_
system_
change_
number
Every commit will generate SCN, aka commit SCN, that marks a transaction boundary.
Redo? PGA? Not sure where it recordsSnapshotSCNWhen a transaction or query begins, the current SCN is recorded. That SCN serves as the snapshot SCN for the query or transactionscn: kcmgss in v$sysstat?

Current SCN from v$database?
When the query starts it has to note down the SCN that current database or block has so that it can report consistent block back




  • Just like a ticker of clock, SCN keep increment at database level via a different background process like AQ, SMON, job queues… etc.
  • A checkpoint number is the SCN number at which all the dirty buffers are written to disk. There can be a checkpoint at object/tablespace/datafile/database level.
  • Whenever a transaction commits (SCN at redo logs as highest SCN (NEXT_CHANGE#) & lowest SCN (FIRST_CHANGE#) get recorded)
  • Whenever a checkpoint occures (SCN get recorded as CHECKPOINT_CHANGE# into database (v$database/system checkpoint) / datafile (v$datafile_header/datafile START SCN) / controlfile (v$datafile/STOP SCN) / Redo entry (v$log/ High SCN & low SCN))
  • SCN also recorded for Slot reserved for transaction in undo segment.
  • By default a block-level SCN is recorded for each block. (Rows sharing same block can be check using ora_rowscn)
In shutdown normal or shutdown immediate,
When happen checkpoint, will SCN wrote four places to go. Three places in the control file, one in datafile header.
1.System checkpoint SCN ===========> (SYSTEM CHECKPOINT SCN in control file)
2.Datafile checkpoint SCN ===============> (DATAFILE CHECKPOINT SCN in control file)
3.Stop SCN ======================> (STOP SCN in control file)
4.Start SCN ================================> (DATAFILE HEADER)
Why CONTROL FILE stored in two places to be divided (SYSTEM CHECKPOINT SCN, DATAFILE CHECKPOINT SCN?) When you put a tbs set to read-only, SCN will freeze to stop him, this time DATAFILE CHECKPOINT SCN is no longer incremental changes, but the overall SYSTEM CHECKPOINT SCN will continue to increase, but still advancing. So, this is why you need are stored in two places SCN.
 Also check out this recovery based articles for more understanding
https://karunadba.blogspot.in/2017/07/difference-between-media-recovery-crash.html


Difference between Media Recovery  & Crash Recovery

To be simple and easy to remember. Its main funda is below. 

SCN in datafiles - v$datafile_header

SCN of datafiles in controlfile - v$datafile

If the SCN in datafile header is not matching with the Control file that means datafile need recovery

Crash recovery vs media recovery

STOP SCN equal NULL ==> CRASH RECOVERY NEED

DATAFILE HEADER START SCN SCN CONTROLFILE not equal ==> MEDIA NEED RECOVERY

Difference Between "SCN and ORA_ROWSCN" -
SCN is like ticker/end of every transaction in database.
whereas ORA_ROWSCN is an observed point in time. The ora_rowscn is a value associated to a block or a row on a block that represents the “time” the block/row was last modified.
What happens inside RECOVERY of oracle database ?
Well it commonly deals with 2 problems in general.
RECOVERY DATABASE two common problems
1) RECOVER DATABASE UNTIL CANCEL ==> OPEN DATABASE RESETLOG
==> DATAFILE HEADER SCN will be less than the DATAFILE SCN CONTROLFILE
If you have performed RESTORE DATAFILE, of the RESTORE DATAFILE HEADER SCN will be less than the current CONTROLFILE the DATAFILE SCN, this time will be unable to open the database, you must redo archive log media recovery ~~ until the datafile header of SCN = current scn. After the restore datafile, you can mount database and then went to check the controlfile and datafile header SCN
2) RECOVER DATABASE UNTIL CANCEL USING BACKUP CONTROLFILE; ===> OPEN DATABASE RESETLOG
==> DATAFILE HEADER SCN will be greater than the DATAFILE SCN CONTROLFILE
this time after Oracle RESTOREC CONTROL FILE SYSTEM SCN CONTROL FILE'll find inside will be less than the current DATAFILE HEADER SCN, nor equal to the current stored in the LOG SCN FILE inside, then you must use the RECOVER DATABASE UNTIL CANCEL USING BACKUP CONTROLFILE to DROP DATAFILE OR DROP TABLESPACE before the SCN.
Appendix:
Each rollback segment is composed of two distinct components, the undo header and undo entry. The first block of a rollback segment is reserved for the undo header. When a rollback segment is created, only the header is created. Initially, the remaining blocks are allocated to the segment, but no other structures are created. One of the main features in the rollback segment header is the Transaction Table. Key components are the state, scn, and dba.
 By default, the ora_rowscn pseudo column reports the scn at block level. This means that rows sharing the same block will have the same ora_rowscn, and if one row were to be changed, then scn would be altered for both blocks.
As a query enters the execution stage, the current system change number (SCN) is determined. this system change number is <123>. As data blocks are read on behalf of the query, only blocks written with the observed SCN are used. Blocks with changed data (more recent SCNs) are reconstructed from data in the rollback segments, and the reconstructed data is returned for the query. Therefore, each query returns all committed data with respect to the SCN recorded at the time that query execution began. Changes of other transactions that occur during a query's execution are not observed, guaranteeing that consistent data is returned for each query.By default a block-level SCN is recorded for each block. That SCN is the latest SCN for any record in the block.
 The checkpoint records the highest SCN of all changes to blocks such that all data blocks with changes below that SCN have been written to disk by DBWn. The control file also contains a record of the checkpoint SCN contained in the header of each datafile in the database. Whenever a discrepancy occurs between the SCN that is actually in a datafile header and the datafile header SCN listed in the control file, Oracle requires media recovery.
Every redo log file has both a log sequence number and low and high SCN. The low SCN records the lowest SCN recorded in the log file, while the high SCN records the highest SCN in the log file.
A consistent backup of a database or part of a database is a backup in which all read-write datafiles and control files have been checkpointed with respect to the same SCN.
An inconsistent backup s a backup in which all read-write datafiles and control files have not been checkpointed with respect to the same SCN. For example, one read-write datafile header may contain an SCN of 100 while others contain an SCN of 95. Oracle cannot open the database until these SCNs are consistent, that is, until all changes recorded in the online redo logs have been made to the datafiles.
Oracle enables you to restore an older backup and apply partial redo data, thereby recovering the database to a specified non-current time or SCN. This type of recovery is called incomplete recovery. You must open your database with a RESETLOGS operation after performing incomplete recovery in order to reset the online redo logs.
SCN & Instance Crash - the stop SCN is not set, which is indicated by the NULL value in the LAST_CHANGE# column. This information enables Oracle, at the time of the next startup, to determine that the instance crashed because the checkpoint on shutdown was not performed. If it had been performed, the LAST_CHANGE# and CHECKPOINT_CHANGE# values would match for each datafile as they did during a clean shutdown. If an instance crashes at shutdown, then instance crash recovery is required the next time the instance starts up.

Tuesday, 11 July 2017



How to access WIFI inside VIRTUAL MACHINE..



Actually  I have tried using Bridged Network.. bla . bla .. bla .. couple of times.

I have gone through different blogs..but dint work out..

So after some investigation.. here what I found .. 

Keep your settings of VM like this :

Under you Network Settings in VirtualBox set the following to - Attached to: NAT (click advanced text to expand advanced options) Adapter Type: Intel Pro / 1000 MT Desktop (82540EM) ... if that fails then try AMD PCNet FAST III Promiscuous Mode: Deny Cable Connected: Checked


Hope it helps a lot of confused people like me :)



VOILA.!



Saturday, 10 June 2017

adopmon & adopreports - new 12.2.5 feature to monitor the patching cycle..!!


As a new feature of EBS 12.2.5 , we have adopmon(adop monitor, Online Patching Monitoring utility) utility for monitoring the online patching cycles. It provides a readable output, letting us monitor the events that occur in the online patching cycle phases.


The overall progress of an online patching cycle can be followed by running the new Online Patching Monitoring utility (adopmon), while seeing the various individual adop actions being taken (in a readable format).
Adopmon is executed after setting the run environment.

The following example shows how adopmon is used, with some sample output from the finalize phase:
adopmon Running script. Press Ctrl-C to quit Enter the APPS password: 2015/08/04 11:59:02 testsystem EVENT Checking for existing adop sessions. 2015/08/04 11:59:02 testsystem EVENT Checking for pending hotpatch session. 2015/08/04 11:59:02 testsystem EVENT Continuing with existing session [Session ID: 66]. 2015/08/04 11:59:02 testsystem EVENT Checking for pending cleanup session. 2015/08/04 11:59:02 testsystem EVENT ADOP (C.Delta.7) 2015/08/04 11:59:02 testsystem EVENT Phase: finalize 2015/08/04 11:59:02 testsystem EVENT Session ID: 66 2015/08/04 11:59:02 testsystem EVENT Node: testsystem 2015/08/04 11:59:03 testsystem EVENT Verifying existence of context files in database. 2015/08/04 11:59:02 testsystem EVENT Log: /u01/orauser/usertest/fs_ne/ EBSapps/log/adop/66/adop_20150804 _115825.log 2015/08/04 11:59:35 testsystem EVENT Log: @ADZDSHOWLOG.sql "2015/08/04 11:59:35" 2015/08/04 11:59:04 testsystem EVENT Verifying data dictionary. 2015/08/04 11:59:35 testsystem EVENT Running finalize phase database actions. 2015/08/04 11:59:35 testsystem EVENT Finalize System 2015/08/04 12:01:55 testsystem EVENT Generating log report. 2015/08/04 12:00:01 testsystem EVENT Executing FINALIZE actions 2015/08/04 12:00:01 testsystem EVENT Compiling invalid objects. 2015/08/04 12:00:01 testsystem EVENT Compile Edition: V_20150804_1041 2015/08/04 12:01:56 testsystem EVENT The finalize phase completed
successfully.
2015/08/04 12:01:55 testsystem EVENT Output: /u01/orauser/usertest/fs_ne/ EBSapps/log/adop/66/finalize_2 0150804_115825/usertest_testsystem/adzdshowlog.out




adopreports utility in R12.2.5

A related tool, the Online Patching Diagnostic Reports utility, $AD_TOP/bin/adopreports, can be used to help diagnose issues or simply gather information about the status of your system.
The adopreports utility is invoked by entering the command:




$ adopreports <APPS username> <APPS password>

This displays the adopreports Main Menu:
Online Patching Diagnostic Reports Main Menu
——————————————–
1.  Run edition reports
2.  Patch edition reports
3.  Other generic reports
4.  Exit
Choosing option 1 from the Main Menu displays the Run Edition Reports Sub Menu:
Run Edition Reports Sub Menu
—————————-
1.  All
2.  Count of uncovered objects per edition
3.  List of uncovered objects per edition
4.  Cleanup status – summary of covered objects per edition,etc.
5.  Show covered objects count per edition.
6.  Show list of covered objects per edition.
7.  Back to main menu
Choosing option 2 from the Main Menu displays the Patch Edition Reports Sub Menu:
Patch Edition Reports Sub Menu
——————————
1.  All
2.  Patch status – new/changed objects
3.  Objects patch in the current edition
4.  Table manager status
5.  Back to main menu
Choosing option 3 from the Main Menu displays the Other Generic Reports Sub Menu:
Other Generic Reports Sub Menu
——————————
1.  Editions summary
2.  Editioned objects summary
3.  Free space in important tablespaces
4.  Status of critical AD_ZD objects
5.  Actual objects in current edition
6.  Objects dependencies
7.  Objects dependency tree
8.  Editioning views column mappings
9.  Index details for a table
10.  Inherited objects in the current edition
11.  All log messages
12.  Materialized view details
13.  Database sessions by edition
14.  Table details (Synonyms, EV, etc.)
15.  Count and status of DDL execution by phase
16.  Back to main menu