Oracle Common Command Collection

Source: Internet
Author: User
Tags sqlplus

1. Check the listening status Lsnrctl status2. Start monitoring Lsnrctl start3. Turn off monitoring lsnrctl stop4. Log on as a database administrator Sqlplus/as Sysdba5. Manually start the database sql> STARTUP6. Close the database Sql>shutdown immediate;7. View the database name sql> select name from v$database;8. View instance name sql> Select Instance_ Name from v$instance;9. View the current user role sql> select * from user_role_privs;10. View the database status Sql> select status from V$instance;11. Delete users sql> drop user user1;12. See which users the system has sql> select * from All_users;13. Execute the SQL file (path means the file) sql> @PATH/ FILENAME.SQL14. Test SQL statement execution time Sql>set timing on; 15. View Data File select * from dba_data_files;16. To see if the database is in archive mode sql> Select Name,log_mode from V$database; sql> archive log list; Sql> Select Archiver from v$instance;17. View the table space that currently exists SELECT * from v$tablespace;18. View tablespace usage sql> Select Tablespace_ Name,sum (bytes)/1024/1024 from Dba_data_files Group by Tablespace_name; --The unit is M19. View user default Tablespace sql> select Username,default_tablespace from dba_users;19. Create tablespace (data file name must be single quote) sql> create Tablespace test_tbsp datafile '/home/oracle/oradata/test_tbsp.dbf ' size100m;20. Modifying the user tablespace sql> alter user user1 default Tablespace test_tbsp;21. See if the tablespace automatically expands sql> select file_name, Autoextensible,increment_by from Dba_data_files where tablespace_name= ' test_tbsp '; 22. Tablespace Turn on auto-expand sql> ALTER DATABASE DataFile '/home/oracle/oradata/test_tbsp.dbf ' autoextend on;23. tablespace off Auto-expand sql> ALTER DATABASE DataFile '/home/oracle /ORADATA/TEST_TBSP.DBF ' Autoextend off;24. Creating a tablespace create tablespace table space name datafile ' file path \ filename. dbf ' size 1024m;25. Create user and specify default tablespace and temp tablespace create user username identified by password default tablespace tablespace name temporary tablespace temporary tablespace name; 26. User Authorized Grant all PR Ivileges to Username;grant dba to username;27. Import DMP file (Sqlplus must be in front plus $): Imp username/password @ instance name file= file path \ filename. dmp full=y;28. Delete the current user and all data under it: Drop user username cascade;29. Delete the tablespace and all its data: Drop tablespace tablespace name including contents and datafiles;30. Sqlplus Disconnect the current user discon+ enter key 31. If you connect another user conn+ enter 32. View the current database name: Show parameter db_name;33. View the current user name, tablespace select Username, Default_tablespace from user_users;34. View all user names, tablespace select Username,default_tablespace from DBa_users;35. View the current instance name show parameter instance_name;36. Export the dmp file (the Sqlplus must be in front plus $) exp username/Password @ instance name file= file path \ filename. dmp full=y; 37.cmd Remote Connection Database sqlplus user name/password @ server ip:1521/instance name; 38.cmd Test database Connection tnsping service name or tnsping IP address: port number/  Database service name 39.NETCA refers to the network configuration Assistant is used to create, configure listening and service name 40.DBCA refers to the database Configuration tool, the main function is to create a database, configure the existing database options, delete the database and manage database templates.

Oracle Common Command Collection

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.