Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

Oracle 11g R2 DBA Operation Guide for oracle Reading Notes (the first three chapters)

2025-01-25 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >

Share

Shulou(Shulou.com)06/01 Report--

Oracle 11g R2 DBA operation guide is the first book I learned about oracle database knowledge. I record my learning notes here, and verify the knowledge points in the book through practical operation.

1.Oracle Database Foundation 1.1. Relational database 1.1.1. Relational database model

1. Three core concepts of relational database model: relationship, attribute and domain

two。 Relationships: tables made up of rows and columns

Attributes: columns in relationship

Fields: a collection of column values

3. Each row is called a tuple

4. Rules of relational data model:

⑴ the order of the columns in a table is arbitrary

⑵ the attribute value of each tuple cannot be the same, and the attribute corresponding to each tuple will contain a value.

5. Keys: a tuple can be determined by a key, and the key can be composed of one or more attributes.

1.1.2. Founder of relational data model

1. Cod

1.3. Database RDBMS

1. RDBMS: relational database management system

2. Functions: data definition, database creation, database maintenance, data manipulation, database operation management

1.4.SQL language

1. SQL: structured query language

2. The classification of SQL language:

⑴ data manipulation statement: query or manipulate data in existing scheme objects, such as select, insert,update,delete, etc.

⑵ data definition statements: define or modify scheme objects, such as create,rename, etc.

⑶ transaction control statements: manage DML statements to modify data and organize logically related DML statements into transactions

⑷ session control statements: manage attributes of a user's session

⑸ system control statement: modify the properties of the instance. Alter system is the only system control statement.

⑹ embedded SQL statement

two。 2.1.windows environment for database installation

1. The listener is used when accessing the database server through the network. The client connects to the database through the connection tool or program, and the listener is responsible for handing over the user request to the database server process.

2. Check the status of the listener: lsnrctl status

3. Sqlplus tool location under windows

4. Unlock the scott user with the alter user scott identified by password account unlock; and set the password. The default password for the scott user is tiger.

5. If you accidentally delete scott users or data, you can use the $ORACLE_HOME\ RDBMS\ ADMIN\ scott.sql script to restore it.

2.2.Linux environment

1 、

2. Required software catalog

Top-level directory of ⑴ Oracle Base:Oracle software, recommended as / mount_point/app/software_owner

⑵ Oracle Inventory:

3. Database startup and shutdown 3.1. Start database 3.1.1. Database startup process

1. Three states of database startup

Nomount status: only open the database instance and read the parameter file

Mount status: ORACLE finds and opens the control file according to the location of the control file recorded in the parameter file, and reads various parameter information in the control file, such as the location of the data file and log file

Open status: open the data file and perform a series of checks for data recovery

3.1.2. Boot to nomount state

1. When the database starts to nomount state, it opens the database instance, reads the parameter files, and starts five necessary background processes: DBWR (database writing process), LGWR (log writing process), SMON (system monitoring process), PMON (process monitoring process), and CKPT (checkpoint process).

2 、

3. The startup process of the database is recorded in the alarm tracking file and the method of querying the directory

The file name is alert_orcl.log

4 、

This is because in the nomount state, the v$controlfile dynamic view, if the control file is not opened, can not query the location of the control file, while the nomount state does not open the control file; we can get the location of the control file through the v$parameter dynamic view

3.1.3. Database booted to mount state

1. Two ways for database to start to mount state

⑴ direct startup mount

⑵ starts to nomount state before using alter database mount

2. This is where we can view the v$controlfile dynamic view to get the information about the control file, because in the mount state, the control file is opened.

3.1.4. Database booted to open state

1. Two ways for database to start to open state

⑴ starts directly using startup open or startup

⑵ starts to mount state first, and then starts using alter database open

3.2. Close database 3.2.1. Database shutdown process

1 、 close → dismount → shutdown

Close data files, log files (to mount status): alter database close

Close the control file (to nomount status): alter database dismount

Shut down the instance (shut down the instance completely): shutdown

2. You can completely shut down the database by using shutdown directly, but it is usually used in combination with parameters

⑴ shutdown normal: by default, new database connections are not allowed when the database is closed, and the database will be closed only when all current connections are exited. This is the safest way to close the database, but it will take a lot of time because of the number of connections.

⑵ shutdown immediate: shuts down the database quickly and securely, interrupts current transactions, rolls back uncommitted transactions, forcibly disconnects all user connections, and performs checkpoints to write dirty data to data files, but also affects the speed of shutdown because of the number of transactions and user connections

⑶ shutdown transactional: when the database is closed, the current connection continues to execute, but new connections are not allowed. Once all current transactions are completed, the database is closed.

⑷ shutdown abort: an unsafe shutdown method that disconnects all current user connections, rejects new connections, disconnects all current executing transactions, and shuts down the database immediately; database recovery is required when the database is restarted because it does not roll back outstanding transactions or perform checkpoints

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 246

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Database

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report