Open oracle database command

Summary of several ways to shut down and start Oracle

Summary of several ways to shut down and start Oracle: there are several ways to start: 1, startupnomount non-installation start, this way to start under the execution: rebuild the control file, re

Several ways to shut down and start Oracle Summary:

There are several ways to start:

1, startupnomount

Non-installation start, this way to start under the execution: rebuild the control file, rebuild the database

Read init.ora file, start instance, that is, to start the SGA and the background processes, this startup only need to init.ora file.

2, startupmountdbname

Installation start, this way under the start can perform:

Database log archiving,

Database media recovery,

Make the data files online or offline,

Relocation of the data files, redo log files.

Execute “nomount” and then open the control file to confirm the location of the datafiles and online log files,

but do not check the checksum of the datafiles and log files at this time.

3. startupopendbname

First execute “nomount”, then execute “mount”, and then open all the database files, including the Redolog file.

This way you can access the data in the database.

4. startup

Equal to the following three commands




5. startuprestrict

The constrained mode startup





5. p>startuprestricted

This way can start the database, but only allow users with certain privileges to access

Nonprivileged users to access, the following message will appear:


ORA-01035:ORACLE only allows users with RESTRICTEDSESSION privileges to access the database. Use

6, startupforce

Forced startup method

When you can not shut down the database, you can use startupforce to complete the database shutdown

Shut down the database first, and then execute the normal startup database commands

7, startuppfile=parameter file name

Startup with initialization parameter file

First read the parameter file, and then start the database according to the settings in the parameter file

Example: startuppfile=E:Oracleadminoradbpfileinit.ora

8. startupEXCLUSIVE

There are three types of shutdowns. p>

There are three ways to shut down:

1, shutdownnormal

Normal way to shut down the database.

2. shutdownimmediate

The immediate way to shut down the database.

Executing shutdownimmediate in SVRMGRL, the database is not shut down immediately,

but it is shut down after Oracle performs certain cleanup work (terminating the session, releasing session resources),

when using shutdown cannot shut down the database. shutdownimmediate accomplishes the database shutdown.

3. shutdownabort

Directly shut down the database, the session that is accessing the database will be abruptly terminated,

If there are a large number of operations being executed in the database, it will take a long time to restart the database after executing shutdownabort.

What is the linux command to turn on oracle service?

If your oracle installation and configuration are fine:






< p>$ps-ef|greporacle

1. Start the database:

The following is quoted:

[emailprotected]:~ sqlplus/nolog

SQL*Plus:Release9. ProctiononFriJan20 02:29:372006

Copyright(c)1982,2002,OracleCorporation.Allrights reserved.


Connectedtoanidle instance.



TotalSystem GlobalArea135352820bytes


VariableSize 109051904bytes


RedoBuffers679936 bytes


Oracle Database Basic Common Commands Summary

The following is a summary of the basic common commands of the database in Oracle

Get the database name and creation date SELECTnamecreatedlog_modeopen_modeFROMv$database;

The host name of the computer of the ORACLE database ORACLE database instance name and version information of the ORACLE database management system SELECThost_nameinstance_nameversionFROMv$database;

ORACLE database computer host name ORACLE database instance name and ORACLE database management system version information SELECThost_nameinstance_nameversionFROMv$instance;

In order to know oracle database version of some of the special information SELECT*fromv$version;

To get the control file name SELECT*fromv$controlfile;

To get the redo log configuration information of Oracle database SELECTgroup# membersbytesstatusarchivedFROMv$instance;

To know some special information about the version of oracle database SELECTgroup# membersbytesstatusarchivedFROMv$log;selectGROUP#MEMBERfromv$logfile;

Get the configuration information for each redo log (member) file stored in the oracle select*fromv$ logfile;

Know the backup and recovery strategy for the ORACLE database and the archive files in the archiveloglist

Know how many tablespaces there are in the ORACLE database and the status of each tablespace selecttablespace_nameblock_sizestatuscontentslogging sizestatuscontentsloggingfromdba_tablespaces;selecttablespace_namestatusfromdba_tablespaces;

Know which disk each tablespace exists on and the name of the file. SELECTfile_idfile_nametablespace_namestatusbytesfromdba_data_files;selectfile_nametablespace_namefromdba_data_files;

Knowing How many users are on the Oracle database system and when they were createdselectusernamecreatedfromdba_users;selectusernameDEFAULT_TABLESPACEfromdba_users;

Getting information out of the control file involves the following related commands The following are some of the relevant commands

Copy the code code is as follows:select*fromv$archivedselect*fromv$archived_logselect*fromv$backupselect*fromv$databaseselect*fromv$ datafileselect*fromv$logselect*fromv$logfileselect*fromv$loghistselect*fromv$tablespaceselect*fromv$tempfile

The control file consists of two main parts, the reusable part and the The size of the reusable section can be controlled by the CONTROL_FILE_RECORD_KEEP_TIME parameter. The default value of this parameter is days, which means that the contents of the reusable section will be retained for days and may be overwritten after one week. The reusable section is available to the Recovery Manager. The contents of the reusable section can be automatically expanded. You can use the following keywords (parameters) in the CREATDATABASE or CREATCONTROLFILE statement to indirectly affect the size of the non-reusable section


Viewing Control File Configuration SELECTtyperecord_sizerecords_totalrecords_used FROMv$ controlfile_record_section;

If your display is split into two sections you will need to format the output first using a SQL*Plus command similar to setpagesize The relevant formatting output commands are the following record_size is the number of bytes allocated per record records_total is the number of bytes allocated to the section records_total is the number of bytes allocated to the section records_total is the number of bytes allocated to the section records_total is the number of bytes allocated to the section total is the number of records allocated to the segment records_used is the number of records used by the segment

Knowing the records used by all DATAFILE, TABLESPACE, and REDOLOG in the control file SELECTtyperecord_sizerecords_total is the number of records used by the segment. sizerecords_totalrecords_usedFROM v$controlfile_record_sectionWHEREtypeIN(‘DATAFILE’TABLESPACE’ REDOLOG);

Get control file names selectvaluefromv$parameterwherename=control_files; or select*fromv$controlfile

How do you add or move control files in an installed Oracle database? Here are the steps to add or move a control file to an installed Oracle database

aUse the data dictionary v$controlfile to get the name of an existing control file

bShut down the Oracle database normally

cAdd the name of the new control file to the CONTROL_FILES parameter of the parameter file

cAdd the new control file name to the parameter file in the CONTROL_FILES parameter of the parameter file

dCopy the existing control file to the specified location using the operating system’s copy command

eRestart the Oracle database

fVerify that the new control file name is correct using the data dictionary v$controlfile

gIf there is an error, redo the above if there is none and delete the old control file if there is no error. delete the old control file if it is not useful

Note If you are using the Server Initialization Parameter File (SPFILE) you cannot shut down the Oracle database and should change the location of the control file by using the altersystemsetcontrol_files Oracle command at step

Copy the code code as follows:SQL> altersystemsetcontrol_files altersystemsetcontrol_files=’D:\Disk\CONTROLCTL’D:\Disk\CONTROLCTL’D:\Disk\CONTROLCTL’D:\Disk\CONTROLCTLSCOPE= SPFILE;

Since the control file is an extremely important file in addition to the above mentioned protection measures of storing multiple copies of the control file on different hard disks, you should make a backup of the control file immediately after a change in the structure of the database. you can use the Oracle command to make a backup of the control file. alterdatabasebackupcontrolfileto’D:\backup\controlbak;

You can also back up the control file to a trace file that contains the SQL statements needed to rebuild the control file. You can use the following SQL statements to generate this trace file alterdatabasebackupcontrolfiletotrace;


Starting oracle database commands

(1) startup (log in to the database software with the sys user or another user who has the privilege to start the database, and then execute the command, if there are multiple instances, please confirm the SID before starting), the database has three states: nomount, mount, and open, and the default state is open, and if the other two states are opened, then the state can be changed by the alter command. The database has three states, nomount, mount, and open, and is open by default. If it is open to the other two states, then you can change the state by using the alter command.

(2) if it is in rac to stop the database node, then there is a special command srvcrl (this is only the operator of the command, followed by parameters, parameters I will not write, you can look up the specifics, the Internet a lot of content with the even), and there is also crscrl (start and stop the crs service commands, the same is the operator, followed by parameters, and not written here, just check yourself). (3) start the database there is a command is to start listening, lsnrctl command (the same parameters, can start and stop, you can also query the state of listening, this listening to the basic commands)

Restart database command oracle

On the command window, type: sqlplus/nolog

2. Execute the command: connsys/assysdba passphrase: your password for logging in to the database

3. When you see that you have connected, execute the command: shutdownimmediate

4. Finally, execute startup, the following figure appears, indicating that you have successfully restarted the Oracle database.