Oracle learning Summary (1), oracle learning Summary

Source: Internet
Author: User

Oracle learning Summary (1), oracle learning Summary
1. Installation and download of oracle 1.1 oracle service: oracle listening service (OracleOraDb11g_home1TNSListener): it must be enabled to access the database through a program.
Oracle instance service: multiple databases can be created on an oracle software platform. Each database is created automatically.
1.2 oracle uninstallation: 1) uninstall the database normally:
Stop all oracle database services
Start the oracle uninstall program
After uninstallation, some residual system files and registry files may appear in the database, which cannot be deleted during normal operation of the operating system. Therefore, restart the computer and press F8 to enter safe mode.
Clear all oracle_related files, run “regedit.exe "at the same time to enter the registry, manually search for all oracle-related items, and delete them.
2) Half of the installation, over
In this case, uninstalling the program is no longer available. You can only delete the file directly.
To restart the computer, press F8 to enter safe mode.

Clear all oracle_related files, run “regedit.exe "at the same time to enter the registry, manually search for all oracle-related items, and delete them.

1.3 four major database user information: Super administrator: sys/change_on_install. This password cannot be used in actual work.
Common administrator: system/manager. This password cannot be used in actual work.
Normal User: scott/tiger, which needs to be unlocked. This user is a very classic user.

Big Data Users: (example solution database): sh/sh, which must be unlocked.


2. SQLPLUS basic command 2.1 the most important component of the formatting operation in the database is the data table (the table structure is the set of columns and columns). The following queries the data of the emp table.
SET the length of data displayed on each line: set linesize 300;
SET the number of data lines displayed on each page: set pagesize 30;


2.2 When you call the notepad command to write an SQL program, you need to write multiple lines. The command line cannot be processed and you need to call the local Notepad program. Enter the "ed file name"
If there is no file, you will be asked whether to create the file and select "yes". Then run the program code ." @ File name "(SQL suffix can be left blank ). This method is suitable for operating systems that do not display interfaces.
If you have an operating system, you can directly write it in a text editor and copy it directly.
If there is a file on the disk, you must enter the complete path, for example, "d: \ my.txt.
Generally, the suffix *. SQL is called a database script file.
2.3 oracle provides a total of four users. The following syntax can be used to switch between the four users:
CONN username/password [as sysdba]
If you are currently using a SYS account, you must write "as sysdba". After logon, you can use "show user" to find the current USER.
Example: Log On With sys:
CONN sys/change_on_install as sysdba;
Log On with scott
CONN scott/tiger;
 
2.4 calling the local command in sqlplus can directly call the local doscommand, such as the copy command:
Copy source file path target file path
For example, copy d: \ my.txt d: hello.txt
If you want to call it locally: Add a HOST
Example: Call the local copy command
Host copy d: \ my.txt d: hello.txt
 
 
 

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.