cold back up the database and modify the nls_character
2011-12-06 15:55
555 查看
1. Backup the database full.
1.1. query the file information
--After execute the information, save it to a file to query it later.
1.2.generate the backup scripts in linux/unix.
--After execute the information, save it to a file to query it later.
1.3. shutdown the database.
1.4.After completely shutdown the db, execute the OS scripts &1 from step 2.
After execute the copy process, nagative to the db_backup folder and check the backup is complete.
1.5.startup the database.
2. Modify the nls_character
1.1. query the file information
--After execute the information, save it to a file to query it later.
set echo off conn /as sysdba set head on set pages 100 col file_type format a8 col file_name format a50 select * from ( select 'SPFILE' as "file_type",value as "file_name",1 as "file_size(M)" from v$parameter where name ='spfile' UNION select 'CONTROL' as "file_type",name as "file_name",round(BLOCK_SIZE*FILE_SIZE_BLKS/1024/1024,2) as "file_size(M)" from v$controlfile UNION select 'REDOLOG' as "file_type",v$logfile.member as "file_name",round(v$log.bytes/1024/1024,2) as "file_size(M)" from v$log,v$logfile where v$log.group#=v$logfile.group# UNION select 'TEMP' as "file_type",name as "file_name",round(bytes/1024/1024,2) as "file_size(M)" from v$tempfile UNION select 'DATAFILE' as "file_type",name as "file_name",round(bytes/1024/1024,2) as "file_size(M)" from v$datafile ); select sum("file_size(M)") as "total_size(M)" from ( select 'SPFILE' as "file_type",value as "file_name",1 as "file_size(M)" from v$parameter where name ='spfile' UNION select 'CONTROL' as "file_type",name as "file_name",round(BLOCK_SIZE*FILE_SIZE_BLKS/1024/1024,2) as "file_size(M)" from v$controlfile UNION select 'REDOLOG' as "file_type",v$logfile.member as "file_name",round(v$log.bytes/1024/1024,2) as "file_size(M)" from v$log,v$logfile where v$log.group#=v$logfile.group# UNION select 'TEMP' as "file_type",name as "file_name",round(bytes/1024/1024,2) as "file_size(M)" from v$tempfile UNION select 'DATAFILE' as "file_type",name as "file_name",round(bytes/1024/1024,2) as "file_size(M)" from v$datafile );
1.2.generate the backup scripts in linux/unix.
--After execute the information, save it to a file to query it later.
conn /as sysdba set head off set feedback off set pages 0 set echo off select 'cp '||"file_name"||' &1' from ( select 'SPFILE' as "file_type",value as "file_name",1 as "file_size(M)" from v$parameter where name ='spfile' UNION select 'CONTROL' as "file_type",name as "file_name",round(BLOCK_SIZE*FILE_SIZE_BLKS/1024/1024,2) as "file_size(M)" from v$controlfile UNION select 'REDOLOG' as "file_type",v$logfile.member as "file_name",round(v$log.bytes/1024/1024,2) as "file_size(M)" from v$log,v$logfile where v$log.group#=v$logfile.group# UNION select 'TEMP' as "file_type",name as "file_name",round(bytes/1024/1024,2) as "file_size(M)" from v$tempfile UNION select 'DATAFILE' as "file_type",name as "file_name",round(bytes/1024/1024,2) as "file_size(M)" from v$datafile );
1.3. shutdown the database.
conn /as sysdba shutdown immediate;
1.4.After completely shutdown the db, execute the OS scripts &1 from step 2.
After execute the copy process, nagative to the db_backup folder and check the backup is complete.
1.5.startup the database.
conn /as sysdba startup open;
2. Modify the nls_character
conn / as sysdba; select userenv('language') from dual; shutdown immediate; startup mount; show parameter job_queue_processes; show parameter AQ_TM_PROCESSES; alter system enable restricted session; alter system set job_queue_processes =0; alter system set aq_tm_processes = 0; alter database open; alter database character set INTERNAL_USE WE8MSWIN1252; select userenv('language') from dual; alter system set job_queue_processes =&1; alter system set aq_tm_processes = &2; alter system disable restricted session; prompt complete.
相关文章推荐
- How to back up the BlackBerry Configuration Database(备份BES数据库)
- Backing Up and Restoring the Database
- How to Back Up and Restore a MySQL Database
- theprogresscreateandmodifyDatabase
- [Drupal] Submit and redirect back to the modify page
- The difference between VNLS_PARAMETERS and NLS_DATABASE_PARAMETERS
- Postgre back up and migrate database
- Navigation with Back and Up
- Relation Databases Index Design and the Optimizers翻译
- image to DataBase and show the image
- 190 The database is configured in ARCHIVELOG mode and regular complete database backups are taken. T
- [转载]Back up all of your mysql databases nightly
- Restore SQL Server 2005 error : "The tail of the log for the database "TEST1" has not been backed up."
- What is the difference between database table and database view?
- 133.Your database is open and the LISTENER listener is running. The new DBA of the system stops the
- 【Oracle Mgmt】Oracle Character Semantics (NLS_LENGTH_SEMANTICS) and etc...
- Setting Up the Development Environment for SharePoint 2010 on Windows Vista, Windows 7, and Windows
- Prepare to back up and restore a farm (Office SharePoint Server 2007)
- CS231n Neural Networks Part 2: Setting up the Data and the Loss
- OpenGL ES From the Ground Up, Part 6: Textures and Texture Mapping