Configure and manage Oracle listener logs

Source: Internet
Author: User
-- ======================================
-- Oracle listener log configuration and management
-- ======================================
The Oracle listener is a server program used to listen to all requests from the client and provide database services for it. Therefore, listener management and maintenance are very important.

This document describes how to configure and manage Oracle listener log files. For listener descriptions, see

Configure the Oracle client to connect to the database

Configure dynamic service registration for non-default ports

1. Listener log features

1. The Listener log is a plain text file, usually located in the $ ORACLE_HOME/Network/log directory, in the same path as the sqlnet. log file.
2. The default file name is listener. log. For non-default listeners, the generated log file is usually listenername. log.
3. This file is automatically created by the listener by default. When the log file is lost or does not exist, a file with the same name is automatically created, similar to the alert _ <Sid>. log file.
4. The size of the file will keep increasing automatically. When the size is too large or not easy to read, consider backing up the file.
5. Oracle listeners cannot delete or rename log files during runtime.
6. You can set the log status to on or off to enable or disable logs.

2. Set the log file directory and Path

1. Set the log file directory in two ways

LSNRCTL set log_directory directory </P> <p> LSNRCTL> set log_directory/usr/Oracle/admin/log

2. Set log files in two ways

Lsnrctl set LOG_FILE file_name </P> <p> LSNRCTL> SET LOG_FILE file_name

3. Set the log status

LSNRCTL set log_status {on | off} </P> <p> LSNRCTL> set log_status {on | off} <br/>

4. Demo settings
A. Switch to the log directory to view log files.

[Oracle @ test ~] $ CD $ ORACLE_HOME/Network/log <br/> [Oracle @ test log] $ LS-hltr <br/> total 348 k <br/>-RW-r -- 1 Oracle oinstall 305 k apr 6 listener. log <br/>-RW-r -- 1 Oracle oinstall 26 K Jun 27 0:52 listener_demo92.log

B. view the current listener status

[Oracle @ test log] $ LSNRCTL status listener_demo92 </P> <p> LSNRCTL for Linux: Version 9.2.0.8.0-production on 27-jun-2011 01:54:31 </P> <p> copyright (c) 1991,200 6, Oracle Corporation. all rights reserved. </P> <p> connecting to (description = (address = (Protocol = TCP) (host = test) (Port = 1521 ))) <br/> Status of the listener <br/> ---------------------- <br/> alias listener_demo92 <br/> Version tnslsnr for Linux: version 9.2.0.8.0-production <br/> Start Date 27-jun-2011 01:52:18 <br/> uptime 0 days 0 HR. 2 min. 13 sec <br/> Trace Level off <br/> Security on <br/> SNMP off <br/> listener parameter file/Oracle/92/Network/admin/listener. ora <br/> listener log file/Oracle/92/Network/log/listener_demo92.log <br/> listening endpoints summary... <br/> (description = (address = (Protocol = TCP) (host = test) (Port = 1521 ))) <br/> (description = (address = (Protocol = IPC) (Key = EXTPROC) <br/> services summary... <br/> service "demo92" has 1 instance (s ). <br/> instance "demo92", status ready, has 1 handler (s) for this service... <br/> the command completed successfully <br/>

C. Set the listener directory and Log File

LSNRCTL> set current_listener listener_demo92 <br/> current listener is listener_demo92 <br/> LSNRCTL> set password <br/> password: <br/> the command completed successfully <br/> LSNRCTL> set log_directory/home/Oracle/log <br/> connecting to (description = (address = (Protocol = TCP) (host = test) (Port = 1521 ))) <br/> listener_demo92 parameter "log_directory" set to/home/Oracle/log <br/> the command completed successfully <br/> LSNRCTL> SET LOG_FILE listener_test.log <br/> connecting (description = (address = (Protocol = TCP) (host = test) (Port = 1521 ))) <br/> listener_demo92 parameter "LOG_FILE" set to listener_test.log <br/> the command completed successfully <br/> LSNRCTL> set log_status on <br/> connecting to (description = (Address = (Protocol = TCP) (host = test) (Port = 1521 ))) <br/> listener_demo92 parameter "log_status" set to on <br/> the command completed successfully <br/> LSNRCTL> save_config <br/> connecting to (description = (address = (protocol = TCP) (host = test) (Port = 1521) <br/> saved listener_demo92 configuration parameters. <br/> listener parameter file/Oracle/92/Network/admin/listener. ora <br/> old parameter file/Oracle/92/Network/admin/listener. bak <br/> the command completed successfully <br/> LSNRCTL> exit <br/>

D. view log files generated in the new path

[Oracle @ test admin] $ CD/home/Oracle/log <br/> [Oracle @ test log] $ LS-hltr <br/> total 16 k <br/>- RW-r -- 1 Oracle oinstall 41 Jun 27 listener_demo92.log --> set the directory to generate <br/>-RW-r -- 1 Oracle oinstall 113 Jun 27 listener_test.log --> set the new log file after the log file name </P> <p> [Oracle @ test log] $ LS-hltr --> View the log file at intervals, the original log files no longer grow, use the set log file name to record logs <br/> total 16 k <br/>-RW-r -- 1 Oracle oinstall 41 Jun 27 listener_demo92.log <br/>-RW- r -- 1 Oracle oinstall 1.3 K Jun 27 listener_test.log <br/>

E. view the changes in the listener. ora configuration file.

[Oracle @ test admin] $ more listener. ora <br/> # ---- added by tnslsnr 27-jun-2011 02:12:37 --- <br/> logs =/home/Oracle/log <br/> log_file_listener_demo92 = listener_test.log <br/> logging_listener_demo92 = on br/> # -------------------------------------------- <br/>

Iii. log file backup and rename

Generally, you need to stop the listener to back up the log files. In the following example, if you do not stop the listener, rename the log file to back up the log files.
1. Processing on Windows Platform

C: \> CD \ oracle \ ora92 \ Network \ log --> switch to the directory where the listener log file is located <br/> C: \ oracle \ ora92 \ Network \ log> LSNRCTL set log_status off --> suspend or offline log files <br/> C: \ oracle \ ora92 \ Network \ log> rename listener. log listener. old --> rename the log file, generally with the date <br/> C: \ oracle \ ora92 \ Network \ log> LSNRCTL set log_status on --> online listener log file, A new log file is automatically created. <br/>

2. Processing on Unix/Linux platforms

$ LSNRCTL set log_status off <br/> $ MV listener. log listener. old --> another method, CP listener. log/log/bak /. then CP/dev/null> listener. log <br/> $ LSNRCTL set log_status on <br/>

3. Demonstrate renaming log files in Linux

[Oracle @ test ~] $ CD/home/Oracle/log <br/> [Oracle @ test log] $ LSNRCTL set log_status off --> If a password exists, use the LSNRCTL interface to complete </P> <p> LSNRCTL for Linux: Version 9.2.0.8.0-production on 27-jun-2011 02:41:09 </P> <p> copyright (c) 1991,200 6, oracle Corporation. all rights reserved. </P> <p> connecting to (address = (Protocol = TCP) (Port = 1521 )) <br/> listener parameter "log_status" set to off <br/> the command completed successfully <br/> [Oracle @ test log] $ MV listener_test.log listener_test.old <br/> [Oracle @ test log] $ LSNRCTL set log_status on </P> <p> LSNRCTL for Linux: version 9.2.0.8.0-production on 27-jun-2011 02:41:31 </P> <p> copyright (c) 1991,200 6, Oracle Corporation. all rights reserved. </P> <p> connecting to (address = (Protocol = TCP) (Port = 1521 )) <br/> listener parameter "log_status" set to on <br/> the command completed successfully <br/>

Iv. Quick Reference

For performance optimization, see

Oracle hard parsing and soft Parsing

Sharedpool Tuning)

Buffercache adjustment and optimization (1)

Use of Oracle table cache (cachingtable)

 

For the Oracle architecture, see

Oracle tablespace and data files

Oracle Password File

Oracle parameter file

Oracle online redo log file)

Oracle Control File)

Oracle archiving logs

Oracle rollback and undo)

Oracle database instance startup and Shutdown Process

Automated Management of Oracle10g SGA

Oracle instances and Oracle databases (Oracle Architecture)

 

For more information about the flash back feature, see

Flashback Database)

Flashback drop & recyclebin)

Oracle flash back features (flashback query, flashbacktable)

Oracle flash back feature (flashback version, flashback transaction)

 

For more information about user-managed backup and recovery, see

Oracle cold backup

Oracle Hot Backup

Concept of Oracle backup recovery

Oracle instance recovery

Oracle recovery based on user management (describes media recovery and processing in detail)

System tablespace management and Backup Recovery

Sysaux tablespace management and recovery

 

For information on RMAN backup recovery and management, see

RMAN overview and architecture

RMAN configuration, Monitoring and Management

Detailed description of RMAN backup

RMAN restoration and recovery

Create and use rmancatalog

Create RMAN storage script based on catalog

Catalog-based RMAN backup and recovery

Use RMAN to migrate a file system database to ASM

RMAN backup path confusion (when using plus archivelog)

 

For Oracle faults, see

Error Handling for ORA-32004

ORA-01658 error.

CRS-0215 error handling

ORA-00119, ORA-00132 error handling

Another spfile setting error causes the database to fail to start.

Misunderstanding and setting of the parameter fast_start_mttr_target = 0

Spfile error causing database startup failure (ORA-01565)

 

For more information about ASM, see

Create an ASM instance and an ASM Database

Management of ASM disks and directories

Use asmcmd to manage the ASM directory and files

 

For more information about SQL and PLSQL, see

Common sqlplus commands

Replace variables with SQL * Plus Environment Settings

SQL plus paging using uniread

SQL Basics--> SELECT query

SQL Basics--> Use of new_value

SQL Basics--> Set operation (Union and Union all)

SQL Basics--> Common functions

SQL Basics--> View (createview)

SQL Basics--> Create and manage tables

SQL Basics--> Multi-Table query

SQL Basics--> Filtering and sorting

SQL Basics--> Subquery

SQL Basics--> Grouping and grouping Functions

SQL Basics--> Hierarchical query (startby... connect by prior)

SQL Basics--> Rollup and cube operators implement data aggregation

PL/SQL--> Cursor

PL/SQL--> Exception Handling)

PL/SQL--> Language basics

PL/SQL--> Process Control

PL/SQL--> PL/SQL records

PL/SQL--> Create and manage packages

PL/SQL--> Implicit cursor (SQL % found)

PL/SQL--> Package overloading and initialization

PL/SQL--> Use of dbms_ddl package

PL/SQL--> DML triggers

PL/SQL--> Instead of trigger

PL/SQL--> Stored Procedure

PL/SQL--> Function

PL/SQL--> Dynamic SQL

PL/SQL--> Common Errors of dynamic SQL

 

Other Oracle features

Common Oracle directory structure (10 Gb)

Use OEM, SQL * Plus, and iSQL * Plus to manage Oracle instances

Logging mode (logging, force logging, nologging)

Logging and nologging on table and index segments

Oralceomf Functions

Oracle users, object permissions, and system Permissions

Oracle role and configuration file

Oracle Partition Table

Oracle External table

Use external tables to manage Oracle alarm logs (alaert _ $ Sid. Log)

Cluster table and cluster Table Management (index clustered tables)

Use of Data Pump expdp export tool

Use of Data Pump impdp import tool

Import and Export Oracle Partition Table Data

SQL * loader usage

Enable User Process Tracking

Configure dynamic service registration for non-default ports

Configure the Oracle client to connect to the database

Difference between systemsys and sysoper sysdba

Oracle_sid, db_name, instance_name, db_domian, global_name

Complete Oracle patches (Oracle 9i 10g 11g path)

Upgrade oracle10.2.0.1 to 10.2.0.4

Oracle kill session

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.