In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-17 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >
Share
Shulou(Shulou.com)06/01 Report--
Oracle database startup and shutdown mode
To start and shut down the database, you must log in as a user with Oracle administrator privileges, usually as a user with SYSDBA privileges. Generally speaking, we often use INTERNAL users to start and shut down databases (INTERNAL users are actually synonymous with SYS users using SYSDBA connections). The new version of the Oracle database will phase out the internal user INTERNAL, so we'd better set the DBA user to have SYSDBA privileges.
Two: it takes three steps to start a database
1. Create an instance of Oracle (non-installation phase)
2. Install the database by the instance (installation phase)
3. Open the database (open phase)
Three: Startup (start database command)
1 、 STARTUP NOMOUNT
The NONOUNT option simply creates an instance of Oracle. Read the init.ora initialization parameter file, start the background process, initialize the system global area (SGA). The Init.ora file defines the instance configuration, including the memory structure size and the number and type of background processes started. The instance name does not have to be the same as opening the database name according to the Oracle_SID setting. When the instance is opened, the system displays a list of SGA memory structure and size, as shown below:
SQL > startup nomount
The ORACLE routine has been started.
Total System Global Area 35431692 bytes
Fixed Size 70924 bytes
Variable Size 18505728 bytes
Database Buffers 16777216 bytesu
Redo Buffers 77824 bytes
2 、 STARTUP MOUNT
This command creates an instance and installs the database, but does not open the database. The Oracle system reads the contents of the data file and redo log file in the control file, but does not open the file. This opening method is often used in database maintenance operations, such as renaming data files, changing redo logs, opening archives, and so on. In this open mode, in addition to seeing the list of SGA systems, the system will also give a "database loaded" prompt.
3 、 STARTUP
This command completes all three steps of creating an instance, installing an instance, and opening the database. At this point, the database brings the data file and redo log file online, and one or more rollback segments are usually requested. At this time, the system will not only see all the prompts in the previous Startup Mount mode, but also give a "database has been opened" prompt. At this point, the database system is in a normal working state and can accept user requests.
If you use the STARTUP NOMOUNT or STARTUP MOUNT database open command, you must use the ALTER DATABASE command to perform the open database operation. For example, if you open the database in STARTUP NOMOUNT, that is, the instance has been created, but the database is not installed and opened. You must run the following two commands for the database to start correctly.
ALTER DATABASE MOUNT
ALTER DATABASE OPEN
4. Other opening methods
In addition to the three database opening options described above, there are other options.
(1) STARTUP RESTRICT
In this way, the database will be opened successfully, but only some privileged users (users with the DBA role) will be allowed to use the database. This method is often used to maintain the database, such as when data import / export operations do not want other users to connect to the database to manipulate data.
(2) STARTUP FORCE
This command is actually a combination of forcibly closing the database (shutdown abort) and starting the database (startup). This command is used only if there is a problem with shutting down the database.
(3) ALTER DATABASE OPEN READ ONLY
This command opens the database as read-only after creating the instance and installing the database. For those who only provide query function, the product database can be opened in this way.
Four: database shutdown (SHUTDOWN)
1 、 SHUTDOWN NORMAL
This is the default option for the database shutdown SHUTDOWN command. That is to say, if you issue a SHUTDOWN command like this, it means SHUTDOWN NORNAL.
After issuing this command, any new connections will no longer be allowed to connect to the database. Before the database shuts down, Oracle will wait for all currently connected users to exit from the database before starting to shut down the database. Shutting down the database in this way does not require any instance recovery at the next startup. It is important to note, however, that in this way, it may take several days or longer to shut down a database.
2 、 SHUTDOWN IMMEDIATE
This is a way we often use to close the database. We want to close the database quickly, but we often use this way to make the database clean.
The SQL statement that is currently being processed by Oracle is interrupted immediately, and any uncommitted transaction in the system is rolled back. If there is a long uncommitted transaction in the system, it will also take some time to shut down the database in this way (the transaction rollback time). The system does not wait for all users connected to the database to exit the system, forcibly rolls back all currently active transactions, and then disconnects all connected users.
3 、 SHUTDOWN TRANSACTIONAL
This option is available only after Oracle 8i. This command is often used to plan the shutdown of the database, which makes the current connection to the system and the execution of the active transaction complete, and after running the command, any new connections and transactions are not allowed. After all active transactions are completed, the database shuts down the database in the same way as SHUTDOWN IMMEDIATE.
4 、 SHUTDOWN ABORT
This is the last move to shut down the database, and it is only when there is no way to close the database that you have to adopt the method, which is generally not used. You can consider shutting down the database in this way if the following occurs.
Start the database
SQL > conn / as sysdba
SQL > alter database mount
SQL > alter database open
Shut down the database
SQL > shutdown immediate
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: 0
*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.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.