Some useful Oracle SQL scripts are constantly improving ......

Source: Internet
Author: User

// View all database objects in the Oracle database
Select * From dba_objects

// View database objects that meet specific conditions
Select * From dba_objects where owner = 'user1'

// View database version information
Select * From product_component_version
For example, the output information is as follows:
Product Version status
Nlsrtl 9.0.1.1.1 Production
Oracle9i Enterprise Edition 9.0.1.1.1 Production
PL/SQL 9.0.1.1.1 Production
TNS for 32-bit windows: 9.0.1.1.0 Production

// View the information of the current database. V $ instance is an instance of the database system.
Select * from V $ instance
For example, the output information is as follows: instance_number instance_name host_name version startup_time status parallel thread # archiver log_switch_wait logins shutdown_pending database_status instance_role active_state
1 USP wangpengpc 9.0.1.1.1 07/29/2004 09:19:47 open No 1 stopped allowed no active primary_instance normal

// View database version information
Select * from V $ version
For example, the output information is as follows:
Banner
Oracle9i Enterprise Edition Release 9.0.1.1.1-Production
PL/SQL release 9.0.1.1.1-Production
Core 9.0.1.1.1 Production
TNS for 32-bit windows: Version 9.0.1.1.0-Production
Nlsrtl version 9.0.1.1.1-Production

// View the information of the Client Connecting to the database, such as which users connect to the database
Select * from V $ session

// Provides related SchedulingProgramProcess information, such as name, URL, status, usage statistics table, and index number
Select * from V $ dispatcher

// Provides a rate statistics table for the scheduler Process
Select * from V $ dispatcher_rate

// Contains messages about the message queue of the Shared Server
Select * from V $ queue

// Contains information about the Shared Server process
Select * from V $ shared_server

// Display the initialization parameters of the current database
Select * from V $ Parameter

// List information about the current Database Control File
Select * from V $ controlfile
For example:
Status name
D:/oracle9.11/oradata/USP/control01.ctl
D:/oracle9.11/oradata/USP/control02.ctl
D:/oracle9.11/oradata/USP/control03.ctl

// Display the information of the current database
Select * from V $ Database

// Display historical archived log information in the control file
Select * from V $ archived_log

// Describes the current instance, all archiving targets, and the current values, modes, and statuses of these targets.
Select * from V $ archive_dest

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.