table of Contents
1. Install virtualbox
1.1 What is virtualbox
- virtualbox is a free virtual machine provided by oracle
- The virtual machine can make multiple operating systems run on the computer, for example, your computer can run xp, linux, mac systems
- Here use a virtual machine to install an xp system, and then install oracle in the xp system to facilitate learning oracle database
1.2 Install virtualbox
- Install in the next step
1.3 virtualbox running xp system
- 32-bit xp system
- Memory is set to 1g
- Choose a fixed size
- It is recommended to allocate 20G enough (the position can be adjusted, otherwise it is installed on the C drive by default)
- Remove hardware acceleration
- Enter
- Enter is slower (you can select fast by up and down keys)
- Enter the product key (MRX3F-47B9T-2487J-KWKMF-RPWBY)
- Custom computer name and password
- Other configurations can be the next step
- Opt out of automatic updates
- Just enter a name
- Next step, finish
- carry out
- ie also accessible
- Turn off firewall
1.4 Let the xp of the virtual machine communicate with the external system network
- The default xp ip is type A, which is different from the ip type C of the external host, and it cannot be pinged
- Different from the outside network segment
- Set the bridged network card in the settings, select (using network cable) local network card or (using wifi) wireless network card
- Successful ping (remember to turn off the firewall, otherwise it may cause ping failure)
2. Install oracle to the virtual machine xp system
- The version used here is oracle10, which is installed in the xp system of the virtual machine [it doesn’t matter which version you learn, the main thing to learn is the addition, deletion, modification and investigation of oracle]
2.1 Host and virtual machine shared directory
-
Prepare oracle installation package and 360 decompression, because there is no tool to decompress files in pure xp
-
Is to share the downloaded oracle database folder
-
Install enhancements
-
Restart xp
-
Successfully found the shared folder
-
Then copy the 10G compressed package to the c drive of xp, usually copy, otherwise there will be problems [experience], and then unzip
-
If there is no decompression tool, install a 360 decompression tool
-
Install 360 decompression
2.2 Install oracle10 to the virtual machine
- Unzip the file 10201_database_win32.zip, and double-click setup.exe in the unzipped directory, the installation interface appears, as follows:
- Enter the password and confirm the password, such as: orcl, click Next, and the following progress bar will appear.
Note: This password is the administrator password. [The password here is orcl]
- Check the prerequisites, check the selection box shown in the red box, as shown below
- Click "Next", the "Summary" interface appears, click "Install".
- The installation progress bar appears, wait for the installation to complete, as shown below:
- After the installation is complete, automatically run the configuration wizard, as shown in the figure below, and wait for it to complete:
- After completion, the "Password Management" interface appears, click "Password Management", as shown below:
- Remove the gap between SCOTT and HR users (unlock these two accounts), as shown in the figure below, click "OK": Set the password to be the same as the username
- Back to the "Password Management" interface, click "OK", as shown below:
- After the installation is over, click "Exit".
3. Host connect to oracle
3.1 Use oracleInstanceClient to connect to oracle
- Unzip to current
- Configure environment variables
- Open the terminal and enter the following command to log in to orcale [sqlplus hr/[email protected]:1521/orcl]
- Oracle can also be connected in xp, the principle is the same as above, the content after @ can be omitted when connecting
3.2 Backup XP system
- Back up the xp system to facilitate restoration of the system due to system errors and other problems
- Select the status of the backup to restore the backup
- You can also back up after completing some operations, and then select the current state to continue generating
4. Some basic concepts of oracle
oracle server
- Is a data management system (RDBMS), which provides open, comprehensive, and almost perfect information management
- Consists of one oracle database and multiple Oracle instances
oracle database and oracle instance
- Oracle database : The files that actually store data on the hard disk. These files are grouped together to form a logical whole, that is, the Oracle database. Therefore, the Oracle database refers to the logical collection of files on the hard disk. It must cooperate with the instance in the memory. Provide external data management services.
- Oracle instance : a data structure located in physical memory. It consists of a shared memory pool and multiple background processes. The shared memory pool can be accessed by all processes. If users want to access the data in the database, they must pass the instance Can only be realized, can not directly read the files on the hard disk
- Difference : An instance can operate a database. An instance can only be associated with one database at any time. In the case of multiple data, only one instance can operate on it.
Table space and database files
- The table space is composed of multiple data files, and the data file can only belong to one table space
- The table space is a logical concept, and the data file is a physical concept
Segment, area, block
- Segment exists in the table space
- Segment is a collection of districts
- Area is a collection of data blocks
- Data blocks will be mapped to disk blocks