The present invention discloses a method for automatically collecting
Oracle statistical information, comprising the following steps: (a) designing a
database table into a partition table, and dividing the partition table into different statistical collection types according to a service feature; (b) periodically scheduling, by an
operating system, a
database storage procedure, and an input
database table owner, a table name, or a partition name, to perform statistical information collection of different granularities; and (c) in the database storage procedure, searching for a corresponding statistical collection type according to the input database table owner, the table name, or the partition name, and completing statistical information collection of a database table object. According to the method for automatically collecting
Oracle statistical information, the database table is designed into a partition table, operations such as addition, modification, and deletion are merely for a current partition or some specific partitions, and query and statistics-collection are separately implemented according to different statistical collection types, so that it is convenient to perform statistical information collection based on a
granularity of such as an owner, a table, or a partition, thereby improving running efficiency, stability and service continuity of an
Oracle database.