Oracle 10g deal with common problems

1.Oracle common error code analysis and solution
2.ORACLE monitor error (ora-12514) to solve
3.oracle listener can not start, "Error 1067: The process terminated unexpectedly"
4.Oracle not the Available Shared Memory realm does not exist solution
5. in the oracle database, how to increase the size of table space, there are two ways to increase the size of table space
6. lookup table space and table space usage
7.Oracle how to solve ORA-04031 error
8.ORA- 01034 error solutions
9. the library cache hit rate
whether 10. test oracle database installation is successful
****************************** ************************************************** **********
-------------- ------------- ************* -
analysis and Solution *********** 1.Oracle common error codes

In the process of using ORACLE too, we will often encounter a number of ORACLE errors generated, for starters, these errors may be a bit fuzzy,
and may sometimes do not know how to deal with these errors generated, they appear more frequently on the use of error code 11 to make points:

ORA-01650:unable to extend rollback segment NAME by NUM intablespace NAME

Cause: The above error ORACLE rollback table space is insufficient cause, which is the most common ORACLE ORACLE data administrator error message.
When the user is doing a very large data manipulation led to the existing shortage of rollback, the rollback segments can be assigned table space with a full and
can no longer be distributed, the above error occurs.

Solution: Use "ALTER TABLESPACE tablespace_name ADD DATAFILE filename SIZE size_of_file" command to increase the space of the specified data table,
can add one or more tablespaces according to the specific circumstances. Of course, this also with your bare disk device on the host about,
if you host a bare disk device has no extra use of space, I suggest you do not lightly increase the size of the rollback table space,
use the following statement to query about how much remaining space tablespace:

Select user_name,sql_text from V$open_cursor where user_name=’’;

If more extra space, you can be appropriately added to a large rollback table space, to avoid the errors mentioned above.
You can also use the following statement to detect what the competition rollback segment:

Select class,count from V$waitstat where calss in(‘system undo header’,’system undo block’,’undo header’,’undo block’);和

Select sum(value) from V$sysstat where name in (‘db_block_gets’,’consistents gets’);

If any one class in count / sum (value) greater than 1%, you should consider increasing the rollback segment.

Corresponding English as follows:

Cause:Failed to allocate extent from the rollback segment in tablespace

Action:Use the ALTER TABLESPACE ADD DATAFILE statement to add one or more files to the specified tablespace.

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

Cause: ORACLE temporary segment table space is insufficient, because the ORACLE always try to allocate contiguous space, one can be allocated but not enough space or there will be discontinuous distribution of the above phenomenon.

Solution: We know that ORACLE table space as a logical structure - unit, while the physical structure of the table space is the data files, data files physically created on disk,
all the objects in the table space also exists on the disk, in order to table space increased space, we must increase the data file.
First check the specified table space available space, use the View SYS.DBA_FREE_SPACE, view each record represents the size of available space debris:

SQL>Select file_id,block_id,blocks,bytes from sys.dba_free_space where tablespace_name=’’;

The information returned may be initially determined the largest block of available space, look at whether it is smaller than the size mentioned in the error message, then check the default table space parameters:

SQL>SELECT INITIAL_EXTENT,NEXT_EXTENT,MIN_EXTENTS,PCT_INCREASE FROM SYS.DBA_TABLESPACES WHERE TABLESPACE_NAME=name;

Modify the temporary segment table space by the following SQL command to the default storage values:

SQL>ALTER TABLESPACE name DEFAULT STORAGE (INITIAL XXX NEXT YYY);

-------------------- ****************** ------------ -----------
2.Oracle monitor error (ora-12514) solution
C: \ Documents and Settings \ Administrator> sqlplus SYS / System @dbs AS sysdba


SQL> shutdown immediate;

Database closed.
Database has been uninstalled.
ORACLE instance shut down.

ERROR:

ORA-12514: TNS: listener does not recognize the current service connection descriptor requested
solve ORA-12514: TNS: listener can not currently service connection descriptor requested to identify
cause of the error analysis:
--------
    inspection monitoring, found that listening is not set to the service name (Oracle10g default does not automatically set after the installation monitor).

    When your database server tnsnames.ora file SERVICE_NAME not you want to connect to the listener registered, this error message appears. If your client configuration has not changed, then the database server configuration must be changed, otherwise you used to SERVICE_NAME connection will never be registered with the listener.

    Registered with the listener's SERVICE_NAME service_names is determined by the parameters of the database instance. Server document View Reference Guide to find detailed information on when this parameter is not set, its default value is how to set. You can set it by explicitly to prevent it from being affected by changes in the other parameters.

   You have probably encountered a timing problem. If the listener is restarted, the database instance must re-register with it. Typically, this problem occurs every 60 seconds. If you can not wait, then log in as the database administrator to the database server, and run the "Change the system registry," so that you can force it to register with the listener immediately.
-----------------------------------------
solution:
------
1. open the file "<OracleHome> /network/admin/listener.ora", you will see the following contents:
    SID_LIST_LISTENER =
    (SID_LIST =
      (SID_DESC =
        (SID_NAME = PLSExtProc)
        (ORACLE_HOME = D: \ the Oracle \ Product \ 10.2 .0 \ db_1)
        (= the extproc the PROGRAM)
      )
    )
   2. Add the following statements to the above statement.
        (SID_DESC =
        (= the GLOBAL_DBNAME the ORACLE)
        (ORACLE_HOME = D: \ Oracle \ Product \ 10.2.0 \ db_1)  
        (= SID_NAME the ORACLE)
       )
   3. The contents of the file becomes as follows:
     SID_LIST_LISTENER =
    (SID_LIST =
      (SID_DESC =
        (SID_NAME = PLSExtProc)
        (ORACLE_HOME = D: \ Oracle \ Product \ 10.2.0 \ db_1)
        (= the extproc the PROGRAM)
      )
      (SID_DESC =
        (GLOBAL_DBNAME = ORACLE)
        (ORACLE_HOME = D: \ the Oracle \ Product \ 10.2.0 \ db_1)  
        (SID_NAME = ORACLE)
       )
    )
   4. save the file, and then restart the listener service TNSListener on it!


Problem solving
----------------------
active with passive relationship
1. The listener is to automatically load the service
because of added
    (SID_DESC =
      (SID_NAME = orcl)
      (ORACLE_HOME /data/cache1/oracleDB/oracle/product/10.2.0/db_2 =)
    )
after, when using the listener lsnrctl start listener service will be registered to the process monitor (pmon) in
2.listener passive load the service
if there is no the content, the registration process is served by pmon instance in the listener in terms of listener is passive.
This is why after the first start listening start, on the contrary reason can not work properly connected to the database.


Well, the next step is to reload the listener under
C: \ Documents and Settings \ Administrator > lsnrctl reload

The command completed successfully

Let's show a listening state:
C: \ Documents and Settings \ Administrator> lsnrctl Status

SQL> shutdown immediate

Database closed.
Database has been uninstalled.
ORACLE instance shut down.
C: \ Documents and Settings \ Administrator > sqlplussys / sys @ colinas sysdba


------------- ***************** -------------------- ---
3.Oracle listener can not start, "error 1067: the process terminated unexpectedly"
    encountered a problem today: oracle in OracleOraHome90TNSListener service will not start now, and
before can start, after start now is a mistake: in local computer does not start OracleOraHome90TNSListener service
message is "error 1067: the process terminated unexpectedly."
      Finding the cause is a bit ip address or machine name changes over the solution is as follows:
         modify this file listener.ora information about IP addresses
         or use the Net Manager-> local -> listener, the listening position modified to the correct IP address saved after the line

---------------- ************ ---------------------- -
4.Oracle not the Available Shared Memory realm does not exist solutions
ORA-01034: ORACLE not available, ORA-27101: shared memory realm does not exist-Oracle installation
Oracle installation is complete, restart the service, they reported the following error: eRROR:
ORA-01034: ORACLE not the Available
ORA-27101: Shared Memory realm does not exist

------Solution------------------------------------------ --------------
when faced with Oracle appears following tips:

ora-01034:oracle not available

ora-27101:shared mermory realm does not exist


method 1:

1. Input: connect / as sysdba;

2. Restart the computer is OK;

Method 2:

Enter the command line

C:\>svrmgrl

Oracle Server Manager Release 3.1.7.0.0 - Production

Copyright (c) 2000, Oracle Corporation. All Rights Reserved.

Oracle8i Enterprise Edition Release 8.1.7.0.0 - Production

With the Partitioning option

JServer Release 8.1.7.0.0 - Production

SVRMGR> connect internal/oracle

connection succeeded.

SVRMGR> startup

startup and then connect to the database should be no problem.

You directly to the PGA 256 is not going to work, right?
Pga say you do not understand what is the meaning of it he can not directly set the bar? ? ? ?
pga = java_pool_size + large_pool_size + shared_pool_size + db_cache_size

---------------- ****************** ---------------- ---------
5. oracle database, how to increase the size of table space, there are two ways to increase the size of the table space:

  1. additional data file to the tablespace

  例如:alter tablespace users add datafile '/u01/oradata/orcl/users02.dbf' size 25m;

  2. Modify the table space in the current data file

  例如:alter database datafile '/u01/oradata/orcl/users01.dbf' resize 50m;

----------------- ***************** ---------------- ------------
6. lookup table space and table space usage
--------------------------- -------------------------------------------------
* ************************************************** *************************
in the Microsoft Windows [version 5.2.3790]
(C) Copyright 1985-2003 Microsoft Corp.

C:\Documents and Settings\Administrator>sqlplus yanfa/yanfa@dbs

SQL * Plus: Release 10.1.0.2.0 - Production on Wednesday, December 9 22:12:05 2009

Copyright (c) 1982, 2004, Oracle. All rights reserved.


连接到:
Oracle Database 10g Enterprise Edition Release 10.1.0.2.0 - Production
With the Partitioning, OLAP and Data Mining options

 

SQL> SELECT tablespace_name tablespace, sum (blocks * 8192/1000000) remaining space M FROM dba_free_space GROUP BY tablespace_name;

Table space remaining space M
------------------------------ ----------
the DBS 5.111808
the SYSAUX 7.733248
the SYSTEM 6.88128
UNDOTBS1 101.056512
-
                    101.449728

SQL> select a.a1 表空间名称, c.c2 类型, c.c3 区管理, b.b2/1024/1024 表空间大小M,
(b.b2-a.a2)/1024/1024 已使用M, substr((b.b2-a.a2)/b.b2*100,1,5) 利用率 from (sel
ect tablespace_name a1, sum(nvl(bytes,0)) a2 from dba_free_space group by tables
pace_name) a, (select tablespace_name b1, sum(bytes) b2 from dba_data_files grou
p by tablespace_name) b, (select tablespace_name c1,contents c2,extent_managemen
t c3 from dba_tablespaces) c where a.a1=b.b1 and c.c1=b.b1;

Type the name of the table space area management table has been used space M M
------------------------------ ------- ------------ ---------- -----------
utilization
----------
DBS the PERMANENT the LOCAL 296.25 293.375
99.02

SYSAUX                         PERMANENT LOCAL              240   238.0625
99.19

SYSTEM                         PERMANENT LOCAL              440     433.75
98.57


Type the name of the table space area management table has been used space M M
------------------------------ ------- ------------ ---------- -----------
utilization
----------
UNDOTBS1 UNDO the LOCAL 115 18.25
15.86

 

SQL> alter tablespace dbs add datafile 'D:\oracle\product\10.1.0\oradata\DBS\use
rs02.dbf' size 2G;

Table space has changed.

SQL> SELECT UPPER (F.TABLESPACE_NAME) "table space",
       D.TOT_GROOTTE_MB "table space (M)",
       D.TOT_GROOTTE_MB - F.TOTAL_BYTES "used space (M)",
       the TO_CHAR (ROUND ((D. TOT_GROOTTE_MB - F.TOTAL_BYTES) / D.TOT_GROOTTE_MB * 100,
                     2),
               '990.99') "use than",
       F.TOTAL_BYTES "free space (M)",
       F.MAX_BYTES "maximum block (M)"
the FROM (the SELECT TABLESPACE_NAME ,
               the ROUND (the SUM (BYTES) / (1024 * 1024), 2) TOTAL_BYTES,
               the ROUND (MAX (BYTES) / (1024 * 1024), 2) MAX_BYTES
          the FROM SYS.DBA_FREE_SPACE
         the GROUP BY TABLESPACE_NAME) F.,
       (the SELECT DD.TABLESPACE_NAME,
               ROUND (SUM (DD.BYTES) / (1024 * 1024), 2) TOT_GROOTTE_MB
          FROM SYS.DBA_DATA_FILES DD
         GROUP BY DD.TABLESPACE_NAME) D
WHERE D.TABLESPACE_NAME = F.TABLESPACE_NAME
ORDER BY 4 DESC

SQL>


------------------ **************** ---------------- ---
how to solve ORA-04031 error 7.Oracle

For most applications, shared pool size is very important for Oracle is the performance. Save data dictionary cache shared pool
and a fully resolved or compiled PL / SQL blocks and SQL statements.

When we try to allocate large tracts of contiguous memory failures in the shared pool time, Oracle first refresh all objects in the pool not currently in use, the air
free memory block the merger. If you still do not have enough single large chunk of memory to satisfy the request, it will generate an error ORA-04031.

Shared pool 1. Examples of parameters related to

Before proceeding, understand the following instance parameters are important:

SHARED_POOL_SIZE - This parameter specifies the size of the shared pool in bytes. Acceptable or several digital value
, after the words to keep the suffix "K" or "M". "K" for kilobytes, "M" for megabytes.

SHARED_POOL_RESERVED_SIZE - specifies the shared pool of memory reserved for the shared pool for continuation requests a large
space. When the shared pool fragmentation forces the Oracle to find and release chunks of unused pool to satisfy the current request when the parameter
number and SHARED_POOL_RESERVED_MIN_ALLOC parameters can be used together to avoid performance degradation.

The ideal parameter values should be large enough to meet any of the reserved list memory scanning without refreshing the request from the shared pool of
objects. Since the operating system can limit the size of the shared memory pool, in general, you should set this parameter is
10% the size of SHARED_POOL_SIZE parameters.

SHARED_POOL_RESERVED_MIN_ALLOC - The value of the parameter control of reserved memory allocation. If a sufficient
enough size chunk of memory could not be found in the shared pool free list, the memory allocated a large empty than this value from the list of reserved
rooms. The default value for most systems are sufficient. If you increase this value, Oracle server will allow this
reserved list and allocate fewer requests more memory from the shared pool list. This parameter in Oracle 8i is hidden
in.
2. Diagnostic error ORA-04031

ORA-04031 error is usually because the library cache or shared pool reserved space debris. When increasing the size of the shared pool consider adjusting applications
using a shared SQL and adjust the following parameters:

SHARED_POOL_SIZE,
SHARED_POOL_RESERVED_SIZE,
SHARED_POOL_RESERVED_MIN_ALLOC.

First, determine whether the ORA-04031 error is caused by the shared pool reserved space in the library cache of debris generated. Submitted under the query:

SELECT free_space, avg_free_size, used_space, avg_used_size,
request_failures, last_failure_size
FROM v$shared_pool_reserved;

in case:

REQUEST_FAILURES > 0 并且
LAST_FAILURE_SIZE > SHARED_POOL_RESERVED_MIN_ALLOC

So ORA-04031 error is because of the shared pool reserved space due to the lack of contiguous space.
To solve this problem, consider increasing SHARED_POOL_RESERVED_MIN_ALLOC to reduce the buffer into the shared pool reserved space,
the number of pixels, and increase SHARED_POOL_RESERVED_SIZE and SHARED_POOL_SIZE to increase the pool of available shares reserved space in the
memory.

如果:
REQUEST_FAILURES > 0 并且
LAST_FAILURE_SIZE < SHARED_POOL_RESERVED_MIN_ALLOC

or

REQUEST_FAILURES 等于0 并且
LAST_FAILURE_SIZE < SHARED_POOL_RESERVED_MIN_ALLOC

So because of the lack of contiguous space lead to ORA-04031 errors in the library cache.

The first step should be to consider lowering SHARED_POOL_RESERVED_MIN_ALLOC to put more objects to shared pool
reserved space and increase SHARED_POOL_SIZE.


. (1) Solution: Modify the parameter file InitIDS.ora

The following parameters will be amended as follows:

sga_max_size=500M

shared_pool_size=300M

SHARED_POOL_RESERVED_SIZE =30M

. (2) Solution used:

Microsoft Windows [Version 5.2.3790]
(C) Copyright 1985-2003 Microsoft Corp.


C:\Documents and Settings\Administrator>sqlplus sys/system as sysdba

SQL * Plus: Release 10.1.0.2.0 - Production on Friday December 11 2009 17:49:17

Copyright (c) 1982, 2004, Oracle. All rights reserved.


连接到:
Oracle Database 10g Enterprise Edition Release 10.1.0.2.0 - Production
With the Partitioning, OLAP and Data Mining options

SQL> show parameter sga;

NAME                                 TYPE        VALUE
------------------------------------ ----------- ------------------------------
lock_sga                             boolean     FALSE
pre_page_sga                         boolean     FALSE
sga_max_size                         big integer 1G
sga_target                           big integer 0
SQL>alert system set sga_max_size= 1024M scope = spfile;

SQL> show parameter sharea;
SQL>
SQL>
SQL>


SQL> show parameter shared;

NAME                                 TYPE        VALUE
------------------------------------ ----------- ------------------------------
hi_shared_memory_address             integer     0
max_shared_servers                   integer
shared_memory_address                integer     0
shared_pool_reserved_size            big integer 100M
shared_pool_size                     big integer 300M
shared_server_sessions               integer
shared_servers                       integer     1
SQL>
SQL>alert system set shared_pool_size=300M scope = spfile;
SQL>
SQL>alert system set shared_pool_reserved_size=100M scope = spfile;
SQL>
SQL>shutdown immediate;
如果报错,则

C:\Documents and Settings\Administrator>sqlplus /nolog

SQL>connect / as sysdba;


SQL>shutdown immediate;

SQL>startup ;

To get.

------------------- ********************** --------- --------------
8.ORA-01034 error solutions

Problem Description
=======

When attempting to start the database, Oracle reported the following error:
ERROR:
ORA-27101 Shared Memory realm does not exist
ORA-01034 ORACLE not the Available

基本解释
=======
Error: ORA-27101
Text: shared memory realm does not exist
-------------------------------------------
Cause: Unable to locate shared memory realm
Action: Verify that the realm is accessible


How to solve
=======

In fact, this problem can be explained in one sentence:

ORACLE_HOME or ORACLE_SID not set correctly.

In previous versions, if the ORACLE_SID is not correct, generally only prompted ORA-01034. Oracle 8.1.7 gives an additional message: ORA-27101.

-> If it is Unix, the ORACLE_SID set correctly can be (note case sensitive issue) in the Shell.
  Also, check the ORACLE_HOME environment variable. How to check refer to the following command:

% echo $ORACLE_SID
% ps -ef |grep smon

-> If you're on Windows, usually because the system has multiple instances it caused.

 At the command line can be C: \> the SET DEMO the ORACLE_SID =
                  
                   C: \> Show the ORACLE_SID

 The DEMO here for you to change the corresponding instance name.

 If not enough, then check the registry ORACLE_HOME.


  In addition, in the Windows environment sometimes can not connect a remote database, report such errors.

The solution is to put sqlnet.ora file
  SQLNET.AUTHENTICATION_SERVICES = (NTS) NTS change to NONE.

--------------------------***************--------------------------

Hit rate helps you measure the use of the shared pool, the number of statements that need to be resolved rather than reuse. The following SQL statement will help you calculate the library cache hit rate:

SELECT SUM(PINS) "EXECUTIONS",
            SUM(RELOADS) "CACHE MISSES WHILE EXECUTING"
            FROM V$LIBRARYCACHE;


----------------------************************-------------------------

10. Test whether the installation is successful oracle database

(1).C:\Documents and Settings\Administrator>lsnrctl


(2).C:\Documents and Settings\Administrator>tnsping table_space_name 如:dbs

C:\Documents and Settings\Administrator>netca dbca

 

Reproduced in: https: //my.oschina.net/usenrong/blog/197879

Guess you like

Origin blog.csdn.net/weixin_33695082/article/details/92028903