什么技术不玩就会陌生,ORACLE控制文件举足轻重,接下来写一篇如何为ORACLE增加控制文件的文章。
首先查看当前控制文件的信息:
SQL> show parameter controlNAME TYPE VALUE------------------------------------ ----------- ------------------------------control_file_record_keep_time integer 7control_files string /u01/oradata/sansom/control01. ctl, /u01/oradata/sansom/contr ol02.ctl, /u01/oradata/sansom/ control03.ctl目前控制文件有3个,接下来我们用创建PFILE直接修改PFILE文件内容的方法增加控制文件,并放在不同的路径
[oracle@gard3 dbs]$ pwd/u01/oracle/dbs[oracle@gard3 dbs]$ ll-rw-r----- 1 oracle oinstall 1536 Nov 4 08:45 orapwsansom-rw-r----- 1 oracle oinstall 2560 Nov 22 03:23 spfilesansom.ora
目前/u01/oracle/dbs并没有PFILE文件,我们来创建它
SQL> create pfile from spfile;File created.SQL> ![oracle@gard3 dbs]$ lltotal 76-rw-r--r-- 1 oracle oinstall 974 Nov 22 03:36 initsansom.ora-rw-r----- 1 oracle oinstall 1536 Nov 4 08:45 orapwsansom-rw-r----- 1 oracle oinstall 2560 Nov 22 03:23 spfilesansom.ora打开initsansom.ora文件直接添加'/u01/oradata/backup/control04.ctl',并保存
sansom.__db_cache_size=176160768sansom.__java_pool_size=4194304sansom.__large_pool_size=4194304sansom.__shared_pool_size=92274688sansom.__streams_pool_size=4194304*.audit_file_dest='/u01/admin/sansom/adump'*.background_dump_dest='/u01/admin/sansom/bdump'*.compatible='10.2.0.1.0'*.control_files='/u01/oradata/sansom/control01.ctl','/u01/oradata/sansom/control02.ctl','/u01/oradata/sansom/control03.ctl','/u01/oradata/backup/control04.ctl'*.core_dump_dest='/u01/admin/sansom/cdump'*.db_block_size=8192
拷贝任意一个控制文件到backup目录下,并关闭数据库:
[oracle@gard3 dbs]$ cp /u01/oradata/sansom/control01.ctl /u01/oradata/backup/control04.ctl [oracle@gard3 dbs]$ exitexitSQL> shutdown immediateDatabase closed.Database dismounted.ORACLE instance shut down.使用pfile重新启动数据库:
SQL> startup pfile='/u01/oracle/dbs/initsansom.ora'ORACLE instance started.Total System Global Area 285212672 bytesFixed Size 1218992 bytesVariable Size 104859216 bytesDatabase Buffers 176160768 bytesRedo Buffers 2973696 bytesDatabase mounted.Database opened.SQL> show parameter controlNAME TYPE VALUE------------------------------------ ----------- ------------------------------control_file_record_keep_time integer 7control_files string /u01/oradata/sansom/control01. ctl, /u01/oradata/sansom/contr ol02.ctl, /u01/oradata/sansom/ control03.ctl, /u01/oradata/ba ckup/control04.ctlSQL>增加成功,可以删除老的spfile,用现在的pfile来创建spfile,控制文件添加完毕!