客户有个RAC,觉得太难管,不想弄,想做成双机
今天在LINUX上测试了下下,ORACLE方面的
SQL> create pfile='/tmp/init.ora' from spfile;
File created.
[oracle@westzq1 ~]$ srvctl stop database -d rac9i
*********************************************************************************
[oracle@westzq1 ~]$ cat /tmp/init.ora
#*.background_dump_dest='/oracle/ora9/admin/rac9i/bdump'
*.background_dump_dest='/oracle/ora9/admin/single/bdump'
#*.cluster_database_instances=2
#*.cluster_database=true
#rac9i1.cluster_database=TRUE
*.compatible='9.2.0.0.0'
*.control_files='/dev/raw/raw3','/dev/raw/raw2'
#*.core_dump_dest='/oracle/ora9/admin/rac9i/cdump'
*.core_dump_dest='/oracle/ora9/admin/single/cdump'
*.db_block_size=8192
*.db_cache_size=25165824
*.db_domain=''
*.db_file_multiblock_read_count=16
*.db_name='rac9i'
*.fast_start_mttr_target=300
*.hash_join_enabled=TRUE
#rac9i1.instance_name='rac9i1'
#rac9i2.instance_name='rac9i2'
#rac9i2.instance_number=2
#rac9i1.instance_number=1
*.instance_name='single'
*.java_pool_size=0
*.large_pool_size=8388608
#rac9i2.local_listener='(address=(protocol=tcp)(host=westzq2)(port=1521))'
#rac9i1.local_listener='(address=(protocol=tcp)(host=westzq1)(port=1521))'
*.log_archive_dest_1='LOCATION=/oracle/ora9/arch MANDATORY REOPEN'
*.log_archive_format='%t_%s'
*.log_archive_start=TRUE
*.open_cursors=300
*.parallel_max_servers=50
*.pga_aggregate_target=25165824
*.processes=150
*.query_rewrite_enabled='FALSE'
#*.remote_listener='LISTENERS_RAC9I'
#rac9i2.remote_listener='(address=(protocol=tcp)(host=westzq1)(port=1521))'
#rac9i1.remote_listener='(address=(protocol=tcp)(host=westzq2)(port=1521))'
*.remote_login_passwordfile='exclusive'
*.shared_pool_size=83886080
*.sort_area_size=524288
*.star_transformation_enabled='TRUE'
#rac9i1.thread=1
#rac9i2.thread=2
*.timed_statistics=TRUE
*.undo_management='AUTO'
*.undo_retention=10800
#rac9i1.undo_tablespace='UNDOTBS1'
#rac9i2.undo_tablespace='UNDOTBS2'
*.undo_tablespace='UNDOTBS1'
##*.user_dump_dest='/oracle/ora9/admin/rac9i/udump'
*.user_dump_dest='/oracle/ora9/admin/single/udump'
*********************************************************************************
export ORACLE_SID=single
*********************************************************************************
[oracle@westzq1 admin]$ ls -l
total 8
drwxr-xr-x 8 oracle dba 4096 Dec 2 2008 rac9i
[oracle@westzq1 admin]$ mv rac9i single
[oracle@westzq1 admin]$ ls -l
total 8
drwxr-xr-x 8 oracle dba 4096 Dec 2 2008 single
[oracle@westzq1 dbs]$ orapwd file=/oracle/ora9/product/9.2/dbs/orapwsingle password=sys
*********************************************************************************
启动实例一
SQL> startup pfile='/tmp/init.ora';
ORACLE instance started.
Total System Global Area 135336712 bytes
Fixed Size 451336 bytes
Variable Size 109051904 bytes
Database Buffers 25165824 bytes
Redo Buffers 667648 bytes
Database mounted.
Database opened.
SQL> show parameter cluster
NAME TYPE VALUE
------------------------------------ ----------- ------------------------------
cluster_database boolean FALSE
cluster_database_instances integer 1
cluster_interconnects string
SQL> show parameter instance
NAME TYPE VALUE
------------------------------------ ----------- ------------------------------
active_instance_count integer
cluster_database_instances integer 1
instance_groups string
instance_name string single
instance_number integer 0
open_links_per_instance integer 4
parallel_instance_group string
parallel_server_instances integer 1
*********************************************************************************
SQL> alter database disable thread 2;
Database altered.
*********************************************************************************
[oracle@westzq1 bin]$ cd $ORACLE_HOME/rdbms/lib
[oracle@westzq1 lib]$ make -f ins_rdbms.mk rac_off
rm -f /oracle/ora9/product/9.2/lib/libskgxp9.so
cp /oracle/ora9/product/9.2/lib//libskgxpd.so /oracle/ora9/product/9.2/lib/libskgxp9.so
rm -f /oracle/ora9/product/9.2/lib/libskgxn9.so
cp /oracle/ora9/product/9.2/lib//libskgxns.so /oracle/ora9/product/9.2/lib/libskgxn9.so
/usr/bin/ar d /oracle/ora9/product/9.2/rdbms/lib/libknlopt.a kcsm.o
/usr/bin/ar cr /oracle/ora9/product/9.2/rdbms/lib/libknlopt.a /oracle/ora9/product/9.2/rdbms/lib/ksnkcs.o
[oracle@westzq1 lib]$ make -f ins_rdbms.mk ioracle
- Linking Oracle
rm -f /oracle/ora9/product/9.2/rdbms/lib/oracle
gcc -o /oracle/ora9/product/9.2/rdbms/lib/oracle -L/oracle/ora9/product/9.2/rdbms/lib/ -L/oracle/ora9/product/9.2/lib/ -L/oracle/ora9/product/9.2/lib/stubs/ -Wl,-E `test -f /oracle/ora9/product/9.2/rdbms/lib/skgaioi.o && echo /oracle/ora9/product/9.2/rdbms/lib/skgaioi.o` /oracle/ora9/product/9.2/rdbms/lib/opimai.o /oracle/ora9/product/9.2/rdbms/lib/ssoraed.o /oracle/ora9/product/9.2/rdbms/lib/ttcsoi.o /oracle/ora9/product/9.2/lib/nautab.o /oracle/ora9/product/9.2/lib/naeet.o /oracle/ora9/product/9.2/lib/naect.o /oracle/ora9/product/9.2/lib/naedhs.o /oracle/ora9/product/9.2/rdbms/lib/config.o -lserver9 -lodm9 -lskgxp9 -lskgxn9 -lclient9 -lvsn9 -lwtcserver9 -lcommon9 -lgeneric9 /oracle/ora9/product/9.2/rdbms/lib/defopt.o -lknlopt `if /usr/bin/ar tv /oracle/ora9/product/9.2/rdbms/lib/libknlopt.a | grep xsyeolap.o > /dev/null 2>&1 ; then echo "-loraolap9" ; fi` -lslax9 -lpls9 -lplp9 -lserver9 -lclient9 -lvsn9 -lwtcserver9 -lcommon9 -lgeneric9 -lknlopt -lslax9 -lpls9 -lplp9 -ljox9 -lserver9 -locijdbcst9 -lwwg9 `cat /oracle/ora9/product/9.2/lib/ldflags` -lnsslb9 -lncrypt9 -lnsgr9 -lnzjs9 -ln9 -lnl9 -lnro9 `cat /oracle/ora9/product/9.2/lib/ldflags` -lnsslb9 -lncrypt9 -lnsgr9 -lnzjs9 -ln9 -lnl9 -lmm -lnls9 -lcore9 -lnls9 -lcore9 -lnls9 -lxml9 -lcore9 -lunls9 -lnls9 `cat /oracle/ora9/product/9.2/lib/ldflags` -lnsslb9 -lncrypt9 -lnsgr9 -lnzjs9 -ln9 -lnl9 -lnro9 `cat /oracle/ora9/product/9.2/lib/ldflags` -lnsslb9 -lncrypt9 -lnsgr9 -lnzjs9 -ln9 -lnl9 -ltrace9 -lnls9 -lcore9 -lnls9 -lcore9 -lnls9 -lxml9 -lcore9 -lunls9 -lnls9 `if /usr/bin/ar tv /oracle/ora9/product/9.2/rdbms/lib/libknlopt.a | grep "kxmnsd.o" > /dev/null 2>&1 ; then echo " " ; else echo "-lordsdo9"; fi` -lctxc9 -lctx9 -lzx9 -lgx9 -lctx9 -lzx9 -lgx9 -lordimt9 -lnls9 -lcore9 -lnls9 -lcore9 -lnls9 -lxml9 -lcore9 -lunls9 -lnls9 -lsnls9 -lunls9 -lxsd9 -lnls9 -lcore9 -lnls9 -lcore9 -lnls9 -lxml9 -lcore9 -lunls9 -lnls9 `cat /oracle/ora9/product/9.2/lib/sysliblist` -Wl,-rpath,/oracle/ora9/product/9.2/lib:/lib/i686:/lib:/usr/lib -lm `cat /oracle/ora9/product/9.2/lib/sysliblist` -ldl -lm `test -f /oracle/ora9/product/9.2/rdbms/lib/skgaioi.o && echo -laio`
mv -f /oracle/ora9/product/9.2/bin/oracle /oracle/ora9/product/9.2/bin/oracleO
mv /oracle/ora9/product/9.2/rdbms/lib/oracle /oracle/ora9/product/9.2/bin/oracle
chmod 6751 /oracle/ora9/product/9.2/bin/oracle
*********************************************************************************
[oracle@westzq1 lib]$ /oracle/ora9/product/9.2/bin/gsdctl stop
Successfully stopped GSD on local node
[oracle@westzq1 lib]$ ps -ef|grep oracm
oracle 5398 1 0 00:05 pts/1 00:00:00 oracm
oracle 5399 5398 0 00:05 pts/1 00:00:00 oracm
oracle 5401 5399 0 00:05 pts/1 00:00:00 oracm
oracle 5402 5399 0 00:05 pts/1 00:00:00 oracm
oracle 5403 5399 0 00:05 pts/1 00:00:00 oracm
oracle 5404 5399 0 00:05 pts/1 00:00:00 oracm
oracle 5405 5399 0 00:05 pts/1 00:00:00 oracm
oracle 5406 5399 0 00:05 pts/1 00:00:02 oracm
oracle 5407 5399 0 00:05 pts/1 00:00:00 oracm
oracle 5423 5399 0 00:05 pts/1 00:00:00 oracm
oracle 8846 6806 0 00:35 pts/1 00:00:00 grep oracm
[oracle@westzq1 lib]$ kill -9 5398
*********************************************************************************
SQL> startup pfile='/tmp/init.ora';
ORACLE instance started.
Total System Global Area 135336712 bytes
Fixed Size 451336 bytes
Variable Size 109051904 bytes
Database Buffers 25165824 bytes
Redo Buffers 667648 bytes
Database mounted.
Database opened.
SQL> create spfile from pfile='/tmp/init.ora';
File created.
*********************************************************************************
SQL> select * from v$thread;
THREAD# STATUS ENABLED GROUPS INSTANCE OPEN_TIME CURRENT_GROUP# SEQUENCE# CHECKPOINT_CHANGE# CHECKPOIN
---------- ------ -------- ---------- ---------------- --------- -------------- ---------- ------------------ ---------
ENABLE_CHANGE# ENABLE_TI DISABLE_CHANGE# DISABLE_T
-------------- --------- --------------- ---------
1 OPEN PUBLIC 2 single 30-AUG-09 1 51 2185600 30-AUG-09
1 02-DEC-08 0
2 CLOSED DISABLED 2 rac9i2 29-SEP-09 0 15 2185307 29-SEP-09
62222 02-DEC-08 2185416 30-AUG-09
SQL> select * from v$log;
GROUP# THREAD# SEQUENCE# BYTES MEMBERS ARC STATUS FIRST_CHANGE# FIRST_TIM
---------- ---------- ---------- ---------- ---------- --- ---------------- ------------- ---------
1 1 51 26214400 1 NO CURRENT 2185600 30-AUG-09
2 1 50 26214400 1 YES INACTIVE 2185583 30-AUG-09
3 2 15 26214400 1 YES INACTIVE 2185254 29-SEP-09
4 2 14 26214400 1 YES INACTIVE 2185247 29-SEP-09
SQL> alter database drop logfile group 3;
Database altered.
SQL> alter database drop logfile group 4;
Database altered.
SQL> select * from v$thread;
THREAD# STATUS ENABLED GROUPS INSTANCE OPEN_TIME CURRENT_GROUP# SEQUENCE# CHECKPOINT_CHANGE# CHECKPOIN
---------- ------ -------- ---------- ---------------- --------- -------------- ---------- ------------------ ---------
ENABLE_CHANGE# ENABLE_TI DISABLE_CHANGE# DISABLE_T
-------------- --------- --------------- ---------
1 OPEN PUBLIC 2 single 30-AUG-09 1 51 2185600 30-AUG-09
1 02-DEC-08 0
*********************************************************************************
SQL> shutdown immediate
Database closed.
Database dismounted.
ORACLE instance shut down.
SQL> startup
ORACLE instance started.
Total System Global Area 135336712 bytes
Fixed Size 451336 bytes
Variable Size 109051904 bytes
Database Buffers 25165824 bytes
Redo Buffers 667648 bytes
Database mounted.
Database opened.
SQL>
*********************************************************************************
需要注意的:
初始化参数修改
线程的DISABLE和日志组的DROP
ORACLE RAC选项的关闭,不关闭单实例下启动还是需要集群件的支持
来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/8242091/viewspace-613556/ ,如需转载,请注明出处,否则将追究法律责任。