Three recent summary of Oracle Management

Source: Internet
Author: User

1. Statement to modify the Oracle user password

Alter user edw1010 identified by edw1010;

In fact, this is very simple, but because it is not commonly used, it may seem a little busy.

2. View deleted code scripts

The reference statement is as follows:

-- Can be used to view objects (PROCEDURE, PACKAGE, package body, type body, TRIGGER, FUNCTION, and TYPE) of the flashback query)
-- In fact, it is the use of the flashback query of ORACLE in the data dictionary table.
-- Log On As a dba using sys
Select *
From dba_source as of timestamp to_timestamp ('2017-01-23 06:56:00 ', 'yyyy-MM-DD HH24: MI: ss ')
Where owner = 'edw'
And type = 'processed ';
Select *
From dba_source as of timestamp to_timestamp ('2017-01-23 07:46:00 ', 'yyyy-MM-DD HH24: MI: ss ')
Where owner = 'edw'
And type = 'function ';

Flashback view of Table Structure

-- The following statement can be used to view the table creation statements in the table structure, but it does not work for Flashback queries.
SELECT DBMS_METADATA.GET_DDL ('table', 'test', 'edw ')
From dual as of timestamp to_timestamp ('2017-01-23 08:13:30 ', 'yyyy-MM-DD HH24: MI: ss ');
-- However, you can view the table structure status using the following statement:
Select *
From dba_tab_columns as of timestamp to_timestamp ('2017-01-23 08:27:00 ', 'yyyy-MM-DD HH24: MI: ss ')
Where owner = 'edw' and table_name = 'gbicc ';

3. Generate a script to delete the object statement under the user

-- Delete objects under a user
Set heading off;
Set feedback off;
Spool D: \ drop_user_obj. SQL;
Prompt -- start to generate a script to delete the following objects under the current user (if not all objects listed in this script, you can add them yourself)
Prompt -- Drop constraint
Select 'alter table' | table_name | 'drop constraint' |
Constraint_name | ';'
From user_constraints
Where constraint_type = 'R ';
Prompt -- Drop tables
Select 'drop table' | table_name | ';' from user_tables;
Prompt -- Drop view
Select 'drop view' | view_name | ';' from user_views;
Prompt -- Drop procedure
Select 'drop procedure '| object_name | ';'
From user_procedures
Where object_type = 'processure ';
Prompt -- Drop function
Select 'drop function' | object_name | ';'
From user_procedures
Where object_type = 'function ';
Prompt -- Drop sequence
Select 'drop sequence '| sequence_name |'; 'from user_sequences;
Spool off;

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.