Oracle BASIC commands

Source: Internet
Author: User

Oracle Use steps: I. Oracle installation two files extracted to the same folder, Doc for description/use of document two. Oracle boot: 1. Start Oracle: Start monitoring and Custom library 2. Start Cmd->sqlplus->sys/java Login Three. Oracle operating User: 1. The current user sql> show users user is "SYS" 2. Create User: Sql> creating users XR identified B        y Java;    The user has created.        3. Authorized User: Sql> grant dba to XR;    Authorization is successful.    4. Switch User: sql> conn XR input password: connected.        5. Delete users: sql> drop user xr;    The user has been deleted.        6. View all Users://view if not your own built users, there will be many tables sql> select * from All_users; USERNAME user_id CREATED------------------------------------------------------S Cott 84 30月-March -10 owbsys_audit 83 30月-March -10 Owbsy S 79 30月-March -10 apex_030200 78 30月-March -10 Apex_publ Ic_user 76 30月-March -10 flows_files 75 30月-March -10 Mgmt_vieW 74 30月-March -10 Sysman 72 30月-March -10 spatial_csw_                                 ADMIN_USR 70 30月-March -10 spatial_wfs_admin_usr 67 30月-March -10 mddata 65 30月-March-104. Oracle Action tablespace: 1. New tablespace: sql> create tablespace goods datafile ' d:/        goods.dbf ' size 100M autoextend on NEX t 5M maxsize 1000M;    The tablespace has been created.        2. Delete Table space: sql> drop tablespace GOODS including contents and datafiles;    Table space has been deleted. 3. Check created tablespace: sql> Select table_name from user_tables;//to use 4 in a table of your own definition. View all tablespaces: sql> Select Tablespace_        Name from dba_tablespaces;//successful tablespace_name------------------------------SYSTEM Sysaux UNDOTBS1 TEMP USERS GOODS has selected 6 rows.    Five. Oracle Operations Entity table: 1. New entity table: sql> CREATE TABLE goods (ID number,price number);         2. View the Entity table structure: sql> desc goods;      Name                                Is it empty?                                                 Type--------------------------------------------------------ID Number Price Number 3. View the table space where the current entity table is located: sql> Sele        CT tablespace_name from dba_tables where table_name= ' EMP '; Tablespace_name------------------------------users 4. View user-defined tables: sql> select table_name from u        Ser_tables;    table_name//printing results are not as many results as you need, not just tables that you create yourself.        5. Modify the table structure sql> ALTER TABLE goods add price number;    The table has changed.        6. Add Data: sql> INSERT into goods values (1, ' Apple ', 5);    1 rows have been created.            7. View Table Data: sql> select * from goods;                          ID NAME Price----------------------------------------1 apples            5 8. View Column data: Sql> select ID from goods; ID----------1 9. Update the specified column: sql> updateGoods set price=4 where id=2;    1 rows have been updated.        10. Delete the specified column: sql> delete from goods where id=2;    1 rows have been deleted.        11. Delete all data: sql> delete from goods;        1 rows have been deleted. 12. Delete tables: sql> drop table Stu;

Oracle BASIC commands

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.