Sei sulla pagina 1di 126

up

vote44d
own
voteacc
epted

ACID Atomicity, Consistency, Isolation, Durability


AIO Asynchronous I/O
BASE - Basically Available, Soft-State, Eventually
Consistent...essentially a counterpart to (though not really
"opposite" of) ACID, this is the core principle of most NoSQL
implementations.
BI - Business Intelligence
BLOB Binary Large OBject
CAP Consistency, Availability, Partition tolerance... The three
requirements of a distributed system (as they apply to a
database) according to Eric Brewer's CAP Theorem.
CDM Copy Data Management
CI Clustered Index
CK Candidate Key
CLOB Character Large OBject
CRUD Create, Read, Update, and Delete
CS Cursor Stability - an isolation level supported by different
database management systems.
CTE Common Table Expression
DB Database
DBA Database Administrator
DBMS Database Management System
DCL Data Control Language
DDL Data Definition Language
DML Data Manipulation Language
DMV - Dynamic Management Views
DR - Disaster Recovery
DRBD - Distributed Replicated Block Device
DRDA Distributed Relational Database Architecture
DRI - Declarative Referential Integrity
DSS - Decision Support Systems
DTD Document Type Definition
DW or DWH Database Warehouse
EAV Entity-Attribute-Value (aka. the archenemy)
ERD - Entity Relationship Diagram
ETL Extract, Transform, Load
FDW - Foreign Data Wrapper (PostgreSQL)
FK Foreign Key
FLWOR For, Let, Where, Order, Return - an expression form used
within XQuery to query XML within a database (not sure if DB2
only)
FS Filesystem
FTS Fulltext Search
GBP Group Buffer Pool

HA High Availability
HADR High Availability Disaster Recovery
HDD Hard Disk Drive
ICP Index Condition Pushdown (MySQL)
IOPS IO Per Second
IOT Index Organized Table (Oracle)
ISAM - Indexed Sequential Access Method
I/O Input/Output
JDBC Java Database Connectivity
KV Key/Value
LAMP - Linux, Apache, MySQL and PHP
LBAC - Label Based Access Control
LOB Large OBject
LPAR Logical Partition
LRU Last Recently Used (algorithm)
LUN Logical Unit Number
MDC Multidimensional Clustering Table
MDM Master Data Management
MDX Multidimensional Expressions
MED Management of External Data
MQT Materialized Query Table (IBM DB2)
MV Materialized View
MVCC Multiversion Concurrency Control
NAS - Network Attached Storage
NCI Non-clustered Index
NF - Normal Form (ie: 1NF, first normal form)
ODBC Open Database Connectivity
ODS - Operational Data Store
OLAP Online Analytical Processing
OLTP Online Transaction Processing
OODBMS Object-Oriented Database Management System
OOM Out Of Memory
ORM Object-Relational Mapping
OS Operating System
PK Primary Key
PL/pgSQL Procedural Language/SQL (PostgreSQL) used for
writing stored procedures. Similar to PL/SQL.
PL/SQL Procedural Language/SQL (Oracle) used for writing
stored procedures. Also see SQL PL.
QPS Queries Per Second
RAC Real Application Clusters (Oracle)
RAID Redundant Array of Independent Disks
RBAR Row By Agonizing Row
RDBMS Relational Database Management System
RBR Row-Based Replication (MySQL)
RPO - Recovery Point Objective - how much data you can afford to

lose. If your server went down, this is the point at which you'd be
able to recover the data.
RR Repeatable Read - an isolation level supported by different
database management systems.
RS
Read Stability - an isolation level supported by different
database management systems.
Replica Set - multiple physical nodes forming a logical node with
redundant data. Most commonly used in the MongoDB ecosystem
RTO - Recovery Time Objective - how much time it would take you
to recover the data to the RPO
SAN Storage Area Network
SBR Statement-Based Replication (MySQL)
SCD Slowly Changing Dimension
SE Storage Engine (MySQL and forks)
SEQUEL Structured English QUEry Language, which was IBM's
precursor to SQL, which is why SQL is sometimes (often?)
pronounced SEQUEL and not S.Q.L.
SP Stored Procedure
SQL Structured Query Language
SQL PL SQL Procedure Language used for writing stored
procedures. Also see PL/SQL.
SQL/XML an extension of the SQL language used for querying
XML.
SSD Solid State Drive
TPS* - Transactions Per Second, a measurement of database
performance.
UAT - User Acceptance Testing
UDF User Defined Function
UDT User Defined Type
UR Uncommitted Read - an isolation level supported by different
database management systems.
URLT - Update Resume; Leave Town - For those DBAs that don't
bother putting together a proper recovery strategy
XML eXtensible Markup Language
XSD XML Schema Definition
XSLT XML Stylesheet Transformation

share

edited Apr 4 at 10:46

community wiki

44 revs, 18 users 21%

Chris Aldrich

45 Useful Oracle Queries


BY VIRAL PATEL JANUARY 14, 2014

Heres a list of 40+ Useful Oracle queries that every Oracle developer must
bookmark. These queries range from date manipulation, getting server info,
get execution status, calculate database size etc.
Date / Time related queries
1.

Get the first day of the month


Quickly returns the first day of current month. Instead of current month
you want to find first day of month where a date falls, replace SYSDATE
with any date column/value.

SELECT TRUNC (SYSDATE, 'MONTH') "First day of current month"


FROM DUAL;
2.
Get the last day of the month

This query is similar to above but returns last day of current month. One
thing worth noting is that it automatically takes care of leap year. So if
you have 29 days in Feb, it will return 29/2. Also similar to above query
replace SYSDATE with any other date column/value to find last day of
that particular month.
SELECT TRUNC (LAST_DAY (SYSDATE)) "Last day of current month"
FROM DUAL;
3.
Get the first day of the Year
First day of year is always 1-Jan. This query can be use in stored
procedure where you quickly want first day of year for some calculation.
SELECT TRUNC (SYSDATE, 'YEAR') "Year First Day" FROM DUAL;
4.
Get the last day of the year
Similar to above query. Instead of first day this query returns last day of
current year.
SELECT ADD_MONTHS (TRUNC (SYSDATE, 'YEAR'), 12) - 1 "Year Last Day"
FROM DUAL
5.
Get number of days in current month
Now this is useful. This query returns number of days in current month.
You can change SYSDATE with any date/value to know number of days in
that month.
SELECT CAST (TO_CHAR (LAST_DAY (SYSDATE), 'dd') AS INT)
number_of_days
FROM DUAL;
6.
Get number of days left in current month
Below query calculates number of days left in current month.
SELECT SYSDATE,
LAST_DAY (SYSDATE) "Last",
LAST_DAY (SYSDATE) - SYSDATE "Days left"
FROM DUAL;
7.
Get number of days between two dates
Use this query to get difference between two dates in number of days.

SELECT ROUND ( (MONTHS_BETWEEN ('01-Feb-2014', '01-Mar-2012') *


30), 0)
num_of_days
FROM DUAL;
OR
SELECT TRUNC(sysdate) - TRUNC(e.hire_date) FROM employees;
Use second query if you need to find number of days since some specific
date. In this example number of days since any employee is hired.
8.

Display each months start and end date upto last month of the year
This clever query displays start date and end date of each month in
current year. You might want to use this for certain types of calculations.

SELECT ADD_MONTHS (TRUNC (SYSDATE, 'MONTH'), i) start_date,


TRUNC (LAST_DAY (ADD_MONTHS (SYSDATE, i))) end_date
FROM XMLTABLE (
'for $i in 0 to xs:int(D) return $i'
PASSING XMLELEMENT (
d,
FLOOR (
MONTHS_BETWEEN (
ADD_MONTHS (TRUNC (SYSDATE, 'YEAR') - 1, 12),
SYSDATE)))
COLUMNS i INTEGER PATH '.');
9.
Get number of seconds passed since today (since 00:00 hr)
10. SELECT (SYSDATE - TRUNC (SYSDATE)) * 24 * 60 * 60
num_of_sec_since_morning
11.
FROM DUAL;
12. Get number of seconds left today (till 23:59:59 hr)
13. SELECT (TRUNC (SYSDATE+1) - SYSDATE) * 24 * 60 * 60
num_of_sec_left
14.
FROM DUAL;
Data dictionary queries
15.

Check if a table exists in the current database schema

A simple query that can be used to check if a table exists before you
create it. This way you can make your create table script rerunnable. Just

replace table_name with actual table you want to check. This query will
check if table exists for current user (from where the query is executed).
SELECT table_name
FROM user_tables
WHERE table_name = 'TABLE_NAME';
16. Check if a column exists in a table
Simple query to check if a particular column exists in table. Useful when
you tries to add new column in table using ALTER TABLE statement, you
might wanna check if column already exists before adding one.
SELECT column_name AS FOUND
FROM user_tab_cols
WHERE table_name = 'TABLE_NAME' AND column_name =
'COLUMN_NAME';
17. Showing the table structure
This query gives you the DDL statement for any table. Notice we have
pass TABLE as first parameter. This query can be generalized to get DDL
statement of any database object. For example to get DDL for a view just
replace first argument with VIEW and second with your view name and
so.
SELECT DBMS_METADATA.get_ddl ('TABLE', 'TABLE_NAME', 'USER_NAME')
FROM DUAL;
18. Getting current schema
Yet another query to get current schema name.
SELECT SYS_CONTEXT ('userenv', 'current_schema') FROM DUAL;
19. Changing current schema
Yet another query to change the current schema. Useful when your script
is expected to run under certain user but is actually executed by other
user. It is always safe to set the current user to what your script expects.
ALTER SESSION SET CURRENT_SCHEMA = new_schema;
Database administration queries
20.

Database version information

Returns the Oracle database version.


SELECT * FROM v$version;
21. Database default information
Some system default information.
SELECT username,
profile,
default_tablespace,
temporary_tablespace
FROM dba_users;
22. Database Character Set information
Display the character set information of database.
SELECT * FROM nls_database_parameters;
23. Get Oracle version
24.
25.
26.
27.

SELECT VALUE
FROM v$system_parameter
WHERE name = 'compatible';
Store data case sensitive but to index it case insensitive

Now this ones tricky. Sometime you might querying database on some
value independent of case. In your query you might do UPPER(..) =
UPPER(..) on both sides to make it case insensitive. Now in such cases,
you might want to make your index case insensitive so that they dont
occupy more space. Feel free to experiment with this one.
CREATE TABLE tab (col1 VARCHAR2 (10));
CREATE INDEX idx1
ON tab (UPPER (col1));
ANALYZE TABLE a COMPUTE STATISTICS;
28. Resizing Tablespace without adding datafile
Yet another DDL query to resize table space.
ALTER DATABASE DATAFILE '/work/oradata/STARTST/STAR02D.dbf' resize
2000M;
29. Checking autoextend on/off for Tablespaces

Query to check if autoextend is on or off for a given tablespace.


SELECT SUBSTR (file_name, 1, 50), AUTOEXTENSIBLE FROM
dba_data_files;
(OR)
SELECT tablespace_name, AUTOEXTENSIBLE FROM dba_data_files;
30. Adding datafile to a tablespace
Query to add datafile in a tablespace.
ALTER TABLESPACE data01 ADD DATAFILE
'/work/oradata/STARTST/data01.dbf'
SIZE 1000M AUTOEXTEND OFF;
31. Increasing datafile size
Yet another query to increase the datafile size of a given datafile.
ALTER DATABASE DATAFILE '/u01/app/Test_data_01.dbf' RESIZE 2G;
32. Find the Actual size of a Database
Gives the actual database size in GB.
SELECT SUM (bytes) / 1024 / 1024 / 1024 AS GB FROM dba_data_files;
33. Find the size occupied by Data in a Database or Database usage details
Gives the size occupied by data in this database.
SELECT SUM (bytes) / 1024 / 1024 / 1024 AS GB FROM dba_segments;
34. Find the size of the SCHEMA/USER
Give the size of user in MBs.
SELECT SUM (bytes / 1024 / 1024) "size"
FROM dba_segments
WHERE owner = '&owner';
35. Last SQL fired by the User on Database
This query will display last SQL query fired by each user in this database.
Notice how this query display last SQL per each session.
SELECT S.USERNAME || '(' || s.sid || ')-' || s.osuser UNAME,
s.program || '-' || s.terminal || '(' || s.machine || ')' PROG,
s.sid || '/' || s.serial# sid,

s.status "Status",
p.spid,
sql_text sqltext
FROM v$sqltext_with_newlines t, V$SESSION s, v$process p
WHERE
t.address = s.sql_address
AND p.addr = s.paddr(+)
AND t.hash_value = s.sql_hash_value
ORDER BY s.sid, t.piece;
Performance related queries
36.

CPU usage of the USER

Displays CPU usage for each User. Useful to understand database load by
user.
SELECT ss.username, se.SID, VALUE / 100 cpu_usage_seconds
FROM v$session ss, v$sesstat se, v$statname sn
WHERE
se.STATISTIC# = sn.STATISTIC#
AND NAME LIKE '%CPU used by this session%'
AND se.SID = ss.SID
AND ss.status = 'ACTIVE'
AND ss.username IS NOT NULL
ORDER BY VALUE DESC;
37. Long Query progress in database
Show the progress of long running queries.
SELECT a.sid,
a.serial#,
b.username,
opname OPERATION,
target OBJECT,
TRUNC (elapsed_seconds, 5) "ET (s)",
TO_CHAR (start_time, 'HH24:MI:SS') start_time,
ROUND ( (sofar / totalwork) * 100, 2) "COMPLETE (%)"
FROM v$session_longops a, v$session b
WHERE
a.sid = b.sid
AND b.username NOT IN ('SYS', 'SYSTEM')
AND totalwork > 0
ORDER BY elapsed_seconds;
38. Get current session id, process id, client process id?
This is for those who wants to do some voodoo magic using process ids
and session ids.

SELECT b.sid,
b.serial#,
a.spid processid,
b.process clientpid
FROM v$process a, v$session b
WHERE a.addr = b.paddr AND b.audsid = USERENV ('sessionid');
o

V$SESSION.SID AND V$SESSION.SERIAL# is database process id

V$PROCESS.SPID is shadow process id on this database server

V$SESSION.PROCESS is client PROCESS ID, ON windows it IS :


separated THE FIRST # IS THE PROCESS ID ON THE client AND 2nd

one IS THE THREAD id.


Last SQL Fired from particular Schema or Table:

SELECT CREATED, TIMESTAMP, last_ddl_time


FROM all_objects
WHERE
OWNER = 'MYSCHEMA'
AND OBJECT_TYPE = 'TABLE'
AND OBJECT_NAME = 'EMPLOYEE_TABLE';
Find Top 10 SQL by reads per execution

SELECT *
FROM ( SELECT ROWNUM,
SUBSTR (a.sql_text, 1, 200) sql_text,
TRUNC (
a.disk_reads / DECODE (a.executions, 0, 1, a.executions))
reads_per_execution,
a.buffer_gets,
a.disk_reads,
a.executions,
a.sorts,
a.address
FROM v$sqlarea a
ORDER BY 3 DESC)
WHERE ROWNUM < 10;
Oracle SQL query over the view that shows actual Oracle
connections.

SELECT osuser,
username,
machine,
program
FROM v$session
ORDER BY osuser;

Oracle SQL query that show the opened connections group by the
program that opens the connection.

SELECT program application, COUNT (program) Numero_Sesiones


FROM v$session
GROUP BY program
ORDER BY Numero_Sesiones DESC;
Oracle SQL query that shows Oracle users connected and the
sessions number for user

SELECT username Usuario_Oracle, COUNT (username) Numero_Sesiones


FROM v$session
GROUP BY username
ORDER BY Numero_Sesiones DESC;
Get number of objects per owner

SELECT owner, COUNT (owner) number_of_objects


FROM dba_objects
GROUP BY owner
ORDER BY number_of_objects DESC;
Utility / Math related queries
Convert number to words

More info: Converting number into words in Oracle


SELECT TO_CHAR (TO_DATE (1526, 'j'), 'jsp') FROM DUAL;
Output:

one thousand five hundred twenty-six


Find string in package source code
Below query will search for string FOO_SOMETHING in all package
source. This query comes handy when you want to find a particular
procedure or function call from all the source code.

--search a string foo_something in package source code


SELECT *
FROM dba_source
WHERE UPPER (text) LIKE '%FOO_SOMETHING%'
AND owner = 'USER_NAME';
Convert Comma Separated Values into Table

The query can come quite handy when you have comma separated data
string that you need to convert into table so that you can use other SQL
queries like IN or NOT IN. Here we are converting AA,BB,CC,DD,EE,FF
string to table containing AA, BB, CC etc. as each row. Once you have this
table you can join it with other table to quickly do some useful stuffs.

WITH csv
AS (SELECT 'AA,BB,CC,DD,EE,FF'
AS csvdata
FROM DUAL)
SELECT REGEXP_SUBSTR (csv.csvdata, '[^,]+', 1, LEVEL) pivot_char
FROM DUAL, csv
CONNECT BY REGEXP_SUBSTR (csv.csvdata,'[^,]+', 1, LEVEL) IS NOT
NULL;
Find the last record from a table
This ones straight forward. Use this when your table does not have
primary key or you cannot be sure if record having max primary key is
the latest one.
SELECT *
FROM employees
WHERE ROWID IN (SELECT MAX (ROWID) FROM employees);
(OR)

SELECT * FROM employees


MINUS
SELECT *
FROM employees
WHERE ROWNUM < (SELECT COUNT (*) FROM employees);
Row Data Multiplication in Oracle
This query use some tricky math functions to multiply values from each
row. Read below article for more details.
More info: Row Data Multiplication In Oracle
WITH tbl
AS (SELECT -2 num FROM DUAL
UNION
SELECT -3 num FROM DUAL
UNION
SELECT -4 num FROM DUAL),

sign_val
AS (SELECT CASE MOD (COUNT (*), 2) WHEN 0 THEN 1 ELSE -1 END
val

FROM tbl
WHERE num < 0)
SELECT EXP (SUM (LN (ABS (num)))) * val
FROM tbl, sign_val
GROUP BY val;
Generating Random Data In Oracle
You might want to generate some random data to quickly insert in table
for testing. Below query help you do that. Read this article for more
details.

More info: Random Data in Oracle


SELECT LEVEL empl_id,
MOD (ROWNUM, 50000) dept_id,
TRUNC (DBMS_RANDOM.VALUE (1000, 500000), 2) salary,
DECODE (ROUND (DBMS_RANDOM.VALUE (1, 2)), 1, 'M', 2, 'F')
gender,
TO_DATE (
ROUND (DBMS_RANDOM.VALUE (1, 28))
|| '-'
|| ROUND (DBMS_RANDOM.VALUE (1, 12))
|| '-'
|| ROUND (DBMS_RANDOM.VALUE (1900, 2010)),
'DD-MM-YYYY')
dob,
DBMS_RANDOM.STRING ('x', DBMS_RANDOM.VALUE (20, 50))
address
FROM DUAL
CONNECT BY LEVEL < 10000;
Random number generator in Oracle
Plain old random number generator in Oracle. This ones generate a
random number between 0 and 100. Change the multiplier to number
that you want to set limit for.

--generate random number between 0 and 100


SELECT ROUND (DBMS_RANDOM.VALUE () * 100) + 1 AS random_num
FROM DUAL;
Check if table contains any data

This one can be written in multiple ways. You can create count(*) on a
table to know number of rows. But this query is more efficient given the
fact that we are only interested in knowing if table has any data.
SELECT 1
FROM TABLE_NAME
WHERE ROWNUM = 1;
If you have some cool query that can make life of other Oracle developers
easy, do share in comment section.

Top 10 Most Common Database Scripts


What are the scripts that a working DBA uses so often that they become part
of the 'muscle memory'? Grant Fritchey asked the question on the forums of
SQL Server Central. From the large response, Grant was able to pick out the
ten most popular T-SQL commands, scripts, or fragments. It seems as if,
despite the range of tasks we do, there are some common tools we use.
You may not have DBA in your job title but you and I both know that youre
the person responsible for the database, and you might as well have that
title. You might consider yourself an accidental DBA, a reluctant DBA, an
incidental DBA or even a forced DBA, but somehow you managed find your
way to a place where youre the person responsible for the local instance of
SQL Server. You could probably use a little help now that youve arrived.
There is a lot of documentation out there describing how to set up your
backups or maintain your databases, indexes, statistics, logs, and so on, and
much of this work will be automated. However, what about the day-to-day TSQL commands that youre just going to have to run manually, over and
over?
I took the following question online through various forums:
What are the top 5 T-SQL commands, scripts, or fragments that you have
typed so often that they are now second nature?
I received many responses, and a pretty good collection of scripts. I also
requested everyone to nominate scripts that used native commands only,
and not their favorite third-party script or tool. A few, very clear winners rose
to the top, and here are the top 10:

1. sp_who2 / sys.dm_exec_requests / sp_whoisactive


2. STATISTICS IO/TIME
3. BACKUP DATABASE
4. sp_help
5. DBCC SQLPERF
6. sys.dm_exec_query_stats
7. RESTORE DATABASE
8. RESTORE FILELISTONLY
9. sp_spaceused
10.

DBCC SHOW_STATISTICS

If youre just getting started as a DBA, accidental or otherwise, these are the
ones you should start memorizing now, because youre going to need them
frequently. My article Using SQL Prompt to Accelerate the Top 10 Most
Common Database Scripts shows how to create a set of DBA snippets from
these scripts, so you can run each of them with one or two simple
keystrokes.
#1 sp_who2 / sys.dm_exec_requests / sp_whoisactive
For several reasons, I lumped these three scripts together. While I was very
explicit in asking people not to nominate third party scripts, Adam
Machanics sp_whoisactive kept showing up over and over again, so I
decided that I couldnt very well keep it off the list.
The sp_whoisactive script uses various DMVs to investigate current activity
on the system. It will highlight, among other things, which queries are
running long and where you might be experiencing blocking. Under the
covers, it makes use of the sys.dm_exec_requests Dynamic Management
View (DMV), so I decided to keep them together. The tool sp_who2 represents
the old way of looking at current activity on the system, and Im including it
here too mainly because I want people to stop using it. Instead,
use sys.dm_exec_requests and the associated DMVs to find this information
(or sp_whoisactive).

There are lots of ways to put together information out of these DMVs. Heres
one example that shows you whats currently running on the system, the
query text and the execution plan.
SELECT *
FROM sys.dm_exec_requests AS der
CROSS APPLY sys.dm_exec_sql_text(der.sql_handle) AS dest
CROSS APPLY sys.dm_exec_query_plan(der.plan_handle) AS deqp;
GO
Listing 1
Armed with a simple script like this, you can quickly and easily see
everything that you can see through sp_who2. Using the same data (the
same FROM clause), you can start to slice and dice it in interesting ways.
Heres an example, which I dont expect you to memorize:
SELECT SUBSTRING(dest.text, ( der.statement_start_offset / 2 ) + 1,
( CASE der.statement_end_offset
WHEN -1 THEN DATALENGTH(dest.text)
ELSE der.statement_end_offset
- der.statement_start_offset
END ) / 2 + 1) AS querystatement ,
deqp.query_plan ,
der.session_id ,
der.start_time ,
der.status ,
DB_NAME(der.database_id) AS DBName ,
USER_NAME(der.user_id) AS UserName ,
der.blocking_session_id ,
der.wait_type ,
der.wait_time ,
der.wait_resource ,
der.last_wait_type ,
der.cpu_time ,
der.total_elapsed_time ,
der.reads ,
der.writes
FROM sys.dm_exec_requests AS der
CROSS APPLY sys.dm_exec_sql_text(der.sql_handle) AS dest
CROSS APPLY sys.dm_exec_query_plan(der.plan_handle) AS deqp;
GO
Listing 2

#2 SET STATISTICS IO/TIME


Frankly, I was a little surprised to see these SET STATISTIC
IO / TIME commands come up so frequently. Personally, I stopped using them
after I realized that they can distort the true performance of the query under
analysis. Instead, I capture query metrics using extended events, because
Ive found it to have lower impact, and provide more accurate measures.
Nevertheless, for quick and dirty testing, these commands provide valuable
information, and are clearly popular.
SET
SET
...
SET
SET

STATISTICS IO ON;
STATISTICS TIME ON;
STATISTICS IO OFF;
STATISTICS TIME OFF;

Listing 3
Simply replace the ellipsis with your query, in Listing 3, and youll see a set
of messages to written to Messages output within the SSMS query window,
the amount of time spent on the query and the reads and writes the query
causes.

(2636 row(s) affected)


Table 'SalesOrderDetail'. Scan count 449, logical reads 1834, physical reads 3, read-ahead
0, lob physical reads 0, lob read-ahead reads 0.
Table 'SalesOrderHeader'. Scan count 1, logical reads 689, physical reads 0, read-ahead re
lob physical reads 0, lob read-ahead reads 0.
Table 'Product'. Scan count 1, logical reads 16, physical reads 0, read-ahead reads 0, lob lo
reads 0, lob read-ahead reads 0.
SQL Server Execution Times:
CPU time = 0 ms, elapsed time = 321 ms.
Focus are on the logical reads for each of the tables referenced and on the
elapsed time for the query.
#3 BACKUP DATABASE
Im not even remotely surprised that BACKUP DATABASE made the list; in
fact, I expected it to be the #1 query, rather than #3. While youre going to
automate your production database backups so that they run without your

direct intervention, its extremely common to need to create a few extra


database backups.
For example, you might want a fallback option before be deploying new
objects to your database, or to create a copy of the QA database for some
additional testing.
BACKUP DATABASE AdventureWorks2014
TO DISK = 'D:\bu\adw.bak'
WITH COPY_ONLY;
Listing 4
This is a straight forward database backup command. The only wrinkle Ive
added is to use the WITH COPY_ONLY clause. Since this is an ad hoc backup, I
dont want to interfere with any DIFFERENTIAL backups that might run
subsequently.
Only a very few people listed BACKUP LOG as a commonly run command.
This is probably because its just not something that a lot of people do
manually, so its not one that comes to mind when talking about common
scripts.
#4 sp_help
Based on how often sp_help came up in the survey, a lot of people spend a
lot of time in databases that they probably didnt design or build
themselves. sp_help and its series of associated commands, such
as sp_helpdb, sp_helpindex, and sp_helpfile, allow us to gather information
about the target object. Running sp_help on different objects will result in
different result sets, showing varying amounts of details for those objects.
For example, Listing 5 will run sp_help on a table.
sp_help 'Sales.SalesOrderHeader';
Listing 5
This command returns quite a lot of information about the table, as you can
see in Figure 1.

Figure 1
You can see the basics right at the top, describing the table in question, the
table owner and data the table was created. Below that, you start seeing
details. The second section shows the columns, such as the IDENTITY column
and its definition.
Storage, indexes and constraints are all detailed, and finally information
about which foreign keys reference this table.
If youre not sure about a database or its design, sp_help is a quick, easy,
and most importantly programmatic way to identify details about the objects
within it.
#5 DBCC SQLPERF
Most DBAs have been taken by surprise, at one time or another, by
extremely rapid growth in the size of the transaction log. It can be cause by
lack of log backups, or infrequent log backups, or by some other problem,

such as a long running or orphaned transaction that is preventing reuse of


existing log space.
DBCC SQLPERF shows the size of the log for each database and the
percentage of log space that is currently in use. This quickly allows you to
assess which databases might need more log space, how much log space is
currently in use, and if any are just too big.
Putting it to work is easy:
DBCC SQLPERF (LOGSPACE);
Listing 6
The output is very easy to understand:

Figure 2
In addition, you can also use DBCC SQLPERF to reset the statistics gathered
on Waits and Latches by issuing commands to clear them.
DBCC SQLPERF("sys.dm_os_latch_stats" , CLEAR);
DBCC SQLPERF("sys.dm_os_wait_stats" , CLEAR);
GO
Listing 7

Just remember, this resets these statistics completely to zero, so you wont
have any historical track from the moment you run the above commands.
#6 sys.dm_exec_query_stats
If sys.dm_exec_requests is the place to go to find out what requests are
running on the server right now, then sys.dm_exec_query_stats is where
youll find aggregated, server-wide data summarizing previous activity.
It shows aggregations of performance metrics on statements within queries,
procedures and batches. However, this information is only retained on the
queries that are currently stored in cache. As soon as the query leaves the
cache, this information goes away completely. If the query comes back into
cache, it starts over at scratch gathering its metrics. You use this DMV in
similar ways to sys.dm_exec_requests.
SELECT SUBSTRING(dest.text, ( deqs.statement_start_offset / 2 ) + 1,
( CASE deqs.statement_end_offset
WHEN -1 THEN DATALENGTH(dest.text)
ELSE deqs.statement_end_offset
- deqs.statement_start_offset
END ) / 2 + 1) AS querystatement ,
deqp.query_plan ,
deqs.execution_count ,
deqs.total_worker_time ,
deqs.total_logical_reads ,
deqs.total_elapsed_time
FROM sys.dm_exec_query_stats AS deqs
CROSS APPLY sys.dm_exec_sql_text(deqs.sql_handle) AS dest
CROSS APPLY sys.dm_exec_query_plan(deqs.plan_handle) AS deqp;
Listing 8
Queries against sys.dm_exec_query_stats, especially when combined with
other DMVs, can provide meaningful and useful information, but just
remember that these are aggregates, so it wont show individual parameter
values or row counts or other results related to individual executions of the
query.
You can also look to sys.dm_exec_procedure_stats to see the same kind of
information on stored procedures.
#7 RESTORE DATABASE

On the one hand, Im rather shocked to see RESTORE DATABASE so far down
the list. On the other hand, when I think about the number of backups I have
done versus the number of times Ive used those backups to restore a
database, it makes sense. On the gripping hand, Im not surprised that it
made the list because weve all had to restore a backup or three.
Entire articles have been written about all the details of
the RESTORE process. Listing 9 shows one use of RESTORE that comes up a
lot, namely creating a new database from the BACKUP file.
RESTORE DATABASE ADW
FROM DISK = 'D:\bu\adw.bak'
WITH MOVE 'AdventureWorks2014_Data' TO 'E:\data\adwnew.mdb',
MOVE 'AdventureWorks2014_Log' TO 'F:\log\adwnewlog.ldb',
NORECOVERY;
Listing 9
The basics of the command are second nature to most DBAs. You have to
define which database youre restoring and then you have to deal with the
files. In this case, Im moving the data to a new location, with new names, in
order to be able to restore a database to the same server that already has a
copy of this database. Finally, I use the NORECOVERY option so that I can
validate the RESTORE process before I open the database up to people. As a
final step you just run RESTORE...WITH RECOVERY.
RESTORE DATABASE ADW
WITH RECOVERY;
GO
Listing 10
#8 RESTORE FILELISTONLY
Closely related to RESTORE DATABASE is RESTORE FILELISTONLY. If you have
to run a restore, youre going to want to know what the logical names and
physical locations of the files. Further, youre going to want to know how
many filesyou have because databases can have multiple data files, all of
which have to be used during a RESTORE (not counting piece
meal RESTOREs). The syntax is very simple.
RESTORE FILELISTONLY
FROM DISK = 'c:\bu\adw.bak';

Listing 11
The results are very thorough. Im going to just show a small sub-section of
all the details:
LogicalName
AdventureWorks2014_Data
AdventureWorks2014_Log
You can see everything you need to feedback to the RESTORE
DATABASE operation (#7).
#9 sp_spaceused
One of the primary tasks youre going to find yourself doing as a DBA is
managing files on disks and worrying about disk space. One of the ways
youre going to worry about it is by investigating the individual objects,
tables and indexes, which are using up your disk space. Thats
where sp_spaceused comes in handy.
EXEC sys.sp_spaceused @objname = N'Sales.SalesOrderHeader';
Listing 12
The results are easy to understand.

Figure 3
If we dont supply an object name, i.e. just run EXEC sys.sp_spaceused, then
well see results for the entire database, and return a very different set of
results.

Figure 4
One additional argument that is worth noting is @updateusage, which when
set to true will run DBCC UPDATUSAGE. It will rescan the system views that
store this data and update pages and row counts so that they report more
accurate size and space information.
For example, Listing 13 reruns sys.sp_spaceused for
our SalesOrderheader table.
EXEC sys.sp_spaceused @objname = N'Sales.SalesOrderHeader',
@updateusage = 'true';
GO
Listing 13
Ill get a slightly different set of results:

Figure 5
We now see a slightly different set of values form those shown in Figure 3;
note that the reserved, index_size and unused values have changed.
Running DBCC UPDATUSAGE can result in additional I/O load on your system,
so exercise caution.
Many people have stopped using sp_spaceused in favor of directly querying
the system tables and DMVs for object usage information. However, my
survey results indicate the enduring popularity of sp_spaceused.
#10 DBCC SHOW_STATISTICS
Coming in at #10 is DBCC SHOW_STATISTICS. Again, Im surprised it came in
so far down the list. Maybe Ive had to deal with bad parameter sniffing too
many times. Maybe I just do lots of index and query tuning. Whatever the
cause, I look at the statistics on my tables and indexes more than my peers,
but clearly, theyre looking at them too since this command made the list.
If you want to see how SQL Server thinks your data looks to the optimizer,
statistics are the answer. The syntax for retrieving them is pretty clear.

DBCC SHOW_STATISTICS('Sales.SalesOrderHeader',
'PK_SalesOrderHeader_SalesOrderID');
Listing 14
You just provide the table name and the name of the set of statistics in which
youre interested. In this example, Im looking at the primary key. The results
come in three parts.

Figure 6
At the top is the header which provides some general information. Next is
the density graph which shows the uniqueness or selectivity of the column or
columns that make up this set of statistics. Finally, you have the histogram,
up to 200 steps showing the data distribution of the first column out of
however many columns there are in this set of statistics. I chose to show the
primary key for the table so that you can see how, despite there being
31,465 rows in the table, the histogram only shows two steps. This is
because every single one of those rows is unique for the primary key value,
so the distribution doesnt need 200 steps to show how things are laid out
within the data.
Conclusion
Few if any of the scripts that appear on the Ten Most Common Database
Scripts were a real surprise. The interesting thing for me was the variation in
how individuals use these scripts or arrive at their own version of these
scripts. Everyone out there has tasks in common. Everyone out there has
tasks that are unique to them. Everyone out there finds new ways to solve
these tasks, but most of us use a common set of tools.
I hope these scripts are helpful to anyone finding their way into the DBA role.
SQL*Plus User's Guide and Reference
SQL*Plus Quick Start

These instructions are to enable you to login and connect to a database after
you have installed SQL*Plus. You can connect to the default database you
created during installation, or to another existing Oracle database.

SQL*Plus Resources
SQL*Plus Overview
SQL*Plus Prerequisites
Starting SQL*Plus Command-line
Starting SQL*Plus Windows GUI
Starting iSQL*Plus
Starting SQL*Plus Instant Client
Connecting to a Different Database
Sample Schemas and SQL*Plus
Running your first Query
Exiting SQL*Plus

SQL*Plus Resources

SQL*Plus on the Oracle Technology Network


at http://www.oracle.com/technology/tech/sql_plus/.
SQL*Plus Discussion Forum at http://www.oracle.com/forums/.
Oracle Documentation Library
at http://www.oracle.com/technology/documentation.
SQL*Plus Product and Documentation feedback by
emailing sqlplus@oracle.com.

SQL*Plus Overview
SQL*Plus is an interactive and batch query tool that is installed with every
Oracle Database installation. It has a command-line user interface, a
Windows Graphical User Interface (GUI) and the iSQL*Plus web-based user
interface.
There is also the SQL*Plus Instant Client which is a stand-alone commandline interface available on platforms that support the OCI Instant Client.
SQL*Plus Instant Client connects to any available Oracle database, but does
not require its own Oracle database installation. See the Oracle Call Interface
Programmer's Guide for more information on the OCI Instant Client.
SQL*Plus has its own commands and environment, and it provides access to
the Oracle Database. It enables you to enter and execute SQL, PL/SQL,
SQL*Plus and operating system commands to perform the following:

Format, perform calculations on, store, and print from query results
Examine table and object definitions

Develop and run batch scripts


Perform database administration

You can use SQL*Plus to generate reports interactively, to generate reports


as batch processes, and to output the results to text file, to screen, or to
HTML file for browsing on the Internet. You can generate reports dynamically
using the HTML output facility of SQL*Plus, or using the dynamic reporting
capability of iSQL*Plus to run a script from a web page.
Connections to an Oracle7 database from SQL*Plus 10.2 are not supported.
Who Can Use SQL*Plus
The SQL*Plus, SQL, and PL/SQL command languages are powerful enough to
serve the needs of users with some database experience, yet straightforward
enough for new users who are just learning to work with the Oracle
Database.
The SQL*Plus language is easy to use. For example, to rename a column
labelled LAST_NAME with the heading "Family Name", enter the command:
COLUMN LAST_NAME HEADING 'Family Name'
Similarly, to list column definitions for the EMPLOYEES table, enter the
command:
DESCRIBE EMPLOYEES
How Can I Learn SQL*Plus
There are several sources available to assist you to learn SQL*Plus:

Part II of this Guide, Using SQL*Plus

Help for SQL*Plus, Command-line and iSQL*Plus online help

Oracle Database 10g: SQL Fundamentals


An instructor-led course run by Oracle. This is a comprehensive handson course taking the student through all aspects of using SQL*Plus
and iSQL*Plus to access Oracle Database.

More Oracle Database 10g Training

To find more useful Oracle courses, go


to http://www.oracle.com/education.
How to Use the SQL*Plus Guide
This guide provides information about SQL*Plus that applies to all operating
systems. It also includes some Windows and UNIX specific information, for
example, the Windows Graphical User Interface. Some aspects of SQL*Plus
differ on each operating system. Such operating system specific details are
covered in the Oracle Database Installation Guide provided for your system.
Use these operating system specific guides in conjunction with this SQL*Plus
User's Guide and Reference.
Throughout this guide, examples showing how to enter commands use a
common command syntax and a common set of sample tables. The tables
are described in "Sample Schemas and SQL*Plus".
SQL*Plus Command-line and Windows GUI Architecture
SQL*Plus command-line and the Windows GUI use a two-tier model
comprising:

Client (command-line user interface).


Database (Oracle Database).

The two tiers may be on the same machine.


SQL*Plus Client
The command-line user interface is the character based terminal
implementation. The Windows GUI is an alternate user interface available in
Windows installations.
Oracle Database
Oracle Database Net components provide communication between the
SQL*Plus Client and Oracle Database.
iSQL*Plus Architecture
iSQL*Plus is a browser-based interface which uses the SQL*Plus processing
engine in a three-tier model comprising:

Client (Web browser).


Middle tier (Application Server).

Database (Oracle Database).

Description of the illustration arch.gif

The iSQL*Plus Server is installed on the same machine as the Application


Server. The client may or may not also be on this machine. The middle tier
coordinates interactions and resources between the client tier and the
database tier. The database is Oracle8i, Oracle9i or Oracle Database
10g accessed through Oracle Net.
Web Browser
The iSQL*Plus user interface comprises web pages served to your web
browser through the Internet or your intranet. There is no installation or
configuration required for the iSQL*Plus user interface. You only need to
know the URL of the Application Server to access an available Oracle
database.
Application Server
The Application Server is installed when Oracle Database is installed.
The middle tier contains a Java2 Enterprise Edition (J2EE) compliant
application server. It uses Oracle Containers for Java (OC4J) as the server
engine. The Application Server enables communication and authentication
between the iSQL*Plus user interface and Oracle Database.
Oracle Database

Oracle Net components provide communication between the iSQL*Plus


Application Server and Oracle Database in the same way as for a client
server installation of Oracle Database.
SQL*Plus Prerequisites
SQL*Plus is a component of Oracle Database. SQL*Plus, and its commandline user interface, Windows GUI, and iSQL*Plus web-based user interface are
installed by default when you install the Oracle Database.
Some aspects of Oracle Database and SQL*Plus differ from one computer
and operating system to another. These topics are discussed in the Oracle
Database Installation Guide for each operating system that SQL*Plus
supports.
What is necessary before you can run SQL*Plus or iSQL*Plus?

Install Oracle Database (or Oracle Client for the command-line


SQL*Plus or Windows GUI interfaces only). See the Oracle Database
Installation Guide for your operating system available
at http://www.oracle.com/technology/documentation/.

Obtain an Oracle Database login username and password during


installation or from your Database Administrator. See Login Username
and Password.

Ensure a sample database is installed and that you have a login


username and password for it during Oracle Database installation.
See Sample Schemas and SQL*Plus.

Create a default database during installation or obtain the connection


identifier for the Oracle Database you want to connect to from your
Database Administrator. See Connecting to a Database.

Ensure the database you want to connect to is started. See


the STARTUP command.

If using iSQL*Plus, ensure that you have the URL for the Application
Server you want to connect to, and that the Application Server is
available and running. See Starting the iSQL*Plus Application Server,
and Testing if the iSQL*Plus Application Server is Running.

SQL*Plus Date Format

The default date format in SQL*Plus is determined by the database


NLS_DATE_FORMAT parameter and may use a date format displaying two
digit years. You can use the SQL TO_CHAR function, or the SQL*Plus COLUMN
FORMAT command in your SELECT statements to control the way dates are
displayed in your report.
Starting SQL*Plus Command-line
The SQL*Plus executable is usually installed in $ORACLE_HOME/bin, which is
usually included in your operating system PATH environment variable. You
may need to change directory to the $ORACLE_HOME/bin directory to start
SQL*Plus.
In the following examples, you are prompted to enter the database account
password.
An example using an Easy Connection identifier to connect to the HR schema
in the MYDB database running on mymachine is:
sqlplus hr@//mymachine.mydomain:port/MYDB
An example using a Net Service Name is:
sqlplus hr@MYDB
Net Service Names can be stored in a number of places, including Oracle
Names. See the Net Services Reference Guide for more information.
If you want to use Net Service Names configured in a local Oracle Net
tnsnames.ora file, then set the environment variable TNS_ADMIN to the
directory containing the tnsnames.ora file. For example, on UNIX, if your
tnsnames.ora file is in /home/user1 and it defines the Net Service Name
MYDB2:
TNS_ADMIN=/home/user1
export TNS_ADMIN
sqlplus hr@MYDB2
This example assumes the ORACLE_HOME environment variable is set, and
the $ORACLE_HOME/network/admin/tnsnames.ora or %ORACLE_HOME
%\network\admin\tnsnames.ora file defines the Net Service Name MYDB3:

sqlplus hr@MYDB3
The TWO_TASK (on UNIX) or LOCAL (on Windows) environment variable can
be set to a connection identifier. This removes the need to explicitly enter
the connection identifier whenever a connection is made in SQL*Plus or
SQL*Plus Instant Client. This UNIX example connects to the database known
as MYDB4:
TNS_ADMIN=/home/user1
export TNS_ADMIN
TWO_TASK=MYDB4
export TWO_TASK
sqlplus hr
To start SQL*Plus and connect to the default database
1. Open a UNIX or a Windows terminal and enter the SQL*Plus command:
2. sqlplus
3. When prompted, enter your Oracle Database username and password.
If you do not know your Oracle Database username and password, ask
your Database Administrator.
4. Alternatively, enter the SQL*Plus command in the form:
5. sqlplus username
You are prompted to enter your password.
6. SQL*Plus starts and connects to the default database.
Now you can start entering and executing SQL, PL/SQL and SQL*Plus
statements and commands at the SQL> prompt.
To start SQL*Plus and connect to a database other than the default
Open a UNIX or a Windows terminal and enter the SQL*Plus command:

sqlplus username@connect_identifier
You are prompted to enter your password.
Starting SQL*Plus Windows GUI
To start the SQL*Plus Windows GUI and connect to a database
1. Click Start > Programs > Oracle-OraHomeName > Application
Development > SQL Plus.
2. Alternatively, open a Windows terminal and enter the SQL*Plus
command:
3. sqlplusw
4. The SQL*Plus Windows GUI opens and the Log On dialog is displayed.
Enter your Oracle Database username and password in the Log On
dialog. If you do not know your Oracle Database username and
password, ask your Database Administrator.
Leave the Host String field blank to connect to the default database.
Enter a connection identifier for the database you want to connect to in
the Host String field. You can connect to Oracle8i, Oracle9i and Oracle
Database 10g databases.
5. Click OK. SQL*Plus starts and connects to the database.
Now you can start entering and executing SQL, PL/SQL and SQL*Plus
statements and commands at the SQL> prompt.
Starting iSQL*Plus
To start an iSQL*Plus session
1. Enter the iSQL*Plus URL in your web browser's Location or Address
field. The iSQL*Plus URL looks like:
2. http://machine_name.domain:port/isqlplus
If you do not know the iSQL*Plus URL, ask your System Administrator,
or try one of the following on the machine running the iSQL*Plus
Application Server.

http://127.0.0.1:5560/isqlplus/
http://localhost:5560/isqlplus/
iSQL*Plus uses HTTP port 5560 by default. If iSQL*Plus is not available
on port 5560, read the $ORACLE_HOME/install/portlist.ini file on the
computer running the iSQL*Plus Application Server to find the port on
which iSQL*Plus is running.
3. Press Enter to go to the URL. The iSQL*Plus Login screen is displayed in
your web browser.
4. Enter your Oracle Database username and password in the Username
and Password fields. If you do not know your Oracle Database
username and password, ask your Database Administrator.
5. Leave the Connection Identifier field blank to connect to the default
database.
Enter an Oracle Database connection identifier in the Connection
Identifier field to connect to a database other than the default. You can
connect to Oracle8i, Oracle9i and Oracle Database 10g databases.
If restricted database access has been configured, the Connection
Identifier field is a dropdown list of available databases to select.
6. Click Login to connect to the database. The iSQL*Plus Workspace is
displayed in your web browser.
Now you can start entering and executing SQL, PL/SQL and SQL*Plus
statements and commands in the Workspace.
Starting and Stopping the iSQL*Plus Application Server
The iSQL*Plus Application Server is started during Oracle Database
installation. It must be running to enable web-based iSQL*Plus sessions.
See Starting the iSQL*Plus Application Server.
Starting SQL*Plus Instant Client
SQL*Plus Instant Client is the SQL*Plus command-line without the need to
install Oracle Database. For information about using it, see Starting SQL*Plus
Command-line.

Because SQL*Plus Instant Client does not include a database, it is always


'remote' from any database server. To connect to a database you must
specify the database using an Oracle Net connection identifier.
If TNS_ADMIN is not set, then an operating system dependent set of
directories is examined to find tnsnames.ora. This search path includes
looking in the directory specified by the ORACLE_HOME environment variable
for network/admin/tnsnames.ora. This is the only reason to set the
ORACLE_HOME environment variable for SQL*Plus Instant Client. If
ORACLE_HOME is set when running Instant Client applications, it must be set
to a directory that exists.
Connecting to a Different Database
To connect to a different database from a current command-line
session
From an existing Windows GUI or command-line session, enter a CONNECT
command in the form:
SQL> connect username@connect_identifier
You are prompted to enter your password.
To connect to a different database from a current iSQL*Plus session
From an existing iSQL*Plus session, enter a CONNECT command in the form:
connect username@connect_identifier
You are prompted to enter your password.
Sample Schemas and SQL*Plus
Sample schemas are included with the Oracle Database. Examples in this
guide use the EMP_DETAILS_VIEW view of the Human Resources (HR) sample
schema. This schema contains personnel records for a fictitious company. To
view column details for the view, EMP_DETAILS_VIEW, enter
DESCRIBE EMP_DETAILS_VIEW
For more information about the sample schemas, see the Oracle Database
Sample Schemas guide.

Unlocking the Sample Tables


The Human Resources (HR) Sample Schema is installed as part of the default
Oracle Database installation. The HR account is locked by default.
You need to unlock the HR account before you can use the HR sample
schema. To unlock the HR account, log in as the SYSTEM user and enter the
following command, where your_password is the password you want to
define for the user HR:
ALTER USER HR IDENTIFIED BY your_password ACCOUNT UNLOCK;
For further information about unlocking the HR account, see the Oracle
Database Sample Schemas guide. The HR user is primarily to enable you to
access the HR sample schema and is necessary to enable you to run the
examples in this guide.
Each table in the database is "owned" by a particular user. You may wish to
have your own copies of the sample tables to use as you try the examples in
this guide. To get your own copies of the HR tables, see your DBA or see
the Oracle Database Sample Schemas guide, or you can create the HR tables
with the script HR_MAIN.SQL which is located in the following directory on
UNIX:
$ORACLE_HOME/demo/schema/human_resources/hr_main.sql
And on the following directory on Windows:
%ORACLE_HOME%\DEMO\SCHEMA\HUMAN_RESOURCES\HR_MAIN.SQL
To create the HR tables from command-line SQL*Plus, do the following:
1. Ask your DBA for your Oracle Database account username and
password.
2. Login to SQL*Plus.
3. On UNIX, enter the following command at the SQL*Plus prompt:
4. SQL> @?/DEMO/SCHEMA/HUMAN_RESOURCES/HR_MAIN.SQL
On Windows, enter the following command at the SQL*Plus prompt:

SQL> @?\DEMO\SCHEMA\HUMAN_RESOURCES\HR_MAIN.SQL
To remove the sample tables, perform the same steps but substitute
HR_DROP.SQL for HR_MAIN.SQL.
Running your first Query
To describe a database object using iSQL*Plus, for example, column details
for EMP_DETAILS_VIEW, enter a DESCRIBE command like:
DESCRIBE EMP_DETAILS_VIEW
which produces the following output:

Description of the illustration describe.gif

To rename the column headings, and to select data from the HR sample
schema view, EMP_DETAILS_VIEW, enter
COLUMN FIRST_NAME HEADING "First Name"
COLUMN LAST_NAME HEADING "Family Name"

SELECT FIRST_NAME, LAST_NAME


FROM EMP_DETAILS_VIEW
WHERE LAST_NAME LIKE 'K%';
which produces the following output:

Description of the illustration selectout.gif

Exiting SQL*Plus
It is recommended that you always use the Logout icon to exit iSQL*Plus to
free up system and server resources.
To exit SQL*Plus command-line, enter EXIT.
To exit the Windows GUI, enter EXIT or select Exit from the File menu.
In iSQL*Plus, the EXIT or QUIT command halts the script currently running, it
does not terminate your session.
Previous Page
Page 7 of 83
Next Page

About Oracle
Contact Us
Legal Notices
Terms of Use
Your Privacy Rights
Copyright 2016, Oracle and/or its affiliates. All rights reserved.

Unix Diary 101


Home
AIX
HPUX
HTML
LINUX
Solaris
Unix
Linux Health Check Commands
This document contains some of the commonly used linux commands when
performing health check on a machine running Linux Operating System.
To view overall performance.
[root@myserver]# top
Note:
- By default is will sort processes based on CPU usage. Press "M" to sort
based on memory usage.
To view I/O of storage devices.
[root@myserver]#
[root@myserver]#
[root@myserver]#
[root@myserver]#
[root@myserver]#

iostat
iostat
iostat
iostat
iostat

-d #Display only disk I/O statistics


-n #Display on network storage devices
-m #Display I/O in MB/s
1 3 #Display I/O every second for 3 times

To check CPU usage at interval of 5 seconds for 3 times.


[root@myserver]# sar -u 5 3
Linux (mysever) 09/29/2013
08:31:15
08:31:20
08:31:25
08:31:30
Average:

PM
PM
PM
PM

CPU
%user
%nice %system %iowait
%idle
all
16.92
0.00
1.48
0.15
81.45
all
14.65
0.00
0.80
0.10
84.45
all
15.85
0.00
2.02
0.07
82.05
all
15.81
0.00
1.43
0.11
82.65

To check memory and swap utilization in megabytes.


[root@myserver]# free -m
total
used
free
shared buffers
cached
Mem:
3735
3567
168
0
270
2221
-/+ buffers/cache:
1075
2659
Swap:
8191
23
8168
To find out top 10 processes consumed the most memory.
The below command will take the output of "ps -aux", sort the memory
column which is column 4 from highest value to lowest and output the first
10 results.
[root@myserver]# ps -aux |sort -nrk 4| head -10
To find out top 10 processes consumed the most CPU.
The below command will take the output of "ps -aux", sort the CPU column
which is column 3 from highest value to lowest and output the first 10
results.
[root@myserver]# ps -aux |sort -nrk 3| head -10
To check how many network interface configured.
[root@myserver]# ifconfig -a
eth0
Link encap:Ethernet HWaddr 11:0B:2D:EF:07:30
BROADCAST MULTICAST MTU:1500 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:0 (0.0 b) TX bytes:0 (0.0 b)
Interrupt:16
eth1

Link encap:Ethernet HWaddr 12:0B:44:FF:47:DF


inet addr:192.0.0.1 Bcast:192.0.0.255 Mask:255.255.255.192
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:1216011503 errors:0 dropped:0 overruns:0 frame:0
TX packets:4253525258 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:0 (0.0 b) TX bytes:0 (0.0 b)
Interrupt:24

To check speed of eth1.


Settings for eth1:
Supported ports: [ MII ]
Supported link modes: 10baseT/Half 10baseT/Full
100baseT/Half 100baseT/Full
1000baseT/Half 1000baseT/Full
Supports auto-negotiation: Yes
Advertised link modes: 10baseT/Half 10baseT/Full
100baseT/Half 100baseT/Full
1000baseT/Half 1000baseT/Full
Advertised auto-negotiation: Yes
Speed: 1000Mb/s
Duplex: Full
Port: Twisted Pair
PHYAD: 1
Transceiver: internal
Auto-negotiation: on
Supports Wake-on: g
Wake-on: d
Current message level: 0x000000ff (255)
Link detected: yes
To check if all hard mount filesystems are mounted properly issue command
"df -h" and cross check with the file /etc/fstab.
[root@myserver]# cat /etc/fstab
[root@myserver]# df -h
To check who is currently logged in.
[root@myserver]# w
To check login history.
[root@myserver]# last
To check current date & time on the server.
[root@myserver]# date

To check current and previous runlevel.


The below output indicate the current runlevel is 3 and previous was 1
[Single user].
[root@myserver]# who -r
run-level 3 Sep 26 06:20 last=S
To check current and previous runlevel.
The below output indicate the current runlevel is 3 and N indicates the
runlevel was not change since boot.
[root@myserver]# runlevel
N3
To reboot.
[root@myserver]# reboot or [root@myserver]# shutdown -r now
or
[root@myserver]# init 6
To shutdown the Operating System.
By default shutdown command will bring the Operating System to runlevel 1.
[root@myserver]# shutdown
To shutdown the Operating System and poweroff.
[root@myserver]# shutdown -h now
To cancel shutdown.
[root@myserver]# shutdown -c
To list services configured.
[root@myserver]# chkconfig --list
To start a service.

[root@myserver]# service nfs start


To view hardware info.
[root@myserver]# dmidecode
Email ThisBlogThis!Share to TwitterShare to FacebookShare to Pinterest
Labels: Linux
Newer PostOlder PostHome
Search This Blog
Search

About Me
Ed
View my complete profile
Disclaimer
This blog was created to document some of the common used command
related to Unix Operating System. If you intend to use the command found in
this blog, please use with care and make sure you understand it's function
before applying it on your system. The owner of this blog and author of any
article found in this blog shall not be liable for any loss or damage of
whatever nature arising from the article found in this blog. If you identify any
such content that is harmful, malicious, sensitive or unnecessary in this blog,
I request you to contact me via email [edtishere@gmail.com] so I may rectify
the problem.
Simple template. Powered by Blogger.

Skip to content

O RAC L E D B A A H E L P I N G H A N D
RA J E E V KU M A R J H A D O M A I N H E A D O RAC L E ( O C P 9 I , 1 0 G , 1 1 G
& O RA C L E C E RT I F I E D E X P E RT , O RAC L E R E A L A P P L I C AT I O N
C LU S T E R S 1 1 G A N D G R I D I N F RA S T R U C T U R E A D M I N I S T RAT O R )

HOME
ORACLE DBA (A HELPING HAND)

PERFORMANCE TUNING
ORACLE REPLICATION

DATABASE ADMINISTRATION
DATABASE MAINTENANCE TASKS
BACKUP & RECOVERY
DATA GUARD
DATABASE ARCHITECTURE

ORACLE RAC

SCRIPTS
ORACLE 12C

INTERVIEW QUESTIONS

ABOUT
S T E P BY S T E P D ATA B A S E R E F R E S H.
December 25, 2015
In this post I am going to describe you step by step process for database
refresh using datapump (EXPDP/IMPDB). In this example my source database
name is MYDB where target database is AVANI
I found many DBA forget to restore old password while import or not
checking invalid object before giving ok to requester who requested for
database refresh from production to test or development databases.
Please find the step by step process which you can follow in your
environments.
1. Always remember to Check the database name before export or import.
SQL> select name from v$database;
NAME

MYDB
2. Check the space utilise of by schema before export.
SQL> select owner,sum(bytes)/1024/1024 MB from dba_segments group
by owner;

OWNER
MB

SYSTEM
30
SYS
715.0625
WMSYS
1.1875
RAJEEV
111
WKSYS
1.625
OUTLN
.5625
DBSNMP
.75
3. Check the username and tablespace before export so you can compare
thing before import.
SQL> col ACCOUNT_STATUS for a10
SQL> col profile for a15
SQL> set lines 150
SQL> select
USERNAME,ACCOUNT_STATUS,DEFAULT_TABLESPACE,TEMPORARY_TABLESPA
CE,PROFILE from dba_users where username=RAJEEV;
USERNAME ACCOUNT_ST DEFAULT_TABLESPACE TEMPORARY_TABLESPACE
PROFILE

RAJEEV OPEN DATA01 TEMP DEFAULT
4. Note the password of schema for export and do same on target database
before import, it can help you when you need to maintain old password.
SQL> set long 2000
SQL> select dbms_metadata.get_ddl(USER,RAJEEV) from dual;
DBMS_METADATA.GET_DDL(USER,RAJEEV)
CREATE USER RAJEEV IDENTIFIED BY VALUES
S:3AFD2F1934CCFB63E4793D84FC8
F1D663550D0D07EEADEE4005F8C46807F;5BE571F865FDADE0
DEFAULT TABLESPACE DATA01
TEMPORARY TABLESPACE TEMP
5. Check the tablespaces used be schema before export

SQL> select distinct tablespace_name from dba_segments where


owner=RAJEEV;
TABLESPACE_NAME

DATA01
6. Check all objects and there status before export. It can help you compare
your object after import.
SQL> select object_type, count(1) from dba_objects where owner=RAJEEV
group by rollup(object_type);
OBJECT_TYPE

FUNCTION
INDEX
PACKAGE
PACKAGE BODY
PROCEDURE
SEQUENCE
TABLE
TRIGGER
TYPE
VIEW

COUNT(1)
32
134
2
2
494
1
93
57
45
9

869
11 rows selected.
SQL> select object_type,status,count(1) from dba_objects where
owner=RAJEEV group by object_type,status;
OBJECT_TYPE
STATUS COUNT(1)
- - TYPE
VALID
45
PROCEDURE
VALID
494
FUNCTION
VALID
32
PACKAGE BODY
VALID
2
PACKAGE
VALID
2
VIEW
VALID
9
INDEX
VALID
134
SEQUENCE
VALID
1

TRIGGER
TABLE

VALID
VALID

57
93

7. Check objects status if any invalid before export. In this example no invalid
object on source.
SQL> select distinct status from dba_objects where owner=RAJEEV;
STATUS
VALID
8. Check the database dictionary before export. So you have idea where you
have to export and which location your export file will be kept.
SQL>
SQL> SELECT owner, directory_name, directory_path
FROM all_directories;
9. I prefer to create par file for export and import it can be done without par
file also.
Create par file with the help of vi editor or any text file. Here i am using
simple par file for demo purpose we can use complex query as well in par
file.
vi expdp_RAJEEV.par
DIRECTORY=DP_MYDB
SCHEMAS=RAJEEV
DUMPFILE=MYDB_RAJEEV_04DEC2013.DMP
LOGFILE=EXPDP_MYDB_RAJEEV_04DEC2013.log
10. Now i am going to call par file for this export. It can be done from
command prompt also.
nohup expdp \/ as sysdba\ parfile=expdp_RAJEEV.par &
Or
nohup expdp system/password DIRECTORY=DP_MYDB
DUMPFILE=MYDB_RAJEEV_04DEC2013.DMP SCHEMAS=RAJEEV
LOGFILE=EXPDP_MYDB_RAJEEV_04DEC2013.log &

11. Now copy the export file on target server for import. Go to the location
wher your export file is available and copy it. Make sure you have privilage of
copy the dump on target server on mentioned lcoation.
scp EXPDP_MYDB_RAJEEV_04DEC2013.log
rajeev@targetserver:/orasav/AVANI/bkp/exp .
**************************************************************targetserver***
******************************************************************************
*******
12. Check the database name before import. Dont forget to check database
name, we found sevral dba done mistake and import will happen in deafult
database which is pre selected.
SQL> select name from v$database;
NAME

AVANI
13. Check the schme avilable on target database or not if yes space
utilisation need to check before import.
SQL> select owner,sum(bytes)/1024/1024 from dba_segments group by
owner;
OWNER

SYSTEM
SYS
RAJEEV
OUTLN
DBSNMP

SUM(BYTES)/1024/1024
29.875
683.3125
106.25
.5625
,6875

14. Check the tablespaces used be schema before import. If required you can
create tablespace or use remap_schema
SQL> col ACCOUNT_STATUS for a10
SQL> col profile for a15
SQL> set lines 150
SQL> select
USERNAME,ACCOUNT_STATUS,DEFAULT_TABLESPACE,TEMPORARY_TABLESPA
CE,PROFILE from dba_users where username=RAJEEV;

USERNAME ACCOUNT_ST DEFAULT_TABLESPACE TEMPORARY_TABLESPACE


PROFILE

RAJEEV OPEN DATA01 TEMP DEFAULT
15. As comunicated in source database export you muct copy the password
before import if you need to maintain old password.
Note the password of schema before droping the schema, it can help you to
maintain old password if required.
SQL> set long 2000
SQL> select dbms_metadata.get_ddl(USER,RAJEEV) from dual;
DBMS_METADATA.GET_DDL(USER,RAJEEV)

CREATE USER RAJEEV IDENTIFIED BY VALUES


S:7BD39503F6BE84405B049490125F74E398DB1B6D80306F07F12699FF81
B4;14F7A8346F70B02D
DEFAULT TABLESPACE DATA01
TEMPORARY TABLESPACE TEMP
16. Drop schema if not required. Datapump automatically create schema
while import.Else you can execute below command after import to maintain
old password.
Note: Below syntax is optional.
SQL> alter user RAJEEV IDENTIFIED BY VALUES
S:7BD39503F6BE84405B049490125F74E398DB1B6D80306F07F12699FF81
B4;14F7A8346F70B02D;
17.Check the database dictionary before import if source and target diffent
please create par file accordingly.
SQL> SELECT owner, directory_name, directory_path
FROM all_directories;
18. Create par file with the help of vi editor or any text file for import the
schema.
vi impdp_RAJEEV.par

DIRECTORY=DP_AVANI
SCHEMAS=RAJEEV
DUMPFILE=EXPORT_RAJEEV_MYDBP_12-17-14.dmp
LOGFILE=IMPDP_MYDB_RAJEEV_12-17-14.log
19. Now i am going to call par file for import. It can be done from command
prompt also as we have done during export.
nohup impdp \/ as sysdba\ parfile=impdp_RAJEEV.par &
20 Check all objects and there status after import. If any invalid object please
recompile it.
SQL> select object_type,status,count(1) from dba_objects where owner=HR
group by object_type,status;
OBJECT_TYPE
STATUS COUNT(1)
- - FUNCTION
VALID
75
PACKAGE BODY
VALID
1
PROCEDURE
VALID
2
PACKAGE
VALID
1
VIEW
VALID
35
INDEX
VALID
586
SEQUENCE
VALID
120
FUNCTION
INVALID
1
TRIGGER
VALID
121
VIEW
INVALID
1
TABLE
VALID
211
OBJECT_TYPE
STATUS COUNT(1)
- - TRIGGER
INVALID 6
12 rows selected.
21. Check objects status if any invalid after import. In this example i have
invalid object and we need to recompile it if required as we know my source
dont have any invalide object.
SQL> select distinct status from dba_objects where owner=RAJEEV;
STATUS
-

VALID
INVALID
ALTER TRIGGER AUDUPD_TM_PROFILE COMPILE;
******************************* END of database refresh
******************************
If any other object is invalid you can try to compile like below mentioned
steps.
SELECT owner,
object_type,
object_name,
status
FROM dba_objects
WHERE status = INVALID
and owner=RAJEEV;
SQL> SELECT owner, object_type, object_name, status
FROM dba_objects
WHERE status = INVALID and owner=RAJEEV;
OWNER OBJECT_TYPE OBJECT_NAME STATUS
- - RAJEEV PROCEDURE USP_REPORT_DONNEES_CAP_PROVCRE INVALID
RAJEEV PROCEDURE USP_REPORT_DONNEES_CAP_PROVTIT INVALID
RAJEEV PROCEDURE USP_TRACE_EXPORT_CAP_MODULE INVALID
RAJEEV PROCEDURE USP_REPORT_PROVCREANCEHG INVALID
RAJEEV PROCEDURE USP_REPORT_PROVCREANCERECAP INVALID
RAJEEV PROCEDURE USP_SELECT_ALL_DONNEES_CAP INVALID
6 rows selected.
SQL> select alter ||object_type|| ||object_name|| compile; from
user_objects where object_type=VIEW and status=INVALID;
ALTER FUNCTION GETMACHINE COMPILE;
ALTER TRIGGER AUDINS_TM COMPILE;
ALTER VIEW VDK_SYNC_TRG COMPILE;
EXEC DBMS_DDL.alter_compile(PACKAGE, MY_SCHEMA, MY_PACKAGE);
EXEC DBMS_DDL.alter_compile(PACKAGE BODY, MY_SCHEMA,
MY_PACKAGE);

EXEC DBMS_DDL.alter_compile(PROCEDURE, RAJEEV,


USP_SELECT_ALL_DONNEES_CAP);
EXEC DBMS_DDL.alter_compile(FUNCTION, TMS, GETMACHINE);
EXEC DBMS_DDL.alter_compile(TRIGGER, TMS, AUDDEL_TM_PROFILE);

I hope you enjoyed demo.


RELATED
About
these ads
Drop Database Manually
Drop Database Manually in Oracle 9i Database deletion task is not coming to
DBA on regular interval. I was lucky to get few tasks for production database
deletion. I have 10 year experience in database and first time, I got the
opportunity to delete the production database after migration database
In "Database Maintenance Tasks"
Export Script for DBA which save time and humman error.
It is my pleasure to share with you this customizes script which can help DBA
for export/import task. The greatest feature of this script that it can work on
complicated environments to save the DBA time and reduce the human
errors. export_data.sh scripts can easily understand the environment
whatever it's
In "Scripts"
How to Check Whether Physical Standby is in Sync with the Primary or Not
and resolved gap ?
Step by Step Process to Resolved gap on Standby database. Summary 1.
Check the name and status of database. 2. Check for GAP on standby 3.
Check redo received on standby 4. Check redo applied on standby 5. Identify
missing archive log files 6. Copy archive log files 7. Register
In "Data Guard"
Posted in: Backup & Recovery, Database Maintenance Tasks, Oracle DBA (A
HELPING HAND)
P O S T N AV I G AT I O N
RAC Interview Questions
2015 in review
L E AV E A R E P LY

Search for:
T O P P O S T S & PA G E S

How to Check Whether Physical Standby is in Sync with the Primary or


Not and resolved gap ?
UNNAMED File Error in standby after adding new file to primary
database ORA-01111, ORA-01110, ORA-01157
ASM Interview Questions
Step by Step RMAN Recovery Catalog Creation and Configuration.
(Windows)
Step by step database refresh.
Cold backup
ORA-01144: File size (4325376 blocks) exceeds maximum of 4194303
blocks
ORA-12514, but tnsping works
Oracle RAC Various Command For Day to Day Operation
What is SCAN listener and how it works in Oracle RAC 11gR2 ?
RECENT POSTS
Oracle Education
TOP 5 Major Reasons Not to Use Oracle Db Links
ORAchk release 12.1.0.2.6 is now available for use.
Recovery Catalog Benefits, features,Costs of Using the
Recovery Catalog
Get password changed time for an oracle user
C AT E G O R I E S
Categories
ARCHIVES
Archives
M E TA

Register
Log in
Entries RSS

Comments RSS
WordPress.com
RECENT POSTS
Oracle Education
TOP 5 Major Reasons Not to Use Oracle Db Links
ORAchk release 12.1.0.2.6 is now available for use.
Recovery Catalog Benefits, features,Costs of Using the
Recovery Catalog
Get password changed time for an oracle user
RECENT COMMENTS
surya on ASM Interview
Questions
dagnachew on UNNAMED File
Error in standby
balaji14 on ASM Interview
Questions
How To Backup Asm
Me on ASM Interview
Questions
Amit on UNNAMED File Error in
standby
ABOUT THE ADMIN

I'm Rajeev Jha (OCP 9i,10g,11g & Oracle Certified 11g RAC Eepert.) Working
as Domain Head Oracle in Banking & Finance sector. I have 10 year
experience in database with Oracle & Microsoft. I also conduct training on
behalf of Oracle University.
BLOG AT WORDPRESS.COM.

Sign in
SQL Protocols
Topics from the Microsoft SQL Server Protocols team Netlibs, TDS, SQL
Browser, etc
Steps to troubleshoot SQL connectivity issues

SQL Server ConnectivityApril 30, 200859

0
0

We have been seeing and trying to resolve SQL connectivity issue all the
time. I guess it would be helpful if we can put some guidance on how to
resolve connectivity issues. Here comes a proposal based on my experience.
Basically, when you failed to connect to your SQL Server, the issue could be:
1) Network issue,
2) SQL Server configuration issue.
3) Firewall issue,
4) Client driver issue,
5) Application configuration issue.
6) Authentication and logon issue.
Usually, customers see connectivity issue in their applications, but it would
be great if you can follow the steps below to eliminate issues one by one and
post a question on SQL Server Data Access forum if needed.

Step 1: Network issue

You might be able to make local connection without a working network, but
thats a special case. For remote connection, a stable network is required.
The first thing to trouble shoot SQL connectivity issues is to make sure the
network we rely on is workable and stable. Please run the following
commands:
ping -a <your_target_machine> (use -4 and -6 for IPv4 and IPv6
specifically)
ping -a <Your_remote_IPAddress>
nslookup (type your local and remote machine name and IP address
multiple times)
Be careful to see any mismatch on the returned results. If you are not able to
ping your target machine, it has high chance that either the network is
broken or the target machine is not running. Its possible the target machine
is behind a firewall and the firewall blocks the packets sent by ping, though.
Windows firewall does not block ping (ECHO) packet by default. The
correctness of DNS configuration on the network is vital to SQL connection.
Wrong DNS entry could cause of all sorts of connectivity issue later. See this
link for example, Cannot Generate SSPI Context error message, Poisoned
DNS.
Step 2: SQL Server configuration issue
You need to make sure the target SQL Server is running and is listening on
appropriate protocols. You can use SQL Server Configuration Manager (SCM)
to enable protocols on the server machine. SQL Server supports Shared
Memory, Named Pipes, and TCP protocols (and VIA which needs special
hardware and is rarely used). For remote connection, NP and/or TCP protocols
must be enabled. Once you enabled protocols in SCM, please make sure
restart the SQL Server.
You can open errorlog file to see if the server is successfully listening on any
of the protocol. The location of errorlog file is usually under:
%ProgramFile%Microsoft SQL Server/MSSQLxx.xxx/MSSQL/Log
If the target SQL instance is a named instance, you also need to make sure
SQL Browser is running on the target machine. If you are not able to access
the remote SQL Server, please ask your admin to make sure all these
happen.
Step 3: Firewall issue
A firewall on the SQL Server machine (or anywhere between client and
server) could block SQL connection request. An easy way to isolate if this is a
firewall issue is to turn off firewall for a short time if you can. Long term
solution is to put exception for SQL Server and SQL Browser.

For NP protocol, please make sure file sharing is in firewall exception list.
Both file sharing and NP use SMB protocol underneath.
For TCP protocol, you need put the TCP port on which the SQL Server listens
on into exception.
For SQL Browser, please put UDP port 1434 into exception.
Meanwhile, you can put sqlservr.exe and sqlbrowser.exe into exception as
well, but this is not recommended. IPSec between machines that we are not
trusted could also block some packets. Note that firewall should never be an
issue for local connections.

Step 4: Client driver issue


At this stage, you can test your connection using some tools. The tests need
to be done on client machine for sure.
First try:
telnet <your_target_machine> <TCP_Port>
You should be able to telnet to the SQL server TCP port if TCP is enabled.
Otherwise, go back to check steps 1-3. Then, use OSQL, SQLCMD, and SQL
Management Studio to test sql connections. If you dont have those tools,
please download SQL Express from Microsoft and you can get those tools for
free.
OSQL (the one shipped with SQL Server 2000) uses MDAC.
OSQL (the one shipped with SQL Server 2005 & 2008) uses SNAC ODBC.
SQLCMD (shipped with SQL Server 2005 & 2008) uses SNAC OLEDB.
SQL Management Studio (shipped with SQL Server 2005 & 2008) uses
SQLClient.
Possilbe command use be:
osql -E -SYour_target_machineYour_instance for Windows Auth
osql -Uyour_user -SYour_target_machineYour_instance for SQL Auth
SQLCMD also applies here. In addition, you can use Stcp:Your_target_machine, Tcp_port for TCP, Snp:Your_target_machineYour_instance for NP, and Slpc:Your_target_machineYour_instance for Shared Memory. You would
know if it fails for all protocols or just some specific procotols.
At this stage, you should not see general error message such as error 26 and
error 40 anymore. If you are using NP and you still see error 40 (Named Pipes

Provider: Could not open a connection to SQL Server), please try the
following steps:
a)
Open a file share on your server machine.
b)
Run net view \your_target_machine and net
use \your_target_machineyour_share (You can try Map Network Drive
from Windows Explorer as well)
If you get failure in b), its very likely you have OS/Network configuration
issue, which is not SQL Server specific. Please search on internet to resolve
this issue first.
You can try connection using both Windows Authentication and SQL
Authentication. If the tests with all tools failed, there is a good chance that
steps 1-3 were not set correctly, unless the failure is logon-related then you
can look at step 6.
If you succeeds with some of the tools, but fails with other tools, its probably
a driver issue. You can post a question on our forum and give us the details.
You can also use windowssystem32odbcad32.exe (which ships with
Windows) to test connection by adding new DSN for various drivers, but
thats for ODBC only.

Step 5: Application issue


If you succeed with steps 1-4 but still see failure in your application, its likely
a configuration issue in your application. Think about couple of possible
issues here.
a) Is your application running under the same account with the account you
did tests in step 4? If not, you might want to try testing in step 4 under that
account or change to a workable service account for your application if
possible.
b) Which SQL driver does your app use?
c) Whats your connection string? Is the connection string compatible to your
driver? Please check http://www.connectionstrings.com/ for reference.

Step 6: Authentication and logon issue


This is probably the most difficult part for sql connectivity issues. Its often
related to the configuration on your network, your OS and your SQL Server
database. There is no simple solution for this, and we have to solve it case by
case. There are already several blogs in sql_protocols talking about some
special cases and you can check them see if any of them applies to your
case. Apart from that, things to keep in mind:

a) If you use SQL auth, mixed authentication must be enabled. Check this
page for reference http://msdn.microsoft.com/en-us/library/ms188670.aspx
b) Make sure your login account has access permission on the database you
used during login (Initial Catalog in OLEDB).
c) Check the eventlog on your system see if there is more information
At last, please post question on our forum. More people could help you over
there. When you post question, you can refer to this link and indicate you
see failure at which step. The most important things for us to troubleshoot
are a) exact error message and b) connection string.

Xinwei Hong, SQL Server Protocols


Disclaimer: This posting is provided AS IS with no warranties, and confers
no rights

Comments (59)

Name *

Email *

Website

Post Comment

1.

Waleed
June 2, 2008 at 8:13 am

im using oledb connection.


while deploying my application to client pc i cant connect to
sqlserver 2005 developer ed.
while from my pc (i have vb.net 2003) im connecting
error message
[DBNETLIB][Connection Open(Connect()).]SQL Server does not exist
or access denied
Reply

2.

SQL Server Tips & Tricks


June 11, 2008 at 8:04 pm
In SQL server the default instance has a listener which listens on
the fixed port which is TCP port 1433.
Reply

3.

Marker
June 13, 2008 at 7:30 am
I am not able to connect to SQL 2005 DB in windows authentication
mode remotly from web application. Is it required to configure
kerberos auhentication?
What could be the cause of this?
Reply

4.

Victor
June 27, 2008 at 10:59 am

Hi! I have this configuration:


1 SQL Server 2000 Enterprise Edition mounted on a Windows 2003
Server (wich we will call Server A). SQL Server is listening trough
port 1433
1 Windows 2003 Server (wich we will call Server B)
Both Servers are on the same network group
What I need is to create an SQL Server System DSN to connect from
B to a SQL Server Database located in A.
When I do This i get the following error:
[DBNETLIB]SQL Server does not exist or access denied
[DBNETLIB]ConnectionOpen (Connect()).
If I try to use the osql command, everytime i get the same error
What might be causing this????
Reply

5.

alexwcy@hotmail.com
July 1, 2008 at 4:04 am
Hi, I am having below error in my production server that running
ASP.NET2.0 and SQL Server 2005. Can someone tell me why this
error happen? Thanks.
Source = .Net SqlClient Data Provider
Error = A connection was successfully established with the server,
but then an error occurred during the pre-login handshake.
(provider: SSL Provider, error: 0 Not enough storage is available to
complete this operation.) | at
System.Data.ProviderBase.DbConnectionPool.GetConnection(DbCo
nnection owningObject)
at
System.Data.ProviderBase.DbConnectionFactory.GetConnection(Db
Connection owningConnection)
at
System.Data.ProviderBase.DbConnectionClosed.OpenConnection(D

bConnection outerConnection, DbConnectionFactory


connectionFactory)
at System.Data.SqlClient.SqlConnection.Open()
Reply

6.

Ernst
July 17, 2008 at 6:06 pm
Thank for Help on Step 2, it seems SQL Express defaults these all to
off. SO remote access doesnt work.
Reply

7.

Cor
July 22, 2008 at 1:43 pm
I am having occasional/rare connection problems with ADO/ADO
.Net connection pooling. The connections use aliases set up for
TCP/IP. Could the problems be occurring because of Kerberos Ticket
Expiration with the pooled connections or could it be that SQL
Server is Orphaning the pooled connections or could it be some sort
of socket problem? Perhaps someone has another suggestion as to
what may be wrong. I am considering using Named Pipes instead to
get around Kerberos authentication.
Reply

8.

Harvey
July 23, 2008 at 10:50 am

In my case, the SQL application slows down to a crawl when the


customer loses his internet service. When the service was restored
by the provider, it started working like is should. Any thoughts . . .
Reply

9.

SQL Server Connectivity


July 23, 2008 at 5:16 pm
Harvey, its probably Windows Authentication and/or SSL
handshaking are tring to connect the DC or some network entity.
For all other guys, some are general cases. Please ask questions in
the forum so that somebody can help you troubleshooting. We need
more detailed info about the failure and its circumstance!!!
Thanks.
Xinwei
Reply

10.

Sarah

August 20, 2008 at 12:33 pm


Ive also found that running a quick trace to catch login failures is
useful. App teams generally dont believe that their app is
configured wrong. They will insist that the server is down even
though all connectivity tests we use work. We will start the trace
and have them try to connect. If you dont see a failure, you can
absolutely point to a problem outside of MSSQL. It sometimes
takes this to get folks to check other possibilities.
Reply

11.

PuckStopper

August 29, 2008 at 4:02 pm


Im having an issue connectiont to SQL server through Access. It
only occurs during testing when we set the PC date forward on the
client machine. Has anyone come accross this? ErrorMsg: 2147467259 Cannot generate SSPI Context
Thanks
Reply

12.

Shai

September 9, 2008 at 3:20 pm


Were seeing an issue in our environment where we have a .NET 1.1
web application on a Windows 2003 server machine and SQL Server
on a Windows 2000 server machine. In the application, we use SQL
logins to connect to the db. What we are seeing is, when we put a
bad password to log in, an error message is generated (login failed)
in the event log which is whats expected, but then we continually
see the same error message repeating for the next few hours as if
the connection is still alive and retrying automatically. Any ideas
why? Thanks
Reply

13.

Nathan

November 19, 2008 at 6:48 pm


I am trying to connect to a MSSQL 2005 server from a Windows NT
box through a system DSN. I know 2005 prefers you use SQL
Native Client to connect, however, all that is on this machine is the
SQL Server driver. How can I make this work?
Reply

14.

dmickel

December 18, 2008 at 4:22 pm


I just installed MSSQL 2008 Server on my laptop XP SP3 for
evaluation purposes. All SQL services start except for the engine. I
get the following message in event viewer.
SQL Trace was stopped due to server shutdown. Trace ID = 1. This
is an informational message only; no user action is required.
When I research this I get lots of different things but none seems to
help my issue.
Thanks in advance for any help.
Reply

15.

SandorVigh

December 19, 2008 at 8:41 am


Please help to find the solution to problem.
We used MSSQL 2000 without any problems with ODBC , and now
we tried to use MSSQL2008. Approximately on every fifth PC we
cannot set the ODBC connection with SQL server, we receive error
logs :
SQL State 1000
SQL Server error 10060
SQL State 08001
SQL server error 17
we tried everything, it seems that on some clients something
missing, but I have no idea what is this.
The clients MSSQL ODBC version : 03.85.1132
with this version on one PC it is working, on the pother isnt.
I tried to turn of the firewall : no effect.

What to do ?
Reply

16.

SQL Server Connectivity

December 19, 2008 at 12:54 pm


SandorVigh,
error 10060 is:
A connection attempt failed because the connected party did not
properly respond after a period of time, or established
connection failed because connected host has failed to respond.
This still looks like a firewall issue if the server name is correct. Did
you tried to follow my steps to troubleshoot? Is your server
machine Vista/Windows Server 2008? Turning off the firewall on
Vista/W2k8 is little tricky as it involves different domains.
I would suggest you post your follow up question on our forum
(mentioned at the end of the blog)
Thanks,
Xinwei
Reply

17.

SQL Server Connectivity

December 19, 2008 at 12:57 pm


dmickel,
Can you post a question on our forum and post the info in SQL
Server Errorlog file?
Thanks.
Reply

18.

SM

March 17, 2009 at 6:58 am


Hi
I am getting an error :
"Message:[Microsoft][ODBC Driver Manager] Data source name not
found and no default driver specified ".
Just to brief about my setup , It goes like this;I have a SQL server
2008 installed on Win 2008 (x64)and I also have a clinet machine
installed with Win 2003(32-bit).
Now I am trying to establish a connectivity between them by using
SNAC tool (v10.0).
Actually I am running one benchmark application script on Client
machine which first tries to establish the database connectivity .
Now I think some one can give me some clue what could be the
reason for the error.I also have created Aliases on both server as
well as Client machine (Was not very sure where they required to
be created).
I have been strugling all alone for quite a time now.Hope someone
can help me to reach at the solution.
Thanks & Regards,
SM.
Reply

19.

Sanjay

April 1, 2009 at 5:35 pm


Hi
I am getting an error :
"[DBNETLIB][ConnectionOpen (Connect()).]SQL Server does not
exist or access denied"

While accessing SQL Server 7.0 from a MS Access 2007 application.


My client m/c OS: Windows XP Service Pack 2. The same access
application is working on other desktop (XP SP2) in the same
network. I have performed the following steps, but no hope.
#1: I found sqloledb.rll file was missing, i placed the above resource
file in appropriate location. No luck.
#2: Tried repairing MDAC from INF folder, no luck.
Any suggestion? Thank you in advance.
Reply

20.

thussain

May 21, 2009 at 7:15 pm


I am getting this error sometime only when connecting to my sql
server 2000 from my client machine using isql
OLE DB provider "SQLNCLI" for linked server "oa-citrix02" returned
message "Login timeout expired".
OLE DB provider "SQLNCLI" for linked server "oa-citrix02" returned
message "An error has occurred while establishing a connection to
the server. When connecting to SQL Server 2005, this failure may
be caused by the fact that under the default settings SQL Server
does not allow remote connections.".
apple
Server: Msg 50000, Level 16, State 1, Line 15
Named Pipes Provider: Could not open a connection to SQL Server
[5].
OrangeNamed Pipes Provider: Could not open a connection to SQL
Server [5].
Reply

21.

akhilpatel2

August 25, 2009 at 11:44 am


Hello,
I seem to be in deep trouble over a linked server setup. I have 2
servers running SQL server 2005 standard x64 SP3. I am trying to
create a linked server from one to another.
I createa link server and map a login called testuser2 (sql login) on
both servers, and has sysadmin permissions. However, after
running sp_addlinkedserver and sp_addlinkedsrvlogin, if I attempt
running a query or run "Test Connection" the query times out or
gives an error " login failed for NT AUTHORITYANYONYMOUS
LOGON..with the client name.
If I check in the server logs (to which I was trying to query ), it gives
me an error
Error: 18456, Severity: 14, State: 11.
I tried pinging and doing an nslookup from client machine and it
succeeds. These are servers on same domain and in the same
location. I have also ensured that both servers have named pipes
enabled on them..
I also sometimes get error 7399. Linked server authentication
failed, even through I can connect remootely through the same
login testuser2 on either server.
Any help would be appreciated.
Regards
Akhil
Reply

22.

SQL Server Connectivity

August 26, 2009 at 1:48 pm


Akhil,
Can you check this blog see if it can solve your problem?
http://blogs.msdn.com/sql_protocols/archive/2006/08/10/694657.as
px

Thanks.
Xinwei
Reply

23.

Larry Kagan

August 27, 2009 at 10:46 am


Hi,
We have some erratic performance with our .net app which uses
connection pooling and has a VERY high throughput to our SQL
Server 2005 database.
We were wondering when is it appropriate to configure an
additional port for SQL Server to listen on.
There are NO error messages in the SQL Server log nor in the client
logs indicating a particular problem, but netstat reports a high
number of TCP failed connections.
TCP Statistics for IPv4
Active Opens

= 690858

Passive Opens

= 140956

Failed Connection Attempts


Reset Connections

= 650737
= 6829

Current Connections

= 24

Segments Received

= 2971348717

Segments Sent
Segments Retransmitted

= 1947969915
= 5448550

Note our SQL Server version string is:


Microsoft SQL Server 2005 9.00.4035.00 (X64) Nov 24 2008
16:17:31 Copyright (c) 1988-2005 Microsoft Corporation
Enterprise Edition (64-bit) on Windows NT 5.2 (Build 3790: Service
Pack 2)
The server is a cluster using ipv4 and listening on 1433.

Thank you,
-Larry
Reply

24.

keik

October 15, 2009 at 12:00 am


Sometimes the port is not 1433
Look in the registry using regedit.exe at
HKEY_LOCAL_MACHINESOFTWAREMicrosoftMicrosoft SQL
ServerSQLEXPRESSMSSQLServerSuperSocketNetLibTcp.
One of the nameValue pairs has name TcpPort and a value, which is
the port that the SQL Server is listening on (mine was set to 1030).
Reply

25.

S. Balakrishnan

November 5, 2009 at 10:54 pm


Hai,
We have 2008 Server & SQL 2008.
Networking load balancing also has been installed.
for 6 ips and virtual ip is 192.168.1.100
Nat policy has been created in sonicall to route the static ip to local
ip.
Now i am trying to conect the odbc it say server does not exist.
What must be the issue
please help me.
Thanks & REgards
S. Balakrishnan

Reply

26.

S. Balakrishnan

November 5, 2009 at 11:03 pm


Hai
We have 2008 Server & SQL 2008
Networking Load Balance has been configured
the virual ip is 192.168.1.100
Nat policy has been created throguh sonicwall to this ip from the
public ip (static Ip).
Now i am strying to connect the odbc. it says server does not exist
Please help me to trouble shoot
Thanks
S. Balakrishnan
edp@rajparkchennai.com
Reply

27.

Aaron Barr

December 9, 2009 at 2:24 pm


Thank You so much Keik. You helped determine the last port I had to
unblock. I am running SQL 2008 on WS 2008. For anyone else
having this issue for me I did this.
On my Windows Server 2008 I did the following:
1.Added an exception for the SQL Browser exe file.
2.Added an exception for the UDP Port 1434.
3.Found out what the listening port was by following Keiks advice
which is

"Look in the registry using regedit.exe at


HKEY_LOCAL_MACHINESOFTWAREMicrosoftMicrosoft SQL
ServerSQLEXPRESSMSSQLServerSuperSocketNetLibTcp.
One of the nameValue pairs has name TcpPort and a value, which is
the port that the SQL Server is listening on (mine was set to 1030)."
Mine was 51070 then added the exception to that tcp in the
windows firewall.
Then boom all access finally granted. Thank you Keik for suggesting
that as it finally became unblocked and now works like a champ. I
have spent litterally 2 days getting this to work and I had figured
that it was a simple firewall issue but was lost on where to find the
information. God Bless you Sir!
Reply

28.

Ashu

December 22, 2009 at 10:13 pm


I installed sql server 2005 (dev)
I have a java program which takes connection from database
connection string is :
"jdbc:sqlserver://localhost:1434;databaseName=abc"
when i ru this iit works fine. I modified the code now it takes
connection and with out closing it tries to take another connection
second time it throws an exception msg saying:: "An I/O error
occurred while receiving the TDS prelogin response."
I thought its because of maximum no of connection but maximum
no of conn is set to 0(ulimited).
please help mee
Reply

29.

Mugunthan Mugundan- MSFT

December 30, 2009 at 1:33 pm


What version of the driver you are using?
Reply

30.

David Olix

January 7, 2010 at 1:00 pm


Hi Ashu,
SQL Server uses port TCP/1434 for Dedicated Administrator
Connections (see http://msdn.microsoft.com/enus/library/ms189595.aspx).
One of the restrictions with Dedicated Administrator Connections is:
"To guarantee that there are resources available for the connection,
only one DAC is allowed per instance of SQL Server. If a DAC
connection is already active, any new request to connect through
the DAC is denied with error 17810."
That is why only the first connetion succeeds.
Regards,
David Olix [SQL Server]
Reply

31.

Ana

February 3, 2010 at 9:27 pm


Currently we have installed Windows operating server 2008 and
SQL server 2008 and now i want to connect server and
workstation,unfortunately im unable to see SQL SERVER native
client 10.1 at in ODBC connectivity.If i select SQL SERVER then its
prompting me "Login user failure :ABCServerGuest" in ODBC
section.

1) do i need to install any package to all workstation/client pc?


2) Can i connect directly using SQL Server setting to connect to
server and database?
Advise needed
Reply

32.

dpblogs

February 3, 2010 at 10:06 pm


Hi Ana,
Sounds like you have 2 machines, one where SQL Server 2008 is
installed and another machine where your application is running.
On the machine where your application is running, did you install
SQL Server Native Client? If not, you can find the latest SQL Server
2008 Native Client
at http://www.microsoft.com/downloads/details.aspx?
familyid=B33D2C78-1059-4CE2-B80D2343C099BCB4&displaylang=en
BTW, the ODBC driver name is "SQL Server Native Client 10.0}".
Regarding your 2nd question, it would really depend on your
application and how it configures the SQL Server setting.
HTH,
Jimmy Wu
Reply

33.

dpblogs

February 3, 2010 at 11:45 pm


Sorry, minor copy/paste error. The ODBC driver name is supposed
to be "{SQL Server Native Client 10.0}", with the {} around the
name and not just } at the end.

Jimmy Wu
Reply

34.

Ana

February 5, 2010 at 6:17 pm


I already installed the SQL Server Native Client 10.1 at client pc and
while im connecting it prompt me error message " Login Failed for
user "SERVERGUEST" WHY?
Urgently help needed.
tks
Reply

35.

dpblogs

February 7, 2010 at 2:55 pm


Looks like you are trying to use Trusted_Connection. Is the
application running on IIS or some other mid-tier application
server?
Using Trusted_Connection will utility the authentication of the
process. So, if the process is configured to run as "SERVERGUEST"
then, thats the user credential SQL Server Native Client will use.
If the application is hosted in IIS, please make sure IIS is configured
to support Windows Authentication http://technet.microsoft.com/enus/library/cc754628(WS.10).aspx
BTW, for these type of troubleshooting questions, I recommend
posting the question on our
forum http://social.msdn.microsoft.com/forums/enUS/sqldataaccess/thread/ where you have the entire community to
help you.
HTH,
Jimmy Wu

Reply

36.

Karthick

March 17, 2010 at 2:09 pm


This link was very useful. Thanks a lot
Reply

37.

nadia

May 10, 2010 at 3:41 am


line 1: Incorrect syntax near -.
please help me out.
I traced it, but I didnt find the character (I didnt write the
character -). I ran my app on different computers, theres no
problem with my app. I reformatted my computer and reinstalled all
the programs, it didnt work. It still had that error
Can someone tell me whats wrong with my application (or
computer)??
Note: Im using VB6 for the interface and SQLServer 2000 for the
database and crystal report for report view. the error occurs when
view reports using crystalr report.
Reply

38.

nadia

May 10, 2010 at 3:47 am


please help me out.

I traced it, but I didnt find the character (I didnt write the
character -). I ran my app on different computers, theres no
problem with my app. I reformatted my computer and reinstalled all
the programs, it didnt work. It still had that error
Can someone tell me whats wrong with my application (or
computer)??
Note: Im using VB6 for the interface and SQLServer 2000 for the
database and crystal report for report view. the error occurs when
view reports using crystalr report.
Reply

39.

Moorthy

October 4, 2010 at 11:06 am


Nice compilation.. This saved me today!
Reply

40.

SQL 2005sp3 on W2008r2

January 24, 2011 at 6:59 pm


I have 2 SQL 2005 instances installed on a 2 node w2008 cluster.
Mgt Studio can connect from XP client, but not from Windows 7
client.
suggestion?
Reply

41.

Saurabh Suri

October 11, 2011 at 11:53 pm

Nice One.

Thanks. Really helped me

Reply

42.

cr.net

October 28, 2011 at 6:23 am


I am facing guest Login error when connecting to remote database
running winxp pofessional sp3 with sqlserver express 2005.
please help me to understand this & resolve this.
hoping earnest reply.
Reply

43.

Jijin

February 12, 2012 at 5:18 am


Intermittent connectivity issues between application servers and
sql cluster , i have 3 application servers are on NLB and 2 database
severs configured on SQL cluster [SQL 2005] . i am facing a
intermittent connectivity issues with one of the application server
(in NLB) to the db cluster . If anybody faced like this scenario before
please let me know the resolution . Your advises is highly
appreciable
Reply

44.

Vijai

July 12, 2012 at 11:01 am

Thanks, was able to fix the Firewall issue!


Reply

45.

Nagaraju Kandagatla

July 28, 2012 at 8:23 am


i am using windows server 2008 r2 64 bit operating system and i've
installed sql server 2008 standard edition 32 bit in that. my
application is working properly in server system . but, while
accessing from client its not working properly. so, i've tested with
.udl at client machine . it's raising an error as [DBNETLIB]
[Connection Open(Connect()).]SQL Server does not exist or access
denied. i was using xp2 in client machine. please give me the
solution so that i can start the work at client side.
Reply

46.

bharati

September 5, 2012 at 9:55 am


i right click on data connection & select create new sql connection
& type my server name & type something my database name &
click on ok then it give error 40
Reply

47.

TonyBromo

November 21, 2012 at 6:36 pm


With all the data moving into the "cloud" I was wondering if
someone could point me to some good resources reguarding
trying/catching specific SQL server events such as trapping:

(TSQL 2008r2 server) "Msg 6005, Level 14, State 2, Line 1


SHUTDOWN is in progress." Plus any ideas for handling basic
connectivity issues programatically.
Right now my focus is on web development using C#
(ASP4.NET/MVC) and MS Access 2010 dev (using VBA 7.0).
Reply

48.

kazma

October 3, 2013 at 9:12 am


I am having problem running the sqlcmd command in my linux box
with an error "Unable to load SQLCMD resource file(s)". After
investigating this I realized that the driver and sqlcmd are looking
for the resource files at a specific path /opt/microsoft/msodbcsql
location. In my environment this is not possible:
1) I am not an admin and can not access to that directory
2) We use enterprise file system so individual machine installation
directory is not allowed.
Is it possible to have the driver look at some other location for
resource files?
Please let me know, since this is stopping me from going forward.
Reply

49.

Larry

February 24, 2014 at 5:59 am


Hi I set up a test and production instance SQL Server 2008 R2
Express.
The test I installed on the default c: drive and works fine. The
production I installed the data on the e: drive and I can't get to it.
However the application works fine from the production server.
Any Ideas?

Reply

50.

Sam

March 28, 2014 at 10:30 pm


I am not able to connect to SQL 2005 DB in windows
authentication,plz help me outi'm gtng an error as follows.
ADDITIONAL INFORMATION:
A network-related or instance-specific error occurred while
establishing a connection to SQL Server. The server was not found
or was not accessible. Verify that the instance name is correct and
that SQL Server is configured to allow remote connections.
(provider: SQL Network Interfaces, error: 25 Connection string is
not valid) (Microsoft SQL Server, Error: 87)
For help, click: ht
Reply

51.

Chris

May 10, 2014 at 4:13 am


Changing name on the server after installing MSSQL-server was my
problem. Uninstalling MSSQL and reinstalling it solved the problem.
12h testing there for you guys.

Reply

52.

Arturo Equihua

August 28, 2014 at 5:37 pm

I have an ASP.NET/IIS 6 based application that runs on a SQL Server


2000 database on Windows 2003. We lost the server and we are
trying to setup the application from scratch in a new machine. The
application fails with error 40 and also error 26 (cannot locate SQL
Server connection). The application and the database are on the
same host. No local firewall is running. The OSQL utility works
correctly. If I install the IIS application in another machine, that
application is actually capable to connect to the database (the
connection error happens locally only).
The connection string I'm testing in the web.config file is this:
<add name="keyconnection" connectionString="Data
Source=10.162.6.199; Initial Catalog=EDM2Pruebas; User ID=xxxx;
Pwd=xxxxx" />
In the connectionString I have tried the server name, the IP
address, the (local) keyword, and all of them fail.
Any ideas of what I might be missing?
Reply

53.

mohamed

October 25, 2014 at 11:15 pm


TITLE: Connect to Server

Cannot connect to MOHAMED-PC.

ADDITIONAL INFORMATION:
A network-related or instance-specific error occurred while
establishing a connection to SQL Server. The server was not found
or was not accessible. Verify that the instance name is correct and
that SQL Server is configured to allow remote connections.
(provider: TCP Provider, error: 0 No connection could be made
because the target machine actively refused it.) (Microsoft SQL
Server, Error: 10061)
For help, click: go.microsoft.com/fwlink

B
Reply

54.

Shabbir Bytelink

November 30, 2014 at 9:13 pm


Hi, I need urgent help here.
Scenario:
1. Windows 7,
2. SQL Server 2000 setup successfully installed with Sql Server
Authentication.
3. Created two users for Sql authentication. Given permission to my
tables for both
4. I want to run my application using vb6 on two clients machines
A, B.
5. Test connection is OK on both clients A and B
6. Problem is simple, when i login from my A client system, it very
easily login to my application main menu when i enter login name
and passsword.
7. But when i try to login from B client system, then after getting
username and password, it does not show application Main menu
hang on and time out expire msg listed later.
8. and when log out from my first A system, and then try to login
from B, then it easily go through and show App main menu and vice
versa????
Plz help me soonnnnnnnnnnnnwaiting thanks
Reply

55.

Koti

December 11, 2014 at 3:15 am

Hi I am using mixed mode authentication still we are getting Error:


18456, Severity: 14, State: 58.
Please help on this
Reply

56.

Koti

December 11, 2014 at 3:19 am


Hi
We are getting Error: 18456, Severity: 14, State: 58. Mysql server is
2008r2 and it is configured with mixed mode.
Still users are not able to connect sql server, ould you please help
on this
Reply

57.

Simon

December 16, 2014 at 5:44 am


Thanks for the article. I was trying hard to follow the instruction on
other tutorials. Your's is the only one mentioning the necessity of
SQL Server Browser running.
Saved me further headaches.

Reply

58.

Dave

February 13, 2015 at 1:02 am

SQL Server was not accessible from the requesting machine. how
we make the 2 machine communicate
Reply

59.

Avi

March 25, 2015 at 9:52 am


Error: Error locating server/instance specified
It works for some users and don't for few.
1. When the exe is copied to local drive (C: or O:) and launched
from local drive, exe is able to connect to MS SQL database and the
process works fine.
2. When the network path of exe location is mapped to a drive
locally (say P ) and exe is launched from P: that doesnt work (fails
connecting to MS SQL database).
3. When the exe is launched from network path it never worked.
Exe is in .net , Connectstring uses SQL auth.
Reply
Skip to main content
Follow Us
Popular Tags
SQL Server SQL Server Cluster SQL Server 2005 connectivity Connection
String SQL Browser Firewall Login Vista Longhorn PowerShell Windows Server
2008 R2 setup hang SQLConnection Windows
7 10055 socket Winsock WSAENOBUFS
Archives

October 2011 (1)


August 2011 (1)
October 2010 (2)
August 2010 (1)
April 2010 (1)
January 2010 (1)

October 2009 (2)


September 2009 (1)
March 2009 (1)
November 2008 (1)
September 2008 (1)
August 2008 (1)
All of 2011 (2)
All of 2010 (5)
All of 2009 (4)
All of 2008 (12)
All of 2007 (12)
All of 2006 (19)
All of 2005 (32)
Privacy & Cookies Terms of Use Trademarks
2016 Microsoft

Search the TechTarget Network

LOGIN

SearchOracle

T OPIC Backup and recovery

SE C TI ON Get Started

Solving common Oracle error codes guide

by SearchOracle.com experts
Solve your Oracle errors quickly and easily with
help from this fast guide. It covers every expert
response pertaining to Oracle errors on
SearchOracle.com.
Sections

ORA-00000 - ORA-01999

ORA-02000 - ORA-03999

ORA-04000 - ORA-05999

ORA-06000 - ORA-07999

ORA-08000 - ORA-11999

ORA-12000 - ORA-13999

ORA-14000 - ORA-23999

ORA-24000 - ORA-25999

ORA-26000 - ORA-27999

ORA-28000 - ORA-30100

Other error messages

General information about working with errors

Next Steps

Dig Deeper
Related Content

"ORA-12541 TNS : no Listener" error on Oracle 9i ... SearchOracle

Errors with select query on dblink SearchOracle

TNS errors: ORA-12514 and ORA-12502 SearchOracle

Sponsored News

How DBAs Can Drive Oracle Performance With All-Flash Storage


Pure Storage

A Quick Guide for DBAs: Oracle, the Cloud and All-Flash Storage
Pure Storage

See More
Vendor Resources

Oracle Data Guard with Oracle Database 11g Release 2 Oracle


Corporation
Take Advantage of Oracle's 2 Day DBA Course Oracle Corporation
Stumped by an Oracle error? Find the answers quickly and easily in the guide
below. If the error you're dealing...
Sign in for existing members
Continue Reading This Article
Enjoy this article as well as all of our content, including E-Guides, news, tips
and more.

Continue Reading

By submitting your personal information, you agree that TechTarget and


its partners may contact you regarding relevant content, products and
special offers.
You also agree that your personal information may be transferred and
processed in the United States, and that you have read and agree to
the Terms of Use and the Privacy Policy.

with is not listed, just ask one of our experts for help and we'll add the
response to this ever-growing guide to common Oracle error codes.
ORA-00000 - ORA-01999
ORA-00054: resource busy and acquire with NOWAIT specified
Solutions:

How long does a rollback take?

ORA-00054 error with shell scripts

Identifying locks to resolve ORA-01658 and ORA-00054 errors

Error trying to rebuild index after cancelled transaction

Is there a way to stop a rollback?

ORA-00060: deadlock detected while waiting for resource


Solutions:

Deadlock error when a specific batch process runs in parallel

ORA-00200: controlfile could not be created


Solutions:

Avoiding Oracle errors

ORA-00235: controlfile fixed table inconsistent due to concurrent update


Solutions:

Using the RMAN level 0 hot backup process

ORA-00312: online log string thread string: 'string'


Solutions:

Receiving ORA-313 and ORA-312 errors when trying to open


database

Errors causing Oracle instance to shut down

ORA-00313: open failed for members of log group string of thread string
Solutions:

Receiving ORA-313 and ORA-312 errors when trying to open


database

ORA-00320: can not read file header from log 1 thread 1


Solutions:

Getting Oracle errors -- database and Web site are down

ORA-00321: ORACLE_HOME Redo1.log


Solutions:

Errors causing Oracle instance to shut down

Getting Oracle errors -- database and website are down

ORA-00381: cannot use both new and old parameters for buffer cache size
specification
Solutions:

Why am I getting the ORA-00381 error when initializing the


parameter?

ORA-00396: error string required fallback to single-pass recovery


Solutions:

ORA-00396 and ORA-00397 while loading data

ORA-00397: lost write detected for file string, block string


Solutions:

ORA-00396 and ORA-00397 while loading data

ORA-00406: COMPATIBLE parameter needs to be string or greater


Solutions:

ORA-00406 when trying to create a function index

ORA-00439: feature not enabled: string


Solutions:

Creating a table partition

Managed standby error in ARCHIVE MODE

Problems with installation of Partitioning

ORA-00510: internal limit restriction exceeded


Solutions:

Is the number of processes causing listener error?

ORA-00600: internal error


Solutions:

"Disconnection forced" message

System timing out writing to control file

Error when updating table in Oracle 8i

ORA-00604: error occurred at recursive SQL level string


Solutions:

Unexplained daily errors

ORA-00604 error on SQL level 2 generated on table update

Recursive SQL error when using Web app

Errors executing Oracle recursive query

Getting ORA-00604 error when connecting to database user

Table update fails at recursive SQL level 2

ORA-00604: error with recursive SQL

ORA-00903: invalid table name


Solutions:

Trigger error in SQL*Plus

ORA-00904: invalid column name


Solutions:

SQL execution error ORA-00904

"Invalid column name" error

Error on "select timestamp" command

Error accessing all SQL Server fields in Oracle environment

Getting invalid column name without access to system tables

Error viewing records in table that has abstract column datatype

ORA-00922: missing or invalid option


Solutions:

Substitution variables

ORA-00932: inconsistent datatypes


Solutions:

How to get the lengths of values in "long" datatype

Unexplained daily errors

Help creating a script from a view

UNION of two Oracle8i views with CLOBs

ORA-00942: table or view does not exist


Solutions:

Unable to select or drop a table

Errors with export command

Export errors on Solaris

Export errors on Linux

Oracle9i R1 allows any user to access any table

ORA-00955: name is already used by exsisting object


Solutions:

Installing the recovery catalog from RMAN prompt

ORA-00959: tablespace 'string' does not exist


Solutions:

Importing a table that contains LOB segments

ORA-00980: synonym translation is no longer valid


Solutions:

Information on ORA-00980

ORA-01000: Maximum open cursors exceeded


Solutions:

ORA-01000 errors on Windows XP

Errors executing Oracle recursive query

ORA-01002: fetch out of sequence


Solutions:

ORA-01002 error when trying to describe a table

Resolving the ORA-01002 error #1

Resolving the ORA-01002 error #2

ORA-01017: Invalid username/password


Solutions:

Error when trying to restore a specific table

"Invalid username/password" error

ORA-01017 error when connecting through Windows XP client

Unable to log in to database from desktop

ORA-01031: insufficient privileges


Solutions:

Trouble inserting large CLOB

Password file generation

Creating a function-based index

"Insufficient privileges" error

Logging in to a test database

ORA-01031: insufficient privileges trying to restore a database

ORA-01033: ORACLE initialization or shutdown in progress


Solutions:

Database stopped, showing multiple error messages

Getting ORA-01033 when logging in to 9i application

Restoring default database in 8i

Encountering error while cloning a production database

Initialization or shutdown in progress

ORA-01033 error when taking backup

ORA-01034: ORACLE not available


Solutions:

After starting SQL*Plus after 9i install

On Linux Fedora Core 2

When rebooting 9i

Errors during reboot

Error accessing database after migration to 9.2.0.3

Errors connecting Oracle through SQL*Plus

Domain name changes causing error

Trouble getting two database instances running

Error when starting Oracle

Resolving the ORA-01034 error

Oracle not available after installing 8i on WinXP Pro

ORA-01034 after upgrading to version 9.2

ORA-01034: Oracle not available error

Resolving the "ORA-01034: ORACLE not available" error

"Oracle not available" error

Can't log in to database from SQL*Plus

Error with tnsping

ORA-01034 and ORA-27101 on trying to log in to database

Receiving "Oracle is not available" error after restart

Receiving ORA-01034 error while connecting

Suddenly getting ORA-01034 and ORA-27101

Unable to connect to server with Oracle8i

Why won't the mount and open happen automatically?

ORA-01039: insufficient privilege on underlying objects of the view


Solutions:

Insufficient privileges error ORA-01039

ORA-01053: user storage address cannot be read


Solutions:

ORA-1053 error after 8i installation on Windows 2003

ORA-01078: failure in processing system parameters


Solutions:

Help with error ORA-01078

ORA-01081: cannot start already-running ORACLE - shut it down first


Solutions:

Problems starting one of two databases on same server

ORA-01089: immediate shutdown in progress - no operations are permitted


Solutions:

When opening database

Cause of ORA-1089 error

Error when stopping/starting Oracle SID

ORA-01092: Oracle instance terminated. Disconnection forced


Solutions:

Database Configuration Assistant not executing

Oracle installed, but error when creating db

ORA-01092 error during 9i installation

ORA-01092 error while executing database creation command

ORA-01092 on creating a new database

ORA-01110: data file string: 'string'


Solutions:

Database stopped, showing multiple error messages

Input/output errors

ORA-01110 error when not in archive log mode

ORA-01113 and ORA-01110 errors on restarting database

Too many open files error message

ORA-01113: file n needs media recovery


Solutions:

ORA-01113 and ORA-01110 errors on restarting database

ORA-01115: IO error reading block from file string (block # string)


Solutions:

Database stopped, showing multiple error messages

User datafile needs media recovery

Input/output errors

Too many open files error message

ORA-01122: database file string failed verification check


Solutions:

Database crash during hot backup

ORA-1122 error and huge TEMP tablespace

ORA-01157: cannot identify/lock data file string - see DBWR trace file
Solutions:

ORA-01033 error when taking backup

ORA-01158: database %s already mounted


Solutions:

Cloning a production database into a development server

ORA-01403: no data found


Solutions:

Errors during import of a dump file

ORA-01452: cannot CREATE UNIQUE INDEX; duplicate keys found


Solutions:

ORA-1452 error after export/import

ORA-01501: CREATE DATABASE failed


Solutions:

Avoiding Oracle errors

ORA-01503: CREATE CONTROLFILE failed


Solutions:

Cloning a production database into a development server

ORA-01535: rollback segment 'name' already exists


Solutions:

Errors when importing from same version

ORA-01543: tablespace 'TEMP' already exists


Solutions:

Errors when importing from same version

ORA-01555: snapshot too old: rollback segment number string with name
"string" too small
Solutions:

Solving an ORA-1555 error in the testing database

Help with ORA-01555: snapshot too old

Help with ORA-01555 during export

Exporting a table that is constantly updated

RBS monitor to catch ORA-01555 errors

Can't escape ORA-01555 error!

Cause of "snapshot too old" error

Errors and slowness during export

ORA-01593: rollback segment optimal size (string blks) is smaller than the
computed initial size (string blks)
Solutions:

Errors and slowness during export

ORA-01594: attempt to wrap into rollback segment (string) extent (string)


which is being freed
Solutions:

Errors and slowness during export

ORA-01630: max # extents (string) reached in temp segment in tablespace


string
Solutions:

Resolving the ORA-01630 error

ORA-01650: unable to extend rollback segment string by string in


tablespace string
Solutions:

Errors and slowness during export

ORA-01652: unable to extend temp segment by string in tablespace string


Solutions:

Advice from the TechTarget community on the ORA-01652 error code

Help with ORA-01652 error -- unable to extend temp segment

Solving ORA-1652 error

High IO program is throwing ORA-01652 errors

ORA-01652: add or resize datafile?

Resolving errors ORA-01652 and ORA-04031

Errors during building of tables

ORA-01652 error when running query to delete large amount of data

Questions about ORA-1652 error

ORA-01653: unable to extend table xxx by xxx


Solutions:

Action can't be handled

ORA-01658: unable to create INITIAL extent for segment in tablespace


string
Solutions:

Identifying locks to resolve ORA-01658 and ORA-00054 errors

ORA-01756: quoted string not properly terminated


Solutions:

Error inserting data into customer table

Error inserting single quote into string

ORA-01758: table must be empty to add mandatory (NOT NULL) column


Solutions:

Adding a new NOT NULL field to an existing table

ORA-01940: cannot drop a user that is currently connected


Solutions:

Deleting a user from a tablespace

More resources from Oracle.com


Detailed error documentation
Search for an error
ORA-02000 - ORA-03999

ORA-02019: connection description for remote database not found


Solutions:

Why am I getting the ORA-02019 error?

ORA-02035: illegal bundled operation combination


Solutions:

When does 02035 error occur?

ORA-02085: database link string connects to string


Solutions:

Problem with dblink: ORA-02085

Setting GLOBAL_NAMES to false to use dblink

Error after creating DBLink

ORA-02201: sequence not allowed here


Solutions:

Can triggers be applied to sequence objects

ORA-02266: unique/primary keys in table referenced by enabled foreign


keys
Solutions:

Truncate tables using PL/SQL

ORA-02449: unique/primary keys in table referenced by foreign keys


Solutions:

Error when dropping objects

Find all the 'son' constraints

ORA-03001: unimplemented feature


Solutions:

Solving ORA-03001

ORA-03113: end-of-file on communication channel


Solutions:

Whenever the client is idle for five minutes

When trying to start up

ORA-03113 when running a query

Error when creating a queue table

Problem installing Oracle on Red Hat Linux

Failure installing 9i Database Configuration Assistant Tool on


Win2000

Getting end of communication error when submitting a query

Solving error ORA-03113

Archive log files generating quickly

ORA-03113 error when querying table

ORA-03113 trying to rebuild indexes

What is the ORA-03113 error?

ORA-03114: not connected to ORACLE


Solutions:

ORA-03114 causing instability to application services

During the initializing database step

Resolving the ORA-03114 error

ORA-03121: no interface driver connected


Solutions:

ORA-03121 while attaching database

What is the solution of the ORA-03121 error?

ORA-03232: unable to allocate an extent of x blocks from tablespace x


Solutions:

ORA-03232 error

ORA-04000 - ORA-05999
ORA-04030: out of process memory
Solutions:

Help with ORA-04030 -- out of process memory

RMAN process ran out of memory

ORA-04030: Out of process memory

ORA-04031: unable to allocate string bytes of shared memory


("string","string","string","string")
Solutions:

In the job queue process

Recursive SQL error when using Web app

Consistently getting ORA-04031 error

Error during patch installation

Need fixes for ORA-04031

Help with ORA-4031 error

Resolving errors ORA-01652 and ORA-04031

Error when trying to reduce temp tablespace

Resolving a 04031 error

Resolving the ORA-04031 error

Minimizing generation of archive logs

ORA-04043: object string does not exist


Solutions:

Workaround for ORA-04043: Can't describe object using db_link

ORA-04052: error occurred when looking up remote object name


Solutions:

Error creating database link

ORA-04076: invalid NEW or OLD specification


Solutions:

How to solve ORA-04076 error?

ORA-04091: table string.string is mutating, trigger/function may not see it


Solutions:

Selecting rows from the same table in the trigger

Resolving ORA-04091

Workaround for the ORA-04091 error when checking ranges

Resolving an ORA-04091 error

Timestamping all rows of some tables on insert and update

Writing an ON INSERT trigger without encountering mutating table


error

ORA-04098: trigger 'SYSTEM.LOG_ERRORS_TRIG' is invalid and failed revalidation


Solutions:

Trigger error in SQL*Plu

ORA-06000 - ORA-07999
ORA-06401: NETCMN: invalid driver designator
Solutions:

When trying to connect from Dreamweaver

When using SQL*Plus on host computer

Password creation in Oracle Developer 6i

Error using JDBC to query local database

Error trying to insert record through database link

Resovling the ORA-06401 error

ORA-06508: PL/SQL: could not find program unit being called


Solutions:

Resolving the ORA-06508 error

ORA-06512: Backtrace message as the stack is unwound by unhandled


exceptions
Solutions:

What is ORA-06512?

Errors during import of a dump file

Problems with exp utility after migration

ORA-06532: Subscript outside of limit


Solutions:

New user error

Determining the reason for the error message

ORA-06544: PL/SQL: internal error, arguments: [string], [string], [string],


[string], [string], [string], [string], [string]
Solutions:

How to resolve ORA-06544

ORA-06550: line string, column string:string


Solutions:

Error when calling stored procedure

Help with ORA-06550 error

Resolving error ORA-06550

Cause of ORA-06550 error

Error during export of database

Error when executing procedures

Receiving error at export command

Receiving ORA-06550 error

Ways to handle an error on an INSERT statement

ORA-06553: PLS-string: string


Solutions:

Error calling stored procedure from Java

Removing Services entries, fixing ORA-06553

Problems with exporting database after modifying database


characterset

ORA-06554: package DBMS_STANDARD must be created before using


PL/SQL
Solutions:

Help with ORA-06554 regarding package DBMS_STANDARD

ORA-07445: exception encountered: core dump [10]


Solutions:

SQL subquery errors

ORA-08000 - ORA-11999
ORA-10033: sort run information (SRD*/SRS*)
Solutions:

ORA-10033 error won't let me connect

ORA-10902: disable seghdr conversion for ro operation


Solutions:

Cause of ORA-10902 error

ORA-12000 - ORA-13999
ORA-12154: TNS-12154: TNS:could not resolve service name
Solutions:

No connection to run Forms

Copying tables from one DB to another via database link

Configuring the TNSNAMES.ORA file

Connecting to 10g database after rebooting server

ORA-12203: TNS-12203: TNS:unable to connect to destination


Solutions:

On home computer

After installing 7.3

Unable to install Developer 2000

Unable to connect to destination

Resolving the PDE-POCO11 ORA-12203 error

Problem connecting to a remote database

Database crash during hot backup

Problems connecting to database after installing Forms

ORA-12502: TNS-12502: TNS:listener received no CONNECT_DATA from


client
Solutions:

Resolving the TNS-12502 error

ORA-12505: TNS-12505: TNS:listener could not resolve SID given in connect


descriptor
Solutions:

Resolving the ORA-12505 TNS error

ORA-12514: TNS-12514: TNS:listener could not resolve SERVICE_NAME


given in connect descriptor
Solutions:

When trying to create db link

Error connecting through SQL*Plus

Resolving the ORA-12514 TNS listener error

Resolving the ORA-12514

Accessing an Oracle instance with SQL*Plus

ORA-12514 error when connecting through SQL*Plus

Problems accessing 10g through SQL*Plus and Enterprise Manager

Problems connecting after installation of 10g

ORA-12528: TNS:listener: all appropriate instances are blocking new


connections
Solutions:

ORA-12528 after shutting down and restarting instance

ORA-12531: TNS-12531: TNS:cannot allocate memory


Solutions:

No new connections allowed

ORA-12533: TNS-12533: TNS:illegal ADDRESS parameters


Solutions:

ORA-12533 during installation

ORA-12535: TNS-12535: TNS:operation timed out


Solutions:

Timed out error and slow computer performance

Error since converting to 9.2

Getting ORA-12535 since upgrade

"TNS: Operation timed out" error

Error in ODBC connections

TNS-12535 error connecting to remote machine

ORA-12537: TNS connection closed


Solutions:

"TNS:connection closed" error

ORA-12537 error when trying to connect

ORA-12541: TNS: no listener


Solutions:

Causes

Connecting to database through forms builder

No listener error when logging in to Oracle8

No listener error after install on XP

Receiving ORA-12541 error trying to connect through Forms/Reports

ORA-12542: TNS: address already in use


Solutions:

Error affecting nightly batch jobs

ORA-12545: TNS-12545: Connect failed because target host or object does


not exist
Solutions:

Error accessing 9i on Linux

Error in Oracle connection

Resolving error ORA-12545

Resolving error ORA-12545

Error message ORA-12545 during remote connect

ORA-12545 error trying to open forms in Oracle 8i on Windows 2000

ORA-12545 error when connecting to database via client

ORA-12546: TNS: permission denied


Solutions:

DBA cannot connect to database

Help with listener error

ORA-12560: TNS-12560: TNS:protocol adapter error


Solutions:

When connecting to Oracle 9.0.2 on Win2K

When logging in to svrmgr after install

When connecting over dial-up

When installing 8.1.7 on Windows 2000

When creating new database

When running exp

Trouble connecting to listener after install

Error running a form in a browser

Connection problem with Forms/Reports

Resolving ORA-12560 error

Uninstalling Oracle9i

"TNS:Could not resolve Service name" error

Oracle 9i login error

Receiving "TNSListener protocol adapter error" during installation

Unable to connect to 9i on Windows 98

Unable to log in after installing Oracle Client 9i

ORA-12571: TNS-12571: TNS:packet writer failure


Solutions:

Resolving the "ORA-12571: TNS:Packet writer failure" error

ORA-12571 error with Oracle 8i on Windows XP

ORA-12638: Credential retrieval failed


Solutions:

Another Oracle server from a different LAN

"TNS: Operation timed out" error

ORA-12638 and ORA-01031 on Windows cluster

Problems with Oracle applications after upgrading to XP

ORA-12640: TNS-12640: Authentication adapter initialization failed


Solutions:

Backup batch jobs not running

Error creating database link

Database link works for a few days, then ORA-12640

ORA-12663: TNS-12663: Services required by client not available on the


server
Solutions:

Error using DESC across dblink

ORA-12801: error signaled in parallel query server string


Solutions:

Errors during building of tables

ORA-14000 - ORA-23999
ORA-1650: unable to extend rollback segment R05 by 512 in tablespace
RBS Failure to extend rollback segment 6 because of 1650 condition.
Solutions:

Solving the ORA-1650 error message

ORA-24000 - ORA-25999
ORA-24008: queue table string.string must be dropped first
Solutions:

How to drop the example schemas from Oracle9i

ORA-24801: illegal parameter value in OCI lob function


Solutions:

Export/import on table with clob datatype column

ORA-25143: default storage clause is not compatible with allocation policy


Solutions:

Error inserting new record in table

ORA-25150: ALTERING of extent parameters not permitted


Solutions:

Error inserting new record in table

ORA-26000 - ORA-27999
ORA-27038: skgfrcre: file exists
Solutions:

Avoiding ORA-27038 when creating a tablespace in 8i

Avoiding Oracle errors

ORA-27041: unable to open file


Solutions:

Errors causing Oracle instance to shut down

Too many open files error message

ORA-27072: skgfdisp: I/O error


Solutions:

Database stopped, showing multiple error messages

Input/output errors

ORA-27091: skgfqio: unable to queue I/O


Solutions:

Getting Oracle errors -- database and Web site are down

Errors causing Oracle instance to shut down

Input/output errors

ORA-27101: shared memory realm does not exist


Solutions:

When trying to connect to the database

Errors during reboot

Unable to login after installation

Trouble getting two database instances running

Error when starting Oracle

"Oracle not available" error

Can't log in to database from SQL*Plus

ORA-01034 and ORA-27101 on trying to log in to database

ORA-27101 error after moving DB to new domain

Suddenly getting ORA-01034 and ORA-27101

Why won't the mount and open happen automatically?

ORA-27123: unable to attach to shared memory segment


Solutions:

Error accessing database after migration to 9.2.0.3

Error after upgrading to 9i Data Server patch set

ORA-27123 while trying to create database after Red Hat Linux


installation

ORA-27125: unable to create shared memory segment


Solutions:

When creating Oracle database on Fedora Core 2

ORA-28000 - ORA-30100
ORA-28030: Server encountered problems accessing LDAP directory service
Solutions:

Using dblink to access a different server

ORA-28547: connection to server failed, probable Net8 admin error


Solutions:

ORA-28547 trying to set up practice database

ORA-29516: Aurora assertion failure: string


Solutions:

Hit an error

"Aurora assertion failure" error

ORA-30036: unable to extend segment by string in undo tablespace 'string'


Solutions:

Error loading data into target

ORA-30036 error when executing update query

Other error messages


SQL*Plus error messages
SP2-0678: Column or attribute type can not be displayed by SQL*Plus
Solutions:

What is error SP2-0678?

Import error messages


IMP-00009: abnormal end of export file Solutions:

Dump file error

Error during import from 9i to 10g

Errors during import of dump file

IMP-00010: not a valid export file, header failed verification


Solutions:

Create tablespace to resolve IMP-00010 error?

IMP-00015: following statement failed because the object already exists


Solutions:

Which IMP messages are warnings and which are errors?

IMP-00022: failed to process parameters, type 'IMP HELP=Y' for help


Solutions:

Which IMP messages are warnings and which are errors?

IMP-00028: partial import of previous table rolled back


Solutions:

Dump file error

Error during import from 9i to 10g

Errors during import of dump file

Export error messages


EXP-00002: error in writing to export file
Solutions:

Errors with character set in export

ORADIM command syntax errors


DIM-00019: Create Service Error
Solutions:

"Create service" error when starting DBCA

General information about working with errors

Where to get a complete list of all ORA errors

What should monitoring reports identify

Catching error code that arises in PL/SQL

Capturing errors from merge statement

Logging the command that caused server error

Perform a check or wait for an error?

Oracle alert log miner

Advanced error checking using a trigger

Next Steps
Avoid errors when copying Oracle Database 9i to a new server
Find out why this error kept TNS listener from connecting
Learn to use Oracle Data Recovery Advisory for database backup and
recovery
Get more information on Oracle Business Accelerators and how they can
speed up ERP deployment
Learn three tips for using Oracle insert syntax

This was last published in April 2008


Dig Deeper on Oracle database backup and recovery

Load

ALL
NEWS

E VALU ATE
M AN AGE

PRO BLEM SOLVE

For Oracle disaster recovery, check your physical standby databases


Using Oracle Data Recovery Advisory for database backup and recovery
How to tune Oracle instance recovery
Perfect the Oracle RMAN duplicate 10g command
More

Join the conversation


1 comment
Send me notifications when other members comment.Add My Comment

Oldest
[-]

SearchOracle.com experts - 14 Apr 2008 8:00 PM


What Oracle error code have you faced most frequently?
Reply

Latest TechTarget resources

DATA MANAGEMENT

BUSINESS ANALYTICS

SAP

SQL SERVER

JAVA

DATA CENTER

CONTENT MANAGEMENT

FINANCIAL APPLICATIONS

SearchDataManagement
Embedded analytics to feel widest impact of machine learning projects

Ovum analyst Tony Baer discusses machine learning tools, IoT-driven


streaming analytics and Hadoop in the cloud, all of which ...

Amazon Web Services history set the stage for cloud data grab

Seeing the future is hard, as a look into Amazon Web Services history
can show. Now, though, it's clear that the cloud leader ...

Cross-platform integration, data preparation process grows in cloud

While cloud computing may be convenient and more cost-effective for


users, it can also lead to new challenges and requirements in...

About Us

Contact Us

Privacy Policy

Advertisers

Business Partners

Media Kit

Corporate Site

Contributors

Reprints

Archive

Site Map

Answers

E-Products

Events

Features

Guides

Opinions

Photo Stories

Quizzes

Tips

Tutorials

Videos

All Rights Reserved, Copyright 2003 - 2016, TechTarget

Potrebbero piacerti anche