Search Articles

ORA-00245: Control File Backup Failed; Target is Likely on a Local File System

In alert log I got an issue ORA-00245: control file backup failed; target is likely on a local file system. Regarding this issue, I checked the snapshot control file location on rman prompt and observed that it was on local file system. In RAC environment, Snapshot control file backup location should be on a shared disk group so that it can be visible or accessible to all RAC nodes.


Check the configured snapshot controlfile default location.


RMAN> show snapshot controlfile name;

starting full resync of recovery catalog
full resync complete
RMAN configuration parameters for database with db_unique_name ORAHOW are:
CONFIGURE SNAPSHOT CONTROLFILE NAME TO '/u01/app/oracle/product/11.2.0.4/dbhome_1/dbs/snapcf_ORAHOW2.f'; # default

Here you can see that controlfile is on a local file system, so to fix this issue configure it to a shared location.

To Configure the snapshot controlfile to a shared disk

Connect to target database, and issue the following command on RMAN prompt.
rman target /

RMAN> CONFIGURE SNAPSHOT CONTROLFILE NAME TO '<shared_disk>/snapcf_<DBNAME>.f';

Let us take an example,

RMAN> CONFIGURE SNAPSHOT CONTROLFILE NAME TO '+RC_DATA/ORAHOW/snapcf_orahow.f';

new RMAN configuration parameters:
CONFIGURE SNAPSHOT CONTROLFILE NAME TO '+RC_DATA/ORAHOW/snapcf_orahow.f';
new RMAN configuration parameters are successfully stored
starting full resync of recovery catalog
full resync complete


Due to the changes made to the controlfile backup mechanism any instances in the cluster may write to the backup controlfile when making changes to the current controlfile. Therefore, the backup file needs to be visible to all instances.


Read more ...

4 Best Ways to Find Blocking Sessions in Oracle 11g

Blocking sessions occur when one sessions holds an exclusive lock on an object and doesn't release it before another sessions wants to update the same data. This will block the second until the first one has done its work. It mainly happens when a session issues an insert, update or delete command that changes a row. When the change occurs, the row is locked until the session either commits the change or rolls the change back.

When a DML is executed (update/delete/insert,merge, and select .... for update) oracle obtains 2 locks on the table. Row level Lock (TX) - This obtains a lock on the particular row being modified and any other transaction attempting to modify the same row gets blocked, till the one already owning it finishes. Table Level Lock (TM) - When Row lock (TX) is obtained an additional Table lock is also obtained to prevent any DDL operations to occur while a DML is in progress. Example: to avoid truncate and alter operation during table modification.

User can modify different rows of the table at the same time but cannot modify the same row at the same time. During row revel lock oracle acquire lock mode 3. Parallel DML operations and serial insert using direct load operations take exclusive table locks with lock mode 6. Below lock mode 6 lock the whole table and during this lock user even can't modify the rows. This will result in library cache lock. So lock mode 3 is common but avoid using hints during insert because it will lock the whole table.

6   Exclusive (X)              Lock table in exclusive mode
                                         create index    -- duration and timing depend on options used
                                          insert /*+ append */



From the view of the user it will look like the application completely hangs while waiting for the first session to release its lock. You'll often have to identify these sessions in order to improve your application to avoid as many blocking locks as possible.


.You can see where problems might occur, for example a user might make a change and then forget to commit it and leaves for the weekend without logging off the system.


Oracle provide views like, DBA_BLOCKERS and V$LOCK using which we can easily find the blocking locks. Here, we will try to find blocking locks using V$LOCK view which is faster to query and makes it easy to identify the blocking session.

SQL> select * from v$lock ;

ADDR     KADDR           SID TY        ID1        ID2      LMODE    REQUEST    CTIME      BLOCK
-------- -------- ---------- -- ---------- ---------- ---------- ---------- ---------- -------------------------------------
AF8E2C4C AF9E2C50      419 TX     141028      15289      0              6                    675          0
ADDF7EC8 ADDF8EE0    542 TM    77529          0            3              0                    687          0
ADDF7F74 ADDF7F8C     419 TM    77529          0            3              0                    675          0
ADEBEA20 ADEBEB4C   542 TX     141028     152899     6             0                    687          1


Here we are interested in the BLOCK column. If a session holds a lock that's blocking another session, BLOCK=1. Further, you can tell which session is being blocked by comparing the values in ID1 and ID2. The blocked session will have the same values in ID1 and ID2 as the blocking session, and, since it is requesting a lock it's unable to get, it will have REQUEST > 0.

In the query above, we can see that SID 542 is blocking SID 419. SID 542 corresponds to Session 1 in our example, and SID 419 is our blocked Session 2. To avoid having to stare at the table and cross-compare ID1's and ID2's, put this in a query:

 Query to find Blocking sessions using v$lock
SQL> select l1.inst_id,l1.sid, ' IS BLOCKING ', l2.sid,l1.type,l2.type,l1.lmode,l2.lmode,l2.inst_id
from gv$lock l1, gv$lock l2
where l1.block =1 and l2.request > 0
and l1.id1=l2.id1
and l1.id2=l2.id2;


To Get Detailed information on blocking locks
SQL> SELECT 'Instance '||s1.INST_ID||' '|| s1.username || '@' || s1.machine
   || ' ( SID=' || s1.sid || ','|| s1.serial#||s1.status||  '  )  is blocking '
   || s2.username || '@' || s2.machine || ' ( SID=' || s2.sid || ' ) ' ||s2.sql_id
    FROM gv$lock l1, gv$session s1, gv$lock l2, gv$session s2
   WHERE s1.sid=l1.sid AND
    s1.inst_id=l1.inst_id AND
    s2.sid=l2.sid AND
    s2.inst_id=l2.inst_id AND
    l1.BLOCK=1 AND
   l2.request > 0 AND
   l1.id1 = l2.id1 AND
   l2.id2 = l2.id2 ;


Finding blocking sessions with v$session
set lines 1234 pages 9999
col inst_id for a10
col serial# for a10
col machine for a30
col username for a10
col event for a20
col blocking_session for 999999
col blocking_instance for 999999
col status for a10
col INST_ID for 9999
col SERIAL# for 999999

SQL> select inst_id,sid,serial#, machine, username, event, blocking_session, blocking_instance, status, sql_id from gv$session where status ='ACTIVE'and username is not null;

Finding SQL_ID from SID using v$session

SQL> select sql_id from v$session where sid=4120;

SQL_ID
-------------


SQL> select sql_fulltext from v$sql where sql_id ='xxxxx';


Killing Oracle Sessions
Be very careful when identifying the session to be killed. If you kill a session belonging to a background process you will cause an instance crash.

There are a number of ways to kill blocking sessions both from Oracle sql prompt and externally.

Identify the Session to be Killed
ALTER SYSTEM KILL SESSION
ALTER SYSTEM DISCONNECT SESSION
The Windows Approach
The UNIX Approach

SQL> ALTER SYSTEM KILL SESSION 'sid,serial#' IMMEDIATE;
This does not affect the work performed by the command, but it returns control back to the current session immediately, rather than waiting for confirmation of the kill.

In a RAC environment, you optionally specify the INST_ID, shown when querying the GV$SESSION view. This allows you to kill a session on different RAC node.

SQL> ALTER SYSTEM KILL SESSION 'sid,serial#,@inst_id';

SQL> ALTER SYSTEM DISCONNECT SESSION 'SID,SERIAL#' IMMEDIATE;

The DISCONNECT SESSION command kills the dedicated server process, which is equivalent to killing the server process from the operating system

kill -9 spid

 To identifying blocked objects

The view v$lock we've already used in the queries above exposes even more information. There are differnet kind of locks - check this site for a complete list: http://download.oracle.com/docs/cd/B13789_01/server.101/b10755/dynviews_1123.htm#sthref3198

If you encounter a TM lock is means that two sessions are trying to modify some data but blocking each other. Unless one sessions finished (commit or rollback), you'll never have to wait forever.

The following queries shows you all the TM locks:

SELECT sid, id1 FROM v$lock WHERE TYPE='TM'
SID ID1
92 20127
51 20127

The ID you get from this query refers to the actual database object which can help you to identify the problem, look at the next query:

SELECT object_name FROM dba_objects WHERE object_id=20127

These queries should help you to identify the cause of your blocking sessions!

Read more ...

HTTP Listener Failed at Startup Possible Port Conflict on Port

Few days back I got an alert: Agent is Not Running. Possible port conflict on port(3872): Retrying the operation. Failed to start the agent after 1 attempts. Please check that the port(3872) is available.



Regarding this first check the status of the agent after that we will look into it.
[oracle@orahowracq1] cd /u01/app/oracle/product/12.1.0.2/agent/agent_inst/bin
[oracle@orahowracq1] ./emctl status agent
Oracle Enterprise Manager Cloud Control 12c Release 2
Copyright (c) 1996, 2012 Oracle Corporation.  All rights reserved.
---------------------------------------------------------------
Status agent Failure:unable to connect to http server at https://orahowracq1.hiw.com:3872/emd/lifecycle/main/. [peer not authenticated]
Agent is Not Running


Above we can see that agent is not running, so first try to start the agent normally as usually you do.
[oracle@orahowracq1] ./emctl start agent
Oracle Enterprise Manager Cloud Control 12c Release 2
Copyright (c) 1996, 2012 Oracle Corporation.  All rights reserved.
Starting agent ................ failed.
HTTP Listener failed at Startup
Possible port conflict on port(3872): Retrying the operation...
Failed to start the agent after 1 attempts.  Please check that the port(3872) is available.
Consult emctl.log and emagent.nohup in: /u01/app/oracle/product/12.1.0.2/agent/agent_inst/sysman/log


During startup we get an error port conflict. Now you can check which process is listening to this port using simple combination of netstat with grep command.
[oracle@orahowracq1] netstat -anp |grep 3872 


Now find the PID of this process. So that we can mark it for kill.
[oracle@orahowracq1] ps -ef|grep agent

    root  6535     1   0   Jun 17 ?      0:02 /opt/opsware/agent/bin/python /opt/opsware/agent/pylibs/shadowbot/daemonbot.pyc
    root  3804     1   0   Jun 17 ?      206:39 /opt/VRTSobc/pal33/bin/vxpal -a actionagent -x
    root  6549  6535   0   Jun 17 ?      178:38 /opt/opsware/agent/bin/python /opt/opsware/agent/pylibs/shadowbot/daemonbot.pyc
    root  9184     1   0   Jun 17 ?      71:57 /opt/Navisphere/bin/naviagent -f /etc/Navisphere/agent.config
    root  8482  8071   0   Jun 17 ?      114:20 /opt/ecc/exec/mstragent -s
  oracle  15627 15547   0   Mar 13 ?      111:40 /u01/app/oracle/product/12.1.0.2/agent/core/12.1.0.2.0/jdk/bin/sparcv9/java -Xm
  oracle 24178  6501   0 23:22:46 pts/1  0:00 grep agent
  oracle 15547     1   0   Mar 13 ?      0:27 /u01/app/oracle/product/12.1.0.2/agent/core/12.1.0.2.0/perl/bin/perl


Make sure that process must be in: /u01/app/oracle/product/12.1.0.2/agent/core/12.1.0.2.0/jdk/bin/sparcv9/java. Finally kill the process having PID 15627 and start up the agent.

[oracle@orahowracq1] kill -9 15627
[oracle@orahowracq1] cd /u01/app/oracle/product/us/agent12c/bin
[oracle@orahowracq1] ./emctl start agent
[oracle@orahowracq1] ./emctl status agent
[oracle@orahowracq1] ./emctl clearstate agent
[oracle@orahowracq1] ./emctl upload 

Example:

./emctl start agent
Oracle Enterprise Manager Cloud Control 12c Release 2
Copyright (c) 1996, 2012 Oracle Corporation.  All rights reserved.
Starting agent ....... failed.
HTTP Listener failed at Startup
Possible port conflict on port(3872): Retrying the operation...
Failed to start the agent after 1 attempts.  Please check that the port(3872) is available.
Consult emctl.log and emagent.nohup in: /oradba/oemagent/product/12.1.0.2/agent/agent_inst/sysman/log

[oracle@orahowracq1] netstat -anp |grep 3872 
tcp   0      0 :::3872         :::*          LISTEN      7507/java

[oracle@orahowracq1 bin]$ ps -ef|grep agent

oracle    7507  7314  1 Apr14 ?        03:10:55 /oradba/oemagent/product/12.1.0.2/agent/core/12.1.0.2.0/jdk/bin/java -Xmx128M -XX:MaxPermSize=96M

[oracle@orahowracq1] kill -9 7507

Read more ...

ORA-3136: Inbound Connection Timed Out

Few days back we get an issue Inbound connection timed out (ORA-3136) in alert log. To troubleshoot this we need to dig into sqlnet.ora file and the alert log. 

ora-3136: inbound connection timed out


The following four points are very important to troubleshoot this issue: 
  • Check the alert log file and check from where the connection comes.
  • Check the listener is up & running.
  • Ping the server,make sure tnsping is working.
  • Increase inbound_connect_timeout 

Regarding this we need to checked the value of "inbound_connect_timeout".

LSNRCTL> show inbound_connect_timeout
Connecting to (ADDRESS=(PROTOCOL=tcp)(HOST=)(PORT=1521))
LISTENER parameter "inbound_connect_timeout" set to 120
The command completed successfully

Here we can see that time is set to 120 which is ok.

The following would be the most likely reasons for this error :

1.Server gets a connection request from a malicious client which is not supposed to connect to the database.  In this case the error thrown would be the expected and desirable behaviour. You can get the client address for which the error was thrown in the sqlnet.log file that is local to the database.

2.The server receives a valid client connection request but the client takes a long time to authenticate more than the defined timeout.

3.The DB server is heavily loaded due to which it cannot finish the client logon within the timeout specified.


By default, the SQLNET.INBOUND_CONNECT_TIMEOUT is set to 60 seconds.
You can change the setting by adding the parameters SQLNET.INBOUND_CONNECT_TIMEOUT and INBOUND_CONNECT_TIMEOUT_<listener name>  to the $ORACLE_HOME/network/admin/sqlnet.ora file on the database server.

Setting the above parameters to a value of 0 implies an infinite time out.
Alternatively, you can use the lsnrctl command and issue the following:

LSNRCTL> set inbound_connect_timeout=<value>
Before opting for the above parameter changes, confirm that any firewall activity or Network Address Transalation (NAT) that may be occuring beween the client and and the database are not the cause of latency which is exceeding the timeout threshold.

 To identify the listener name and ORACLE_HOME and sqlnet.ora file we can use the below command.

[oracle@racdbq1.dcb.ichotels.com] ps -eaf|grep tns

Read more ...

ORA-01950: no privileges on tablespace users in Oracle

Few days back, an error was reported in the alert log which was due to no privileges on tablespace for auto execution of job as shown below.


ORA-01950: no privileges on tablespace


ORA-12012: error on auto execute of job "ORAHOW"."DB_GROWTH_JOB"
ORA-01950: no privileges on tablespace 'ORA_DATA'
ORA-06512: at "ORAHOW.PROC_DB_GROWTH_INFO", line 4


After looking into it we found that user doesn't have privileges to allocate an extent in the specified tablespace. So using the below query we get the object type and the status of the object.

SQL> select owner,object_name,object_type,status from dba_objects where  object_name='DB_GROWTH_JOB';

OWNER          OBJECT_NAM      OBJECT_TYPE       STATUS
-------- ---------- ------------------------------------
ORAHOW      DB_GROWTH_ JOB      JOB            VALID

      

Now we will check the user default tablespace on which we need to give privileges.
SQL> select USERNAME, DEFAULT_TABLESPACE from dba_users where USERNAME='ORAHOW';

USERNAME                 DEFAULT_TABLESPACE
-----------------------------------------------
ORAHOW                     ORA_DATA


As you can see that user ORAHOW is using default tablespace ORA_DATA, but we also need to check the amount of space allocated for that user on that tablespace using the below query.
SQL> select TABLESPACE_NAME,USERNAME,MAX_BYTES,BYTES from dba_ts_quotas where USERNAME='ORAHOW';

no rows selected

Using the above query we can see that this user doesn't have access to this tablespace, so we will assign unlimited quota on this tablespace for this user.
SQL> alter user ORAHOW DEFAULT TABLESPACE ORA_DATA quota unlimited on ORA_DATA;

User altered.
If you want you can assign limited quota to that user.
ALTER USER <username> QUOTA 100M ON <tablespace name>
GRANT UNLIMITED TABLESPACE TO <username> 


Now will verify the above changes using the following query.
SQL>  select TABLESPACE_NAME,USERNAME,MAX_BYTES,BYTES from dba_ts_quotas where USERNAME='ORAHOW';

TABLESPACE_NAME        USERNAME         BYTES         MAX_BYTES
---------------------------------------------------------------
ORA_DATA                 ORAHOW          786432           -1
  


Finally, after assigning privileges on tablespace to the user we will execute the job.
SQL> exec DBREPORT.PROC_DB_GROWTH_INFO

PL/SQL procedure successfully completed. 
Read more ...

Linux Crontab: Cron and Crontab usage and Examples


Crontab-Examples


Linux Crontab Format - Cron Job Sceduling, usage with Examples


The content of the file can be divided in to 6 fields(first 5 for specifying time and last one for executing scripts/app etc). The first five fields are separated by either a space or a tab and represent the following units, respectively:
* minutes (0-59)

* hour (0-23)

* day of the month (1-31)

* month of the year (1-12)

* day of the week (0-6, 0=Sunday)

An example of crontab format with commented fields is as follows:

# Minute   Hour    Day of Month      Month           Day of Week        Command   
# (0-59)  (0-23)     (1-31)      (1-12 or Jan-Dec)  (0-6 or Sun-Sat) 
           

Allowed special character for job scheduling(*, -, /, ?, #)

Asterik(*) – Match all values in the field or any possible value
Hyphen(-) – To define range.
Slash (/) – 1st field /10 meaning every ten minute or increment of range.
Comma (,) – To separate items.
Hash  (#) - To comment job, or to make a job inactive.



1. To View/List Crontab Entries
To List or view crontab job entries you can use crontab command with -l option, here you will see all the scheduled jobs.
# crontab -l

00 10 * * * /bin/ls >/ls.txt

2. To Edit Crontab Entries
To edit crontab entry, use -e option with crontab as shown below. After proper entry press escap :wq which saves the file and will make necessary changes after editing.
# crontab -e

3.To Remove Crontab Entries
Caution: Crontab with -r parameter will remove complete scheduled jobs without your confirmation from crontab. You can use -i option which confirm's you before removing entries.
# crontab -r

4. Ask Confirmation Before Deleting Crontab
crontab with -i option will prompt you confirmation from user before deleting user’s crontab.
# crontab -i -r

crontab: really delete root's crontab?

5. To Create Crontab for a User
As a root user you can create crontab entries for a particular user using the following command.
#crontab -e -u username

-e is for editing and -u for specifying user name when you are scheduling crontabs for other users. If users want to schedule their own he can just give (crontab -e). After entering the values save and exit the file. A file will be created in crontab file location as /var/spool/cron/orahow with the above content.

6. To View User’s Crontabs entries
To view crontab entries of other Linux users, login as root and use -u {username} -l as shown below.
[root@orahow]# crontab -u santosh -l
@monthly /home/santosh/monthly-backup
00 09-18 * * * /home/santosh/check-db-status 
7. To Check Cron Process
To find out what are the cron jobs which are running at any instant on a Solaris server, you can use ps command which list all the cron jobs which are running on the server. To Check if the 'cron' daemon is running.
ps -ef | grep cron

There should be a process: /usr/sbin/cron that started at the same time as the system booted (check with who -b).

You can 'bounce' the cron daemon, if you want, with:
/etc/init.d/cron stop
/etc/init.d/cron start

 Most frequently used Crontab Examples in Linux/Unix.


1. Schedule a cron to execute at 5 am daily. 
To schedule a job at 5 am daily, you can edit entries as shown below.
0 5 * * * /var/test/script.sh > /temp/script.out 

2. Schedule a cron to execute on every Sunday at 6 PM.
This type of cron are useful for doing weekly tasks, like backup, log rotation etc.

0 18 * * sun  /var/test/script.sh > /temp/script.out

3. Schedule a cron to execute on every 15 minutes.
If you want to run your script on 15 minutes interval, can configure entries like below. These type of crons are usefull for monitoring.

*/15 * * * * /var/test/script.sh > /temp/script.out

*/15: means to on each 15 minutes.

 4. Schedule a cron to execute on every six hours.
If you want to run script on 6 hours interval. It can be configure like below.

0 */6 * * * /var/test/script.sh > /temp/script.out 

5. To Schedule Job on every weekday(Mon to Fri) during the working hours 10 a.m – 6 p.m.

00 10-18 * * 1-5 /var/test/script.sh > /temp/script.out 

00 – 0th Minute
10-18 : At 10 am,11 am, 12 am, 1 pm, 2 pm, 3 pm, 4 pm, 5 pm, 6 pm
* : Every day
* : Every month
1-5 : Mon, Tue, Wed, Thu and Fri

6. To execute script on every 10th of each month at 11:45pm
Script located in /var/test/script.sh executed at given time and save output to the /temp/script.out.
45 23 10 * * /var/test/script.sh > /temp/script.out 

here * in month field and week field indicates any month and any week execute this script

7. To schedule job on every minute of every hour of every day of every month.
This line executes the "ping" command every minute of every hour of every day of every month. The standard output is redirected to dev null so we will get no e-mail but will allow the standard error to be sent as a e-mail. If you want no e-mail ever change the command line to "/sbin/ping -c 1 192.168.0.1 > /dev/null 2>&1".

*       *       *       *       *       /sbin/ping -c 1 192.168.0.1 > /dev/null 

You can also use some of the Special strings for job scheduling:

string         meaning
------         -------

@reboot        Run once, at startup.
----------------------------------------------
@yearly        Run once a year, "0 0 1 1 *".
----------------------------------------------
@annually      (same as @yearly)
----------------------------------------------
@monthly       Run once a month, "0 0 1 * *".
----------------------------------------------
@weekly        Run once a week, "0 0 * * 0".
----------------------------------------------
@daily         Run once a day, "0 0 * * *".
----------------------------------------------
@midnight      (same as @daily)
-----------------------------------------------
@hourly        Run once an hour, "0 * * * *".

 Schedule a job to execute on yearly basis.
@yearly timestamp is similar to “0 0 1 1 *”. This will execute job at 00:00 on Jan 1st for every year.
@yearly /var/test/script.sh 

Schedule a tasks to execute on monthly
@monthly timestamp is similar to “0 0 1 * *”. This will execute job at 00:00 on 1st of every month.
@monthly /var/test/script.sh 

 Schedule a tasks to execute on Weekly.
@weekly timestamp is similar to “0 0 1 * *”. It will execute task on first minute of month. It may usefull to do weekly tasks like cleanup of system etc.
@weekly /var/test/script.sh 

 Schedule a tasks to execute on daily ( @daily ).
@daily timestamp is similar to “0 0 * * *”. It will execute job at 00:00 on every day..
@daily /scripts/script.sh 

 Schedule a tasks to execute on hourly ( @hourly ).
@hourly timestamp is similar to “0 * * * *”. It will execute task on first minute of every hour.
@hourly /var/test/script.sh 

Schedule a tasks to execute on system reboot
@reboot is usefull for those tasks which you want to run on your system startup. It will be same as system startup scripts. It is usefull for starting tasks in background automatically.

@reboot /var/test/script.sh 
System Wide Cron Schedule
you can also use predefine cron directory for job scheduling as shown below.
/etc/cron.d
/etc/cron.daily
/etc/cron.hourly
/etc/cron.monthly
/etc/cron.weekly
So this is all about Linux crontab for cron job scheduling. Here we have explained basics and limited usage examples, if you are planning to deploy any script under crontab we recommend you to cross-verify again from experts or from similar sources.
Read more ...

Install Wine in RHEL/CentOS/Ubuntu 7.0/6.x/5.x and Fedora 21-12

Wine is used To Run Windows Software on Linux. Linux users generally search for some techniques using which they could install Windows .exe files like VLC, on Linux machine. In this article you will show you a step by step process on "how to install latest version of Wine on Red Hat - RHEL and Debian based operating systems like CentOS, Fedora, Ubuntu, Linux Mint and other supported distributions.


Install Wine on RedHat, Ubantu, CentOS, Fedora


Some of the Extra Features Added In this New Release:

  • New version of the Mono engine.
  • A few more functions implemented in MSHTML.
  • Improved support for restoring display mode.
  • Font metrics improvements in DirectWrite.
  • Various types of bug fixes in this new release.

How to install Wine on redhat Linux based operating Systems

Before wine installation we need to install some of the "Development tools" which is required to install the package smoothly. These tools are mostly required to compile and install them using YUM command. If previously installed no need to install again.

#yum groupinstall 'Development Tools'
# yum install libX11-devel freetype-devel zlib-devel libxcb-devel


 Download Wine Packages for Installation from Source using Wget Command

Download the latest version of source file using Wget command under /tmp directory as a normal User, you can also find the latest release from the wine website.

https://www.winehq.org/

$ cd /tmp

$ wget http://citylan.dl.sourceforge.net/project/wine/Source/wine-1.7.32.tar.bz2


Now, extract the downloaded tar file using the following command

$ tar -xvf wine-1.7.32.tar.bz2

To install extracted Wine Packages

Now, it’s time to compile and build Wine installer using the following commands as normal user, if asked for root password provide the same. Note: The installation process might take up-to 10-15 minutes depending upon your internet speed.


On 64-Bit Systems

$ cd wine-1.7.32/

$ ./configure --enable-win64

$ make

# make install


On 32-Bit Systems

# cd wine-1.7.32/

#./configure

# make

# make install

To Install Wine On Ubuntu, Debian and Linux Mint

Under Ubuntu based systems, you can easily install the latest development build of Wine using the official PPA. Open a terminal and run the following commands with sudo privileges.
$ sudo add-apt-repository ppa:ubuntu-wine/ppa

$ sudo apt-get update

$ sudo apt-get install -y wine1.7 winetricks

How to Install and run EXE files in Linux, RHEL, CentOS, Fedora, Ubantu

Navigate to the directory location of your windows application setup file and double click on it. It will automatically start the installation of the application (.exe) file. If it does not work then you can start the installation process from the terminal by typing the following command:

wine your_application_setup_file_name.exe

example:

wine VLC.exe

Read more ...

How to Find Out the size of your Oracle Database

Free-and-Used-Space-within-Oracle-Database
As an Oracle DBA this is the most important interview question and at any time you may face an issue where you need to find out the size of the Oracle Database. In detail, here you will get to know the actual size of the database that comprises of only data files when no redo and temp are generated. In second case, you may asked to find out the overall database size that contains all the data files, temp files and the redo logs (free+used space). Third, is the size occupied by data in this database or you can say  Database usage details which you can get using dba_segments. 


To Find the Actual size of the Database in GB

SELECT SUM (bytes) / 1024 / 1024 / 1024 AS GB FROM dba_data_files;

To Find the Size Occupied by Data in the Database 

Gives the size occupied by data in this database or Database usage details.
SELECT SUM (bytes)/1024/1024/1024 AS GB FROM dba_segments;

To Find the Overall/Total Database Size

Overall database size is the sum of used space plus free space i.e. the size of the data files, temp files, log files and the control files. You can find out the total database size using simple query. This sql gives the total size in GB.  
select
( select sum(bytes)/1024/1024/1024 data_size from dba_data_files ) +
( select nvl(sum(bytes),0)/1024/1024/1024 temp_size from dba_temp_files ) +
( select sum(bytes)/1024/1024/1024 redo_size from sys.v_$log ) +
( select sum(BLOCK_SIZE*FILE_SIZE_BLKS)/1024/1024/1024 controlfile_size from v$controlfile) "Size in GB"
from
dual
Read more ...

Schema and Non-Schema Objects in Oracle Database

Oracle database contains schema objects like views, tables, triggers etc., and several other types of objects which are also stored in the database but are not contained in a schema.

A schema is a collection of logical structures of data, or schema objects which is owned by a database user and has the same name as that of the user. Schema objects can be created and manipulated with SQL and include the following types of objects:




Types of Schema Objects

Schema objects are logical data storage structures which do not have a one-to-one correspondence to physical files on disk that store their information. However, Oracle Database stores a schema object logically within a tablespace of the database. The data of each object is physically contained in one or more of the tablespace's datafiles.
  • Tables and index-organized tables
  • Constraints
  • Views
  • Database links
  • Database triggers
  • Dimensions
  • External procedure librarie
  • Indexes and indextypes
  • Java classes, Java resources, and Java sources
  • Materialized views and materialized view logs
  • Object tables, object types, and object views
  • Operators
  • Sequences
  • Stored functions, procedures, and packages
  • Synonym
  • Tables and index-organized tables
  • Clusters 

Types of NON-SCHEMA Objects

There are several other types of objects which are also stored in the database but are not contained in a schema are:
  • Contexts
  • Directories
  • Parameter files (PFILEs) and server parameter files (SPFILEs)
  • Profile
  • Roles
  • Rollback segments
  • Tablespaces
  • User
 For some objects, such as tables, indexes, and clusters, you can specify how much disk space Oracle Database allocates for the object within the tablespace's datafiles.

Read more ...

How To Find DBID in NOMOUNT State

Oracle Database identifier in short DBID is an internal, unique identifier for an Oracle database. Database administrator must note down the DBID in safe place, so that any miss-happening to the database could be easily identified and recovered. In case it is required to recover SPFILE or control file from autobackup, such as disaster recovery, you will need to set DBID. So lets see how to get DBID in NOMOUNT State.



Why DBID is important? 

  • It is an unique identifier for a database.
  • In case of backup and recovery RMAN distinguishes databases by DBID.
  • When DBID of a database is changed, all previous backups and archived logs of the database become unusable.
  • After you change the DBID, you must open the database with the RESETLOGS option, which re-creates the online redo logs and resets their log sequence to 1 
  • You should make a backup of the whole database immediately after changing the DBID.


Let's take an example of getting it in nomount state:

First shut down the database using shut immediate command

SQL> shut immediate
Database closed.
Database dismounted.
ORACLE instance shut down.
Now startup database in nomount state
SQL> startup nomount
ORACLE instance started.
Total System Global Area  606806016 bytes
Fixed Size                  1376268 bytes
Variable Size             402657268 bytes
Database Buffers          197132288 bytes
Redo Buffers                5640192 bytes
You can also set tracefile identifier for easily identification of tracefile.

SQL> alter session set tracefile_identifier=orahow;
Session altered.
Now, dump first ten block of datafile, because each block header contains dbid information.

SQL> alter system dump datafile 'D:\app\SantoshTiwari\oradata\TEST11\USERS01.DBF'
  2  block min 1 block max 10;
System altered.
Now find the location of Trace file.

SQL> show parameter user_dump_dest
NAME                                 TYPE        VALUE
------------------------------------ ----------- ------------------------------
user_dump_dest                       string      d:\app\santoshtiwari\diag\rdbm
                                                 s\test11\test11\trace

Now search for Db ID inside the trace file. In Linux you can use cat command with grep to find it:

cat filename | grep Db id

Here you can see the dump here:

Start dump data block from file D:\APP\SANTOSHTIWARI\ORADATA\TEST11\USERS01.DBF minblk 1 maxblk 10
 V10 STYLE FILE HEADER:
Compatibility Vsn = 186646528=0xb200000
Db ID=3561501508=0xd4483344, Db Name='TEST11'
Activation ID=0=0x0
Control Seq=3522=0xdc2, File size=640=0x280
File Number=4, Blksiz=8192, File Type=3 DATA


In simple you can also get it using v$database:

SQL> select name, dbid from v$database;
NAME            DBID
--------- ----------
TEST11    3561501508


 DBID is also displayed by the RMAN client when it starts up and connects to your database. Typical output follows:


SQL> host rman target /
Recovery Manager: Release 11.2.0.1.0 - Production on Thu Nov 6 19:59:06 2014
Copyright (c) 1982, 2009, Oracle and/or its affiliates.  All rights reserved.
connected to target database: TEST11 (DBID=3561501508)

Read more ...

CONTACT

Name

Email *

Message *