RAC modify the character set

Modify had several character sets, and this feeling still a little ring true, take a detour, and then record again
[Overview]
ready to build RAC + RAC DG, found at both ends of the character set is not consistent, time to worry about the problem.

[Target]
The library prepared NLS_NCHAR_CHARACTERSET modified to be consistent with the primary database.
- Preparation of
the NLS_NCHAR_CHARACTERSET the UTF8
modify
- Main
the NLS_NCHAR_CHARACTERSET of AL16UTF16

0、备库 修改前
PRIMARY-SYS@TESTDB2>set pagesize 100
PRIMARY-SYS@TESTDB2>col value$ for a30
PRIMARY-SYS@TESTDB2>select name,value$ from props$ where name like '%NLS%';

NAME VALUE$
------------------------------------------------------------------------------------------ ------------------------------
NLS_LANGUAGE AMERICAN
NLS_TERRITORY AMERICA
NLS_CURRENCY $
NLS_ISO_CURRENCY AMERICA
NLS_NUMERIC_CHARACTERS .,
NLS_CHARACTERSET ZHS16GBK
NLS_CALENDAR GREGORIAN
NLS_DATE_FORMAT DD-MON-RR
NLS_DATE_LANGUAGE AMERICAN
NLS_SORT BINARY
NLS_TIME_FORMAT HH.MI.SSXFF AM
NLS_TIMESTAMP_FORMAT DD-MON-RR HH.MI.SSXFF AM
NLS_TIME_TZ_FORMAT HH.MI.SSXFF AM TZR
NLS_TIMESTAMP_TZ_FORMAT DD-MON-RR HH.MI.SSXFF AM TZR
NLS_DUAL_CURRENCY $
NLS_COMP BINARY
NLS_LENGTH_SEMANTICS BYTE
NLS_NCHAR_CONV_EXCP FALSE
NLS_NCHAR_CHARACTERSET UTF8
NLS_RDBMS_VERSION 11.2.0.4.0

20 rows selected.

1, node 2 first stopped, to start after the completion of modification in the node 1
[NODE2 the root @ ~] # LS -l /u01/app/11.2.0/grid/bin/crsctl
-rwxr X-1 XR-8576 the root the oinstall 13 is /u01/app/11.2.0/grid/bin/crsctl 2017 jan
[NODE2 the root @ ~] #
[@ NODE2 the root ~] # /u01/app/11.2.0/grid/bin/crsctl STOP Cluster
the CRS-2673 : Attempting to STOP 'ora.crsd' ON 'NODE2'
the CRS-2790: Starting the shutdown of the Cluster Resources Managed the Ready-ON Services 'NODE2'
the CRS-2673: Attempting to STOP 'ora.LISTENER_SCAN1.lsnr' ON 'NODE2'
CRS- 2673: Attempting to STOP 'ora.LISTENER.lsnr' ON 'NODE2'
the CRS-2673: Attempting to STOP 'ora.CRSDG.dg' ON 'NODE2'
the CRS-2673: Attempting to STOP 'ora.TESTDB.db' ON ' NODE2 '
the CRS-2677:Stop of 'ora.LISTENER_SCAN1.lsnr' on 'NODE2' succeeded
CRS-2673: Attempting to stop 'ora.scan1.vip' on 'NODE2'
CRS-2677: Stop of 'ora.LISTENER.lsnr' on 'NODE2' succeeded
CRS-2673: Attempting to stop 'ora.NODE2.vip' on 'NODE2'
CRS-2677: Stop of 'ora.scan1.vip' on 'NODE2' succeeded
CRS-2672: Attempting to start 'ora.scan1.vip' on 'NODE1'
CRS-2677: Stop of 'ora.NODE2.vip' on 'NODE2' succeeded
CRS-2672: Attempting to start 'ora.NODE2.vip' on 'NODE1'
CRS-2677: Stop of 'ora.TESTDB.db' on 'NODE2' succeeded
CRS-2673: Attempting to stop 'ora.DATA.dg' on 'NODE2'
CRS-2673: Attempting to stop 'ora.FRA.dg' on 'NODE2'
CRS-2677: Stop of 'ora.DATA.dg' on 'NODE2' succeeded
CRS-2677: Stop of 'ora.FRA.dg' on 'NODE2' succeeded
CRS-2676: Start of 'ora.scan1.vip' on 'NODE1' succeeded
CRS-2672: Attempting to start 'ora.LISTENER_SCAN1.lsnr' on 'NODE1'
CRS-2676: Start of 'ora.NODE2.vip' on 'NODE1' succeeded
CRS-2676: Start of 'ora.LISTENER_SCAN1.lsnr' on 'NODE1' succeeded
CRS-2677: Stop of 'ora.CRSDG.dg' on 'NODE2' succeeded
CRS-2673: Attempting to stop 'ora.asm' on 'NODE2'
CRS-2677: Stop of 'ora.asm' on 'NODE2' succeeded
CRS-2673: Attempting to stop 'ora.ons' on 'NODE2'
CRS-2677: Stop of 'ora.ons' on 'NODE2' succeeded
CRS-2673: Attempting to stop 'ora.net1.network' on 'NODE2'
CRS-2677: Stop of 'ora.net1.network' on 'NODE2' succeeded
CRS-2792: Shutdown of Cluster Ready Services-managed resources on 'NODE2' has completed
CRS-2677: Stop of 'ora.crsd' on 'NODE2' succeeded
CRS-2673: Attempting to stop 'ora.ctssd' on 'NODE2'
CRS-2673: Attempting to stop 'ora.evmd' on 'NODE2'
CRS-2673: Attempting to stop 'ora.asm' on 'NODE2'
CRS-2677: Stop of 'ora.evmd' on 'NODE2' succeeded
CRS-2677: Stop of 'ora.asm' on 'NODE2' succeeded
CRS-2673: Attempting to stop 'ora.cluster_interconnect.haip' on 'NODE2'
CRS-2677: Stop of 'ora.cluster_interconnect.haip' on 'NODE2' succeeded
CRS-2677: Stop of 'ora.ctssd' on 'NODE2' succeeded
CRS-2673: Attempting to stop 'ora.cssd' on 'NODE2'
CRS-2677: Stop of 'ora.cssd' on 'NODE2' succeeded
[root@NODE2 ~]#

2, the node 1

PRIMARY-SYS@TESTDB1>show parameter pfile;

The TYPE of VALUE NAME
------------------------------------ ----------- ---------------------- ---------------------------- -
SPFILE String + the DATA / the TESTDB / the PARAMETERFILE / SPF
ile.344.1016736315
a PRIMARY @-testdb1 the SYS> Create pfile from SPFILE;
- so would modify the build file pfile above cluster_database = false with modified pfile mount + INTERNAL_USE + open and then re-create spfile were used with node 2

- The following is not necessary to modify the spfile, holding SPFILE (two shared nodes) = TRUE in cluster_database
--alter System SET = cluster_database to false;
a PRIMARY @-testdb1 the SYS> System ALTER SET = cluster_database to false scope = SPFILE;

System altered.

- [need] to restart to take effect, although the above has been modified
PRIMARY-SYS @ TESTDB1> show parameter cluster_database

NAME TYPE VALUE
------------------------------------ --------------------------------- ------------------------------
cluster_database boolean TRUE
cluster_database_instances integer 2
PRIMARY-SYS@TESTDB1>shutdown immediate;
Database closed.
Database dismounted.
ORACLE instance shut down.

--mv initTESTDB1.ora initTESTDB1.ora.bak, finally mv back, did not they reported back to following the wrong
PRIMARY @ SYS-testdb1> the Startup Mount;
ORA-01 078: Processing System failure in the Parameters
LRM-00109: could not open parameter file '/u01/app/oracle/product/11.2.0/db_home1/dbs/initTESTDB1.ora'

PRIMARY-SYS@TESTDB1>startup mount;
ORACLE instance started.

Total System Global Area 7.4826E+10 bytes
Fixed Size 2261048 bytes
Variable Size 4.6976E+10 bytes
Database Buffers 2.7649E+10 bytes
Redo Buffers 199049216 bytes
Database mounted.
PRIMARY-SYS@TESTDB1>ALTER SYSTEM ENABLE RESTRICTED SESSION;

System altered.

PRIMARY-SYS@TESTDB1>ALTER SYSTEM SET JOB_QUEUE_PROCESSES=0;

System altered.

PRIMARY-SYS@TESTDB1>ALTER SYSTEM SET AQ_TM_PROCESSES=0;

System altered.

PRIMARY-SYS@TESTDB1>ALTER DATABASE OPEN;

The Altered Database.
- This step is focused on [to modify]
PRIMARY @ SYS-testdb1> the ALTER DATABASE the NATIONAL CHARACTER the SET INTERNAL_USE AL16UTF16;

Database altered.

--pfile启动了,没法修改spfile了
PRIMARY-SYS@TESTDB1>alter system set cluster_database=true scope=spfile sid='*';
alter system set cluster_database=true scope=spfile sid='*'
*
ERROR at line 1:
ORA-32001: write to SPFILE requested but no SPFILE is in use


PRIMARY-SYS@TESTDB1>show parameter pfile;

NAME TYPE VALUE
------------------------------------ --------------------------------- ------------------------------
spfile string

- manually modify the initTESTDB1.ora cluster_database = true, reconstruction SPFILE
a PRIMARY @-testdb1 the SYS> Create SPFILE from pfile = '/ u01 / App / Oracle / Product / 11.2.0 / db_home1 / DBS / initTESTDB1.ora';

File created.

PRIMARY-SYS@TESTDB1>shutdown immediate;
Database closed.
Database dismounted.
ORACLE instance shut down.
PRIMARY-SYS@TESTDB1>startup mount;
ORACLE instance started.

Total System Global Area 7.4826E+10 bytes
Fixed Size 2261048 bytes
Variable Size 4.6976E+10 bytes
Database Buffers 2.7649E+10 bytes
Redo Buffers 199049216 bytes
Database mounted.
--还得改回去,0->1
PRIMARY-SYS@TESTDB1>ALTER SYSTEM DISABLE RESTRICTED SESSION;

System altered.

PRIMARY-SYS@TESTDB1>ALTER SYSTEM SET JOB_QUEUE_PROCESSES=1;

System altered.

PRIMARY-SYS@TESTDB1>ALTER SYSTEM SET AQ_TM_PROCESSES=1;

System altered.

PRIMARY-SYS@TESTDB1>show parameter pfile;

NAME TYPE VALUE
------------------------------------ --------------------------------- ------------------------------
spfile string /u01/app/oracle/product/11.2.0
/db_home1/dbs/spfileTESTDB1.or
a
PRIMARY-SYS@TESTDB1>alter system set cluster_database=true scope=spfile sid='*';

System altered.

PRIMARY-SYS@TESTDB1>alter database open;

Database altered.


--cluster_database [restart] to take effect

PRIMARY-SYS@TESTDB1>show parameter cluster_database

NAME TYPE VALUE
------------------------------------ --------------------------------- ------------------------------
cluster_database boolean FALSE
cluster_database_instances integer 1
PRIMARY-SYS@TESTDB1>shut immediate
Database closed.
Database dismounted.
ORACLE instance shut down.
PRIMARY-SYS@TESTDB1>
PRIMARY-SYS@TESTDB1>
PRIMARY-SYS@TESTDB1>
PRIMARY-SYS@TESTDB1>startup
ORACLE instance started.

Total System Global Area 7.4826E+10 bytes
Fixed Size 2261048 bytes
Variable Size 4.9392E+10 bytes
Database Buffers 2.5233E+10 bytes
Redo Buffers 199049216 bytes
Database mounted.
Database opened.
PRIMARY-SYS@TESTDB1>show parameter cluster_database

NAME TYPE VALUE
------------------------------------ --------------------------------- ------------------------------
cluster_database boolean TRUE
cluster_database_instances integer 2
PRIMARY-SYS@TESTDB1>

PRIMARY-SYS@TESTDB1>set pagesize 100
PRIMARY-SYS@TESTDB1>col value$ for a30
PRIMARY-SYS@TESTDB1>select name,value$ from props$ where name like '%NLS%';

NAME VALUE$
------------------------------------------------------------------------------------------ ------------------------------
NLS_LANGUAGE AMERICAN
NLS_TERRITORY AMERICA
NLS_CURRENCY $
NLS_ISO_CURRENCY AMERICA
NLS_NUMERIC_CHARACTERS .,
NLS_CHARACTERSET ZHS16GBK
NLS_CALENDAR GREGORIAN
NLS_DATE_FORMAT DD-MON-RR
NLS_DATE_LANGUAGE AMERICAN
NLS_SORT BINARY
NLS_TIME_FORMAT HH.MI.SSXFF AM
NLS_TIMESTAMP_FORMAT DD-MON-RR HH.MI.SSXFF AM
NLS_TIME_TZ_FORMAT HH.MI.SSXFF AM TZR
NLS_TIMESTAMP_TZ_FORMAT DD-MON-RR HH.MI.SSXFF AM TZR
NLS_DUAL_CURRENCY $
NLS_COMP BINARY
NLS_LENGTH_SEMANTICS BYTE
NLS_NCHAR_CONV_EXCP FALSE
- [amended] has found success
NLS_NCHAR_CHARACTERSET AL16UTF16
NLS_RDBMS_VERSION 11.2.0.4.0

20 rows selected.

PRIMARY-SYS@TESTDB1>


3、第二个节点启动
[root@NODE2 ~]# /u01/app/11.2.0/grid/bin/crsctl start cluster
CRS-2672: Attempting to start 'ora.cssdmonitor' on 'NODE2'
CRS-2676: Start of 'ora.cssdmonitor' on 'NODE2' succeeded
CRS-2672: Attempting to start 'ora.cssd' on 'NODE2'
CRS-2672: Attempting to start 'ora.diskmon' on 'NODE2'
CRS-2676: Start of 'ora.diskmon' on 'NODE2' succeeded
CRS-2676: Start of 'ora.cssd' on 'NODE2' succeeded
CRS-2672: Attempting to start 'ora.ctssd' on 'NODE2'
CRS-2676: Start of 'ora.ctssd' on 'NODE2' succeeded
CRS-2672: Attempting to start 'ora.evmd' on 'NODE2'
CRS-2672: Attempting to start 'ora.cluster_interconnect.haip' on 'NODE2'
CRS-2676: Start of 'ora.evmd' on 'NODE2' succeeded
CRS-2676: Start of 'ora.cluster_interconnect.haip' on 'NODE2' succeeded
CRS-2672: Attempting to start 'ora.asm' on 'NODE2'
CRS-2676: Start of 'ora.asm' on 'NODE2' succeeded
CRS-2672: Attempting to start 'ora.crsd' on 'NODE2'
CRS-2676: Start of 'ora.crsd' on 'NODE2' succeeded

- Set the automatic restart, it fails. . .
@ Testdb2-SYS PRIMARY> the Startup Mount
ORA-10997: Another the Startup / Operation of the this instance the shutdown InProgress
ORA-09968: Unable to Lock File
Linux-x86_64 Error: 11: Resource temporarily. It is unavailable Sign of the
Additional Information: 169 786
. . . Since it started. . .

- Wait a discovery started the OK
PRIMARY-SYS @ testdb2> the SELECT INST_ID, instance_name, Status from GV $ instance;

INST_ID INSTANCE_NAME STATUS
---------- ------------------------------------------------ ------------------------------------
2 TESTDB2 OPEN
1 TESTDB1 OPEN

2 rows selected.

Since both nodes are OK


[Summary]
above might say a bit chaotic, stroked a stroke. . . I do not know that right
0, before work plan to plan, and unrealistic expectations is a major technical obstacle, say very nice, but doing it is not always so easy, a little wrong to waste time than spend more time preparing in advance a lot , of course, except for cattle, timely treatment.
1, according to the generated pfile node 1 modify modify cluster_database = false start, and then change back point is not less troublesome
2, modify the character set close to a node, a node in another modification, this node should change cluster_database before modification to false (do not change under spfile, spfile two nodes are common, and other changed again to change back, repeated work!), restart (to take effect), after the mount is modified according to the above operation, modify it and then the 0 changed to 1, cluster_database then changed to true, reboot (take effect), start the node 2 (or spfile amount before modification, cluster_database still true), the end.


[Episode] two nodes does not start from the ASM SPFILE
PRIMARY-SYS @ DINPAY1> Show the Parameter pfile;

NAME TYPE VALUE
------------------------------------ --------------------------------- ------------------------------
spfile string /u01/app/oracle/product/11.2.0
/db_home1/dbs/spfileDINPAY1.or
a
PRIMARY-SYS@DINPAY1>create pfile from spfile;

File created.

PRIMARY-SYS@DINPAY1>create spfile from pfile='/u01/app/oracle/product/11.2.0/db_home1/dbs/initDINPAY1.ora';
create spfile from pfile='/u01/app/oracle/product/11.2.0/db_home1/dbs/initDINPAY1.ora'
*
ERROR at line 1:
ORA-32002: cannot create SPFILE already being used by the instance

PRIMARY-SYS@DINPAY1>shut immediate

PRIMARY-SYS@DINPAY1>startup pfile='/u01/app/oracle/product/11.2.0/db_home1/dbs/initDINPAY1.ora';

PRIMARY-SYS@DINPAY1>show parameter pfile;

NAME TYPE VALUE
------------------------------------ --------------------------------- ------------------------------
spfile string
PRIMARY-SYS@DINPAY1>create spfile='+data' from pfile='/u01/app/oracle/product/11.2.0/db_home1/dbs/initDINPAY1.ora';

File created.
PRIMARY-SYS@DINPAY1>show parameter pfile;

NAME TYPE VALUE
------------------------------------ --------------------------------- ------------------------------
spfile string
PRIMARY-SYS@DINPAY1>shut immediate

Find --grid landing generate spfile position
ASMCMD> cd + the DATA / dinpay / the PARAMETERFILE /
ASMCMD> LS
spfile.282.1016709123
spfile.343.1016734531
spfile.344.1016736315
spfile.346.1025548589
- just generated
+ DATA / dinpay / parameterfile / spfile.346.1025548589

- Update pfile, so do not create pfile from spfile; generating location specified pfile
[Oracle @ zhjlrac1 DBS] $ pwd
/u01/app/oracle/product/11.2.0/db_home1/dbs
[Oracle @ szml02 DBS-DB01] $ CAT initDINPAY1.ora
the SPFILE = '+ the DATA / dinpay / the PARAMETERFILE / spfile.346.1025548589'

PRIMARY-SYS@DINPAY1>startup
ORACLE instance started.

Total System Global Area 7.4826E+10 bytes
Fixed Size 2261048 bytes
Variable Size 4.9124E+10 bytes
Database Buffers 2.5501E+10 bytes
Redo Buffers 199049216 bytes
Database mounted.
Database opened.
PRIMARY-SYS@DINPAY1>

PRIMARY-SYS@DINPAY1>show parameter pfile;

The TYPE of VALUE NAME
------------------------------------ ----------- ---------------------- ---------------------------- -
SPFILE String the DATA + / dinpay / the PARAMETERFILE / SPF
ile.346.1025548589
another node pointing to this page as spfile, restart OK.

If used directly create pfile from spfile; command to create a pfile, then generate the pfile pfile file overwrites the original file in the $ ORACLE_HOME / dbs directory. In previous pfile file which preserves the value of a point to spfile storage location records. After this modification, it will cause will because they can not read the local files spfile pfile file database is started , instead of sharing spfile files on the device. Such parameters of the management will bring trouble, but also bring other problems.
So for the RAC , should be used with caution pfile from SPFILE the Create ; to create pfile file, at the time of creation, try to generate a specified position of pfile .

Guess you like

Origin www.cnblogs.com/ritchy/p/12037919.html