Oracle hr 확인

sql 2015. 3. 6. 01:45

처음 설치시 oracle password :  system/oracle


계정접속후 SID 확인

show parameter instance_name
select instance_name from v$instance;


SID 확인

lsnrctl services




alter user hr identified by hr account unlock;


alter user hr identified by hr;



alter system set sec_case_sensitive_logon=false;


'sql' 카테고리의 다른 글

sqlplus shell에서 실행하기.  (0) 2017.02.15
오라클 월 마지막날 첫째날 구하기  (0) 2014.09.12
그룹함수 NTILE  (0) 2014.08.01
sqlite에서 rownum기능.. LIMIT  (0) 2014.07.31
yyyymmdd를 종종 yyyy-mm-dd로 표현해야 할때..  (0) 2014.07.17
Posted by 무세1
,

spring + mybatis 프로젝트 구성


src/main/java 폴더에 mapper.xml 파일을 위치 시키니 maven build mapper.xml 파일이 누락되는 현상이 발생함.


src/main/resources 폴더에 mapper.xml 파일을 옮긴 후에 빌드하니 정상적으로 됨.

'java' 카테고리의 다른 글

java.sql.SQLRecoverableException: IO Error: Connection reset 오류 해결  (0) 2015.11.30
springboot connection pool 설정  (0) 2015.10.22
spring mysql datasouce  (0) 2015.02.08
쓰레드.. wait, notify, notifyAll  (0) 2014.07.09
Thread join 함수  (0) 2014.07.09
Posted by 무세1
,

spring mysql datasouce

java 2015. 2. 8. 17:35

mysql> create user testuser;

Query OK, 0 rows affected (0.00 sec)


mysql> create user testuser@localhost identified by 'testuser';

Query OK, 0 rows affected (0.00 sec)


mysql> create schema test default character set utf8;

Query OK, 1 row affected (0.00 sec)


mysql> select host, user, password from user;

+-----------------------+----------+-------------------------------------------+

| host                  | user     | password                                  |

+-----------------------+----------+-------------------------------------------+

| localhost             | root     |                                           |

| skp1002428mn001.local | root     |                                           |

| 127.0.0.1             | root     |                                           |

| ::1                   | root     |                                           |

| localhost             |          |                                           |

| skp1002428mn001.local |          |                                           |

| %                     | testuser |                                           |

| localhost             | testuser | *3A2EB9C80F7239A4DE3933AE266DB76A7846BCB8 |

+-----------------------+----------+-------------------------------------------+

8 rows in set (0.00 sec)


mysql> grant all privileges on test.* to testuser@localhost;

Query OK, 0 rows affected (0.00 sec)


mysql> grant select, insert, update, delete on test.* to testuser@localhost;

Query OK, 0 rows affected (0.01 sec)


mysql> flush privileges;

Query OK, 0 rows affected (0.00 sec)




mysql -utestuser -ptestuser



    <bean id="dataSource" class="org.springframework.jdbc.datasource.DriverManagerDataSource">  

        <property name="driverClassName" value="com.mysql.jdbc.Driver" />

        <property name="url" value="jdbc:mysql://localhost:3306/test" />

        <property name="username" value="testuser" />

        <property name="password" value="testuser" />

    </bean>



'java' 카테고리의 다른 글

springboot connection pool 설정  (0) 2015.10.22
maven build 할때 mapper.xml 누락되는 현상  (0) 2015.03.05
쓰레드.. wait, notify, notifyAll  (0) 2014.07.09
Thread join 함수  (0) 2014.07.09
Spring - IoC & DI & AOP ( 퍼옴 )  (0) 2014.07.03
Posted by 무세1
,

tomcat의 커넥션풀을 쓰지 않는 경우..


제니퍼 4.5.3버전 이상인 경우에..


enable_direct_sql_trace=true 변경하면 잘 나온다..

'기타' 카테고리의 다른 글

제니퍼 SQL 안나오는 문제  (0) 2015.10.22
Posted by 무세1
,

traceroute 명령어

linux 2014. 12. 10. 10:23

traceroute -T -p 1700 10.1.1.23


포트까지 traceroute

'linux' 카테고리의 다른 글

리눅스 file 사이즈 0 으로 만들기  (0) 2015.07.31
리눅스 find cp 혼합  (0) 2015.07.29
ssh, sftp 명령어..  (0) 2014.06.11
gzip 사용법  (0) 2014.03.27
hp unix, ibm unix 한글 언어 확인  (0) 2014.03.24
Posted by 무세1
,

sudo nano /private/etc/hosts


##

# Host Database

#

# localhost is used to configure the loopback interface

# when the system is booting.  Do not change this entry.

##

127.0.0.1       localhost

255.255.255.255 broadcasthost

::1             localhost

10.2.2.10      test.domain.com


Ctrl+o

Enter

Ctrl+x



바로 적용을 위해서

dscacheutil -flushcache


Posted by 무세1
,

맥북 mariadb 설치하기

맥북 2014. 11. 10. 22:43

Homebrew 설치 되어 있다는 가정하에 진행함.

terminal 실행후 아래 두 명령어를 실행하면 끝.


>brew update


>brew install mariadb


mariadb 설치후 db실행

>mysql.server start


mariadb 설치후 db stop

>mysql.server stop


mariadb 접속

mysql -uroot


맥북 실행시 mariadb 실행하려면

> ln -sfv /usr/local/opt/mariadb/*.plist ~/Library/LaunchAgents

> launchctl load ~/Library/LaunchAgents/homebrew.mxcl.mariadb.plist



Posted by 무세1
,

맥북 homebrew 설치하기

맥북 2014. 11. 10. 22:26

맥북에 homebrew 설치할때, 일단 terminal 실행한다.


ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"


위 명령어를 실행하면 설치를 진행한다.

설치진행시 패스워드를 입력하라는 창이 나오면 패스워드를 입력한다.


설치 진행은 아래와 같이 진행된다.



Posted by 무세1
,

오라클에서 제공하는 날짜 함수중 월의 마지막날을 구하는 LAST_DAY 함수가 있다.

> SELECT  TO_CHAR(LAST_DAY(SYSDATE),'YYYYMMDD') MONTH_LAST_DAY FROM DUAL


MONTH_LAST_DAY

------------------

20140930


그러면 월의 첫째날은 어떻게 구해야 할까?

월의 마지막 날에서 하루를 더하면 다음달의 첫날이 된다. 그리고 ADD_MONTHS 라는 함수를 이용해서 한달을 빼면 월의 첫째날을 구할 수 있다.

> SELECT  TO_CHAR(ADD_MONTHS(LAST_DAY(SYSDATE)+1,-1),'YYYYMMDD') MONTH_FIRST_DAY

FROM    DUAL


MONTH_FIRST_DAY

------------------ 

20140901


* 이 방법이 더 단순하네요..

select  trunc(sysdate,'MM') from dual;


'sql' 카테고리의 다른 글

sqlplus shell에서 실행하기.  (0) 2017.02.15
Oracle hr 확인  (0) 2015.03.06
그룹함수 NTILE  (0) 2014.08.01
sqlite에서 rownum기능.. LIMIT  (0) 2014.07.31
yyyymmdd를 종종 yyyy-mm-dd로 표현해야 할때..  (0) 2014.07.17
Posted by 무세1
,

jdk에서 제공하는 api를 쓰지 않고 대소문자 변환 직접 구현


public class ConvertString {


  private static final int lowerStart   = 97; //소문자 'a' 아스키 값

  private static final int lowerEnd     = 122;  //소문자 'x' 아스키 값

  private static final int upperStart   = 65; //대문자 'A' 아스키 값

  private static final int upperEnd     = 90; //대문자 'X' 아스키 값

  

  public static char convertUpperToLower(char s) {

    int i=s;

    if(i>=upperStart && i<=upperEnd) i = i+32;  //대문자인 경우 +32 하면 소문자로 변환

    return (char)i;

  }

  

  public static char convertLowerToUpper(char s) {

    int i=s;

    if(i>=lowerStart && i<=lowerEnd) i = i-32;  //소문자인 경우 -32 하면 소문자로 변환

    return (char)i;

  }

  

  public static void main(String[] args) {

    System.out.println(convertUpperToLower('A'));

    System.out.println(convertUpperToLower('X'));

    System.out.println(convertLowerToUpper('a'));

    System.out.println(convertLowerToUpper('x'));

  }

}


java에서 제공되는 api는..

String a = "A";

String b = "a";

System.out.println(a.toLowerCase());    // String 형에서 제공되는 소문자 변환 함수

System.out.println(b.toUpperCase());    // String 형에서 제공되는 대문자 변환 함수


//Charactor 형에서 제공되는 대소문자 변환 함수

System.out.println(Character.toLowerCase('A'));

System.out.println(Character.toUpperCase('b'));



Posted by 무세1
,