No nonsense, just like the question.
-
- View Current Database Mode
Connect to the database and enter the following command:
SQL> archive log list;You can view the current database mode. If "Database Log mode is not archive mode", you need to switch the following process.
-
- Before switching, make sure that the following parameters are set
The log_archive_dest_n parameter sets the log archiving target, where n is replaced by a number. In Oracle9i, the range of N is 1 ~ 5. N in Oracle10g can be set to 1 ~ 10. The settings are as follows:
SQL> alter system set log_archive_dest_1 = "location = path" Scope = both;PATH is the folder path for storing archived log files. The final scope = both is used to apply the settings to the current database instance and save the parameter settings to spfile. When the database is restarted, the parameter information in spfile is loaded directly.
You can set multiple archiving log targets. Set multiple targets. archive log files can be saved to multiple archive versions at the same time during archiving. It is a good habit to set multiple targets, although it does not seem necessary before a problem occurs.
- Close Database SQL> shutdown immediate
Closing a database usually does not cause any problems, but after the database is put into use, closing the database must be a last resort (even if you deliberately close it, it must be very forced, huh, huh) -- It is best to make sure that no one is using the database. Otherwise, there will be your wait ^_^.
- The database is suspended.
SQL> startup Mount This step will only result in a real problem. The Mount fails to be started for countless times. It is a listener.ProgramYou cannot listen to your current routine. Of course, such problems will not occur here if the listener is properly configured. Since there is a problem with the listener, let's start from here. You can find listener in the installation directory of the Oracle database (path may be E: \ oracle \ product \ 10.2.0 \ db_1 \ Network \ ADMIN. ora parameter files can be opened in Notepad for editing and saving. Of course it is not wise to manually modify this file, because the brackets in it can destroy countless brain cells. The net manager component is usually installed by default when oracle is installed. It helps you easily configure annoying parameters of the listener:
Oracle Net configuration listener, select "Database Service" in the top drop-down box on the right of the form ". If you have not listened to the database service, this is the key to solving the problem. Add a database. The global database and Sid are set to the same value as SERVICE_NAME in the tnsnames. ora file (Note: The tnsnames. ora file is in the same directory as the listener. ora file ). Save, more settings will be added in listener. ora, as shown below:
Sid_list_listener =
(Sid_list =
(Sid_desc =
(Global_dbname = Orcl)
(ORACLE_HOME = E: \ oracle \ product \ 10.2.0 \ db_1)
(Sid_name = Orcl)
)
) The complete content is not configured in the red part of the formal listener. If you have configured the content, you can solve the problem that the database cannot be suspended. Note that the SERVICE_NAME in the tnsnames. ora file is orcl. Of course, the listener is not immediately applied to the listener after the listener parameters are configured. We also need to re-load the listener and enter the command line:
C :\ > LSNRCTL
LSNRCTL > Reload
After a database is reconnected, the result is "connected to the idle routine ". In this case, startup mount is enabled, and the instance is suspended.
- switch mode in the suspended Data Warehouse routine
code highlighting produced by actipro codehighlighter (freeware)
http://www.CodeHighlighter.com/
--> SQL > alter system archivelog;
the system prompts "the database has been changed ". After opening the database, use archive log list to view the current mode: Database Log mode archive mode.
- Open Database SQL> Alter Database Open;
The pending database is not actually available. Only the opened database is a running routine.
- End work
Enable automatic archiving
SQL > Alter System Set log_archive_start = true; Scope = both;
Manual archiving;
SQL > Alter System switch logfile ; -- Manual archiving can be performed to check whether the above settings have been applied to the current database
Set the size of the flash Zone
SQL > Alter System Set Db_recovery_file_dest_size = 5368709102; -- 5g
- Other problems
During the switching mode, I also encountered a problem, that is, when I opened the spfile with a Wordpad, I accidentally pressed save. Small storage poses a big problem. spfile is a binary file, although the WordPad can open and normally browse most of the content, it cannot read the file ID in the first line of the file (normally, the first line of opening the file with the WordPad is garbled, the key is ). Save it. The spfile is changed to plain text. It is easy to read, but oracle doesn't know it. No way. Create another one.
Rebuilding spfile requires pfile in the system. The good thing about pfile is that it is a text file named pai_^. Generally, it has already been created while the database is being created. Its path may be as follows: e: \ oracle \ product \ 10.2.0 \ admin \ orcl \ pfile \. In this path, there is a file starting with init. ora.. The file name ends with a string of numbers (by default ). Connect to the idle routine of the database as sysdba (the database cannot be started without spfile and can only be connected to the idle routine such as Conn/As sysdba). The command to recreate the spfile is as follows:
SQL > Create Spfile = ' E: \ oracle \ product \ 10.2.0 \ db_1 \ DBS \ spfileorcl. ora ' From Pfile = ' E: \ oracle \ product \ 10.2.0 \ admin \ orcl \ pfile \ init. ora .************ ' ;
If the reconstruction is successful, the system prompts "the file has been created ". After creating a new spfile, the database can be started normally. However, remember to use the system command alter system set... scope = spfile; to modify the spfile content.