1. Connection commands
Connection:
Conn [ect] user name/password @ network server [as sysdba/sysoper]
If you log on to SYS, because sys can have two roles, You need to log on in the "Connect user name/password as role" format and specify the login role.
Disconnect from the solution:
Disc [onnect]
Change User Password:
Passw [ord] User Name
Password Jack ;)
If you change your password, enter the "password" command.
View the current Login User:
Show user
Exit the command window:
Exit or quit
Ii. File Operation commands
Execute the external file: Start c: \ A. SQL or @ C: \ A. SQL;
Edit the external file: Edit c: \ A. SQL;
Record window command:
Spool D: \ B. SQL;
.....
.....
Spool off;
Iii. Oracle user management
Create a new user: create user username identified by password; (create user Jack indentified by Tiger)
New users do not have the permission to connect to the current scheme. They must grant (connection permission): grant connect to user name; (grant connect to Jack ;)
Change Password: in addition to the two types described earlier, there is also a new password: Alter User Username identified;
Delete user: Drop User Username [cascade];
If a user with a cascade is deleted, all tables, views, and Other Resources created by the user are deleted.
3. user authorization
New users do not have any permissions, including connection scheme permissions, and must be authorized.
The corresponding permission names for adding, deleting, modifying, and querying a table are insert, delete, update, and select.
Grant a permission to the user: grant permission name on user name. Table name to user name (grant insert/delete/update/select on Scott. EMP to Jack)
Note: If the table name is followed by a column, only the corresponding column permissions are available, for example, grant select on Scott. EMP (name) to Jack. Only the name column of the EMP table can be queried.
To grant all of the preceding permissions to a user, you can grant one or more permissions at a time: grant all on user name. Table name to user name (grant all on Scott. EMP to Jack)
To revoke a permission: revoke permission name on user name. Table name from user name (revoke insert/delete/update/select on Scott. EMP from Jack)
To revoke all the preceding permissions: revoke all on user name. Table name from user name (revoke all on Scott. EMP from Jack)
If the system administrator uses the with Grant (Admin) option when authorizing a user, the user can continue to grant this permission to other users.
However, once the Administrator revokes this permission, the permissions of other users are also revoked.
Note: system permissions are not cascaded, and object permissions are cascaded.
With grant option cannot be assigned a role
The following command requires DBA permission
Account lock: create profile file name limit failed_login_attempts times password_lock_time Number of days locked
Usage: Alter User Username profile file name
Unlock: Alter User Username account unlock
Termination command: create profile file name limit password_life_time interval days password_grace_time Grace days [password_reuse_time password days can be reused days]
Delete profile: Drop profile file name [cascade]