Oracle training and learning highlights 360-degree scans

Source: Internet
Author: User

Oracle training and learning highlights 360-degree scans first, create user conn system/orclhspcreate user xiaoming identified by m123grant connect to xiaminggrant resource to xiaomingconnect xiaoming/m123pasword xiaoming Change Password disconnect new table and add data create table users (id number ); insert into users values (1) revoke permissions. Note that you cannot implement the permission by yourself. You can also delete the user drop user xiaoming after using systemconn system/orclhsprevoke connect from xiaomke resource from xiaoming; (An error will be reported.) Note that if the user has created data Object (Table \ trigger \ sequence), so when we delete a user, we need to add the option cascade to indicate that the user will be deleted, and all objects will also be deleted drop user xiaoming cascade; second, instance, solution (schema) Pay attention to this point is extremely important, here and other databases: mysql sqlserver maximum difference. term: database instance: orclmk has only one instance. After a user is created, if this user creates any data object, our dbms will create a corresponding solution that corresponds to this user. And the name is the same as the user name. Scott's solution: self-built tables are played back in their own directories. Therefore, you can create tables with the same name (different solutions are acceptable, but the same is not acceptable ). _ Tips: to check the data objects of a user, you can use pl/SQL developer _ or: Use xiaoming to query the scott table. The procedure is as follows: A first uses scott to log on. When Bgrant select | update on emp to xiaohongxiaohong queries the emp table, select * from sott. emp; show user; what is the current user name? Sixth, using the profile file to manage passwords allows users to try up to three times. If the password fails, try again three days later. Oracle Database startup process windows system information details 7. conn xxx/xxx as sysdba can also be logged on, regardless of its user or password. Show user; show sys1. common user: the default is Database Authentication: conn scott/tiger2. privileged user, which is authenticated by the operating system by default, for example: conn system/sss as sysdbc [only available in the ora_dba group, but not available] method 2. After Successful Logon, the system will automatically switch to the sys user. What should I do if my password is lost? Eighth, the data type char (size) is used to store strings. The maximum length is 2000 characters and the length is fixed. Fixed Length explanation: If this table is created: create table test (name char (32); -- this column can contain a maximum of 32 characters. If it is exceeded, an error is returned. If it is not enough, spaces are used to complete the statements. You can use this letter. Select name, dump (name) from testvarchar: smaller varchar2: Variable Length, up to 4000. It will be recycled without spaces. Usage principle: if the data length is fixed, such as the product number and ID card number, char should be used, because the speed will be fast nchar: fixed length, which is encoded in unix. Note: Chinese characters are also different from others. Nvarchar2: clob: Large Object of the dense type. It can only contain characters. The maximum value is 8 Tblob: Variable Length, binary, image, sound, and text. The maximum value is 8 TB in actual development, A small number of pictures and sounds are stored in the database. Generally, only the url address is stored in the ninth lecture date. The default format is "day-month-year". Therefore, this format is also used during insertion. If you want to change to the Chinese style, use this method: timestamp (n), 1 Postmark type, if you change a Name field, the date in this format will also change the name of a student table: rename old table name to new name character kg and date type should be included in single quotes delete from table write log, slow speed: you can retrieve truncate from table without writing logs, speed class, cannot retrieve rollback; select * from studentsoracle column name, select ename, sal * fd AS annual salary from empselect ename, sal * fd annual salary from emp a function that is unique to itself. Nvl (num, 0) If num is null, 0 is returned. If it is not null, its value is returned. | merge Column Display to combine multiple columns into one column, connect rub to ts operator select name | job from emp;

Related Article

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.