2013年8月31日土曜日

さくらのVPS CentOSにてMYSQLデータバックアップ方法


ダンプとは、デバッグやデータ修復のために、ファイルやメモリの内容をディスクに出力(記録、あるいは表示)すること。

1. データベースのダンプ(バックアップ)

MySQL内の全データをファイルdump.sql(名前は自由)に出力。
[root@web ~]# mysqldump -u root -p -x --all-databases > dump.sql <Enter>

特定のデータベース(database_name)のみバックアップする。
[root@web ~]# mysqldump -u root -p database_name > dump.sql <Enter>

もしデータベースが文字化けしていた場合はこちら。
[root@web ~]# mysqldump --default-character-set=utf8 -u root -p database_name > dump.sql <Enter>

更に特定データベースの特定テーブル(table_name1 table_name2)のみバックアップする場合はこちら。
[root@web ~]# mysqldump --default-character-set=utf8 -u root -p database_name table_name1 table_name2 > dump.sql <Enter>

2. データベースのインポート(復元)

バックアップしたファイルをMySQLに取り込む。
[root@web ~]# mysql -u root -p < dump.sql <Enter>

以上。

2013年8月26日月曜日

模擬問題 05 (MCP 70-640 Windows Server 2008 Active Directory, Configuring)

あなたの会社では、Windows Server 2008の機能レベルで実行され、Active Directoryフォレストがあります。
あなたは、Active Directory Rights Managementサービス(AD RMS)を実装しました。
あなたは、Microsoft SQL Server 2005をインストールしました。
あなたは、AD RMS管理Webサイトを開こうとすると、次のエラーを受け取りました
メッセージ: "SQL Serverが存在しないか、アクセスが拒否されました。"
あなたは、AD RMS管理Webサイトを開く必要があります。
あなたはどちら二つのアクションを実行する必要があります?
(それぞれの正しい答えは、ソリューションの一部を紹介します。2を選択してください。)

A.は、IISを再起動します。
B.手動でAD DSのサービス接続ポイントを削除し、AD RMSを再起動します。
C.インストールがメッセージキューを。
D.は、MSSQLSVCサービスを開始します。
正解:AD
A. Restart IIS.
D. Start the MSSQLSVC service.
参考:
RMS Administration Issues
"SQL Server does not exist or access denied" message received when attempting to open the RMS
Administration Web site
If you have installed RMS by using a new installation of SQL Server 2005 as your database server the SQL
Server Service might not be started. In SQL Server 2005, the MSSQLSERVER service is not configured to
automatically start when the server is started. If you have restarted your SQL Server since installing RMS
and have not configured this service to automatically restart RMS will not be able to function and only the
RMS Global Administration page will be accessible.
After you have started the MSSQLSERVER service, you must restart IIS on each RMS server in the
cluster to restore RMS functionality.

模擬問題 04 (MCP 70-640 Windows Server 2008 Active Directory, Configuring)

あなたの会社は、Active Directoryドメインがあります。
同社は、DC1とDC2という名前の2つのドメインコントローラを持っています。
DC1は、スキーママスタの役割を保持しています。
DC1は失敗します。
あなたが管理者アカウントを使用してActive Directoryにログオンします。
あなたは、スキーママスタ操作の役割を転送することはできません。
あなたは、DC2はスキーママスタの役割を保持していることを確認する必要があります。

あなたはどうすればいいの?

A.は、ブリッジヘッドサーバーとしてDC2を構成します。
B.は、DC2でスキーママスタの役割をつかむ。
C.は、スキーマのメンバであるアカウントを使用してログオフし、Active Directoryに再度ログオン
Administratorsグループ。スナップインActive Directoryスキーマを起動します。
D.は、schmmgmt.dllとを登録します。スナップインActive Directoryスキーマを起動します。

正解:B
B. On DC2, seize the Schema Master role.
参考:
Transfer the Schema Master
You can use this procedure to transfer the schema operations master role if the domain controller that
currently hosts the role is inadequate, has failed, or is being decommissioned. The schema master is a
forest-wide operations master (also known as flexible single master operations or FSMO) role.
..
Note: You perform this procedure by using a Microsoft Management Console (MMC) snap-in, although you
can also transfer this role by using Ntdsutil.exe.

Membership in Schema Admins, or equivalent, is the minimum required to complete this procedure.

模擬問題 03 (MCP 70-640 Windows Server 2008 Active Directory, Configuring)

あなたの会社は、Active Directoryライトウェイトディレクトリサービス(AD LDS)のインスタンスを実行するサーバーを持っています。
あなたは、AD LDSのアプリケーションディレクトリパーティション内に新しい組織単位を作成する必要があります。
あなたはどうすればいいの?
A.は、組織単位を作成します。dsmod OUの<OrganizationalUnitDN>コマンドを使用します。
B.は、AD LDS上の組織単位を作成するには、Active Directoryユーザーとコンピュータスナップインを使用して、
アプリケーションディレクトリパーティション。
C.は、組織単位を作成します。dsadd OUの<OrganizationalUnitDN>コマンドを使用します。
D.は、ADSI Editスナップインを使用して、AD LDSのアプリケーションディレクトリ上に組織単位を作成します。

正解:D
D. Use the ADSI Edit snap-in to create the organizational units on the AD LDS application directory
参考:
ADSI Edit (adsiedit.msc)
Active DirectoryR Service Interfaces Editor (ADSI Edit) is a Lightweight Directory Access Protocol
(LDAP) editor that you can use to manage objects and attributes in Active Directory. ADSI Edit
(adsiedit.msc) provides a view of every object and attribute in an Active Directory forest. You can use ADSI
Edit to query, view, and edit attributes that are not exposed through other Active Directory Microsoft
Management Console (MMC) snap-ins: Active Directory Users and Computers, Active Directory Sites and
Services, Active Directory Domains and Trusts, and Active Directory Schema.

2013年8月22日木曜日

Sakura VPSにPHP 加速器eAccelerator 0.9.6.1をインストールする手順

1. まずはApacheとPHPの環境を整えます。

$ sudo yum install php-devel <Enter>
$ sudo yum install gcc <Enter>
2. ソースをダウンロードしてコンパイルします。

$ wget http://bit.ly/ymYXBI <Enter>
$ unzip eaccelerator-0.9.6.1.zip <Enter>
$ cd eaccelerator-0.9.6.1 <Enter>
$ phpize <Enter>
Configuring for:PHP
 Api Version:         20090626
 Zend Module Api No:      20090626
 Zend Extension Api No:   220090626

$ ./configure \  --enable-eaccelerator=shared \  --with-php-config=/usr/bin/php-config  <Enter>
$ make <Enter>
$ make install  <Enter>

3. 続いて、起動用の設定ファイルを作ります。
$ cd /etc/php.d/ <Enter>
$ vi eaccelerator.ini  <Enter>
eaccelerator.iniの中身はこんな感じ。
ほとんどREADMEをコピーしていますが、
eaccelerator.shm_sizeを16から128にして、
eaccelerator.compressとeaccelerator.compress_levelを追加しています。
また、管理コンソール用に、eaccelerator.allowed_admin_pathを追加しました。
extension="eaccelerator.so"
eaccelerator.shm_size="128"
eaccelerator.cache_dir="/tmp/eaccelerator"
eaccelerator.enable="1"
eaccelerator.optimizer="1"
eaccelerator.check_mtime="1"
eaccelerator.debug="0"
eaccelerator.filter=""
eaccelerator.shm_max="0"
eaccelerator.shm_ttl="0"
eaccelerator.shm_prune_period="0"
eaccelerator.shm_only="0"
eaccelerator.compress="1"
eaccelerator.compress_level="9"
eaccelerator.allowed_admin_path="/var/www/html/"
4. キャッシュ用のフォルダを作る

キャッシュ用のフォルダを指定して書き込みできるようにします。
$ mkdir /tmp/eaccelerator <Enter>
$ chmod 0777 /tmp/eaccelerator  <Enter>
5. 動作確認をする

Apacheを再起動して動作を確認してみましょう。
$ sudo service httpd restart  <Enter>
$ php -v <Enter>
PHP 5.3.9 (cli) (built: Jan 23 2012 21:05:00)
Copyright (c) 1997-2012 The PHP GroupZend Engine v2.3.0,
Copyright (c) 1998-2012 Zend Technologies   
with eAccelerator v0.9.6.1, Copyright (c) 2004-2010 eAccelerator, by eAccelerator
6. 管理コンソールを使う

eAcceleratorはWebベースの管理コンソールがあります。
管理者ののみアクセスできるようにcontrol.phpのユーザ名とパスワードを設定しておいてください。
そして、eaccelerator.iniのeaccelerator.allowed_admin_pathで指定したパスにコピーします。
$ cd eaccelerator-0.9.6.1 <Enter>
$ vi control.php <Enter>
$ cp control.php /var/www/html/  <Enter>
7. ブラウザから見てみます.
 http://YourDomain.com/control.php

以上。

模擬問題 02 (MCP 70-640 Windows Server 2008 Active Directory, Configuring)

あなたの会社は、Contoso社株式会社は本社や支店を持っています。
オフィスはWANリンクによって接続されている。
Contosoはad.contoso.comという名前の単一のドメインが含まれているActive Directoryフォレストがあります。

ad.contoso.comドメインは主に位置しているDC1という名前のドメインコントローラが含まれています
DC1はad.contoso.com DNSゾーンのDNSサーバとして設定されています。
このゾーンは標準プライマリゾーンとして構成されている。

あなたは、ブランチオフィスにDC2という名前の新しいドメインコントローラをインストールします。
あなたがDC2でDNSをインストールします。

あなたは、DNSサービスがレコードを更新した場合にWANリンクに失敗しているDNSクエリを解決できることを確認する必要があります。
あなたはどうすればいいの?
A.は、DC2にad.contoso.comという新しいスタブゾーンを作成します。
B.は、DC2にad.contoso.comという新しい標準セカンダリゾーンを作成します。
C.は、DC1に要求を転送するようにDC2でDNSサーバーを設定します。
D.は、Active Directory統合ゾーンにDC1上ad.contoso.comゾーンを変換します。
正解:D
D. Convert the ad.contoso.com zone on DC1 to an Active Directory-integrated zone.

Understanding Active Directory Domain Services Integration
The DNS Server service is integrated into the design and implementation of Active Directory Domain
Services (AD DS). AD DS provides an enterprise-level tool for organizing, managing, and locating
resources in a network.

How DNS integrates with AD DS
When you install AD DS on a server, you promote the server to the role of a domain controller for a
specified domain. As part of this process, you are prompted to specify a DNS domain name for the AD DS
domain which you are joining and for which you are promoting the server, and you are offered the option to
install the DNS Server role. This option is provided because a DNS server is required to locate this server
or other domain controllers for members of an AD DS domain.

2013年8月21日水曜日

模擬問題 01 (MCP 70-640 Windows Server 2008 Active Directory, Configuring)

あなたは、単一のActive Directoryドメインがあります。
すべてのドメインコントローラはWindows Server 2008を実行し、DNSサーバとして設定されています。
ドメインは、1つのActive Directory統合DNSゾーンが含まれています。

あなたは、古いDNSレコードが自動的にDNSゾーンから削除されていることを確認する必要があります。
あなたはどうすればいいの?
A.は、ゾーンのプロパティからSOAレコードのTTLを変更します。
B.は、ゾーンのプロパティから清掃を有効にします。
C.は、コマンドプロンプトから、ipconfig / flushdnsを実行します。
D.は、ゾーンのプロパティから、動的更新を無効にします。

正解:B
参考:
Explanation:
http://technet.microsoft.com/ja-jp/library/cc753217.aspx
Set Aging and Scavenging Properties for the DNS Server
The DNS Server service supports aging and scavenging features. These features are provided as a
mechanism for performing cleanup and removal of stale resource records, which can accumulate in zone
data over time. You can use this procedure to set the default aging and scavenging properties for the
zones on a server.