first, the basic operation of the database1, create a user SQL> Create UserUser name identified bypassword;2, Super User system gives new user rights SQL> GrantConnect, Resource toMike; Authorized connection permission to delete and modify permissions3, new User login, enter new user's space SQL>Connect Mike/m111;4that shows the current user SQL>ShowUser;5, build tables, add data, delete and change. 6, login Sqlplus>Sqlplus Login Name/Password@127.0.0.1:1521/DB Instance Name II, Oracle data type1, character type:varchar2 --equivalent to varchar, variable length, up to 4000 bytesvarchar2(Ten)--for storing fixed lengths, the ' ABCD ' is stored on the diskChar --fixed length, up to 1000 bytes. Char(Ten)--for fixed lengths, the ' ABCD ' is stored on the disk. Note: A Kanji account of 3 bytesCreate TableStudent (namevarchar2( +))2, numeric type: Number --38-bit precision. Number(6)--represents an integer: 6 bits. Number(6,2)--represents decimals: a total of 6 digits, where decimals account for 2 bits. 3, Date type: Date current date: SQL Server--getdate () oracle--sysdatedate format: Control time format SQL with to_date () function> Insert intoPerson (id,name,sex,logindate)Values(10003,'Zhang San','male', To_date ('1998-12-25','YYYY-MM-DD'));4, big objects: Save pictures, videos, files.<2gblob--Binary Large ObjectsClob--large object with character typeiii. Common commands analysis of describe table name--View Table StructureSelect * fromtab--View all tables for the current userDrop TableTable name;--Delete a tableDrop UserUser nameCascade;--Delete UserIv. Practice C:\Documents andSettings\Administrator>Sqlplussql*Plus:release10.2.0.1.0 -Production onSaturday December - Ten: the: * .Copyright (c)1982,2005, Oracle. Allrights reserved. Enter your user name: System input Password: Connect to: OracleDatabase10g Express Edition Release10.2.0.1.0 -Production SQL> Create UserSunnybug identified bym123; user created. SQL> GrantConnect,resource toSunnybug; authorized success. SQL>Connect Sunnybug/m123; connected. SQL>ShowUser;USERto "Sunnybug" SQL>Connect system/m123; connected. SQL>ShowUser;USERto "SYSTEM" SQL> Drop UserSunnybugCascade; The user has been deleted. SQL>Connect Sunnybug/m123; Error:ora-01017: Invalid username/password; logon denied
Oracle Learning 03-sqlplus Common commands and data types