oracle--Common Commands

Source: Internet
Author: User

Oracle: Turn on monitoring
--lsnrctl start
Oracle: Start/Close Database
--sqlplus/nolog
--conn/as SYSDBA
--startup (Open)
--shutdown (OFF)
Oracle: Create a table space
1. Create a temporary table space
--create temporary tablespace XXX (name) tempfile ' xxxx.dbf (save file path) ' size 50m autoextend on next 50m maxsize 20480m extent Management local;
2. Create a data table space
--create tablespace XXX (name) logging datafile ' xxxx.dbf (save file path) ' size 50m autoextend on next 50m maxsize 20480m extent MA Nagement Local;
3. Create a user and specify a tablespace
--create User XXX (username) identified by XXX (password) default tablespace xxx (tablespace name) temporary tablespace xxx (temporary space name);
4. User authorization limit
--grant connect,resource,dba to XXX (username);
Oracle: View table space name, path, physical space size
--select Tablespace_name, file_id, file_name, round (bytes/(1024*1024), 0) Total_space from Dba_data_files ORDER by Tablespace_name;
Oracle: Modify Table Space size
--alter database DataFile ' xxx.dbf (save file path) ' Resize 1000M
Oracle: Delete Table space
--drop tablespace XXX (table space name)
Oracle: Deleting users
--drop User XXX (username) cascade; (Cascade Delete User--maybe the user created the object?)
Oracle: Database Backup and restore
First, backup
1. Fully export the database test, user Name System Password Manager exported to D:\daochu.dmp
--exp System/[email protected] file=d:\daochu.dmp full=y
2. Export the system user in the database and the SYS user's table
--exp System/[email protected] file=d:\daochu.dmp owner= (System,sys)
3. Export the tables in the database table1, table2
--exp System/[email protected] file=d:\daochu.dmp tables= (table1,table2)
4. Export the field filed1 in table table1 in the database with data beginning with "00"
--exp System/[email protected] file=d:\daochu.dmp tables= (table1) query=\ "where filed1 like ' 0% ' \"
Second, restore
1. Import the data from the D:\DAOCHU.DMP into the test database
--imp System/[email protected] file=d:\daochu.dmp full=y ignore=y
2. Import the table table1 in D:\daochu.dmp
--imp System/[email protected] file=d:\daochu.dmp tables= (table1)

oracle--Common 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.