Oracle basic operation commands
Author: cuizong007
The basic Oracle operation commands in this document are performed in Linux, and can be used as a reference for other systems. Due to my limited level, it is inevitable that there are omissions. please correct me more. My mailbox: cuizong007@sina.com welcomes friends in the technical field for technical exchanges.
1. Start the database: dbstart
2. Shut down the database: dbshut
3. Oracle user UNLOCK command: Alter User Username account unlock;
4. view the current user command: Show user;
5. Connect other users (except sys) command: conn user name/password; or conn User Name
6. Run the command SYS: conn username/password as sysdba;
7. If you want to access the query of different tables (using sys user) command: Select * from username. Table Name;
8. In the *. SQL file Editing Command, reference the command in Oracle: @ *. SQL
9. Check whether oralce runs the command in the system: PS-u Oracle
10. Run the select * From tab command to view all the tables in the Oracle database (using the Sys user;
11. Repeat the last executed command in Oracle :/
12. Clear screen command: clear screen; or clear SCR;
13. Modify the Oracle user password command: Alter User Username identified by password;
14. Oracle default password: the default password of sys is change_on_install.
The default password of your system is Manager.
The user Scott's default password is: Tiger
15. Command for viewing listening and database status (in Oracle Identity): $ LSNRCTL status
16. Edit the SQL command: $ ed
17. Run the command $ sqlplus/As sysdba to access sqlplus as a DBA.
18. Create USER command (in SYS identity): create user username identified by password;
19. delete user commands (as sys); drop User Username cascade;
20. Change User Password: Alter User Username identified by password;
21. view the Oracle Language Set setting command: Select userenv ('language') from dual;
22. Command for starting the listener (in Oracle): $ LSNRCTL start
23. Disable the listening command (in Oracle Identity): $ LSNRCTL stop
24. Command for setting the line size: $ set linesize Value
25. Command for setting the column size: $ set pagesize Value
26. view all user name commands (as sys): $ select username from dba_users;
27. view the size of all tablespaces (as sys): Select * From dba_free_space;
28. Switch from another user to sys user command: $ conn sys/password as sysdba
29. Command for deleting tablespaces and contents: $ drop tablespace name including contents;
30. Table deletion command: $ drop table name
31. Modify the table fields:
Alter table table name modify (field name type constraints );
Example: alter table test modify (addd archar2 (10) null );
Alter table table name Add (field name type constraints );
Example: alter table test add (age varchar2 (5 ));
32. view all the table commands of the current user: $ select table_name from user_tables;
33. export data from the database command: $ exp name/pass file = 123.dmp
34. import data from the database command: $ imp name/pass file = 123.dmp
If the import user is different from the Export user, you need to add fromuser =#### touser ####
When exporting large files, you can add commit = y buffer = 10000000.
35. Delete all content under an instance: Drop user #### (user of the table you want to delete) cascade;