문제 해결
-
Visual Studio Package Manager Console 실행 오류2022.10.21
-
Windows 셧다운 관련 Event ID2021.10.12
-
방화벽 설정 command2021.09.17
-
DB 안에 있는 모든 테이블 삭제2021.08.10
-
SQL Server 트랜잭션 로그 정리2021.07.16
-
Windows 이벤트뷰어 - Event Id 정리2021.07.16
-
IIS FTP 사용하기2021.07.16
Visual Studio Package Manager Console 실행 오류
아래와 같이 뜰때는 위와 같이 해주자... gpedit.msc 실행해서 Windows PowerShell 스크립트 실행 설정 '사용'으로 변경
Windows 셧다운 관련 Event ID
The event ID's below will show you these details.
Event ID | Description |
41 | The system has rebooted without cleanly shutting down first. This error could be caused if the system stopped responding, crashed, or lost power unexpectedly. |
1074 | Logged when an app (ex: Windows Update) causes the system to restart, or when a user initiates a restart or shutdown. |
6006 | Logged as a clean shutdown. It gives the message "The Event log service was stopped". |
6008 | Logged as a dirty shutdown. It gives the message "The previous system shutdown at time on date was unexpected". |
This tutorial will show you how to view the date, time, and user details of all shutdown and restart event logs in Windows 7, Windows 8, and Windows 10.
10016 오류 해결 방법
방화벽 설정 command
1. 프로그램 허용
a. netsh advfirewall firewall add rule name=”My Application” dir=in action=allow program=”C:\MyApp\MyApp.exe” enable=yes
b. netsh advfirewall firewall add rule name=”My Application” dir=in action=allow program=”C:\MyApp\Myapp.exe” enable=yes remoteip=157.60.0.1, 172.16.0.0/16,LocalSubnet profile=domain
2. 포트 허용
a. netsh advfirewall firewall add rule name=”Open Port 80” dir=in action=allow protocol=TCP localport=80
3. 허용된 프로그램과 포트 룰 제거 하기
a. netsh advfirewall firewall delete rule name=”rulename” program=”C:\MyApp\MyApp.exe”
b. netsh advfirewall firewall delete rule name=”rulename” protocol=udp localport=500
4. ICMP 설정 하기
a. netsh advfirewall firewall add rule name=”ICMP Allow incoming V4 echo request” protocol=icmpv4:8,any dir=in action=allow
b. netsh advfirewall firewall add rule name=”All ICMP V4” protocol=icmpv4:any,any dir=in action=allow
5. 로깅 설정
a. netsh advfirewall set currentprofile logging filename %systemroot%\system32\LogFiles\Filewall\pfirewall.log
b. netsh advfirewall set currentprofile logging maxfilesize 4096
c. netsh advfirewall set currentprofile logging droppedconnections enable
d. netsh advfirewall set currentprofile logging allowedconnections enable
6. 방화벽 On/Off
a. netsh advfirewall set currentprofile state on
b. netsh advfirewall set currentprofile state on
netsh advfirewall set currentprofile firewallpolicy blockinboundalways,allowoutbound
c. netsh advfirewall set domainprofile state on
netsh advfirewall set domainprofile firewallpolicy blockinbound,allowoutbound
d. netsh advfirewall set domainprofile state on
netsh advfirewall set private profile state on
7. 방화벽 설정 초기화
a. Netsh advfirewall reset
8. 특정 서비스 허용
a. netsh advfirewall firewall set rule group=”File and Printer Sharing” new enable=yes
b. netsh advfirewall firewall set rule group=”remote desktop” new enable=yes
c. netsh advfirewall firewall set rule group=”remote desktop” new enable=yes profile=domain
d. netsh advfirewall firewall set rule group=”remote desktop” new enable=yes profile=private
적용 대상
Windows Vista
Windows 7
Windows 2008
Windows 2008 R2
DB 안에 있는 모든 테이블 삭제
master나 tempdb는 제외하고 생성된 모든 테이블을 삭제
DECLARE @Sql NVARCHAR(500) DECLARE @Cursor CURSOR
SET @Cursor = CURSOR FAST_FORWARD FOR
SELECT DISTINCT sql = 'ALTER TABLE [' + tc2.TABLE_SCHEMA + '].[' + tc2.TABLE_NAME + '] DROP [' + rc1.CONSTRAINT_NAME + '];'
FROM INFORMATION_SCHEMA.REFERENTIAL_CONSTRAINTS rc1
LEFT JOIN INFORMATION_SCHEMA.TABLE_CONSTRAINTS tc2 ON tc2.CONSTRAINT_NAME =rc1.CONSTRAINT_NAME
OPEN @Cursor FETCH NEXT FROM @Cursor INTO @Sql
WHILE (@@FETCH_STATUS = 0)
BEGIN
Exec sp_executesql @Sql
FETCH NEXT FROM @Cursor INTO @Sql
END
CLOSE @Cursor DEALLOCATE @Cursor
GO
EXEC sp_MSforeachtable 'DROP TABLE ?'
GO
출처1 : https://stackoverflow.com/questions/8439650/how-to-drop-all-tables-in-a-sql-server-database
참고 : https://www.mssqltips.com/sqlservertip/6798/drop-all-tables-sql-server/
SQL Server 트랜잭션 로그 정리
-- 로그 정보확인
DBCC SQLPERF(LOGSPACE)
EXEC SP_HELPFILE
SELECT * FROM SYSFILES
-- 데이터베이스 복구 모델을 SIMPLE로 설정하여 파일을 자름
ALTER DATABASE XXXX
SET RECOVERY SIMPLE;
DBCC SHRINKFILE (XXXX_Log, TRUNCATEONLY);
Windows 이벤트뷰어 - Event Id 정리
6005 : 시스템 시작 후 발생 (재부팅 여부를 알 수 있음)
27 : 네트워크 끊김!
IIS FTP 사용하기
FileZila Server를 사용하다가 로그인도 지연되고, 커맨드를 전송해도 Time out 에러가 리턴되는 현상이 간혹 있었다.
PC는 동일해도 이런 현상이 특정한 곳에만 나타나는 걸 보면 PC 문제는 확실히 아닌 것 같다.
정확한 원인은 모르겠으나, 구글링을 해보면 DNS설정이나 공유기 설정에 문제가 있을 수 있다는 의견도 꽤 있다.
나같은 경우는 이런저런 방법을 다 써봐도 안되길래 그냥 심플하게 Windows 자체에 있는 IIS의 FTP를 쓰기로 했다.
앞으로는 무조건 이 방법을 써야겠다! 만약 이 방법이 안되면 대비책으로 FileZila를 쓰는 방향으로!!
- Windows 기능 켜기/끄기로 진입
우리가 설정해야할 항목은 전부 [인터넷 정보 서비스] 항목의 하위 트리다.
여기서 FTP 관련된 것 2개는 모두 체크하고, IIS 관련된 항목은 맨 아래에 있는 'IIS 관리 콘솔' 하나만 체크해도 된다.
(IIS 관련된 항목은 이미 사용중이라면 기존 세팅을 그대로 둔다.)
시작 - 모든 프로그램 - Windows 관리 도구에서 IIS 관리자를 실행합니다.
IIS에서 사이트에 오른쪽 클릭 후 FTP 사이트 추가를 진행합니다.
FTP 사이트 이름과 위에서 생성한 FTP 실제 폴더 경로를 설정합니다.
IP 주소는 기본 IPv4 주소나 지정하지 않은 기본 호스트주소로 설정하고 포트도 기본 21로 설정합니다. SSL 인증서가 있는 환경에서만 SSL을 허용합니다.
익명 인증은 FTP 사용 시 누구나 사용할 수 있도록 허용하는 것이고 기본 인증은 윈도우 로컬 계정이나 그룹에 한해 이용가능하도록 허용할 수 있습니다. 우선은 기본 인증과 모든 사용자에 대해 읽기/쓰기 권한을 넣습니다. 이 설정은 FTP사이트가 생성된 후 FTP 인증에서 변경할 수 있습니다.
다음으로 FTP에 사용할 계정을 생성합니다. 윈도우 탐색기 - 내 PC에서 우클릭 - 관리 페이지를 엽니다.
관리페이지의 시스템 도구 - 로컬 사용자 및 그룹 - 사용자에서 기본 사용자(여기에서는 young)이 외에 FTP이용을 위한 새 사용자를 생성합니다.
다시 IIS로 돌아가 FTP 권한 부여 규칙을 선택합니다. 모든 사용자에 대해 허용된 권한 규칙을 제거하고 위에서 생성한 FTP 전용 계정에 권한을 부여합니다.
위 설정으로 내부망에서 FTP 사용은 완료되었습니다. 다음은 iptime사용자에 한해 포트포워딩 기능으로 외부에서 FTP 사용이 가능하도록 설정합니다. iptime 기본 설정은 이글을 참고하여 DDNS설정을 해주시길 바랍니다. 공유기 관리페이지로 이동하여 FTP 설정합니다.
외부망에서 ftp://{DDNS 호스트이름}.iptime.org 를 탐색기에 검색하고 위에서 생성한 FTP 계정으로 접속후 정상적으로 FTP 사용이 가능합니다.
FTP 이용시 아래와 같이 한글로 된 파일을 송수신할 때 발생하는 오류는 IIS에서 FTP 사이트 - 고급 설정 - UTF8허용 옵션을 False로 변경하고 재시작합니다.
FTP 계정이 없이 익명 인증으로 이용할 때 외부망에서 접속이 불가한 경우
FTP 규칙은 미리 정의 되어 있으므로 FTP 서버 규칙을 선택합니다.
출처 1 : https://offbyone.tistory.com/301
출처 2 : https://luvery93.github.io/articles/2019-01/ftp-setting-with-iis