Understand Oracle, create users, and understand data types!
Goal: Understand the orale Database
- I. Data Types in Oracle:
- Number Type:
- A) number indicates the number type, but if there is a decimal number, it must be written as follows: number (total number of digits, decimal number)
- B) Apart from number, oracle still supports various data types in Sqlserver. For example:Int,Float,Double, AndIntegerEncapsulation data type, but I
- We usually use the number type, and others are not recommended!
- Character Type:
- A) varchar2. in oracle, The varchar2 data type is recommended.VarcharData Type! Of courseVarcharIt is also supported!
- B) long, which indicates a super-long string. It can be up to two GB and is a bit like text in Sqlserver!
- C) and others, such as: nvarchar2,Nchar
- Date type:
- A)DateIs the most common date type!
- Binary data type:
- A) raw, indicating binary data
- B) long raw, ultra-long binary data
- C) The maximum length of BLOB binary data is 4 GB.
- D) The maximum length of CLOB characters is 4 GB.
- E) the maximum length of NCLOB character data depends on the character set.
- F) The maximum length of binary data stored in BFILE outside the database is 4 GB.
- Special pseudo column types:
- A) the unique row number recorded in the ROWID data table is in the format of 10 bytes *********. *****. ******. * 0 or 1.
- B) the maximum length of the unique row number recorded in the NROWID binary data table is 4000 bytes.
- 2. Role Relationship authorization and cancellation in oracle:
- Create a user (the premise is that you have the permissions to create a user, usually DBA ):
- Create UserUser name identifiedByPassword;
- Delete A User:
- DorpUserUser Name
- Grant permissions to users:
- GrantPermission 1, permission 2 ,...ToUser name;
- Several common permissions:
- CreateSession: Database login power
- Create Table: Create a table
- Alter Table: Modify Table
- ....
- Cancel User power:
- RevokePermission 1, permission 2 ,...FromUser name;
- Special:
- AddWithXXXXOptionThis gives the user special ownership. This is because the authorized person still has this permission after the authorized person is deleted!
- Eg:Grant Create Table ToScottWith Grant/AdminOption;
- Where: "grand" indicates operations on user schemes such as adding, deleting, modifying, and querying tables, and "admin" indicates system management schemes such as creating and Deleting Users ....!
- Once and for all:
- When many permissions are granted to users, it is too difficult to set them one by one, so we need to use the Role authorization method:
- Grand role 1, role 2 ,...ToUser name;
- We usually useConnect, Resource!
- Eg: grandConnect, ResourceToLovingshu;
- 3. User Information Modification
- Keywords:Alter
- Here, the most used is to unlock users:
- Eg:Alter UserScott account unlock;--- Unlock scott user!