Changes: Detailed Release Notes Includes versions: JBossAS-5.0.0.GA Feature Request * [ JBAS-70 ] Security event listener that could be plugged in to listen to authentication and authorization events. * [ JBAS-3767 ] Create a canonical "JndiServiceMBeanSupport" useful for binding objects to JNDI * [ JBAS-3997 ] getManagedConnection retries * [ JBAS-4588 ] DeploymentSorter in the new profile service based deployment scanner * [ JBAS-5192 ] ServiceBindingManager that can handle pojo services * [ JBAS-5348 ] Move remoting configuration into deploy * [ JBAS-5535 ] Modularisation of the JBoss Bootstrap * [ JBAS-5545 ] Implement the jsr77 view on top of the new deployers/profileservice/mc * [ JBAS-5766 ] Add new aop deployers * [ JBAS-5900 ] jars are not loaded from the lib directory of a sar in JBoss AS 5 * [ JBAS-5960 ] EJB2: Lack of security domain in JBoss DD does not bypass security * [ JBAS-5966 ] Migrate TomcatService mbean deployment descriptor to mc bean descriptor * [ JBAS-5974 ] Turn of deployment of base-aspects.xml by default * [ JBAS-5975 ] Switch to MC based AOP deployers * [ JBAS-5989 ] Security Beans need ManagedObject annotations * [ JBAS-5998 ] Add resources filtering to MetaDataAwareProfile * [ JBAS-6013 ] Support createDestination in jboss/message-driven * [ JBAS-6032 ] Refactor AOPClassLoaderDeployer * [ JBAS-6058 ] Web descriptors parsing * [ JBAS-6070 ] Need an overview of the profile service in the 5.0 docs * [ JBAS-6088 ] Add simple cache / cluster support for Spring beans * [ JBAS-6099 ] add alternate, not meta data based JSF injection provider * [ JBAS-6130 ] AS5:JACC: * in web.xml should allow configurable authorization bypass * [ JBAS-6136 ] Pojoize the jca configuration * [ JBAS-6158 ] Reduce the distribution size by sharing the libraries between the all and default configs * [ JBAS-6182 ] Add support for JBC MVCC locking in Hibernate 2nd Level Cache configs * [ JBAS-6205 ] Make server.log logging level configurable via system property * [ JBAS-6223 ] Externalize the DeploymentRepository attachments location * [ JBAS-6267 ] Introduce SecurityContextInterceptor in the ejb2 proxy Bug * [ JBAS-2149 ] ByValueContainerInvoker * [ JBAS-5081 ] New transaction manager does not implement TransactionTimeoutConfiguration properly * [ JBAS-5114 ] MessageDriven EJB3 does not create destination automatically * [ JBAS-5115 ] Valid jboss-app.xml file not recognized correctly by jbossxb runtime * [ JBAS-5209 ] Hot deployment scanner deploys files which were expected to be filtered * [ JBAS-5301 ] JaasSecurityManagerService.startService - java.lang.IllegalArgumentException: handler exists * [ JBAS-5412 ] BaseLocalProxyFactory should not check for explicit security context * [ JBAS-5689 ] Not seeing bootstrap ManagedDeployment/ManagedComponents * [ JBAS-5732 ] Deployment of @WebService fails * [ JBAS-5767 ] Security schemas * [ JBAS-5895 ] OptAnnotationMetaDataDeployer is processing too many classes * [ JBAS-5942 ] Session replication with passivation causes inconsistent session data * [ JBAS-5943 ] JRMPInvokerProxyHA should not failover if PooledInvokerProxy.invoke() throws java.rmi.ConnectException with cause of java.io.EOFException * [ JBAS-5951 ] ProfileService unit tests are not validating persistence of updates * [ JBAS-5964 ] NPE in expiration of passivated sessions * [ JBAS-5968 ] NullPointerException in WebServiceDeployerEJB * [ JBAS-5978 ] Mask password logging in ServiceConfigurator * [ JBAS-5979 ] java.lang.NoClassDefFoundError: org/jboss/aop/pointcut/ast/PointcutExpressionParserVisitor in EJB client * [ JBAS-5999 ] EJBTimerServiceImpl timerServiceMap access should be synchronized * [ JBAS-6002 ] NPE for JSF managed beans. * [ JBAS-6007 ] Wrong bean name when EJB is not deployed within an ear * [ JBAS-6017 ] JRMPProxyFactory should rebind the proxy in JNDI rather than just bind it * [ JBAS-6028 ] Bootstrap dependencies failure of ejb3 session beans * [ JBAS-6040 ] Ensure correct TCCL is set before accessing clustered web session cache * [ JBAS-6041 ] let the web metadata override a default context-param * [ JBAS-6044 ] JMX console invokeOp confused ObjectName encoding * [ JBAS-6056 ] UserTransaction cannot be deployed as clustered proxy and sticky transactions randomly work * [ JBAS-6060 ] Tolerate security domain convention in JBoss DD * [ JBAS-6062 ] Exploded WAR archive with no web.xml is no longer supported * [ JBAS-6067 ] XACML policy is not removed when deployment unit is undeployed * [ JBAS-6068 ] Mask passwords in the Deployers * [ JBAS-6077 ] seam-int: hot-redeploys occur constantly on JBoss 5 trunk * [ JBAS-6076 ] Seam war not using jboss-seam-int * [ JBAS-6093 ] Exposing the EMF in JNDI via jboss.entity.manager.factory.jndi.name doesn't work in JBoss 5.0.0.CR2 * [ JBAS-6098 ] juddi-service.sar bundles juddi.jar & scout.jar * [ JBAS-6107 ] Seam hibernate and jpa examples throw ZipExceptions during deployment - but the jars are valid * [ JBAS-6110 ] Tomcat status in the web-console missing logo * [ JBAS-6111 ] Ensure hibernate.cache.region_prefix is specified by PersistenceUnitDeployment * [ JBAS-6116 ] UserTransaction.commit()/rollback() are not fully compliant with the JTA standard * [ JBAS-6117 ] IOException in VFS while undeploying a Seam example * [ JBAS-6131 ] EJB1.1 isCallerInRole must throw RTE if role is not found in deployment descriptor * [ JBAS-6135 ] Concurrent connection of HAPartition channels fails * [ JBAS-6147 ] Profile.getModifiedDeployments() does not ignore .bak file * [ JBAS-6149 ] connectionMap.remove in WrapperDatasourceService never called * [ JBAS-6153 ] Transaction sticky target not available should be thrown as ServiceUnavailableException * [ JBAS-6161 ] Two ears with a same named jar fails to deploy * [ JBAS-6162 ] Error logged when attempting to passivate invalidated session * [ JBAS-6165 ] NPE in TransactionScopedEntityManager * [ JBAS-6174 ] shutdown.jar is missing classes * [ JBAS-6176 ] appclient doesn't declare a dependency on persistence unit * [ JBAS-6177 ] Error on jchannel.getState() right after connect (even with flush) * [ JBAS-6181 ] cannot secure jmx invoker service * [ JBAS-6193 ] JBossCacheManager leaks ReplicationStatistics.TimeStatistic * [ JBAS-6194 ] Move transaction sticky logic in proxy to interceptors to avoid bottleneck * [ JBAS-6206 ] JBossManager sets invalid session cookie after failover * [ JBAS-6207 ] update jts install for new lib layout * [ JBAS-6209 ] DelegatingClassloader is trying to get the parent in an unprivileged block * [ JBAS-6214 ] Default port bindings overriding (bindings.xml) doesn't work. * [ JBAS-6224 ] SecurityContextEstablishmentValve is making expensive loadClass calls * [ JBAS-6229 ] Resolving of relative persistence units doesn't work * [ JBAS-6231 ] jboss.messaging.jar (server) on /client * [ JBAS-6239 ] Regression on run-as in a MDB * [ JBAS-6241 ] EJB TIMERS Table Creation Fails When Oracle Schema Specified * [ JBAS-6243 ] EJB2: Reintroduce explicit run as check before authentication * [ JBAS-6252 ] Messaging release is missing connection-factories-service.xml * [ JBAS-6256 ] NPE during undeployment of test artifact /bundled-myfaces-hellojsf.war * [ JBAS-6275 ] Fix *both* 4.2.x & 5.0.x compatibility matrix tests Task * [ JBAS-2563 ] Cleanup the build for jboss5 * [ JBAS-3916 ] Update source code headers. * [ JBAS-4370 ] SecurityDeployer: XACML/acl Policy Registration * [ JBAS-4814 ] Refactor the conf/jboss-service.xml services * [ JBAS-4967 ] Extract setting of default clustering JBossWebMetaData from TomcatDeployer * [ JBAS-5078 ] Validate SRP Configuration * [ JBAS-5234 ] Include the Windows Service Runner binary (jbossvc.exe) in the distro * [ JBAS-5358 ] Move remote access to profile service into deploy * [ JBAS-5677 ] Add discussion of usage of FC to Clustering Guide * [ JBAS-5778 ] Improve HttpSessionListener handling in clustered environment * [ JBAS-5794 ] Administration and configuration guide * [ JBAS-5795 ] Administration and configuration guide * [ JBAS-5872 ] Update org.jboss.test.compatibility.test.SerialVersionUIDUnitTestCase * [ JBAS-5873 ] Create JBoss-AS-5.0.x-CompatibilityMatrix test run based on the 4.2.x one * [ JBAS-5883 ] Unify name usage in ProfileService * [ JBAS-5908 ] ClientUserTransactionObjectFactory is inefficient * [ JBAS-5930 ] Investigate ENC issues to obtain JBoss Security Manager in the web layer * [ JBAS-5945 ] Make JBossCacheClusteredSession.initAfterLoad() part of an override of update() * [ JBAS-5958 ] Fix any remaining testsuite failures * [ JBAS-5963 ] ClientUserTransaction should log cause exceptions * [ JBAS-5977 ] FIXME the HackClassloaderMetaDataDeployer boot WARN * [ JBAS-5988 ] AS5 Codebase Privileged Blocks * [ JBAS-5994 ] Switch to repository based ProfileService as the default * [ JBAS-6023 ] Inject Naming instance into DetachedHANamingService * [ JBAS-6030 ] Uncomment @JMX annotation in deployers.xml to enable JMX management of DeployersImpl * [ JBAS-6039 ] Change JGroups thread pool rejection policy to 'Discard' * [ JBAS-6064 ] JSR-196 integration for web layer * [ JBAS-6080 ] On Linux, HA-JNDI to pass SocketAddress to MulticastSocket constructor * [ JBAS-6081 ] Remove TUNNEL config * [ JBAS-6084 ] Reduce Logging Visibility when setting DefaultJndiBindingPolicy (when not explicitly specified) * [ JBAS-6087 ] Reduce the excessive logging * [ JBAS-6090 ] Convert legacy clustered services to pojo configuration * [ JBAS-6091 ] Allow JRMPInvoker to work as an MC bean * [ JBAS-6103 ] Review the 'minimal' config * [ JBAS-6105 ] Improve start-up time * [ JBAS-6109 ] ClusteredSession should not subclass StandardSession * [ JBAS-6129 ] Missing licenses * [ JBAS-6132 ] Revert to AS 4 behavior of handling distributable webapps in default config * [ JBAS-6143 ] Remove legacy persistence unit resolving functions from appclient and tomcat * [ JBAS-6148 ] Port metadata awareness to the repository profileservice * [ JBAS-6154 ] Verify JAXB version for 5.0.0.GA release * [ JBAS-6159 ] Make an integration abstraction for the UserTransactionListener and CachedConnectionManager * [ JBAS-6160 ] Component Update to jboss-ejb3-as-int * [ JBAS-6163 ] JACC: Look at the cmp2-audit.jar for security domain * [ JBAS-6169 ] Make "bootstrap" module reusable * [ JBAS-6170 ] Update package names moved from "main" to "bootstrap" * [ JBAS-6172 ] org.jboss.system.server.Server should be JVM-agnostic * [ JBAS-6183 ] ATTRIBUTE granularity clustered session should store attribute in same JBC node as metadata * [ JBAS-6184 ] Eliminate a JBC Fqn level in clustered session caching * [ JBAS-6186 ] Use JBossWebMetaData to drive DistributedCacheManagerFactory * [ JBAS-6189 ] Add plain reports to the test target * [ JBAS-6201 ] Eliminate injection of DistributedReplicantManagerImpl into ClusterPartition * [ JBAS-6237 ] Remove the old JMX kernel's dependency on the Deployment layer * [ JBAS-6238 ] Remove JBossMQ from the 5.0.0 branch * [ JBAS-6249 ] Pick a different port for the JBM Data channel's MPING * [ JBAS-6254 ] Provide an implementation for ejb3 CachedConnectionManager SPI * [ JBAS-6261 ] Rename cluster-jboss-beans.xml to hapartition-jboss-beans.xml * [ JBAS-6263 ] Use Microcontainer to build JBC configs * [ JBAS-6271 ] Create a 'standard' config out of the 'cts' one. * [ JBAS-6273 ] Create release notes for AS 5.0.0.GA * [ JBAS-6279 ] Remove assumption about who master is from HA Singleton test cases * [ JBAS-6280 ] Refresh the communit docs Sub-task * [ JBAS-3858 ] Update jbossweb-cluster.aop to match the current configuration * [ JBAS-5349 ] Test bootstrap dependencies * [ JBAS-5370 ] Deploy an ear/war app through ProfileService * [ JBAS-5856 ] SBM-compatible JBM remoting connector config * [ JBAS-5858 ] Add @JMX annotation to ServiceBindingManager * [ JBAS-5953 ] JBoss-AS-5.0.x-TestSuite-sun16-sun16 - org.jboss.test.jmx.test.UndeployBrokenPackageUnitTestCase * [ JBAS-5969 ] Remove dependency of AOP on VFSDeploymentUnit * [ JBAS-5970 ] Remove dependency of AOP on ServiceMBeanSupport * [ JBAS-5984 ] Make names unique in jbossweb-cluster.aop/META-INF/jboss-aop.xml * [ JBAS-5985 ] Make the switch in aop.xml and deployers.xml * [ JBAS-5986 ] Remove jboss-aop.xml from the deployment for aop.AnnotatedTestCase and aop.ScopedAnnotatedTestCase * [ JBAS-5987 ] Add new tests for scoped aspects with dependencies * [ JBAS-5996 ] Move TomcatDeployer.securityManagerService injection out of the deployer * [ JBAS-5997 ] iiop-service.xml is missing naming service dependencies * [ JBAS-6036 ] Add tests for restart of server to validate profileservice overrides are applied * [ JBAS-6037 ] Restore ProfileService attachments persistence * [ JBAS-6042 ] Remove the user of LoaderRepositoryConfig as an attachment * [ JBAS-6055 ] Use the enforcer plugin to avoid bringing in duplicate/wrong dependencies * [ JBAS-6082 ] JUDDIService.setBindJaxr cannot attempt to bind into jndi * [ JBAS-6083 ] HAPartitionCacheHandler.cache injection is broken * [ JBAS-6096 ] Upgrade ha-server-cache-jbc * [ JBAS-6121 ] Upgrate JAXR to 1.2.1.GA * [ JBAS-6124 ] regression - org.jboss.test.jcaprops.test.* * [ JBAS-6125 ] regression - org.jboss.test.deployers.seam.test.SeamVFSClassloadingUnitTestCase * [ JBAS-6139 ] Create a hudson job that builds using a clean local maven repo. * [ JBAS-6141 ] Upgrade to jboss-server-manager 1.0.0.GA and jboss-test 1.1.3.GA * [ JBAS-6146 ] JBoss-AS-5.0.x-TestSuite-jrockit16-jrockit16 - server all fails to shutdown * [ JBAS-6151 ] Upgrade JBossXACML dependency to 2.0.2.SP1 * [ JBAS-6166 ] regression - org.jboss.test.security.test.authorization.XACMLEJBIntegrationUnitTestCase * [ JBAS-6167 ] Restore the ServerInfo bean/mbean * [ JBAS-6168 ] Modify the Bootstrap spi to pass the kernel deployments loaded by the Server bootstrap * [ JBAS-6178 ] JBoss-AS-5.0.x-CompatibilityMatrix Failures * [ JBAS-6187 ] Break out profileservice spi from jboss-system.jar * [ JBAS-6190 ] repository based ProfileService hot deployment is not working * [ JBAS-6191 ] VFS URL Handler Stubs for JDK PolicyFile implementation to read vfs entries * [ JBAS-6198 ] Javadoc for ManagedOperation.invoke() says it will return a MetaValue, but it's returning unwrapped Objects * [ JBAS-6199 ] break out profileservice spis as a separate project * [ JBAS-6203 ] "config-property" property on Local Datasource managed component returns incorrect MetaType * [ JBAS-6210 ] common core to 2.2.10.GA * [ JBAS-6211 ] jboss integration to 5.0.2.GA * [ JBAS-6215 ] when creating a new Datasource via managementView.applyTemplate(), if the "metadata" CompositeValue property contains no items or a null-valued item, the ds.xml file is written with an empty "metadata" element, which causes the deployer to complain * [ JBAS-6216 ] ManagementView.getComponentsForType(type) returns null, rather than an empty Set, if no Components of the specified type are deployed * [ JBAS-6217 ] JBossWebRealm->enableAuditFlag should be false by default * [ JBAS-6234 ] ManagedProperty contains certain metadata that is not contained in MetaType * [ JBAS-6245 ] org.jboss.test.asynch.AsynchTestCase * [ JBAS-6246 ] org.jboss.test.web.test.JSFIntegrationUnitTestCase * [ JBAS-6247 ] org.jboss.test.xml.DDValidatorUnitTestCase * [ JBAS-6248 ] org.jboss.test.profileservice.override.test.JmsDestinationOverrideTestCase * [ JBAS-6251 ] 15 failures in JBossWS-3.0.4.GA-testsuite-AS5.0.x * [ JBAS-6253 ] Management interface for HAPartition and DRM * [ JBAS-6255 ] 8 test-aop-scoped failures * [ JBAS-6269 ] regression - org.jboss.test.refs.test.ResourceResolutionUnitTestCase.testClientORBResources * [ JBAS-6270 ] ManagementView.getDeploymentNames does not show the bootstrap deployment names Thirdparty Change * [ JBAS-5597 ] Track jboss and thirdparty dependencies upgrades for JBoss 5.0.0.GA Component Upgrade * [ JBAS-5382 ] Upgrade PojoCache to 3.0.0.GA * [ JBAS-5894 ] Upgrade jboss AOP to 2.0.0.GA * [ JBAS-5919 ] Upgrade jboss transactions to 4.4.0.GA * [ JBAS-5927 ] Upgrade jboss-integration spis to 5.0.1.GA * [ JBAS-6004 ] Upgrade jbossws to 3.0.4.GA * [ JBAS-6015 ] Upgrade seam-integration to 5.0.0.GA * [ JBAS-6016 ] Upgrade JBossWeb to 2.1.1.GA * [ JBAS-6018 ] Upgrade jboss-javaee apis to 5.0.0.GA * [ JBAS-6019 ] Upgrade JBoss Aspects to their final version * [ JBAS-6021 ] Upgrade jboss-security to 2.0.2.SP3 * [ JBAS-6022 ] Upgrade jboss vfs to 2.0.0.GA * [ JBAS-6024 ] Upgrade jbossxb to 2.0.0.GA * [ JBAS-6025 ] Upgrade to jnp-client/server 5.0.0.GA * [ JBAS-6026 ] Upgrade jboss-messaging to 1.4.1.GA * [ JBAS-6045 ] Upgrade jboss-microcontainer to 2.0.0.GA * [ JBAS-6046 ] Upgrade jboss-managed/metatype to 2.0.0.GA * [ JBAS-6048 ] Upgrade jboss-deployers to 2.0.0.GA * [ JBAS-6049 ] Upgrade jboss-reflect to 2.0.0.GA * [ JBAS-6050 ] Upgrade jboss-mdr to 2.0.0.GA * [ JBAS-6051 ] Upgrade jboss-classloading to 2.0.1.GA * [ JBAS-6053 ] Upgrade jboss-jaxbintros to a final release * [ JBAS-6063 ] Upgrade javassist to 3.9.0.GA * [ JBAS-6065 ] Upgrade jgroups * [ JBAS-6079 ] Upgrade JBoss Cache to 3.0.1.GA * [ JBAS-6100 ] JBoss Remoting update needed * [ JBAS-6233 ] Upgrade jboss-reflect to 2.0.1.GA
송은영 (f405@sds.co.kr), 김홍섭(hskim@sds.co.kr), 방창현(winchild@sds.co.kr)-등록및포매팅 / (주)삼정데이터서비스 연구소
최종수정일: 2006년1월2일 01시35분
[edit]
1.2.2 MASTER 계정생성 ¶
slave 서버에서 master 서버에 접속할 수 있도록, master 서버에 계정을 만든다. 사용자를 추가해 주어야 한다는 말이다. 이 계정에 REPLICATION SLAVE 권한을 주어야 한다. replication에만 사용할 계정이라면 추가적인 권한은 주지 않아도 된다. slave 서버에서master 서버에 접속할 계정과 패스워드에 권한을 부여하는 명령은 다음과 같다.
master mysql > GRANT REPLICATION SLAVE ON *.* -> TO 'user_name'@'user_host' IDENTIFIED BY 'user_password';
여기서 user_name은 중복되지 않는 이름이면 되며, user_host 는 slave로 만들 서버의 주소 혹은 도메인 네임을 적어준다. 이 주소의 slave 유저만 master 서버로 접속할 수 있다. 4.0.2 이전 버전의 MySQL에서는, REPLICATION SLAVE 권한이 없으므로, 다음과 같이 FILE 권한으로 대신한다.
master mysql > GRANT FILE ON *.* -> TO 'user_name'@'user_host' IDENTIFIED BY 'user_password';
[edit]
1.2.3 MASTER 데이터 SLAVE 에 복사 ¶
master 서버의 기본 데이터를 백업 받아, slave 서버의 데이터베이스에 복사한 후, 데이터 디렉토리에서 압축을 푼다.
HOT 백업
master mysql > FLUSH TABLES WITH READ LOCK; master shell > tar -cvf /tmp/mysql-snapshot.tar . slave shell > tar -xvf /tmp/mysql-snapshot.tar master mysql > UNLOCK TABLES;
mysqldump 이용 백업
master Shell > mysqldump -u root -p ‘password’ -B db_name > dump_file.sql
[edit]
1.2.4 MASTER 환경설정 ¶
Master 와 Slave 의 데이터 베이스 환경을 설정한다. 우선 master 서버를 설정하도록 한다.
master shell> vi /etc/my.cnf
master 서버는 디폴트로 구성이 되어 있을 것이므로, mysqld 섹션에 log-bin이 있는 지 확인한다.
[mysqld]
log-bin
server-id = 1
[edit]
1.2.5 SLAVE 환경설정 ¶
다음은 slave 서버의 환경설정이다.
slave shell> vi /etc/my.cnf
mysqld 섹션으로 가서 server-id를 master 서버의 server-id와 다르게 설정한다. 본 문서에서는 2로 설정하도록 하겠다. slave 서버를 여러 대로 구축하고자 할 때에 각 slave 서버의 server-id는 각각 달라야 한다는 것에 주의하자. 2^32-1까지 가능하다.
[mysqld] server-id = 2 master-host = xxx.xxx.xxx.xxx(user_host) master-port = 3306 master-user = user_name master-password = user_password
master 서버의 데이터를 백업 받았다면, slave 서버를 시작하기 전에 slave 서버의 데이터 디렉토리에 master 서버의 데이터를 복사해 둔다. mysqldump를 사용했다면, 다음으로 가서 먼저, slave 서버를 스타트한다.
[edit]
1.2.7 SLAVE 덤프파일 LOAD ¶
mysqldump를 사용해 백업 파일을 만들었다면, slave 서버에 덤프 파일을 로드시킨다.
slave shell > mysql -u root -p < dump_file.sql
[edit]
1.2.8 MASTER 계정 설정 ¶
slave 서버에서 master-host, master-user, master-password 등의 설정을 다음과 같이 바꿀 수도 있다. 물론 /etc/my.cnf에서 설정하지 않았을 경우에도 쓸 수 있다.
slave mysql > CHANGE MASTER TO -> MASTER_HOST='master_host_name', -> MASTER_USER='replication_user_name', -> MASTER_PASSWORD='replication_password', -> MASTER_LOG_FILE='recorded_log_file_name', -> MASTER_LOG_POS=recorded_log_position;
각 옵션의 최대 길이는 다음과 같다.
MASTER_HOST 60 MASTER_USER 16 MASTER_PASSWORD 32 MASTER_LOG_FILE 255
[edit]
1.2.10 SUCCESS CERTIFICATION ¶
mysql/data/slave.err을 확인하여 다음과 같은 메시지가 있으면 성공적으로 설정된 것이다.
Slave I/O thread: connected to master 'user_name@user_host:3306', replication started in log 'FIRST' at position 4
[edit]
1.3 How to Set Up Dual-Master Replication ¶
우선 이후에서는 지금까지 master 라고 칭했던 서버를 mysql1 서버라고 하고, slave라 칭했던 서버를 mysql2 서버라 하겠다. 듀얼 마스터 리플리케이션을 구축할 두 대의 서버에는 동일 버전의 최신 MySQL이 설치되어 있으며, Master-Slave 리플리케이션이 구축된 상태에 있다고 간주한다.
이미 앞에서 리플리케이션 구축에 대해 자세히 설명하였으므로, 과정에 대해서만 기술하기로 하겠다.
[edit]
1.3.1 SLAVE STOP ¶
mysql2 서버로 이동한 후, mysql2 서버의 mysql 구동을 멈춘다.
mysql2 shell > /etc/init.d/mysqld stop
[edit]
1.3.4 GRANT REPLICATION SLAVE ¶
d. mysql2 서버에서 GRANT REPLICATION SLAVE명령을 실행한다. Dual-Master란 것이 서로가 서로의 master이자 slave가 되는 것이므로, 이전의 설치에서 slave였던 mysql2가 mysql1 서버의 유저를 slave 유저로 갖게 된다.
mysql2 mysql > GRANT REPLICATION SLAVE ON *.* -> TO 'users_name'@'users_host' IDENTIFIED BY 'users_password';
[edit]
1.3.5 MASTER SETUP ¶
이제 mysql1 서버로 이동하여, 설정을 계속한다. 우선, mysql1 서버의 mysql 구동을 멈춘다.
mysql1 shell > /etc/init.d/mysqld stop
[edit]
1.3.6 MASTER CONFIGURATION ¶
mysql1 서버의 /etc/my.cnf 파일을 수정한다. mysqld 섹션으로 가서 mysql2 서버를 마스터로 간주하도록 정보를 추가한다.
[mysqld] server-id = 1 <= 그대로 두고, 아래 내용을 추가한다. master-host = users_host master-port = 3306 master-user = users_name master-password = users_password
[edit]
1.3.8 SUCCESS CERTIFICATION ¶
mysql/data/mysql1.err을 확인하여 다음과 같은 메시지가 있으면 성공적으로 설정된 것이다.
Slave I/O thread: connected to master 'ccotti@222.112.137.172:3306', replication started in log 'FIRST' at position 4
지금까지 별다른 문제없이 설치를 진행하였다면, 각 서버의 mysql 모니터에서 데이터를 입력하고, 두 서버가 서로 연동이 되는 것을 확인할 수 있을 것이다.
[edit]
1.4 장애복구 ¶
위의 설정에서 두 대의 서버 중 한 대가 장애를 일으키는 경우 한 서버를 리부팅한다고 가정할 때, 별도의 설정이 없다면 기존의 MySQL 리플리케이션 구성에서는 두 서버 간의 동기화가 원활히 일어나지 않았다. 그런 경우 다음을 순서대로 진행하며, 장애를 복구할 수 있다. 우선 mysql1 서버를 재시작해야 한다고 가정하자.
1. mysql1의 mysql/data/ 의 mysql1-bin.*를 지운다.
2. mysql1의 mysqld를 시작한다.
mysql1 shell > /etc/init.d/mysqld start
3. mysql2의 mysql 모니터에서 다음 명령어를 실행한다.
mysql2 mysql > slave stop; mysql2 mysql > slave reset; mysql2 mysql > slave start;
[edit]
1.5 참고 ¶
● master와 slave 데이터 일치 방법
- master mysql을 정지시키고 대상 파일들을 백업(복사) - master mysql을 구동
● slave에서 'LOAD TABLE FROM MASTER' 나 'LOAD DATA FROM MASTER' 명령을
-> 이 후 변경사항들이 bin-log에 기록됨
- slave에 백업한 DB 파일들을 복사 후 구동
-> master의 bin-log를 참고하여 데이터 일치됨 ※ 이 때, 복사한 파일의 소유자(mysql인지?) 확인 철저 ※ my.cnf 설정에서 특정 DB를 선택한 경우 master와 slave 모두 동일하게 설정해야 함
(한 쪽은 설정하지 않고 한 쪽은 설정한 경우 오동작)
※ my.cnf 주의사항 : mysql_safe 실행 시 DB_DIR 옵션에 따라 불러오는 위치 달라짐 사용하기 위해서는 replication 계정에 다음은 권한 추가 필요
- SUPER, RELOAD, SELECT 권한을 replication 계정에 부여 ● 다음 명령을 통해 mysql의 내부cache를 clear시키고 쓰기 방지 가능
※ mysql 기본 테이블인 MyISAM 테이블을 사용할 경우 -
● 쓰기 방지 해제 명령
- mysql> UNLOCK TABLES;
● slave의 mysql을 replication 미적용하고 구동 방법
- /usr/local/bin/mysqld_safe --skip-slave-start ● slave 동작 구동 방법 - mysql> start slave;
● replication 정상동작 확인 ※ slave 설정 미인식 등의 문제 발생 시
mysql> change master to 명령을 사용하여 설정
- mysql> show processlist;
또는 mysql> show processlist\G ; 상세한 내용 확인
- mysql> show slave status;
또는 mysql> show slave status\G ; 상세한 내용 확인 또는 mysql> show master status;
- error 로그 확인
-오라클 9i / 10g용 관리 명령어(sql) 요약-
순전히 이기적인 용도로 사용하기 위해 대충 만든 요약본입니다.
필요하신 분은 유용하게 사용하세요.
혹시나 옮겨가실 분은 댓글이라도 달아주세요. ^^
작성자 : mirsya
http://mirsya.tistory.com
최종수정 2007년 2월 18일 일요일
※틀린 부분이나 수정이 필요 한 부분은 가차없이 알려주세요.
순전히 이기적인 용도로 사용하기 위해 대충 만든 요약본입니다.
필요하신 분은 유용하게 사용하세요.
혹시나 옮겨가실 분은 댓글이라도 달아주세요. ^^
작성자 : mirsya
http://mirsya.tistory.com
최종수정 2007년 2월 18일 일요일
※틀린 부분이나 수정이 필요 한 부분은 가차없이 알려주세요.
- !! 오렌지색 부분은 환경에 맞게 수정하세요.
- Oracle 9i / 10g 관리자 명령어 요약
- Startup / Shutdown
- Session
- Parameter File
- Control File
- Redo Log
- Tablespace
- Temporary Tablespace
- Undo Tablespace
- Database Buffer Cache
- Row Migration / Chaining
- Partitioned Table
- Deferred Constraints
- User
- Profile
- Privileges
- Role
- Export
- Import
- Direct Load
- Oracle Net - Host Naming
- Oracle Net - Local Naming
- Create DB - 9i
- Create DB - 10g
- Archive Log
- STARTUP / SHUTDOWN
- STARTUP
- startup [ nomount | mount | open [ read only ]]
- SHUTDOWN
- shutdown [ immediate | transactional | normal | abort ]
- 상태 변경
- alter database [ mount | open [ read only ]];
- STARTUP 상태 조회
- select status from v$instance;
- OPEN 상태 조회
- select open_mode from v$database;
- >>Index<<
- SESSION
- 제한 상태로 변경
- alter system enable restricted session;
- 제한 상태 조회
- select logins from v$instance;
- 사용자 SESSION 조회
- select sid, serial#, username, status from v$session;
- 사용자 SESSION 강제종료
- alter system kill session 'SID,SERIAL#';
- RESTRICTED SESSION 권한 조회
- select * from dba_sys_privs where privilege like '%RESTRICT%';
- >>Index<<
- PARAMETER FILE
- 파일구분
- spfile : binaryfile, open 상태에서 수정
- pfile : textfile, shutdown 상태에서 수정
- 파일생성
- shutdown 상태에서 수행
- create spfile from pfile;
- create pfile from spfile;
- SPFILE
- alter system set parameter_name = 'value' [ comment 'text' ]
[ scope = memory | spfile | both ] [ sid = 'sid' | '*' ]; - PFILE
- shutdown 상태에서 편집기로 편집
- >>Index<<
- CONTROL FILE
- SPFILE 사용시
- open 상태에서 명령수행
alter system set control_files = '경로1', '경로2' scope = spfile;
콘트롤 파일 복사 후 DB 재기동 - PFILE 사용시
- shutdown 상태에서 pfile 파라미터 수정
콘트롤 파일 복사 후 DB 기동 - >>Index<<
- REDO LOG
- LOGSWITCH
- 현재 사용하는 로그파일을 변경
- alter system switch logfile;
- CHECKPOINT
- active 상태의 로그파일을 inactive로 변경
- alter system checkpoint;
- LOG FILE 상태 조회
- select a.group#, a.member, b.bytes, b.status
from v$logfile a, v$log b
where a.group# = b.group#; - GROUP 추가
- alter database add logfile group 그룹번호 '파일경로' size 크기;
- alter database add logfile group 그룹번호 ('파일경로1', '파일경로2') size 크기;
- MEMBER 추가
- alter database add logfile member '파일경로' to group 그룹번호;
- GROUP / MEMBER 삭제
- alter database drop logfile group 그룹번호;
- alter database drop logfile member '파일경로';
- ※삭제 명령시 파일은 삭제되지 않음
- >>Index<<
- TABLESPACE
- TABLESPACE 조회
- select tablespace_name, status, contents, extent_management, segment_space_management
from dba_tablespaces; - DATAFILE 조회
- select tablespace_name, bytes, file_name from dba_data_files;
- TEMPFILE 조회
- select tablespace_name, bytes, file_name from dba_temp_files;
- 일반 TABLESPACE 생성
- create tablespace 테이블스페이스명 datafile '파일경로' size 크기
[ blocksize 크기] // 해당 블럭 사이즈의 db_nk_cache_size 설정 필요
[ extent management local ] // 8i 이전 필수 옵션
[ segment space management auto ] // 9i 이후 필수 옵션; - UNDO TABLESPACE 생성
- create undo tablespace 테이블스페이스명 datafile '파일경로' size 크기;
- TEMPORARY TABLESPACE 생성
- create temporary tablespace 테이블스페이스명 tempfile '파일경로' size 크기;
- TABLESPACE 확장
- alter tablespace 테이블스페이스명 add datafile '파일경로' size 크기;
- alter database datafile '파일경로' resize 크기;
- TABLESPACE 관리
- alter tablespace 테이블스페이스명 offline;
- alter tablespace 테이블스페이스명 online;
- alter tablespace 테이블스페이스명 rename datafile '원본파일경로' to '파일경로';
- TABLESPACE 삭제
- drop tablespace 테이블스페이스명 including contents and datafile cascade constraints;
- 문법
- CREATE TABLESPACE 테이블스페이스명
DATAFILE '파일경로1' SIZE integer [M/K], '파일경로2' SIZE integer [M/K]
[ MINIMUM EXTENT integer [M/K]]
[ BLOCKSIZE integer [K]] [ DEFAULT STORAGE (
INITIAL integer [M/K]
NEXT integer [M/K]
MAXEXTENTS integer
MINEXTENTS integer
PCTINCREASE integer)]
[ ONLINE | OFFLINE ]
[ PERMANENT | TEMPORARY ]
[ EXTENT MANAGEMENT [ DICTIONARY | LOCAL
[ AUTOALLOCATE | UNIFORM [ SIZE integer [M/K]]]]]
[ SEGMENT SPACE MANAGEMENT [ MANUAL | AUTO]] - OPEN 상태에서 DATAFILE 이동
- alter tablespace 테이블스페이스명 offline;
offline 된 T/S에 대해 복사/이동 후
alter tablespace 테이블스페이스명 rename datafile '파일경로' to '파일경로';
alter tablespace 테이블스페이스명 online; - MOUNT 상태에서 DATAFILE 이동
- startup mount;
해당 T/S에 대해 복사/이동 후
alter database rename file '파일경로' to '파일경로';
alter database open; - 모든 데이타 파일은 mount상태에서 복사/이동 가능
- system 파일은 mount상태에서만 복사/이동 가능
- >>Index<<
- TEMPORARY TABLESPACE
- TEMPORARY TABLESPACE 관리
- TEMPORARY T/S는 READ ONLY 설정 불가, nologgin 상태이며 rename불가, 복구대상이 아님
READ ONLY DATABASE 에서도 TEMPORARY 파일은 필요 - DEFAULT TEMPORARY TABLESPACE 확인
- select * from database_properties where property_name like '%TEMP%';
- TEMPORARY TABLESPACE 변경
- create temporary tablespace 테이블스페이스명_신 tempfile '파일경로' size 크기;
alter database default temporary tablespace 테이블스페이스명_신;
drop tablespace 테이블스페이스명_구; - >>Index<<
- UNDO TABLESPACE
- PARAMETER 설정 / 9i
- UNDO_MANAGEMENT = AUTO [ MANUAL ]
UNDO_TABLESPACE = UNDOTBS1
UNDO_SUPPRESS_ERRORS = TRUE // 10g 에서는 쓰이지 않음
UNDO_RETENTION = integer (초) - PARAMETER 확인 / 9i
- show parameter undo;
- DEFAULT UNDO TABLESPACE 설정
- alter system set undo_tablespace = 테이블스페이스명;
parameter 'UNDO_TABLESPACE' 수정 - 설정 조회
- select segment_name, owner, tablespace_name, status
from dba_rollback_segs; - >>Index<<
- DATABASE BUFFER CACHE
- DBWR 기동 이벤트
- Checkpoint - 일반적인 ckpt는 어디까지 내려썼는지만 확인 immediate ckpt시 즉시 내려씀
Dirty Block 임계값 도달
LRU List 의 Free Block 이 부족할 때
Time out
T/S offline (9i부터는 online시), read only, begin backup
Table Drop, Truncate
RAC ping - STANDARD BLOCK SIZE
- System과 Temporary tablespace는 스탠다드 사이즈만 사용 가능
- DB생성시 설정되는 표준 사이즈, 수정 불가(system T/S 가 이미 사용중이므로)
- show parameter db_block_size
- 사용 가능한 BLOCK SIZE 조회
- show parameter cache_size
- db_nk_cache_size / n = '2, 4, 8, 16, 32'
- DB_KEEP_CACHE_SIZE, DB_RECYCLE_CACHE_SIZE
- hit rate 향상을 위한 parameter
db_keep_cache_size : 자주 호출되는 data를 pinning 할 때 쓰임
db_recycle_cache_size : 차후 호출될 가능성의 희박한 data를 읽을 때 쓰임 - SGA 크기 조회
- show parameter sga
show parameter sga_max - nk BLOCK SIZE의 TABLESPACE 생성
- alter system set db_cache_size = 크기[M]; // SGA영역의 공간 확보를 위해 db_cache_size를 줄임
alter system set db_nk_cache_size = 크기[M]; // 줄여진 db_cache_size 만큼 할당 가능
create tablespace 테이블스페이스명 datafile '파일경로' size 크기 blocksize nk; - nk 블럭의 T/S가 존재하면 해당 db_nk_cache_size 를 0으로 설정 불가
- >>Index<<
- ROW MIGRATION / CHAINING
- migration 은 해소 가능 chaining 은 해소 불가
오라클은 이 두 가지 경우를 구분하지 않음 - TABLE 상태 확인
- select owner, table_name, tablespace_name from dba_tables
where owner = '유저명' and table_name = '테이블명'; - TABLE ANALYZE
- analyze table 스키마.테이블명 compute statistics;
- dictionary의 통계정보를 갱신시켜 주는 작업
- CHAIN COUNT 조회
- select num_rows, chain_cnt from dba_tables where table_name = '테이블명';
- TABLE 이동
- alter table 테이블명 move
[ tablespace 테이블스페이스명]; // 생략시 현재 사용중인 T/S 내에서 옮겨짐 - INDEX 조회
- select table_name, index_name, status from dba_indexes where table_name = '테이블명'
- INDEX REBUILD
- alter index 스키마.인덱스명 rebuild;
- TABLE MOVE 명령후 ROWID가 변경됐으므로 INDEX를 REBUILD 해주어야 함
- TABLE의 공간 사용량 조회
- select num_rows, blocks, empty_blocks, avg_space, avg_row_ren from dba_tables
where owner = '유저명' and table_name = '테이블명'; - BLOCKS : H/M 왼쪽 블럭 수
EMPTY_BLOCKS : 미사용 블럭 , H/M 오른쪽 블럭 수
AVG_SPACE : 사용중인 블럭의 평균 빈공간
AVG_ROW_LEN : row의 평균 길이 - TABLE의 EXTENT설정 조회
- select table_name, initial_extent, min_extents from dba_tables
where owner = '유저명' and table_name = '테이블명'; - TABLESPACE의 EXTENT설정 조회
- select tablespace_name, block_size, initial_extent, min_extents from dba_tablespaces
where tablespace_name = '테이블스페이스명'; - >>Index<<
- PARTITIONED TABLE
- LIST 분할
- create table table_name (column_1 type( ), column_2 type( ) ... )
partition by list (column_2) (
partition partition_name values ('value_1') tablespace tablespace_name,
partition partition_name values ('value_2') tablespace tablespace_name); - multi column partition 지원 안함
NULL 값 지정 가능, MAXVALUES 지정 불가
list를 구성하는 문자열은 4k 초과 불가 - PARTITIONED TABLE 조회
- select table_owner, table_name, partition_name, tablespace_name from dba_tab_partitions where table_owner = '유저명';
- TABLE의 PARTITION 여부 조회
- select owner, table_name, partitioned from dba_tables where owner = '유저명';
- PARTITION 관리
- alter table 테이블명 add partition partition_name values ('value') tablespacetablespace_name;
- alter table 테이블명 drop partition partition_name;
- RANGE 분할
- create table table_name (column_1 type( ), column_2 type( ) ... )
partition by range (column_2) (
partition partition_name values less than (value_1),
partition partition_name values less than (value_2),
partition partition_name values less than ( MAXVALUE ) ); - HASH 분할
- create table table_name (column_1 type( ), column_2 type( ) ... )
partition by hash (column_2)
partitions integer store in (tablespace_name, tablespace_name); - >>Index<<
- DEFERRED CONSTRAINTS
- 문법
- CREATE TABLE table_name (column_1 type( ), column_2 type ( ), ...
CONSTRAINT constraint_name constraint_type (column)
[ NOT DEFERRABLE | DEFERRABLE [ INITIALLY [ IMMEDIATE | DEFERRED ]]]); - 지연된 제약조건 활성화
- ALTER SESSION SET CONSTRAINTS = [ IMMEDIATE | DEFERRED | DEFAULT ]
- >>Index<<
- USER
- USER 생성
- create user 유저명 identified by 패스워드
default tablespace 테이블스페이스명
temporary tablespace 임시테이블스페이스명
quota integer [M] on 유저명; - USER 변경
- alter user 유저명 identified by 패스워드
default tablespace 테이블스페이스명
temporary tablespace 임시테이블스페이스명
quota integer [M] on 유저명
[ password expire ]; - USER 의 TABLESPACE 할당량 조회
- select * from dba_ts_quotas;
- >>Index<<
- PROFILE
- PROFILE 조회
- select distinct profile from dba_profiles;
- USER 의 PROFILE 조회
- select username, profile from dba_users;
- PROFILE 생성
- create profile profile_name limit
제한사항 value 제한사항 value ... ; - PROFILE 적용
- alter user 유저명 profile profile_name;
- PARAMETER 'resource_limit' 의 값이 TRUE로 설정되어 있어야 함
- >>Index<<
- PRIVILEGES
- 권한 부여 / SYSTEM PRIVS
- grant 권한 to 유저명
[ with admin option ]; - 권한 부여 / OBJECT PRIVS
- grant 권한 on 개체 to 유저명
[ with grant option ]; - 권한 조회
- select * from dba_sys_privs where grantee like '유저명';
- GRANT 조회 / TABLE
- select * from all_tab_privs where table_name = '테이블명';
- 권한 취소 / SYSTEM PRIVS
- revoke 권한 from 유저명;
- 권한 취소 / OBJECT PRIVS
- revoke 권한 on 개체 from 유저명;
- >>Index<<
- ROLE
- ROLE 의 PRIVS 조회
- select * from dba_sys_privs where grantee = 'role_name';
- ROLE 생성
- create role role_name;
- ROLE 에 SYSTEM PRIVS 부여
- grant privs_name to role_name;
- ROLE 에 OBJECT PRIVS 부여
- grant privs_name on 개체 to role_name;
- DEFAULT ROLE 지정
- alter user user_name default role role_name;
- ROLE 활성화
- set role role_name;
- set role all;
- ROLE 조회
- select * from session_roles;
- >>Index<<
- EXPORT
- 문법
- ]$ exp username/passwd option=(value1, value2, ... ) option=value ...
- OPTION
- file: 백업 파일명 지정 (default : expdat.dmp)
- rows: 테이블의 row의 포함 여부 지정
- full: 전체 DB에 대한 익스포트 지정
- owner: 익스포트할 사용자 지정 (사용자모드)
- table: 익스포트할 테이블 지정 (테이블모드)
- tablespace: 익스포트할 테이블스페이스 지정 (T/S 모드)
- inctype: 전체 백업 레벨 지정 (8i까지만 사용됨)
- indexes: 인덱스 익스포트 지정
- full, owner, table, tablespace 는 동시 사용 불가
- 익스포트시 sys로 작업은 지양 (dictionary data까지 포함되므로)
- >>Index<<
- IMPORT
- 문법
- ]$ imp username/passwd option=(value1, value2, ... ) option=value ...
- OPTION
- file: 입력 파일명 지정
- ignore: 임포트 실행중 입력 오류 무시
- rows: 테이블의 row의 포함 여부 지정
- full: 전체 DB에 대한 임포트트 지정
- fromuser: 익스포트된 객체를 소유한 사용자중 임포트 대상이 되는 사용자
- touser: 임포트할 대상이 되는 사용자
- table: 임포트할 테이블 지정
- tablespace: 임포트할 테이블스페이스 지정
- 임포트 작업시 실행 순서 : 새로운 테이블생성 / 데이터 입력, 인덱스 리빌드 / 제약조건 활성화
- >>Index<<
- DIRECT LOAD
- DIRECT LOAD SAMPLE
- sample.ctl
LOAD DATA INFILE * INTO TABLE table_name
FIELDS TERMINATED BY ',' (column1, column2, column3)
BEGINDATA
111,aa,95
112,ab,86
...
...
- ]$ sqlldr username/passwd sample.ctl
- >>Index<<
- ORACLE NET / HOST NAMING
- HOST NAMING
- port 번호등의 정보를 Client에게 제공하지 않음
다수의 DB를 운용하는 경우는 사용할 수 없음
GLOBAL_DBNAME은 되도록이면 도메인 형식을 사용
(호스트명만 기입시 Windows Client 에서만 이용가능) - SERVER 설정 / LINUX
- $ORACLE_HOME/network/admin/listener.ora
- ora10g =
- (ADDRESS_LIST =
- (ADDRESS = (PROTOCOL = TCP) (HOST = xxx.xxx.xxx.xxx) (PORT = 1521))
- )
- SID_LIST_ora10g =
- (SID_LIST =
- (SID_DESC = (GLOBAL_DBNAME = ora10g.xxx.xxx)
- (ORACLE_HOME = /app/ora10g/10g)
- (SID_NAME = DB09)
- )
- )
- LISTENER 구동
- ]$ lsnrctl start ora10g
- CLIENT 설정 / WINDOWS
- GLOBAL_DBNAME 으로 ping이 되는지 확인, 필요시 hosts나 DNS에 등록
- %ORACLE_HOME%\network\admin\sqlnet.ora
- SQLNET.AUTHENTICATION_SERVICES= (NTS)
- NAMES.DIRECTORY_PATH= (HOSTNAME)
- C:\>sqlplus username/passwd@ora10g.xxx.xxx
- CLIENT 설정 / LINUX
- GLOBAL_DBNAME 으로 ping이 되는지 확인, 필요시 hosts나 DNS에 등록
- $ORACLE_HOME/network/admin/sqlnet.ora
- NAMES.DIRECTORY_PATH= (HOSTNAME)
- ]$ sqlplus username/passwd@ora10g.xxx.xxx
- >>Index<<
- ORACLE NET / LOCAL NAMING
- LOCAL NAMING
- port 번호등 서버정보를 Client가 가지고 있음
- SERVER 설정 / LINUX
- $ORACLE_HOME/network/admin/listener.ora
- ora10g =
- (ADDRESS_LIST =
- (ADDRESS = (PROTOCOL = TCP) (HOST = xxx.xxx.xxx.xxx) (PORT = 1521))
- )
- SID_LIST_ora10g =
- (SID_LIST =
- (SID_DESC = (ORACLE_HOME = /app/ora10g/10g)
- (SID_NAME = DB09)
- )
- )
- 다수의 DB가 존재 할 경우 각 DB의 listner port번호는 다르게 설정한다
- LISTENER 구동
- ]$ lsnrctl start ora10g
- 각각의 DB에 해당하는 listener.ora 파일을 생성하고 listener를 각각 구동한다
- CLIENT 설정 / NAMES.DEFAULT_DOMAIN 미설정 시
- sqlnet.ora
- NAMES.DIRECTORY_PATH= (TNSNAMES)
- tnsnames.ora
- ora9i =
- (DESCRIPTION =
- (ADDRESS = (PROTOCOL = TCP) (HOST = xxx.xxx.xxx.xxx) (PORT = 1529))
- (CONNECT_DATA = (SID = DB09))
- )
- ora10g =
- (DESCRIPTION =
- (ADDRESS = (PROTOCOL = TCP) (HOST = xxx.xxx.xxx.xxx) (PORT = 1521))
- (CONNECT_DATA = (SID = DB10))
- )
- ]$ sqlplus username/passwd@ora10g
]$ sqlplus username/passwd@ora9i - CLIENT 설정 / NAMES.DEFAULT_DOMAIN 설정 시
- TCP/IP 에서의 DOMAIN과 관계 없음
- sqlnet.ora
- NAMES.DEFAULT_DOMAIN= webdb.co.kr
- NAMES.DIRECTORY_PATH= (TNSNAMES)
- tnsnames.ora
- ora9i.webdb.co.kr =
- (DESCRIPTION =
- (ADDRESS = (PROTOCOL = TCP) (HOST = xxx.xxx.xxx.xxx) (PORT = 1529))
- (CONNECT_DATA = (SID = DB09))
- )
- ora10g.webdb.co.kr =
- (DESCRIPTION =
- (ADDRESS = (PROTOCOL = TCP) (HOST = xxx.xxx.xxx.xxx) (PORT = 1521))
- (CONNECT_DATA = (SID = DB10))
- )
- ]$ sqlplus username/passwd@ora10g
]$ sqlplus username/passwd@ora9i
]$ sqlplus username/passwd@ora10g.webdb.co.kr - >>Index<<
- DATABASE 생성 / 9i
- ENV CHECK
- ]$ env | grep ORACLE
- 기존 파일 삭제
- $ORACLE_BASE/oradata/
$ORACLE_BASE/admin/$ORACLE_SID/ - PARAMETER FILE 편집
- $ORACLE_HOME/dbs/initSID_name.ora
- DB 생성
- createdb.sql
- CREATE DATABASE $ORACLE_SID
- LOGFILE
- GROUP 1 ('$ORACLE_BASE/oradata/disk4/redo01.log') size 1M,
- GROUP 2 ('$ORACLE_BASE/oradata/disk4/redo02.log') size 1M,
- GROUP 3 ('$ORACLE_BASE/oradata/disk4/redo03.log') size 1M
- MAXLOGFILES 5
- MAXLOGMEMBERS 5
- MAXDATAFILES 100
- DATAFILE
- '$ORACLE_BASE/oradata/disk3/system01.dbf' size 300M
- EXTENT MANAGEMENT LOCAL
- UNDO TABLESPACE undo DATAFILE
- '$ORACLE_BASE/oradata/disk3/undo01.dbf' size 10M
- DEFAULT TEMPORARY TABLESPACE temp TEMPFILE
- '$ORACLE_BASE/oradata/disk3/temp01.dbf' size 10M
- CHARACTER SET KO16KSC5601
- ;
- @$ORACLE_HOME/rdbms/admin/catalog.sql
- @$ORACLE_HOME/rdbms/admin/catproc.sql
- conn system/manager;
- @$ORACLE_HOME/sqlplus/admin/pupbld.sql
- ]$ sqlplus '/as sysdba'
SQL> startup nomount
SQL> @createdb.sql - >>Index<<
- DATABASE 생성 / 10g
- ENV CHECK
- ]$ env | grep ORACLE
- 기존 파일 삭제
- $ORACLE_BASE/oradata/
$ORACLE_BASE/admin/$ORACLE_SID/ - PARAMETER FILE 편집
- $ORACLE_HOME/dbs/initSID_name.ora
- DB 생성
- createdb.sql
- CREATE DATABASE $ORACLE_SID
- LOGFILE
- GROUP 1 ('$ORACLE_BASE/oradata/disk4/redo01.log') size 4M,
- GROUP 2 ('$ORACLE_BASE/oradata/disk4/redo02.log') size 4M,
- GROUP 3 ('$ORACLE_BASE/oradata/disk4/redo03.log') size 4M
- MAXLOGFILES 5
- MAXLOGMEMBERS 5
- MAXDATAFILES 100
- DATAFILE
- '$ORACLE_BASE/oradata/disk3/system01.dbf' size 300M
- EXTENT MANAGEMENT LOCAL
- SYSAUX DATAFILE
- '$ORACLE_BASE/oradata/disk3/sysaux01.dbf' size 200M
- UNDO TABLESPACE undo DATAFILE
- '$ORACLE_BASE/oradata/disk3/undo01.dbf' size 10M
- DEFAULT TEMPORARY TABLESPACE temp TEMPFILE
- '$ORACLE_BASE/oradata/disk3/temp01.dbf' size 10M
- CHARACTER SET KO16KSC5601
- ;
- @$ORACLE_HOME/rdbms/admin/catalog.sql
- @$ORACLE_HOME/rdbms/admin/catproc.sql
- conn system/manager;
- @$ORACLE_HOME/sqlplus/admin/pupbld.sql
- ]$ sqlplus '/as sysdba'
SQL> startup nomount
SQL> @createdb.sql - >>Index<<
- ARCHIVE LOG MODE
- DB 종료
- SQL> shutown immediate
- Parameter File 수정
- log_archive_start = true
- log_archive_dest = destination
- log_archive_format = %S.arc
- 다수의 아카이빙
- log_archive_duplex_dest = destination
- log_archive_min_succed_dest = [ 1 | 2 ]
- log_archive_dest_# = "location = destination"
- log_archive_dest_# = "service = tnsname"
- DB 기동 / 아카이브 모드 변경
- SQL> startup mount
SQL> alter database archivelog; SQL> startup open - 아카이브 모드 확인 후 Close Backup
SQL> archive log list - >>Index<<