Oracle database various commands

Source: Internet
Author: User

Basic commands

Sqlplus/as sysdba--Command line open Oracle (logged in as DBA)

Drop User myusers cascade;--delete users (Cascade)

Create user myusers identified by 123;--creating users (user name: Myusers. Password: 123)

Grant Connect,resource to myusers;--authorization

Grant DBA to myusers;--Grant DBA authority

Connect myusers/zyt;--to the user you just created

------------------------------------------------------
Oracle Import DMP File command

1. First go to cmd command window

2. Execute command: IMP userid= username/password @orcl file=d:\nc60.dmp full=y
Explain
User name: Is your target user.
Password: Is your target user login password.
ORCL: Is the instance name is the database name.
File: Is the full path of the DMP file you are importing.
Full=y whether all imports are available only when the current user is a DBA.

--------------------------------------------------------

Oracle Import DMP File command

Exp System/[email protected] file=d:/daochu.dmp owner= (system,sys)--Export the system user in the database with the table of the SYS user

--------------------------------------------------------

Create a sequence
CREATE SEQUENCE hibernate_sequence MINVALUE 1 MAXVALUE 999999999999999999999999

Add foreign key

ALTER TABLE EMP_JOBMSG
Add constraint fk_emp foreign key (dep_id)
References Department (dep_id) on delete set null;

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.