background: recently contacted with Oracle, previously used by MySQL, so not too understand, documenting the knowledge of Oracle
Oracle's account operation:
Note: To create a user and delete a user and authorization, the general user does not have permissions, it is recommended to use the Superuser system, if there is a careless small partner and I forgot the System account password, the back will say how to change the password
Many SQL files or DMP files specify a table space, not placed in the specified space import will be an error.
The default tablespace for Oracle can be specified by system,10g before 10g, and the general system defaults to users.
Creating tablespace: Create tablespace table space name datafile ' hard disk address ' size capacity;
Creating User: Create user username identified by password default tablespace table space;
Delete users: Drop user username cascade;
User authorization: Grant DBA to User name;
REVOKE permission: Revoke Connect, resource from username;
Authorization has three roles: Connect (connection role), resource (Resource role), DBA (Administrator role)
Change Password: Alter user username identified by modified password
You can also create your own roles:
Syntax: Create role name;
Example: Create role testrole;
Authorization role:
Syntax: Grant select on the class to role name;
In the following: Grant Select on class to TestRole;
Note: Now, all users with the TestRole role have select query permissions on the class table
To remove a role:
Syntax: drop role name;
Example: Drop role testrole;
Note: Permissions associated with the TestRole role are removed from the database
Forgot system Password Change password:
1. You can change other account password after login using SYSDBA account
Run cmd as follows input command sqlplus/as SYSDBA---------with sys login Super User (SYSDBA)
2. Unlock your account
Alter user username account unlock; ---------unlocked (must be with ";" No.
Take the system user name as an example, the command is the ALTER user SYSTEM account unlock;
3. Set a new password for the account
Alter user username identified by password; -------------Change Password (password plus no double quotation marks can be, must be with ";" No.
Take the user Name System password Dhee as an example, that is, the command is alter user system identified by Dhee;
Then log in with your changed password.
Oracle Turn-off service:
Close service: Shutdown immediate
Start Service: Startup
Some user actions on Oracle database and NOVCAT connection to Oracle