'주디아줌마'에 해당되는 글 340건

  1. 가상계정 로컬 정책 추가 하기
  2. DB 개체 스크립트 하기
  3. 진단 분석 저장프로시져 sp_server_diagnostics
  4. SQL SERVER 2012 EDITIONS 2
  5. 몽고DB Sharding 설정 및 테스트 16
  6. SQL 설치 유용한 스크립트
  7. 몽고DB Config 설정하기(Win7)
  8. Free ebook: Introducing Microsoft SQL Server 2012
  9. Mongdb 시작
  10. Mongo DB 설치 (윈7)

Windows 2008, windows 7이후 버젼부터 가상계정이 생겼습니다. 가상계정에 로컬 정책을 위해서는 아래와 같이 사용자 또는 그룹 추가 해야합니다. 


가상 계정 정보 조회 

select name from sys.syslogins where name like 'nt service%'



가상계정으로 계정 및 그룹에 보이지는 않습니다.

1) nt service\mssql$sql2012을 입력하고 나서 이름 확인을 누른다.

2) 이름 확인후 보이는 화면. 

3) 등록 완료


DB 개체 스크립트 하기

DB를 개발하게 되면 일별 폴백업이 아닌 DB Script들만 따로 백업 받고 싶을 때가 있다. 이때 사용할 수 있는게 C#을 이용하면 아주 편하다.

꿈꾸는 거북이님의 스크립트를 이용해서 약간만 수정해서 만들어 보니 아주 편하다^^

 꿈꾸는 거북이님의 원본 글 

http://blog.naver.com/hrk007/60156735472


1. 소스


using System;
using System.Collections.Generic;
using System.Collections.Specialized;
using System.Collections.ObjectModel;
using System.Linq;
using System.Text;
using System.IO;
using System.Diagnostics.Eventing;

using Microsoft.SqlServer.Management.Sdk;
using Microsoft.SqlServer.Management.Sdk.Sfc;
using Microsoft.SqlServer.Management.Smo;
using Microsoft.SqlServer.Server;
using Microsoft.SqlServer.Management.Common;

// ++ 참고 사이트
// http://blog.naver.com/PostView.nhn?blogId=hrk007&logNo=60156735472&categoryNo=0&parentCategoryNo=0&viewDate=¤tPage=1&postListTopCurrentPage=&userTopListOpen=true&userTopListCount=30&userTopListManageOpen=false&userTopListCurrentPage=1
// http://blogs.lessthandot.com/index.php/DataMgmt/DBAdmin/MSSQLServerAdmin/smo-script-index-and-fk-s-on-a-database
// http://www.mssqltips.com/sqlservertip/1833/generate-scripts-for-database-objects-with-smo-for-sql-server/

namespace DBManagement
{
    class DBScripting
    {
        static void Main(string[] args)
        {
            if (args.Length < 1)
            {
                throw new Exception("입력파라메터 필요 ex) 저장폴더 서버 db1,sp,table:db2,table");
            }
            
            string folder = args[0];
            Server myServer = new Server(args[1]);
            string[] databaseList = args[2].Split(new char[] { ':' });
            
            
            try
            {
                // 1. Using windows authentication
                myServer.ConnectionContext.LoginSecure = true;
                // 2. Using SQL Server authentication
                //myServer.ConnectionContext.LoginSecure = false;
                //myServer.ConnectionContext.Login = "";
                //myServer.ConnectionContext.Password = "";
                myServer.ConnectionContext.Connect();
                // GetSmoTest(myServer, databaseList, folder);
                getSMOObject(myServer, databaseList, folder);
            }
            catch (Exception ex)
            {
                insertWindowEventLog(ex.Message);
            }
            finally
            {
                if (myServer.ConnectionContext.IsOpen)
                    myServer.ConnectionContext.Disconnect();
            }
        } // end main


        // DB 내의 모든 SMO Object 정보 수집
        private static void getSMOObject(Server myServer, string[] databaseList, string folder)
        {
            //foreach (Database myDatabase in myServer.Databases)
            //{
            //    Console.WriteLine(myDatabase.Name);
            //}

            Urn[] urns = null;
            for (int i = 0; i < databaseList.Length; i++)
            {
                // init
                urns = null;
                // ibdb,table,sp
                string[] objList = databaseList[i].Split(new char[] {','});
                // 요청 DB name
                Database db = myServer.Databases[objList[0]];

                List list = new List();

                // 테이블
                for (int j = 1; j < objList.Length; j++)
                {
                    list = new List();
                    urns = null;

                    // 테이블
                    if (objList[j].ToUpper().Equals("TABLE"))
                    {
                        Scripter scripter = new Scripter(myServer);
                        scripter.Options.FileName = setFileName(folder, objList[0], objList[j]);                        
                        scripter.Options.AppendToFile = true;
                        scripter.Options.Indexes = true;
                        scripter.Options.ClusteredIndexes = true;
                        scripter.Options.ScriptSchema = true;
                        scripter.Options.NoCollation = true;
                        scripter.Options.DriDefaults = true;
                        scripter.Options.DriAllConstraints = true;                        
                        scripter.Options.ScriptDrops = false;

                        foreach (Table table in db.Tables)
                        {
                            if (!table.IsSystemObject)
                            {
                                //list.Add(table.Urn);
                                scripter.Script(new Urn[] { table.Urn });
                            }                            
                        }

                        //urns = list.ToArray();
                        //scripter.Script(urns);


                    }// if table


                    // SP
                    if (objList[j].ToUpper().Equals("SP"))
                    {
                        foreach (StoredProcedure sp in db.StoredProcedures)
                        {
                            if (!sp.IsSystemObject && !sp.IsEncrypted)
                            {
                                list.Add(sp.Urn);
                            }                            
                        }
                        urns = list.ToArray();
                        Scripter scripter = new Scripter(myServer);
                        scripter.Options.FileName = setFileName(folder, objList[0], objList[j]);
                        scripter.Options.AppendToFile = true;                        
                        scripter.Script(urns);
                    } // if sp

                    // View
                    if (objList[j].ToUpper().Equals("VIEW"))
                    {
                        foreach (View vw in db.Views)
                        {                            
                            if (!vw.IsSystemObject && !vw.IsEncrypted)
                            {
                                list.Add(vw.Urn);
                            }
                        }

                        urns = list.ToArray();
                        Scripter scripter = new Scripter(myServer);
                        scripter.Options.FileName = setFileName(folder, objList[0], objList[j]);
                        scripter.Options.AppendToFile = true;
                        scripter.Script(urns);
                    } // if sp                    

                    // function
                    if (objList[j].ToUpper().Equals("FUNC"))
                    {
                        foreach (UserDefinedFunction uf in db.UserDefinedFunctions)
                        {
                            if (!uf.IsSystemObject && !uf.IsEncrypted)
                            {
                                list.Add(uf.Urn);
                            }
                        }

                        urns = list.ToArray();
                        Scripter scripter = new Scripter(myServer);
                        scripter.Options.FileName = setFileName(folder, objList[0], objList[j]);
                        scripter.Options.AppendToFile = true;
                        scripter.Script(urns);
                    } // if sp    


                } // end object
                        
            } // for (database)
        }
 

        // 윈도우 Event Log 입력
        private static void insertWindowEventLog(string message)
        {
            try
            {
                System.Diagnostics.EventLog eventLog = new System.Diagnostics.EventLog();
                if (!System.Diagnostics.EventLog.SourceExists("DBObjectScript"))
                {
                    System.Diagnostics.EventLog.CreateEventSource("DBObjectScript", "Application");
                }
                eventLog.Source = "DBObjectScript";
                int eventID = 8;
                eventLog.WriteEntry(message,
                                    System.Diagnostics.EventLogEntryType.Error,
                                    eventID);
                eventLog.Close();
            }
            catch (Exception ex)
            {
                Console.WriteLine(ex.Message);
            }
        }
 

        // 파일명 생성 folderName = "D:\objectscript"
        private static string setFileName(string folderName, string dbname, string objectname)
        {
            string filename = "";
            // 디렉토리
            try
            {
                // 생성
                DirectoryInfo Dir = new DirectoryInfo(folderName);
                if (!Dir.Exists)
                {
                    Dir = Directory.CreateDirectory(folderName);
                }

                filename = folderName + "\\" + dbname + "_" + objectname + "_"
                            + DateTime.Now.ToString("yyyymmdd_hhmm") + ".sql";
                

                // 일자_시분초.sql
                //filename = folderName + "\\" + dbname + "_" + objectname + "_"
                //    + DateTime.Now.ToShortDateString().Replace(":","")
                //    + "_" + DateTime.Now.ToShortTimeString().Replace(":", "") + ".sql";
            }
            catch (Exception ex)
            {
                insertWindowEventLog(ex.Message);
            }
            finally
            {
                if (filename == "")
                  filename = folderName + "\\" + dbname + "_objectscript.sql";  
            }
            return filename;
            
        }
 

    }
}


2. 실행파일

아래의 실행 파일을 다운로드 받거나 위의 소스를 컴파일해서 사용한다.

DBScripting.zip



3. 사용방법

저장경로 DB서버주소 DB명 저장하려고 하는 개체

실행 예) 저장폴더  서버 DB,table,sp,view,func:DB,table 

D:\TEST\DBScripting\DBScripting\bin\Release\DBScripting.exe G:\TEST JUDY\SQL2012 TSQL2012,table,sp,view,func

4. SQL Agent JOB 등록


5. 스크립트 관리??

스크립트 비교 검증 어떻게 할까?? 나는 주로 WinMerge를 애용한다..

위와 같이 비교가 가능하다.



'Etc' 카테고리의 다른 글

SQL 책 추천(강력 추천)  (0) 2012.05.16
몽고DB 책 소개  (0) 2012.05.16
몽고DB Replicated Shard Cluster + Arbitor  (0) 2012.03.19
몽고DB 활용 사례  (0) 2012.03.19
몽고DB Sharding 설정 및 테스트  (16) 2012.02.29

  SQL Server가 업그레이드 할수록 내부적으로 진단할 수 있는 시스템 저장프로시져나 DMV를 제공하는데, SQL2012에서는 진단분석을 할 수 있는 시스템 저장프로시져를 제공합니다. 완전 좋은 기능이죠. 기존에는 DMV나 쿼리로 돌렸으나 내부적으로 제공을 하니 얼마나 좋은 기능입니까?

원본글

http://www.mssqltips.com/sqlservertip/2647/capture-diagnostic-data-and-health-information-in-sql-server-2012-using-spserverdiagnostics-system-stored-procedure/?utm_source=dailynewsletter&utm_medium=email&utm_content=headline&utm_campaign=2012422


MSDN

http://msdn.microsoft.com/en-us/library/ff878233(v=sql.110).aspx


Use master
GO
EXEC sp_server_diagnostics 
GO

Capture Diagnostic Data and Health Information in SQL Server 2012

특정시간 동안 반복적으로 진단 분석하고 싶다면, @repeat_interval값을 0보다 큰값으로 지정하면 반복적으로 진단 정보를 반환합니다.

• System: - It collects information with respect to CPU Usage, Page Faults, Non Yielding Tasks, Latches, Access Violations, Dumps and Spinlock Activity.
• Resource: - It collects data such as Physical and Virtual Memory, Page Faults, Cache, Buffer Pools and other relevant memory related objects. 
• Query Processing: - It collects data with respect to Query Processing such as Wait Types, Tasks, Worker Threads, CPU Intensive Requests and Blocking tasks etc. 
• IO Subsystems: - It collects data with respect to IO such as IO Latch Time outs, Interval Long IO’s, Longest Pending Requests etc.

• Events: -It collects data such as ring buffer exceptions, ring buffer events about memory broker, buffer pool, spinlocks, security, out of memory, scheduler monitor etc.


SQL SERVER 2012 EDITIONS


SQL2012 라인센스 정책. 

가.  a core licensing model for the Enterprise and Standard edition.
나.  Business Intelligence  추가. 


Feature Name

Enterprise

Business Intelligence

Standard

Web

Express with Advanced Services

Express with Tools

Express

Maximum Compute Capacity Used by a Single Instance (SQL Server Database Engine)1

Operating System maximum

Limited to lesser of 4 Sockets or 16 cores

Limited to lesser of 4 Sockets or 16 cores

Limited to lesser of 4 Sockets or 16 cores

Limited to lesser of 1 Socket or 4 cores

Limited to lesser of 1 Socket or 4 cores

Limited to lesser of 1 Socket or 4 cores

Maximum Compute Capacity Used by a Single Instance (Analysis Services, Reporting Services) 1

Operating system maximum

Operating system maximum

Limited to lesser of 4 Sockets or 16 cores

Limited to lesser of 4 Sockets or 16 cores

Limited to lesser of 1 Socket or 4 cores

Limited to lesser of 1 Socket or 4 cores

Limited to lesser of 1 Socket or 4 cores

Maximum memory utilized (SQL Server Database Engine)

Operating system maximum

64 GB

64 GB

64 GB

1 GB

1 GB

1 GB

Maximum memory utilized (Analysis Services)

Operating system maximum

Operating system maximum

64 GB

N/A

N/A

N/A

N/A

Maximum memory utilized (Reporting Services)

Operating system maximum

Operating system maximum

64 GB

64 GB

4 GB

N/A

N/A

Maximum relational Database size

524 PB

524 PB

524 PB

524 PB

10 GB

10 GB

10 GB


http://www.microsoft.com/sqlserver/en/us/sql-2012-editions.aspx




테스트 환경 : Win7 64bit, SSD 128G, Memory 8G

 
1. DB 폴더 생성(관리자 권한 실행)

D:\DB\MONGO>mkdir SHARD1, SHARD2, CONFIG

 
2. 샤딩 서비스 실행

가. 설정 서버 실행

D:\DB\MONGO>mongod --dbpath D:\DB\MONGO\CONFIG --port 20000

 
나. 라우팅 서버 실행

D:\DB\MONGO>mongos --port 30000 --configdb localhost:20000

 
다. 샤딩 인스턴스 1, 2 실행

D:\DB\MONGO>mongod --dbpath D:\DB\MONGO\SHARD1 --port 10000
D:\DB\MONGO>mongod --dbpath D:\DB\MONGO\SHARD2 --port 10001  

 
3. 샤딩 구성

가. mongos 라우팅 인스턴스 접속

C:\Users\judydba>mongo localhost:30000/admin

MongoDB shell version: 2.0.2

connecting to: localhost:30000/admin


 
나. 샤드 구성
addshard 명령어로 샤드를 추가

mongos> db.runCommand( {addshard : "localhost:10000", allowLocal:true})

{ "shardAdded" : "shard0000", "ok" : 1 }

mongos> db.runCommand( {addshard : "localhost:10001", allowLocal:true})

{ "shardAdded" : "shard0001", "ok" : 1 }

※ allowLocal 키는 localhost에 샤드를 실행할 때만 필요합니다. 몽고디비는 실수로 로컬에 클러스터를 설정하는 사태를 막기 위해. allowLocal:true는 생략 가능
 

다. 데이터 샤딩
데이타 분산을 위한 데이터베이스와 컬렉션 수준으로 명시적 설정 
testdb의 test collection을 분산.
분산을 위한 샤드 키는 seq 설정

mongos> db.runCommand({ "enablesharding" : "testdb" })

{ "ok" : 1 }

mongos> db.runCommand({ "shardcollection" : "testdb.test", "key" : {"seq" : 1}})

{ "collectionsharded" : "testdb.test", "ok" : 1 }

 
라. 샤드 구성 확인
청크 사이즈  64M

mongos> use config

switched to db config

mongos> db.shards.find();

{ "_id" : "shard0000", "host" : "localhost:10000" }

{ "_id" : "shard0001", "host" : "localhost:10001" }

mongos> db.databases.find()

{ "_id" : "admin", "partitioned" : false, "primary" : "config" }

{ "_id" : "testdb", "partitioned" : true, "primary" : "shard0000" }

mongos> db.chunks.find()

{ "_id" : "testdb.test-seq_MinKey", "lastmod" : { "t" : 1000, "i" : 0 }, "ns" :

"testdb.test", "min" : { "seq" : { $minKey : 1 } }, "max" : { "seq" : { $maxKey

: 1 } }, "shard" : "shard0000" }
 

mongos> db.printShardingStatus()

--- Sharding Status ---

  sharding version: { "_id" : 1, "version" : 3 }

  shards:

        {  "_id" : "shard0000",  "host" : "localhost:10000" }

        {  "_id" : "shard0001",  "host" : "localhost:10001" }

  databases:

        {  "_id" : "admin",  "partitioned" : false,  "primary" : "config" }

        {  "_id" : "testdb",  "partitioned" : true,  "primary" : "shard0000" }

                testdb.test chunks:

                                shard0000       1

                        { "seq" : { $minKey : 1 } } -->> { "seq" : { $maxKey : 1

 } } on : shard0000 { "t" : 1000, "i" : 0 }

 
 
4. 테스트
500000 데이타를 입력

mongos> use testdb
switched to db testdb

mongos> for(i=0; i<500000; i++) { db.test.insert({"_id" : i, "seq" : i+5000, "date": new Date() }); }


5. 청크 정보 확인

mongos> use config

switched to db config

mongos> db.chunks.find()

{ "_id" : "testdb.test-seq_MinKey", "lastmod" : { "t" : 2000, "i" : 1 }, "ns" :

"testdb.test", "min" : { "seq" : { $minKey : 1 } }, "max" : { "seq" : 5000 }, "s

hard" : "shard0000" }

{ "_id" : "testdb.test-seq_5000.0", "lastmod" : { "t" : 1000, "i" : 3 }, "ns" :

"testdb.test", "min" : { "seq" : 5000 }, "max" : { "seq" : 17024 }, "shard" : "s

hard0000" }

{ "_id" : "testdb.test-seq_17024.0", "lastmod" : { "t" : 2000, "i" : 2 }, "ns" :

 "testdb.test", "min" : { "seq" : 17024 }, "max" : { "seq" : 419135 }, "shard" :

 "shard0001" }

{ "_id" : "testdb.test-seq_419135.0", "lastmod" : { "t" : 2000, "i" : 3 }, "ns"

: "testdb.test", "min" : { "seq" : 419135 }, "max" : { "seq" : { $maxKey : 1 } }

, "shard" : "shard0001" }
 

mongos> db.printShardingStatus()

--- Sharding Status ---

  sharding version: { "_id" : 1, "version" : 3 }

  shards:

        {  "_id" : "shard0000",  "host" : "localhost:10000" }

        {  "_id" : "shard0001",  "host" : "localhost:10001" }

  databases:

        {  "_id" : "admin",  "partitioned" : false,  "primary" : "config" }

        {  "_id" : "testdb",  "partitioned" : true,  "primary" : "shard0000" }

                testdb.test chunks:

                                shard0000       2

                                shard0001       2

                        { "seq" : { $minKey : 1 } } -->> { "seq" : 5000 } on : s

hard0000 { "t" : 2000, "i" : 1 }

                        { "seq" : 5000 } -->> { "seq" : 17024 } on : shard0000 {

 "t" : 1000, "i" : 3 }

                        { "seq" : 17024 } -->> { "seq" : 419135 } on : shard0001

 { "t" : 2000, "i" : 2 }

                        { "seq" : 419135 } -->> { "seq" : { $maxKey : 1 } } on :

 shard0001 { "t" : 2000, "i" : 3 }

데이타가 증가할 수록 moveChunk 폴더가 생기면서 데이타가 분리되었음을 확인가능함.

shard0000, shard0001 청크가 2개씩 존재하며, 각 샤드키로 분산되어 있다.

shard0000 : seq 1 ~ 50000
shard0000 : seq 5000~17024
shard0001 : seq 17024 ~ 419135
shard0001 : seq 419135 ~ Max

 


'Etc' 카테고리의 다른 글

몽고DB Replicated Shard Cluster + Arbitor  (0) 2012.03.19
몽고DB 활용 사례  (0) 2012.03.19
SQL 설치 유용한 스크립트  (0) 2012.02.24
journal 폴더가 왜 생기는 걸까?  (0) 2012.02.21
몽고DB Config 설정하기(Win7)  (0) 2012.02.20

얼마전부터 SQL Server Virtual Labs를 통한 SQL2012를 학습중인데, 학습하던 중 BareMetal-ScriptingPackage를 알게 되었다.  SQL 설치 및 구성 등등을 위한 스크립트를 제공해주는데 DBA에게 유용해보인다.^%^

http://sqlbaremetal.codeplex.com/ 

아래와 같은 기능을 script로 제공해준다. 

Install and configure:
- A domain based network with multiple member servers
- Multiple servers and instances of SQL Server 2008 R2
- Multiple servers and instances of SQL Server code name "Denali"
- Installing SQL Server code name "Denali" on Windows Server core

Configure and Deploy:
- Microsoft Business Intelligence with Sharepoint 2010 and Office client integration
- Mission Critical platform using SQL Server 2008 R2 and SQL Server code name "Denali"

Consume and try:
- Implement SQL Server 2008 R2 Failover Clustering
- Implement SQL Server 2008 R2 Peer to Peer Replication
- Implement SQL Server 2008 R2 Database Mirroring
- Implement AlwaysOn in SQL Server code name "Denali"
- Discover and implement new features in SQL Server code name "Denali"


특히, 유용했던 스크립트는 Window Server 설치 이후 방화벽 오픈을 위해 GUI를 통해서 그동한 오픈해 주었는데 제공해주는 Script를 이용하여 클릭한번이면 끝!! 얼마나 간편한가.ㅎㅎ

BareMetal-ScriptingPackage\VMPlugins\Scripts\Firewall\SQLServerFirewallconfig.cmd

@echo off

@echo This scripts sets the default firewall configurations for SQL Server components

echo.

echo Setting the core components for a database instance 


echo Default Instance

netsh advfirewall firewall add rule name="SQLServer" dir=in action=allow protocol=TCP localport=1433 profile=DOMAIN

 

echo Dedicated Admin Connection

netsh advfirewall firewall add rule name="SQL DAC" dir=in action=allow protocol=TCP localport=1434 profile=DOMAIN




 

'Etc' 카테고리의 다른 글

몽고DB 활용 사례  (0) 2012.03.19
몽고DB Sharding 설정 및 테스트  (16) 2012.02.29
journal 폴더가 왜 생기는 걸까?  (0) 2012.02.21
몽고DB Config 설정하기(Win7)  (0) 2012.02.20
몽고DB 책 소개  (0) 2012.02.17

몽고DB 환경설정을 -f, --config으로  설정할 수 있다.

1. 환경설정 파일 생성
   mongodb.conf 파일을 생성하여 아래와 같이 적용한다. 확장자를 꼭 확인해야 한다. 메모장에서  생성하여 저장하면 기본적으로 .txt로 생성된다. 

dbpath = /mdb

bind_ip = 127.0.0.1

port = 5586
logpath = C:\mongodb\log\log.txt  ## 로그 경로 

noauth = true # use 'true' for options that don't take an argument

verbose = true # to disable, comment out.
 


2. 환경 설정 파일 실행하기(관리자 권한으로 실행)

  
 

'Etc' 카테고리의 다른 글

SQL 설치 유용한 스크립트  (0) 2012.02.24
journal 폴더가 왜 생기는 걸까?  (0) 2012.02.21
몽고DB 책 소개  (0) 2012.02.17
몽고DB 어드민 관리툴  (1) 2011.08.18
SQL to Mongo Mapping Chart  (0) 2011.08.18


SQL2012 소개 버젼 ebook이 무료 배포되었습니다. 

다운로드

PART I   DATABASE ADMINISTRATION   (Ross’s part)

1. Denali Editions and Enhancements

2. High Availability and Disaster Recovery Enhancements

3. Scalability and Performance

4. Security Enhancements

5. Beyond Relational

PART II   BUSINESS INTELLIGENCE DEVELOPMENT   (Stacia’s part)

6. Integration Services

7. Data Quality Services

8. Master Data Services

9. Analysis Services and PowerPivot

Mongdb 시작



MongDB 기본 Port 27017 포트 사용한다.  데이타베이스 관리에 대한 정보를 얻고자 한다면 http://localhost:28017/ 접속하여 얻을 수가 있다.


오웃,, 놀라워라..ㅋㅋㅋ


Monggo DB 접속

1. mongo 실행한다.
    help 명령어를 이용하여 명령어를 확인할 수 있다.
   

Mongo DB 설치 (윈7)


참고

http://www.iaji.net/how-to-install-mongodb-and-php-mongo-extension-on-windows-7.html#more-1318
http://www.mongodb.org/display/DOCS/Quickstart+Windows#QuickstartWindows-Learnmore
http://www.webiyo.com/2011/02/install-mongodb-service-on-windows-7.html 


Win7 몽고DB 설치
1. 몽고DB 최신 버젼을 다운로드(여기)
2. 다운로드한 파일을 C:\mongodb폴더에 압축 해제합니다.(쓰기 권한이 있는지 확인 필수)
3. 몽고 DB용 데이타 폴더를 생성합니다.


4. 몽고DB 실행  
MongDB는 포트로 27017 포트를 사용
데이타 디렉토리가 존재하지 않거나 쓰기 권한이 없을 때에는 서버는 시작되지 않는다
(c:\data\db)
 



Win7 몽고 DB 환경변수 설정

1. 내컴퓨터 > 속성 > 고급 시스템 설정
2. 고급 > 환경 변수
3. 시스템 변수 > Path


 4. 시스템 변수 편집
     C:\mongodb\bin
 


 
Mongo DB 서비스 설정
1. C:\mongodb\log 디렉토리 생성 후 log.txt 파일을생성합니다.
2. Command 명령어로 서비스를 생성합니다.(관리자 권한으로 실행)

c:\mongodb\bin>mongod.exe --bind_ip 127.0.0.1 --logpath c:\mongodb\log\log.txt --logappend --dbpath c:\data\db --directoryperdb --install
(서비스 제거, --install 대신에 --remove)
(서비스 제거, sc delete MongoDB)




설치 끝!!

 



'Etc' 카테고리의 다른 글

NOSQL - MongGo DB  (1) 2011.04.26
NoSQL 에 대한 블로그 포스트 모음  (0) 2011.04.18
In which order does SQL Server process SQL statements  (0) 2010.04.22
DBA 101: Best Practices All DBAs Should Follow  (0) 2009.10.28
Mastering DBA Soft Skills  (2) 2009.10.28