Oracle password mechanism and Common Operations

Source: Internet
Author: User
By default, Oracle has three users: sys password: custom; system password: custom; scott password: Tiger (locked by default). Note: to log on to the database as a Sys user, refer to [assysdba

By default, Oracle has three users: sys password: custom; system password: custom; scott password: Tiger (locked by default). Note: to log on to the database as sysdba with a Sys user, refer to [as sysdba

By default, Oracle has three users: sys password: custom; system password: custom; scott password: Tiger (locked by default );
Note: To Log On with the Sys user, the root must be [as sysdba]

Desc table name: view the table structure;
Dos start listener: lsnrctl start
Dos starts Oracle instance service: oradim-starup-sid orcl
Query the user's system permissions: select * from user_sys_privs;
Query the user's table permissions: select * from user_tab_privs;
When the system permission is granted, the user is followed by: with admin option; -- this means that the object with the permission has the permission to pass this permission;
When granting object permissions, the user is followed by: with grant option; -- permission can be transferred.
Object permissions: Who creates and who grants permissions;
System permission: sys> A, A> B, if (sys <对象权限:a> > B; B> C; if (A < A role can be understood as a set of permissions;
Create role statement: create role name;
Delete role: drop role name;
Some system permissions cannot be assigned to a role, such as the unlimited tablespace permission ).
Permissions that cannot be placed in a role can only be granted by Sys;
Restrict Permissions to columns: grant select (id) on mytable to lisi;
Oracle modifies the session time format: alter session set nls_date_format = 'yyyy-mm-dd ';

Permission comparison:

Create table; create any table;

Alter table (Note: oracle does not have this permission); alter any table;
Drop table (Note: oracle does not have this permission); drop any table;


Three data verification mechanisms
Operating system verification
Password File Verification

Database Verification

Oracle startup in linux:
Lsnrctl start listener
Sqlplus/as sysdba for Password File and operating system verification
(Log on to Oracle9i ):
{
Sqlplus/nolog
Conn sys/oracle as sysdba ;}
Startup

SYS password loss solution:

Delete the Oracle password file and use orapwd file = password file path (the file name must be in PWDorcl. ora format) password = Sys password entries = number of privileged users limit force = force Overwrite

Select * from v $ pwfile_users; // query the number of privileged users


-- Select * from dba_users; query all users in the database


-- Alter user TEST_SELECT account lock; lock the user


-- Alter user TEST_SELECT account unlock; unlock the user


-- Create user xujin identified by xujin; create a user


-- Grant create tablespace to xujin; Authorize


-- Grant select on tabel1 to xujin; Authorize Query


-- Grant update on table1 to xujin;


-- Grant execute on procedure1 to xujin authorized Stored Procedure


-- Grant update on table1 to xujin with grant option; grant the update permission to the xujin user. The user can continue to authorize the update permission;

-- Revoke permissions


-- Revoke select on table1 from xujin1; revoke the select Table query permission;


-- Revoke all on table1 from xujin;


/* Grant connect to xujin;


Revoke connect from xujin


Grant select on xezf. pai_alarm to xujin;


Revoke select on xezf. wash_alarm from xujin ;*/


-- Select table_name, privilege from dba_tab_privs where grantee = 'xujin' query object permissions of a user


-- Select * from dba_sys_privs where grantee = 'xujin' query system permissions of a user


-- Select * from session_privs -- System Permissions Valid for money sessions


-- Role


-- Create role xujin1; -- create an xujin1 role


-- Grant insert on xezf. Into _alarm to xujin1; insert TABLE Information


-- Revoke insert on xezf. revoke _alarm from xujin1; revoke the permission of the xujin1 role


-- Grant xujin1 to xujin; grant the role permission to xujin;


-- Create role xujin2;


-- Grant xujin1 to xujin2; Authorize xujin1 to xujin2;


-- Alter user xujin default xujin1, xujin2; modify user default roles


-- Drop role xujin1; Delete ROLE 1;


-- Select * from role_sys_privs where role = xujin1;


-- View the system permissions under the role Xu Jin 1;


-- Select granted_role, admin_option from role_role_privs where role = 'xujin2 ';


-- View the role permissions under the xujin1 role


-- Select * from role_sys_privs where role = 'xujin2 ';


-- Select table_name, privilege from role_tab_privs where role = 'xujin1 ';


-- Select * from dba_role_privs where grantee = 'xujin' -- check the number of roles under a user;

For more information about Oracle, see the Oracle topic page? Tid = 12

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.