🗄DATABASE/Oracle

오라클 기본 설정

코너(Corner) 2021. 4. 11.
반응형
//계정 규칙 제한 없애기

SQL> alter session set "_ORACLE_SCRIPT"=true;

// 계정생성 (root / 1234)

SQL> create user root identified by 1234;

// 권한 추가

SQL> grant connect, resource, dba to root;

 

 

 

——타임존 설정, utf-8———

// 오라클 설정 파일 확인

> docker exec -it ora_custom_db bash -c "cat /home/oracle/.bashrc"

// Timezone 변경

> docker exec -it ora_custom_db bash -c "echo "export TZ='Asia/Seoul'" >> /home/oracle/.bashrc"

// sqlplus 접속

> docker exec -it ora_custom_db bash -c "source /home/oracle/.bashrc; sqlplus sys/Oradoc_db1@ORCLCDB as sysdba"

// language utf8 업데이트

SQL> update sys.props$ set value$='KOREAN_KOREA.UTF8' where name='NLS_LANGUAGE';

// characterset utf8 업데이트

SQL> update sys.props$ set value$='UTF8' where name='NLS_CHARACTERSET';

// nchar characterset utf8업데이트

SQL> update sys.props$ set value$='UTF8' where name='NLS_NCHAR_CHARACTERSET';

// 반영

SQL> commit;

// 재부팅

SQL> shutdown immediate;

SQL> conn / as sysdba;

SQL> startup;


————————위에가 안되면 다른 방법————————

SQL> shutdown immediate;

SQL> conn sys as sysdba;

SQL> startup;

SQL> SHUTDOWN IMMEDIATE;

SQL> conn sys as sysdba;

SQL> STARTUP MOUNT;

SQL> ALTER SYSTEM ENABLE RESTRICTED SESSION;

System altered.

SQL> ALTER SYSTEM SET JOB_QUEUE_PROCESSES=0;

System altered.

SQL> ALTER SYSTEM SET AQ_TM_PROCESSES=0;

System altered.

SQL> ALTER DATABASE OPEN;

Database altered.

SQL> COL VALUE NEW_VALUE CHARSET

SQL> SELECT VALUE FROM NLS_DATABASE_PARAMETERS WHERE PARAMETER='NLS_CHARACTERSET';

UTF8

SQL> COL VALUE NEW_VALUE NCHARSET

SQL> SELECT VALUE FROM NLS_DATABASE_PARAMETERS WHERE PARAMETER='NLS_NCHAR_CHARACTERSET';

SQL> ALTER DATABASE CHARACTER SET INTERNAL_USE &CHARSET;

SQL> ALTER DATABASE NATIONAL CHARACTER SET INTERNAL_USE &NCHARSET;

SQL> SHUTDOWN IMMEDIATE;

SQL> conn / as sysdba;

SQL> STARTUP;

——————————————————————————

 

[Docker] - Docker 도커 기본적인 명령어 수행

반응형

댓글