Error (10)

안녕하세요, 케이치입니다.


오늘은 리눅스 서버의 재부팅/재기동 또는 언제 shutdown이 됐었는지를 확인하는 방법을 배웠습니다.


그다지 많이 쓸 일은 없는 명령어이긴 한데 웹사이트에 접속이 안되서 확인해보다가 알게되었네요.


우선 웹서버로 접속을 하는데 아래와 같은 메시지가 떴습니다.

Service Temporarily Unavailable
The server is temporarily unable to service your request due to maintenance downtime or capacity problems. Please try again later.


뭔소린가 봤더니 점검 중이거나 용량문제로 인해서 접속할 수 없다라는 말이네요.


그래서 서버에 접속해서 혹시 디렉토리 용량이 부족한가 봤는데 아니었습니다.


그럼 왜 안되는지 에러로그부터 확인해야겠죠.


웹서버의 에러로그를 봤는데 에러가 없습니다 ㄷㄷ;;;;; 뭐지 이건;;;


이제 실제 웹앱이 올라가있는 WAS 기동상태를 확인합니다.


두둥!!!! WAS가 죽었네요 ㅜㅜ


뭐지 난 죽인적이 없는데....그래서 다시 WAS의 에러로그를 확인하는데 헐;;;; 여기도 에러로그는 없습니다. 마지막까지 열심히 사람들의 요청에 부응한 흔적밖에 없네요.


뭐지? 서버가 재부팅 됐나? 어떻게 확인하지?


리눅스 서버의 재기동 상태를 확인하는 명령어는 두 가지가 있습니다.


첫째, last 명령어.

둘째, who 명령어.


[keichee@server1 ~]$ last reboot

reboot   system boot  3.10.0-514.16.1. Thu Jun 22 17:13 - 11:32 (140+18:19)

reboot   system boot  3.10.0-327.36.3. Wed Jan  4 22:14 - 17:11 (168+18:57)

reboot   system boot  3.10.0-327.36.3. Thu Nov 17 14:41 - 17:11 (217+02:30)

reboot   system boot  3.10.0-327.36.3. Thu Nov 17 15:06 - 17:11 (217+02:04)

reboot   system boot  3.10.0-327.36.3. Thu Nov 17 11:01 - 17:11 (217+06:09)


last reboot 명령어는 마지막으로 재기동한 시간이 언제인지를 desc 정렬하여 출력합니다. 즉, 제일 위에 있는게 가장 최근에 재기동한 시간을 말합니다.


last reboot 말고도 last shutdown 명령어로 언제 셧다운됐었는지 확인이 가능합니다. 


last -x 는 어떤 사용자가 서버에 접속해서 얼마나 있었는지 확인이 가능합니다. run level이 어떻게 바뀌었는지도 확인이 가능하죠.


[keichee@server1 ~]$ last -x

keichee    pts/0        210.145.229.14   Fri Nov 10 11:09   still logged in

keichee    pts/0        210.145.229.14   Tue Nov  7 09:17 - 14:14  (04:57)

keichee    pts/0        210.145.229.143   Mon Nov  6 09:19 - 18:27  (09:07)

keichee    pts/2        204.130.143.176  Thu Nov  2 22:04 - 00:26  (02:21)

keichee    pts/1        103.170.103.116  Thu Nov  2 22:04 - 00:26  (02:22)

runlevel (to lvl 3)   3.10.0-514.16.1. Thu Jun 22 17:13 - 11:35 (140+18:22)
reboot   system boot  3.10.0-514.16.1. Thu Jun 22 17:13 - 11:35 (140+18:22)
shutdown system down  3.10.0-327.36.3. Thu Jun 22 17:11 - 17:13  (00:01)


그럼 두 번째 명령어였던 who는 어떻게 쓸까요?


기본적으로 who를 쓸 때는 현재 내가 어떤 사용자로 접속을 했는지 확인하기 위해서 사용할 수 있죠.


[keichee@server1 ~]$ who

keichee    pts/0        2017-11-10 11:09 (118.145.269.124)


help 옵션으로 어떤 옵션을 추가로 줄 수 있는지 한번 볼까요?


[keichee@server1 ~]$ who  --help

Usage: who [OPTION]... [ FILE | ARG1 ARG2 ]

Print information about users who are currently logged in.


  -a, --all         same as -b -d --login -p -r -t -T -u

  -b, --boot        time of last system boot

  -d, --dead        print dead processes

  -H, --heading     print line of column headings

  -l, --login       print system login processes

      --lookup      attempt to canonicalize hostnames via DNS

  -m                only hostname and user associated with stdin

  -p, --process     print active processes spawned by init

  -q, --count       all login names and number of users logged on

  -r, --runlevel    print current runlevel

  -s, --short       print only name, line, and time (default)

  -t, --time        print last system clock change

  -T, -w, --mesg    add user's message status as +, - or ?

  -u, --users       list users logged in

      --message     same as -T

      --writable    same as -T

      --help     display this help and exit

      --version  output version information and exit


옵션 중에 -b 옵션이 마지막 시스템 부팅 시간을 출력한다는 것을 확인할 수 있습니다.


그럼 한 번 써보죠.

[keichee@server1 ~]$ who -b

         system boot  2017-06-22 17:13

17년 6월 22일 17시 13분에 시스템이 기동됐음을 알 수 있습니다.


이상입니다.


오늘은 여기까지~ 

스프링 웹 개발을 하다보면 상당히 많은 에러 메시지와 마주하게 됩니다.


특히 개발 환경을 구성할 때 자주 보게 되죠.


최근에 개인적으로 스프링 웹 개발 환경을 구성을 해보다가 다음과 같은 에러 메시지를 보게 되었습니다.


No converter found for return value of type: class java.util.ArrayList


스프링 메이븐 프로젝트로 구성을 했구요, 스프링 버전은 4.3.2 버전이었습니다.


pom.xml 에 jackson-core 라이브러리를 디펜던시 목록에 추가해놓은 상태여서 당연히 될 거라고 생각했었는데 에러가 발생하더군요.


스프링 컨트롤러에서 @ResponseBody 어노테이션을 사용해서 List<Dto> 를 반환하려고 할 때 발생한 에러입니다.


구글링을 해보니 해결 방법은 간단합니다.


jackson-bind 라이브러리를 추가해주는 겁니다.


그래서 아래 디펜던시 부분을 추가를 해서 해결했습니다.


<dependency>

<groupId>com.fasterxml.jackson.core</groupId>

  <artifactId>jackson-databind</artifactId>

<version>2.5.4</version>

</dependency>



@ResponseBody 어노테이션을 사용하려면 jackson-bind 라이브러리가 필요하다는 것을 알게되었네요~


역시 누가 구성해놓은 환경에서만 개발을 하다가 혼자서 하려니 이런저런 다양한 케이스들을 많이 보게 되는 것 같습니다.


프로그래밍에는 세가지 종류의 에러가 있습니다.

 (a) 문법에러 (b) 런타임 에러 (c) 논리적 에러

문법 에러

문법에러는 파싱에러라고도 합니다. 문법상 맞지 않아서 발생하는 에러죠. 문법에러는 컴파일시에 에러가 있다고 알려주기때문에 찾기쉬운 에러입니다.

아래 예제는 닫는 괄호를 빼먹은 문법에러입니다.

<script type="text/javascript">
<!--
window.print(;
//-->
</script>

 

런타임 에러

런타임에러는 예외라고도 하며 실행시에 에러가 발생합니다. 아래 예제는 문법은 어긋나지 않지만 실행시에 오류가 발생합니다. 왜냐하면 존재하지 않는 메소드를 호출하려고 하기 때문이죠.

<script type="text/javascript">
<!--
window.printme();
//-->
</script>

 

논리적 에러

논리적으로 에러가 발생한 것은 찾기가 힘든 에러입니다. 문법적으로도 맞고 실행시에 아무런 문제가 발생하지 않지만 원하는 값이 안나오는 그런 에러이기 때문에 내가 구현한 로직이 잘못되어서 발생하는 에러라고 보시면 됩니다.

try...catch...finally

자바에서 쓰는 try-catch절을 자바스크립트에서도 쓸 수가 있네요
<script type="text/javascript">
<!--
try {
    // Code to run
    [break;]
} catch ( e ) {
    // Code to run if an exception occurs
    [break;]
}[ finally {
    // Code that is always executed regardless of 
    // an exception occurring
}]
//-->
</script>

 

예제:

존재하지 않는 함수를 호출할 경우 어떻게 에러가 발생하는지 한번 볼까요? 에러는 브라우저별로 다른게 보일 수 있다는 것을 명심하세요. 

<html>
<head>
<script type="text/javascript">
<!--
function myFunc()
{
var a = 100;

alert("Value of variable a is : " + myFunc2() );

} //--> </script> </head> <body> <p>Click the following to see the result:</p> <form> <input type="button" value="Click Me" onclick="myFunc();" /> </form> </body> </html>

 

 

이제 try...catch 절을 이용해서 에러를 잡아보도록 하죠.

<html>
<head>
<script type="text/javascript">
<!--
function myFunc()
{
   var a = 100;
   
   try {
      alert("Value of variable a is : " + myFunc2() );
   } catch ( e ) {
      alert("Error: " + e.description );
   }
}
//-->
</script>
</head>
<body>
<p>Click the following to see the result:</p>
<form>
<input type="button" value="Click Me" onclick="myFunc();" />
</form>
</body>
</html>

 

 

finally 는 try-catch절에서 에러가 발생하든 안하든 항상 실행이 되는 부분입니다.

<html>
<head>
<script type="text/javascript">
<!--
function myFunc()
{
   var a = 100;
   
   try {
      alert("Value of variable a is : " + myFunc2()  );
   }catch ( e ) {
      alert("Error: " + e.description );
   }finally {
      alert("Finally block will always execute!" );
   }
}
//-->
</script>
</head>
<body>
<p>Click the following to see the result:</p>
<form>
<input type="button" value="Click Me" onclick="myFunc();" />
</form>
</body>
</html>

 

 

throw

throw역시 자바에 있는 개념이죠. 예외가 발생했을 때 내가 처리안하고 다른녀석한테 처리해달라고 던지는 놈입니다. throw의 사전적 의미가 "던지다" 입니다. 아래 예제를 한번 보죠.
<html>
<head>
<script type="text/javascript">
<!--
function myFunc()
{
   var a = 100;
   var b = 0;
   
   try{
      if ( b == 0 ){
         throw( "Divide by zero error." ); 
      }else{
         var c = a / b;
      }
   }catch ( e ) {
      alert("Error: " + e );
   }
}
//-->
</script>
</head>
<body>
<p>Click the following to see the result:</p>
<form>
<input type="button" value="Click Me" onclick="myFunc();" />
</form>
</body>
</html>

 

b에 0을 할당하고 b가 0이면 throw 하도록 만든 예제네요. throw가 어떤 식으로 화면에 표현되는지 한번 실행해보세요. 

 

onerror() 메소드

 onerror 메소드는 JavaScript에서 에러핸들링을 위해서 제일 처음 나온 기능이라고 합니다.  error 이벤트는 웹페이지에서 에러가 발생했을때 window객체에서 발생시킵니다. 아래 예제를 한번 볼까요.

<html>
<head>
<script type="text/javascript">
<!--
window.onerror = function () {
   alert("An error occurred.");
}
//-->
</script>
</head>
<body>
<p>Click the following to see the result:</p>
<form>
<input type="button" value="Click Me" onclick="myFunc();" />
</form>
</body>
</html>

에러가 발생하면 경고창을 띄우도록 해놓고 존재하지 않는 함수를 호출하는 예제군요.

한번 실행해보세요. 

 

 onerror 이벤트 핸들러는 세가지 정보를 제공합니다.

  • 에러메시지 . 브라우저가 보여주는 에러메시지입니다.

  • URL . 에러가 발생한 파일을 알려줍니다.

  • 라인 넘버 . 에러를 발생시킨 라인이 몇번째 라인인지를 알려줍니다.

이 세가지 정보를 어떻게받아오는지 한번 볼까요?

<html>
<head>
<script type="text/javascript">
<!--
window.onerror = function (msg, url, line) {
   alert("Message : " + msg );
   alert("url : " + url );
   alert("Line number : " + line );
}
//-->
</script>
</head>
<body>
<p>Click the following to see the result:</p>
<form>
<input type="button" value="Click Me" onclick="myFunc();" />
</form>
</body>
</html>

 

 

 

 onerror 메소드는 아래와같이 이미지를 불러올때 에러가 발생하면 메시지를 보여주기 위해서 사용될 수도 있습니다.

<img src="myimage.gif"
    onerror="alert('An error occurred loading the image.')" />

 

이 onerror메소드는 이미지 태그 이외에도 다른 태그에서도 사용될 수 있다는 것을 알아두시면 좋을 듯 싶네요.

 

 

 

Reference : http://www.tutorialspoint.com/javascript/javascript_error_handling.htm 

 

 

 

 


💻 Programming/Oracle 11g

ORA-01157: cannot identify/lock data file

ORA-01157: cannot identify/lock data file

데이타 파일을 실수로 삭제해버렸다가 DB재시작하게되면 아래처럼 오류가 발생하게 된다.

내가 아닌 누군가가 dbf생성했다가 drop명령을 쓰지않고 unix 콘솔에서 dbf파일을 삭제하게 되면 발생하게되는 오류인데 생각보다 쉽게 해결할 수 있습니다.



ERROR at line 1:
ORA-01157: cannot identify/lock data file 29 - see DBWR trace file
ORA-01110: data file 29:
'/opt/oracle/product/oracle9i/dbs/C:oracleproduct10.2.0oradatapentahoptho_ts.dbf
'

from above datafile name you have realized that its a kinda jerk :s someone has made a datafile with no sense and then he/she have removed the file by O.S command, but he/she did'nt updated database about it !

So during the test when we were starting this database it came untill mount stage and then got stuck !!! i.e.

Problem:

SQL> alter database open;
alter database open
*
ERROR at line 1:
ORA-01157: cannot identify/lock data file 29 - see DBWR trace file
ORA-01110: data file 29:
'/opt/oracle/product/oracle9i/dbs/C:oracleproduct10.2.0oradatapentahoptho_ts.dbf
'

so to fix it, i did following:

Solution:


SQL>alter database datafile 29 OFFLINE DROP;
SQL>alter database open;


출처 : http://nayyares.blogspot.kr/2009/08/ora-01157-cannot-identifylock-data-file.html


How to workaround WebLogic terminalio not found error

In some PC environments, you may have encounter error like following when trying to create and start a WebLogic Server domain admin server

<Mar 10, 2014 9:40:58 AM EDT> <Error> <Security> <BEA-090783> <Server is Running in Development Mode and Native Library(terminalio) to read the password securely from commandline is not found.><Mar 10, 2014 9:40:58 AM EDT> <Notice> <WebLogicServer> <BEA-000388> <JVM called WLS shutdown hook. The server will force shutdown now>
<Mar 10, 2014 9:40:58 AM EDT> <Notice> <WebLogicServer> <BEA-000365> <Server state changed to FORCE_SHUTTING_DOWN>

After this unfriendly message, your process will just exit and won't start at all! One quick fix for this is to try add this sys props -Dweblogic.management.allowPasswordEcho=true This will force the password prompt to echo out on console though, but at least it will start your server. And once the domain is created, you may restart it again without prompting password.

Ref: http://saltnlight5.blogspot.kr/2014/03/how-to-workaround-weblogic-terminalio.html



자바 옵션에 붉은 글씨로 된 부분을 추가해서 실행하시면 됩니다.

아...슬프도다....이 에러의 원인을 찾느라 얼마나 헤맸던지...

쿼리문의 인자로 들어가는 녀석들이 13개이고 이 쿼리문을 스트링 + 스트링 형식으로 묶어놨는데 콤마가 빠진 이유로 변수명이 부적합하다는 오류를 찍어대니 이거 원인을 어떻게 찾으라고.!!!!!!

 

구글링 해보니......

 

콤마가 빠져도 저런 오류를 뿌린다는 것...

 

잘 보니 인자가 많아서 줄바꿈할 때 쉼표를 하나 빼먹었던 것.


이 에러가 났을 때 뭐 때문에 busy라고 나오는지 궁금하다면??

sysdba권한으로 아래 쿼리를 날려보자. 무슨쿼리 때문에 어느 테이블이 lock이 걸려있는지 확인할 수 있다. 

SELECT O.OBJECT_NAME, S.SID, S.SERIAL#, P.SPID, S.PROGRAM,S.USERNAME,
S.MACHINE,S.PORT , S.LOGON_TIME,SQ.SQL_FULLTEXT 
FROM V$LOCKED_OBJECT L, DBA_OBJECTS O, V$SESSION S, 
V$PROCESS P, V$SQL SQ 
WHERE L.OBJECT_ID = O.OBJECT_ID 
AND L.SESSION_ID = S.SID AND S.PADDR = P.ADDR 
AND S.SQL_ADDRESS = SQ.ADDRESS;


위 쿼리를 실행해서 SID와 SERIAL#을 알아내면 아래와 같은 명령으로 해당 세션을 죽일 수 있다.

ALTER SYSTEM KILL SESSION 'SID, SERIAL#';

이상~!!! 당신에게 노력과 행운의 여신이 함께하여 문제가 해결되기를~~


테이블 스페이스를 튜닝하려고 아래 명령어를 입력하였다.

 

ALTER TABLESPACE 테이블스페이스명 AUTOEXTEND ON NEXT 1024K;

 

그랬더니 아래처럼 오류가 떨어졌다.

 

ORA-32773: operation not supported for smallfile tablespace 테이블스페이스명  

 

구글링해서 얻어온 해결책 하나. 아래 경우를 살펴보기 바란다.

 

 

SQL> alter tablespace users resize 300m;
alter tablespace users resize 300m
*
ERROR at line 1:
ORA-32773: operation not supported for smallfile tablespace USERS

SQL> select file_id, tablespace_name from dba_data_files;

   FILE_ID TABLESPACE_NAME
---------- ------------------------------
         1 SYSTEM
         2 UNDOTBS1
         3 SYSAUX
         4 USERS

SQL> alter database datafile 4 resize 300m;

Database altered.

//--------Description from online documents------------------------------------------------------------------
ORA-32773: operation not supported for smallfile tablespace string
Cause:
An attempt was made to perform. an operation which is supported only for bigfile tablespaces, e.g. resize tablespace.
Action: Use the appropriate clause of the ALTER DATABASE DATAFILE command instead.


SQL> alter tablespace users autoextend off;
alter tablespace users autoextend off
*
ERROR at line 1:
ORA-32773: operation not supported for smallfile tablespace USERS


SQL> alter database datafile 4 autoextend off;

Database altered.

 

출처 : http://blog.itpub.net/9765498/viewspace-259958/ 


ORA-00845: MEMORY_TARGET not supported on this system 오류가 발생했다!!!!!

으악!!!!

 

오라클을 재시작하려고 shutdown시킨 뒤 startup을 실행시켰더니 갑자기 이런 오류가 발생했다.

뭥미?? 처음 본 오류라 당황ㅠㅠ

 

구글링해보니 /dev/shm 마운트한거랑 관련이 있었다. 무슨 이유 때문에 발생했는지는 아직도 확실치 않지만...아래와 같이 해결했다.

 

$ umount -l tmpfs

( tmpfs는 /dev/shm이 마운트된 이름이다. 쉘에서 mount명령어로 확인했을때 제일 좌측에 나오는 이름 )

( -l (소문자L)옵션없이 언마운트시키려고 했을때는 busy라고 계속뜨길래 옵션을 주고 언마운트 시켰다. lazy umount 옵션이다. )

 

$ mount -t tmpfs tmpfs /dev/shm

( 다시 마운트 하기 ) 

 

그리고 sqlplus에 sysdba로 conn해서 

SQL> startup

 

게임오버~!  

 

좀 더 자세한 사항은 이곳을 참조하세요. 

device is busy 문제로 umount가 안된다면 이곳을 참조하세요. 


파티셔닝된 테이블의 테이블 스페이스를 옮기려고 할 때 발생했던 오류.

SQL> alter table 테이블명 move tablespace 테이블스페이스명

 

이런경우​에는 아래와 같은 명령어를 사용하자.

 

SQL> alter table 테이블명 modify default attributes tablespace 테이블스페이스명;

 

​그리고 부가적으로 처리해야 하는 일들이 좀 있다.

자세한 사항은 아래 영문을 확인해보길 바란다.

 

출처 : http://amit7oracledba.blogspot.kr/2013/03/move-partitioned-tables-to-different.html 

 

 

How to move partitioned tables to different tablespace

Yesterday I was trying to move a partitioned table to different tablespace using move command I got the following error:-

SQL> alter table partition move tablespace users parallel 10;
alter table partition move tablespace users parallel 10
            *
ERROR at line 1:
ORA-14511: cannot perform operation on a partitioned object


Default tablespace of partitioned table :-

SQL> select TABLE_NAME,PARTITIONING_TYPE,DEF_TABLESPACE_NAME from dba_part_tables where table_name='PARTITION';

TABLE_NAME                     PARTITIONING_TYPE                 DEF_TABLESPACE_NAME
----------------------------------------------------------------------------------------------------------------
PARTITION                          LIST                                               SYSTEM

Changing the default tablespace of Partition table. Now new partitions will be created in the new default tablespace, but old partitions will remain in the old default tablespace :-


SQL> alter table partition modify default attributes tablespace users;

Table altered.

SQL> select TABLE_NAME,PARTITIONING_TYPE,DEF_TABLESPACE_NAME from dba_part_tables where table_name='PARTITION';

TABLE_NAME                     PARTITIONING_TYPE                             DEF_TABLESPACE_NAME
----------------------------------------------------------------------------------------------------------------
PARTITION                          LIST                                               USERS

SQL> SELECT TABLE_NAME,PARTITION_NAME,TABLESPACE_NAME,NUM_ROWS FROM USER_TAB_PARTITIONS WHERE TABLE_NAME='PARTITION';

TABLE_NAME                     PARTITION_NAME                 TABLESPACE_NAME                  NUM_ROWS
----------------------------------------------------------------------------------------------------------------------------
PARTITION                          PAR1                                       SYSTEM
PARTITION                          PAR2                                       SYSTEM

SQL> SELECT * FROM PARTITION;

        ID NAME
---------- ---------------------
         1 d
         3 f
         7 y
         8 t

Analyzing above select statements, table partition have 4 records but records won't reflect in the NUM_ROWS column of USER_TAB_PARTITIONS  view. We need to gather the stats of Table "PARTITION" to reflect the records in NUM_ROWS column.


SQL> SHOW USER
USER is "SYS"
SQL> EXEC DBMS_STATS.gather_table_stats('SYS', 'PARTITION', granularity=>'ALL');

PL/SQL procedure successfully completed.


SQL> SELECT TABLE_NAME,PARTITION_NAME,TABLESPACE_NAME,NUM_ROWS FROM USER_TAB_PARTITIONS WHERE TABLE_NAME='PARTITION'

TABLE_NAME                     PARTITION_NAME                 TABLESPACE_NAME                  NUM_ROWS
-------------------------------------------------------------------------------------------------------------------------
PARTITION                         PAR1                                         SYSTEM                                  2
PARTITION                         PAR2                                         SYSTEM                                  2

Moving OLD partitions to different tablespace :-


SQL> select 'alter table ' || table_name || ' move partition ' || partition_name|| ' tablespace users parallel 10;' "PARTITION_MOVE_SCRIPT" from user_tab_partitions where table_name='PARTITION';

PARTITION_MOVE_SCRIPT
----------------------------------------------------------------------------------------------------------------------
alter table PARTITION move partition PAR1 tablespace users parallel 10;
alter table PARTITION move partition PAR2 tablespace users parallel 10;

After moving a table or partitioned table to different tablespace , indexes associated to the tablespace become unusable. We need to rebuild the associated indexes to make them usable.

Status of Indexes before moving a table :-


SQL>  select index_name,PARTITION_NAME,status from user_IND_PARTITIONS where TABLESPACE_NAME='SYSTEM';

INDEX_NAME                     PARTITION_NAME                 STATUS
----------------------------------------------------------------------------------------
PAR_IDX                             PAR1                                        USABLE
PAR_IDX                            PAR2                                         USABLE

 SQL> alter table PARTITION move partition PAR1 tablespace users parallel 10;

Table altered.

SQL> alter table PARTITION move partition PAR2 tablespace users parallel 10;

Table altered.

SQL>
SQL> SELECT TABLE_NAME,PARTITION_NAME,TABLESPACE_NAME,NUM_ROWS FROM USER_TAB_PARTITIONS WHERE TABLE_NAME='PARTITION';

TABLE_NAME                     PARTITION_NAME                 TABLESPACE_NAME                  NUM_ROWS
--------------------------------------------------------------------------------------------------------------------------
PARTITION                          PAR1                                        USERS                                   2
PARTITION                          PAR2                                        USERS                                   2

SQL> select index_name,PARTITION_NAME,status from user_IND_PARTITIONS where TABLESPACE_NAME='SYSTEM';

INDEX_NAME                     PARTITION_NAME                 STATUS
-----------------------------------------------------------------------------------------
PAR_IDX                              PAR1                                       UNUSABLE
PAR_IDX                              PAR2                                       UNUSABLE

It seems that the indexes becomes unusable. We need to rebuild the indexes to make them usable.

SQL> select 'alter index ' || a.index_name ||  ' rebuild partition ' || a.PARTITION_NAME || ' tablespace USERS parallel 10;' from user_ind_partitions a, user_tab_partitions b where a.partition_name=b.partition_name and b.table_name='PARTITION';


'ALTERINDEX'||A.INDEX_NAME||'REBUILDPARTITION'||A.PARTITION_NAME||'TABLESPACEUSERSPARALLEL10;'
-------------------------------------------------------------------------------------------------------------------------
alter index PAR_IDX rebuild partition PAR1 tablespace USERS parallel 10;
alter index PAR_IDX rebuild partition PAR2 tablespace USERS parallel 10;

SQL> select index_name,PARTITION_NAME,status from user_IND_PARTITIONS where TABLESPACE_NAME='USERS';

INDEX_NAME                     PARTITION_NAME                 STATUS
------------------------------------------------------------------------------------------
PAR_IDX                              PAR1                                        USABLE
PAR_IDX                              PAR2                                        USABLE

This way we can move a partitioned table having n number of partitions to different tablespace.