Saturday 31 December 2016

How to make Bootable Pendrives or USB



Hi Friends,

Today, I would like to share my experiences which will be very useful to everybody. This is useful for all of us either technical or non-technical.

I am sharing it here confidently, because first I have tried this and its working fine.

Before that I suffered a lots for this thing that How to make bootable pen drive, I tried many things but they didn’t work. As we all know everything on web is not 100% correct. So, personally I faced this issue and got the solution then sharing with you all friends.

Let’s follow the steps and commands.

1: Fist we will see and discuss DISKPART command:

Please insert your USB pen drive to your running computer/laptop.
Run the CMD as administrator as guided below lines.
Go to start search for 'cmd' appears, right click CMD and select "Run as administrator".

Type 'diskpart'  as shown below:

C:\Users>ora-data>diskpart

And hit Enter then wait for result, then type below command and hit enter.

C:\Users>ora-data>list disk

There would be seen that the active disks shown as Disk 0 for hard drive and Disk 1 for your USB pen drive with its total capacity.
Then Select Disk1 (your pen drive) as shown below.

C:\Users>ora-data>select disk1

Then clean your pen drive from below command:

C:\Users>ora-data>clean

Then follow the below commands:

C:\Users>ora-data>create partition primary

Then Select partition 1

C:\Users>ora-data>select partition 1

Then type active and hit enter:

C:\Users>ora-data>active

Format the usb pen drive:

C:\Users>ora-data>format fs=ntfs quick

Then exit:

C:\Users>ora-data>exit

2. Now we will create the Boot Sector:
Here Suppose, that the pen drive name E drive and DVD installer located on drive F drive.
So, first we will navigate our command prompt to F drive as shown below:
By default:
C:\Windows\System32>

Navigate to F drive:
C:\Windows\System32>f:

F:\cd boot

F:\boot>bootsect /nt60 E:

After that type exit and come out.
The flash pen drive is ready to be used as a boot media.


Hope this will be useful and easy steps to follow it. If there is any correction or suggestion, please let us know either by writing in comments box or contact us @https://ora-data.blogspot.in/

Some useful & Helpful links:

Jobs Tips

Technical Interviews Questions

Career Planning Tips

Oracle Database

Oracle APPS


Thanks,

Wednesday 28 December 2016

Oracle Data Guard Concept


Hi Friends,
Today, we will discuss about DataGuard. We will see as why we need Dataguard? We will also check the Advantages and Disadvantage.

Now, what is DataGuard?

A DataGuard provide us following as high availability, data protection, and disaster recovery for enterprise data. It 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. And also, it maintains these standby databases as copies of the production database.

It means, suppose the production database becomes unavailable because of a planned (if there is any maintenance) or an unplanned (like disaster, network issue etc.) outage. So, Data Guard can switch any standby database to the production role, and it will minimize the downtime associated with the outage. It can be used with traditional backup, restoration, and cluster techniques to provide a high level of data protection and data availability.

Advantages:

* Data Guard provides us below following below points:
* It helps in Data protection, high availability for a database system.
* Human intervention will be less in case of failover and failback switchover.
* By the using standby redo log files Data guard can minimize loss of data.
* It is simple management and centralized.
* It also supports in heterogeneous configurations where the primary and standby systems may have different CPU architectures, operating.

Disadvantages:

Suppose, if the network links connecting primary and standby is over-subscribed, and the redo logs are not shipped in chronological order, then this can result in large gaps appearing in the available of redo at the standby. Such a condition results in the standby being behind the primary.
Here, the same release of Oracle Database Enterprise Edition must be installed on the primary database and all standby databases also, except during rolling database upgrades using logical standby databases. Oracle Data Guard is available only as a feature of Oracle Database Enterprise Edition.

Data Guard Configurations Details:

A Data Guard configuration consists of one production database and one or more standby databases.
Here, we can 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.

Primary Database:
A Data Guard configuration contains one production database, which called as the primary database that functions in the primary role. And this is the database that is accessed by most of our applications.
This primary database can be either a single-instance Oracle database or an Oracle Real Application Clusters(RAC) database.

Standby Database:
DataGuard contain a standby database as transactionally consistent copies of the production or primary database. Once standby database created from production database backup copies, Data Guard can automatically maintains each standby database by transmitting the redo data from the production or primary database and then applying the redo to the standby database.

Standby database can also be either a single-instance Oracle database or an Oracle RACdatabase like Primary database.

There are two type of Standby database Physical Standby Database and Logical Standby Database.

A physical Standby Database provides a physically identical copy of the primary database, with on disk database structures that are identical to the primary database on a block-for-block basis. The database schema, including indexes, are the same. It always kept synchronized with the primary database, through Redo Apply, which recovers the redo data received from the primary database and applies the redo to the physical standby database.

A logical Standby Database is kept synchronized with the primary database through SQL Apply, which transforms the data in the redo received from the primary database into SQL statements and then executes the SQL statements on the standby database. A logical standby database can be used concurrently for data protection, reporting, and database upgrade with almost no downtime. 

As above discussion, we can see a simple and important difference between Physical and Logical Standby Database is that, In physical standby database is synchronizing through Redo Apply and In Logical Standby Database is synchronizing though SQL Apply. 


DATAGUARD SETUP STEPS>>

Hope these above details and concepts will be useful and helpful. In next update we will update for DataGuard setup.

DATAGUARD SETUP STEPS>>


Some more useful link:

Interviews Q & A

RAC concepts in Oracle
 

R12.1 Vs R12.2
 

R12.2 Architecture & Concepts

Please write to us for any more details and concepts which is not clear. Always remember, we like to hear from you. Contact us @ora-data.blogspot.com

Thanks

Monday 26 December 2016

ORA-00936: missing expression


Hi DBA-Mates, Topic: ORA-00936: missing expression -- Fixed
When we run the command phase=prepare during the upgrade from r12.2.0 to r12.2.3 after the fresh installation on multi-node and our database is 12c, we may face this issue ora-00936 as mentioned below:
ERROR at line 3:
ORA-00936: missing expression in R12.2 upgrade when attempting to adop phase=prepare.
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
adop exiting with status = 1 (Fail).

In this case, you can workaround as: 
If you are applying Delta 8 to a system on a pre-Delta 7 AD-TXK code level, you must apply the Oracle Fusion Middleware patch before proceeding with the AD and TXK patches. If you do not apply this patch, application of the TXK patch will fail.
Fist you should apply AD and TXK Delta7 patches and then apply the Delta 8 patches. So it will go fine without any error.  One more thing you should check appltop_id =  , should not be null. This you can find out in your log details. Due to this issue, we cannot continue with the upgrade.
Or
If above solution didn’t work then follow the below points.
Reason:
The APPL_TOP_NAME in the context file of Primary and Secondary Node are different.
for eg.
In primary node:
<APPL_TOP_NAME oa_var="s_atName">node1</APPL_TOP_NAME>

In Secondary Node:
APPL_TOP_NAME oa_var="s_atName">node2</APPL_TOP_NAME>

In a Shared Application Tier system, the APPL_TOP_NAME on all the nodes should be same.
 
Solution: 
Please follow the below points to be followed.
*. Shutdown the application services on all tiers.
*. Run Autoconfig on primary node.
*. Now, Check that row in AD_APPL_TOPS has changed from node2 to node1.
*. Change the secondary node RUN context file parameter s_atName value from node2 to node1.
*. Run Autoconfig on secondary node node2 RUN context.
*. Check that row with value node1 still exists in AD_APPL_TOPS and secondary node entry node2 is not updated.
*. Start the services on both Nodes.
*. Abort the previous adop session and then run "adop phase=prepare" to re-test.
Hope this will be helpful and useful, if there is any concerns, please let us know. We like to hear from you. One more thing, don't apply this direct at production better first apply on test then apply on production always for any solutions. For any concerns, please contact us ora-data.blogspot.com
Source from my investigation and Doc ID 1677053.1

Thursday 22 December 2016

ORA-8103 (or ORA-600) Partition table after Truncate table

Hi DBA-Mates,
We faced issue like ORA-8103 (or ORA-600) Partition table after Truncate table.
What is this issue and what is solution for this.
As always I would like to share my experiences in form of blog here. So, I am very eager to share it.
We will discuss about _part_access_version_by_number parameter and details of this parameter in oracle database.

Please find the below details:

"_part_access_version_by_number" = FALSE , what does this command?

ORA-8103 (or ORA-600) -- Partition table after Truncate table . This is bug also Bug 19689979
The release is 11.2.0.4 or above

For example of getting this issue or bug, Please find the below details:
 1-. TRUNCATE TABLE abc;
 2-. Access the table:
        select * from abc;
       --> Error is produced.

Here, we are getting above error as mentioned i.e. ORA-8103 (or ORA-600) -- Partition table after Truncate table

Solutions:
"_part_access_version_by_number "
This is hidden undocumented parameters in 12c which use version numbers to access versioned objects for partitioning.

Using "_part_access_version_by_number" = FALSE will revert back to the 11.2.0.3 partitioned handling behaviour and will avoid the problem.

ORA-00600 [QESMAGETTBLSEG1]
closed as a duplicate of ORA-8103 RUNNING SELECT ON PARTITION TABLE ON RAC NODE
1). Either flush the shared pool.

   - OR -

Restart the instance with the hidden parameter "_part_access_version_by_number" set to FALSE.

(RAC sites should restart *all* instances with this parameter set to the same value).


Some more useful links:
Hope this will be useful and helpful. Please let us know for any concerns.
Thanks,

Friday 16 December 2016

Oracle tablespace size freespace, datafiles and disk group details query

Hi DBA-Mates,
Recently, we have done this in our real time. As we know, for every one working on ASM is little bit hard and different. So, when my junior asked about this how to find out the details in ASM, I thought this may be happens with many of us. Then why should not provide the details. So, let’s see. 

a. Tablespace details.
b. Diskgroup details. 
c. Datafile details. 

1. Login to Server.
2. Run the .dbenv file. It may be bydefault also. If .env file is not bydefault, please run the .env file. 
a. $ ls *env
ASM.env     db.env
b. $ . ./db.env 

3. Connect as a either sysdba or db user. Here, we are connecting as sysdba user.

$slqplus ‘/as sysdba’ 

Check the instance details: 
SQL>  select INST_ID,INSTANCE_NAME,HOST_NAME,status from gv$instance;




   INST_ID INSTANCE_NAME    HOST_NAME                                                        STATUS

---------- ---------------- ---------------------------------------------------------------- ------------
         1 SKU            ora-data                                                         OPEN
         2 SKU             ora-data                                                       OPEN

SQL>
Check the Tablespace details: 
SQL> select    tablespace_name,  used_percent from   dba_tablespace_usage_metrics where tablespace_name='ABCD';
TABLESPACE_NAME                USED_PERCENT
------------------------------ ------------
ABCD                        80

Check the Tablespace details with different command, above command may not work: 
SQL>select round((bytes/1024)/1024,0) "Used Space(MB)",
round(total,0) "Allocated size(MB)",
round(max,0) "Maximum allowable(MB)",
round(max-(BYTES/1024)/1024,0) "Effective free(MB)",
round(((max-(BYTES/1024)/1024)/max)*100,2) "FREE(%)"
from SYS.SM$TS_USED,
(select sum((BYTES/1024)/1024) total, sum((decode(MAXBYTES,0,bytes,maxbytes)/1024)/1024) max
from dba_data_files where tablespace_name='&1') where tablespace_name='&1'; 

It will prompt or ask for Tablespace name.
old   8: from dba_data_files where tablespace_name='&1') where tablespace_name='&1'
new   8: from dba_data_files where tablespace_name='ABCD') where tablespace_name='ABCD'

Output as shown below:
Used Space(MB) Allocated size(MB) Maximum allowable(MB) Effective free(MB)    FREE(%)
-------------- ------------------ --------------------- ------------------ ----------
        123456            12345                 1234              1234      123

SQL>
Check the datafiles details: 
SQL> select file_name||'  '|| bytes/1024/1024||'  '|| autoextensible||'  '|| maxbytes/1024/1024 from dba_data_files where tablespace_name=upper('ABCD');

FILE_NAME||''||BYTES/1024/1024||''||AUTOEXTENSIBLE||''||MAXBYTES/1024/1024
--------------------------------------------------------------------------------
+DiskGroupName/***/datafile/abcd.12.12345678   *****  YES  12345

SQL>
For ASM Case:
Run the ASM env file as shown below:
$ . ./ASM.env

Connect as sysdba user.
$ sqlplus '/as sysdba'
SQL>
SQL> select instance_name from v$instance;

INSTANCE_NAME
--------------------------------
+ASM
Check the ASM Diskgroup details:
SQL>  select   name,total_mb,usable_file_mb from v$asm_diskgroup where name='DiskGroupName';

NAME                                                           TOTAL_MB      USABLE_FILE_MB
---------------------------------------------- ---------------    --------------
DiskGroupName                                             12345           1234

SQL>


SQL>SELECT name, free_mb, total_mb, free_mb/total_mb*100 as percentage, total_mb-free_mb as used_mb FROM gv$asm_diskgroup where name='<DiskgroupName>';
 
Note: We have modified or removed the actual output because it’s directly from real time experiences which we can’t share.
Some more useful link:
Oracle Database 12c Issues and Solution
Dataguard Concepts and Setup
Database control file Concepts and Multiplexing
R12 Patching Steps
Important DBA Scripts 
Hope this will be useful and helpful. If you have suggestions, Please comment or contact us@ora-data.blogspot.com.
Thanks,