Some neglected Oracle maintenance commands

Source: Internet
Author: User

Object permissions

Select owner,

TABLE_NAME,

Grantor,

Privilege,

Grantable,

Hierarchy,

' TABLE '/*o.*/object_type

From Dba_tab_privs P

where p.grantee = ' HR '

Order by P.owner, P.table_name;

Role

Select Granted_role, Admin_option, Default_role

From Dba_role_privs

Where grantee = ' HR '

Order BY Granted_role;

System permissions

Select Privilege, admin_option

From Dba_sys_privs

Where grantee = ' HR '

Order BY privilege;

Table Space Limit

SELECT * from Dba_ts_quotas where username = ' Sysman ' ORDER by Tablespace_name;

Permissions for user or system roles

SELECT * from role_sys_privs where role = ' RESOURCE '

All system permission names for the database

Select DISTINCT NAME from System_privilege_map t WHERE t.name like '%select% '

Df-h Disk space usage

Show Parameter Log_archive_format

View the user's profile

Select Username, profile from dba_users where username= ' SCOTT ';

View the settings for the corresponding profile

Select Resource_name, limit from dba_profiles where profile = ' DEFAULT ';

Modify the appropriate profile options

ALTER profile "DEFAULT" LIMIT connect_time 30; Maximum connection time 30 minutes

ALTER profile "DEFAULT" LIMIT failed_login_attempts 3; Maximum number of logon attempts 3 times

Rman initiates automatic backup control file function

Show All;

CONFIGURE Controlfile autobackup Clear; #清除设置 revert to default value

Configure Controlfile autobackup on; #设置为自动备份控制文件

CONFIGURE RETENTION POLICY to RECOVERY WINDOW of the days; #修改保留策略为保留30天

Backup Archivelog all; Back up the archive log

Backup tablespace users; Back up the Users table space

Backup DataFile 3; Backing up data files

Backup incremental level 0 database; Level 0 Backup

Backup incremental level 1 database; First level differential increment

Backup incremental Level 1 Cumulative database format '/oradata/bak/dblevel1.bak '; First-level cumulative increment

Backup as compressed backupset datafile 4; Backing up data files in a compressed way 4

Processing of archive space full time

RM *.arc Manually Delete part of the archive with the operating system command first

Rman Target/

Change Archivelog all validate;

Delete noprompt expired archivelog all;

Run {Execute script b_whole_10;} Execute Rman scripts

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.