Management of Oracle

Source: Internet
Author: User

Start and stop Oracle

Stop and start Oracle needs to be switched to Oracle user only, no other user has this permission




Run Sqlplus but don't log in to Oracle:sqlplus/nolog

Connect to the Oracle server with the privileges of the system administrator: Conn/as SYSDBA;


Start Oracle:startup


Oracle's Listener

Oracle's listener, equivalent to Oracle's TCPServer, will listen on this port at 1521. All ORAC clients require listener to connect to Oracle server.

Start: Exit SQL, enter Lsnrctl enter interface, start, enter, if see success, then start successfully, quit can, other users can connect to Oracle server through listener.


Close database: First: Sqlplus/nolog connection: Conn/as sysdba

Close: Shutdown

Shutdown parameter Description:

-normal Normal shutdown

-immediate Immediate shutdown

-abort give up everything and close immediately

-transacitional: Minimize the impact on the client, to avoid customer loss of information

Sqlplus is one of the most commonly used tools, with strong features, mainly:

1. Database maintenance, which generally operates on the server and cannot be operated remotely

2. Execute SQL statement to execute PL/SQL

3. Execute SQL Script

4. Export of data, report

5. Application development, Test SQL/PLSQP

6. Generate a new SQL script

7. For application calls, such as the installation of scripts in the installation program

8. User management and rights maintenance.

Common commands:

Conn:conn username/password @ NETWORK SERVICE name

Show User: Description shows current users

@script. sql: Description: Execute the specified SQL script file

Quit Description: The command disconnects from the database and exits the Sqlplus

Log in to Oracle:

Method 1:sqlplus username/user Password @ user name

Method 2:conn username/user Password @ user name

Spool

This command can output the contents of the Sqlplus screen to the specified file.

Case:

Sql>spool A.txt

Select *from tablename;

Sql>spool off

A.txt files are generated in the current directory

Linesize: Sets the width of the display line, which is 80 characters by default

Sql>show linesize

Sql>set Linesize 90

PageSize: Sets the number of rows to display per page, default is 14, and uses the same as linesize. The use of other environmental parameters is similar

Character Set display configuration:

Sqlplus determines the display language by using the Nls_lang environment variable in the. bash_profile

nls_lang= "Simplified Chinese_china. ZHS16GBK "

Representative of Traditional Chinese GBK

nls_lang= "Simplified Chinese_china. Al32utf8 "

Representative Simplified Chinese Utf-8

The character set of the Oracle server side in Sqlplus

Select Usereny (' language ') from dual;

Create User:

In Oracle, to create a new user using the Create USER statement, you typically have DBA (database administrator) permissions to use.

Basic syntax: Create user username identified by password

Create user Dbuser1 identified by Dbuser1

User Empowerment Grant:

Overview: A new user is created without any permissions, or even the permissions of the logged-on database, and you need to specify the appropriate permissions for it. Assign permissions to a user using command grant, reclaim permissions using the command revoke

Basic syntax: Grant permissions/role to User

Grant Connent,resource to Dbuser1;

Change Password: If you change your password, you can use it directly.

-password User Name

If you change the password for someone else, you need to have DBA authority, or have alter user's system permissions

Alter user username identified new password

Delete users: Drop user username

Overview: One class as a DBA to delete a user

General: Drop user username

Drop User Dbuser1

This article is from the "11182780" blog, please be sure to keep this source http://11192780.blog.51cto.com/11182780/1871423

Management of Oracle

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.