tag:blogger.com,1999:blog-36377404766104257772024-02-19T07:49:36.179-08:00Online database infoUnknownnoreply@blogger.comBlogger181125tag:blogger.com,1999:blog-3637740476610425777.post-13547788603633444082018-09-02T12:57:00.000-07:002018-09-02T12:57:26.808-07:00SQL Databases and the Firebase Database - The Firebase Database For SQL Developers #1SQL Databases and the Firebase Database - The Firebase Database For SQL Developers <br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiRKVkXuv5-Sw0HeHA_Iw7tQFjkj4gIexPSvsdar3SZlGZk_OmSfFmTdubEqtbNP3PwiOKFdyxfDccla11H_34kiovmIOf-DWnQKCSNcGgv53j0WnI2u052b3aoGPdogpRjsZjB_9KLva0/s1600/SQL+Databases+and+the+Firebase+Database+-+The+Firebase+Database+For+SQL+Developers.jpg" imageanchor="1" style="clear: right; float: right; margin-bottom: 1em; margin-left: 1em;"><img border="0" data-original-height="273" data-original-width="480" height="182" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiRKVkXuv5-Sw0HeHA_Iw7tQFjkj4gIexPSvsdar3SZlGZk_OmSfFmTdubEqtbNP3PwiOKFdyxfDccla11H_34kiovmIOf-DWnQKCSNcGgv53j0WnI2u052b3aoGPdogpRjsZjB_9KLva0/s320/SQL+Databases+and+the+Firebase+Database+-+The+Firebase+Database+For+SQL+Developers.jpg" width="320" /></a></div>
<br />
... JSON ... I lost my breath. "Breathing is good. - It's very good. You can breathe. Database Firebase for SQL Developers 1 - SQL Databases and the Firebase Database Hello, everyone. Welcome to the first episode of the Firebase Database series for SQL developers. In this lesson, I'm going to teach you the difference between how data is saved in a SQL database and in a NoSQL database, such as Firebase Database.<br /><br /><br />To start, let's go to the laptop. Relational databases use tables to save data and a table is made up of columns and rows. A column is a field that can contain something like "name," "birthday," or "place." And a line is everything that represents that entity. In this case, it could be a customer. And, honestly, nothing sounds as SQL as a multi-client table. #SQLJoke How will we know that each of these columns will have a valid entry? What happens if any goes blank? To avoid this, we use "Schemas". A Scheme is like a diagram. Defines how the data will be organized. It specifies the name of the column, the data type, and whether it is required.<br /><br /><br />These specifications are called "Restrictions" because they restrict some properties of the data. One of the most notable Restrictions is called the "primary key" and each row has one. A primary key must be unique because it is used to identify each data entry. If you want to enter data in this table, enter an INSERT statement that indicates which table will receive the data, which fields will be filled, and the values for such fields. Let's say I want to add a field that I'll call LastName. What happens if I add it to the INSERT statement and click execute? He will not give me permission to do that.<br /><br /><br />Because "LastName" is not yet in our Schema. So if we want to insert "LastName", we need to go back and insert an ALTER statement to add it to the Scheme. The ALTER statement creates the "LastName" column, but also adds a constraint because it can not be NULL. And this becomes a paradox. So how do I add the NOT NULL constraint if there is no value in the table for "LastName"? To fix this paradox, you will have to add a new column without the NOT NULL constraint and then manually enter the values in each row.<br /><br /><br />Once you have done this, you can change the column to add the NOT NULL constraint. After that, the table is ready. SQL databases are rigid to ensure greater data integrity. But it can be tricky when you start to develop because you do not know how your Scheme will work. And there may be sudden changes in the data structure, which will force you to change your Scheme and migrate the data.<br />
<br />
In relational models, everything does not always fit. And this is where NoSQL, like the Firebase database, comes into the picture. Firebase Database is a JSON database in NoSQL. It's a fancy way of saying it's just a JSON object. JSON is very simple. It has keys and values. A key is an identifier and a value is ... a value. Just like in the tables, how do you know what each key will accept as value? Is there a Schema that we can use? Well, Firebase Database, like many NoSQL databases, does not have Schemas, which means you do not have to define the structure of your data before you insert them. This provides flexibility because you do not need to change the Schema just to update data. However, just because you do not need to specify a Schema, this does not prevent you from validating the types of data that will be saved to your database.<br /><br /><br />The Firebase Database has a rule language called "Security Rules". Security Rules allow you to specify the shape and size of the data before it is saved to the database. These rules can be specified after you have decided the best structure for your data, giving you more flexibility. You consider the Security Rules as the SQL Restrictions. This rule example checks all direct child keys below the client key. Every time a new child key is saved, the rule confirms that "firstName" has the form String, "birthday" has Number, and "location" also has String format. If the parameters are different, the data will not be saved. You will still be able to validate your data structure as if there is a Constraint Scheme. To create the data, you can use the Firebase SDK. We choose an object from the database to create a reference where the data will be saved.<br /><br /><br />In this case, we have created a reference to the client location. Then specify the role of the child key under the parent key. This child key will be like your primary key, because it will be unique in that collection. After that, you can save your data. And the key is unique because of the nature of JSON. If you try to add another "customer_one" key to this data structure, it replaces the previous one. Essentially, there is no way to have two "customer_one" keys under the "clients" key. In this example, you can imagine clients as a table and "customer_one" as the primary key. But the procedure will not always be so straightforward. NoSQL databases can be used in the structure of columns and rows, but you have flexibility since you do not need to adhere to a Schema. Sometimes there are better options for structuring your data. The main difference between SQL databases and NoSQL lies in data integrity and flexibility. SQL databases are very inflexible, but give us much more data integrity.<br /><br /><br />NoSQL databases are fairly flexible, but part of the data integrity depends on the developer, as you saw with the Security Rules. In the next lesson, we'll explore a more advanced relational model that will be converted to a NoSQL database. If you liked this episode, do not forget to enjoy and sign up to stay up to date on our content, like our Firecasts series that features several tutorials. And if you have any question for us, you can send it through any social network of your choice. Just use the #AskFirebase hashtag. We will respond in the weekly Q & A program. And that is all. See you in the next episode. Thanks for watching the video. You might also like this one or this one. I like this. And sign up. Now, feel free to see me try to get popcorn with your mouth.<br /><br /><br />Two in a row! .Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-3637740476610425777.post-72738069566422004042018-08-09T04:43:00.000-07:002018-09-02T12:59:27.379-07:00Error in invoking target 'agent nmhs' of makefile while installing oracle 11g <div dir="ltr" style="text-align: left;" trbidi="on"><span style="background-color: white; color: #222222; font-size: 13.2px;"><span style="font-family: Arial, Helvetica, sans-serif;">When installing Oracle 11g you may get the following error :-</span></span><br /><span style="font-family: Arial, Helvetica, sans-serif;"><br style="background-color: white; color: #222222; font-size: 13.2px;" /><span style="background-color: white;"><span style="color: #222222;"><span style="font-size: 13.2px;"> Error in invoking target 'agent nmhs' of makefile '/u01/app/oracle/product/11.1.0/db_1/sysman/lib/ins_emagent.mk</span></span></span><br style="background-color: white; color: #222222; font-size: 13.2px;" /><br style="background-color: white; color: #222222; font-size: 13.2px;" /><span style="background-color: white; color: #222222; font-size: 13.2px;">Solution:-</span><br style="background-color: white; color: #222222; font-size: 13.2px;" /></span><br /><span style="color: #333333; font-family: Arial, Helvetica, sans-serif;"><span style="background-color: white; font-size: 14px;">Open the file it reports in error message.</span></span><br /><span style="font-family: Arial, Helvetica, sans-serif;"><br style="background-color: white; box-sizing: content-box !important; color: #333333; font-size: 14px;" /><span style="background-color: white; color: #333333; font-size: 14px;">vi $ORACLE_HOME/sysman/lib/ins_emagent.mk</span></span><br /><span style="font-family: Arial, Helvetica, sans-serif;"><br style="background-color: white; box-sizing: content-box !important; color: #333333; font-size: 14px;" /><span style="background-color: white; color: #333333; font-size: 14px;">Search for the line </span><br style="background-color: white; box-sizing: content-box !important; color: #333333; font-size: 14px;" /><span style="background-color: white; color: #333333; font-size: 14px;">$(MK_EMAGENT_NMECTL)</span><br style="background-color: white; box-sizing: content-box !important; color: #333333; font-size: 14px;" /><span style="background-color: white; color: #333333; font-size: 14px;">Change it to:</span><br style="background-color: white; box-sizing: content-box !important; color: #333333; font-size: 14px;" /><span style="background-color: white; color: #333333; font-size: 14px;">$(MK_EMAGENT_NMECTL) -lnnz11</span></span><br /><span style="background-color: white; color: #333333; font-size: 14px;"><span style="font-family: Arial, Helvetica, sans-serif;"><br /></span></span><span style="background-color: white; color: #333333; font-size: 14px;"><span style="font-family: Arial, Helvetica, sans-serif;"><br /></span></span><span style="background-color: white; color: #333333; font-size: 14px;"><span style="font-family: Arial, Helvetica, sans-serif;"><br /></span></span><span style="background-color: white; color: #222222; font-size: 13.2px;"><span style="font-family: Arial, Helvetica, sans-serif;">Note : edit this file while you still have the installer open, once you have changed it just click retry on the installer window.</span></span><br /><div><span style="background-color: white; color: #222222; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13.2px;"><br /></span></div></div>Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-3637740476610425777.post-48817897451203298662018-07-29T10:46:00.000-07:002018-09-02T12:59:27.596-07:00Migrating databases from NON-ASM to ASM in oracle 12c<div dir="ltr" style="text-align: left;" trbidi="on">Migrating databases from NON-ASM to ASM in oracle 12c<br /><br />Step 1.<br />Login to the database and write down the path of all the datafiles, tempfiles and redo log files.<br /><br /><br />SQL> select status,version,instance_name from v$instance;<br /><br />STATUS VERSION INSTANCE_NAME<br />------------ ----------------- ----------------<br />OPEN 12.1.0.2.0 orclnew<br /><br /><br />SQL> select file_name,tablespace_name from dba_data_files;<br />FILE_NAME TABLESPACE_NAME<br />-------------------------------------------------------------------------------- -------------------------<br />/u01/app/oracle/oradata/ORCLNEW/datafile/o1_mf_users_dcldb9g3_.dbf USERS<br />/u01/app/oracle/oradata/ORCLNEW/datafile/o1_mf_undotbs1_dcldbbm9_.dbf UNDOTBS1<br />/u01/app/oracle/oradata/ORCLNEW/datafile/o1_mf_system_dcld7ty2_.dbf SYSTEM<br />/u01/app/oracle/oradata/ORCLNEW/datafile/o1_mf_sysaux_dcld611r_.dbf SYSAUX<br /><br /><br />SQL> show parameter control_files;<br /><br />NAME TYPE VALUE<br />------------------------------------ ----------- ------------------------------<br />control_files string /u01/app/oracle/oradata/ORCLNE<br /> W/controlfile/o1_mf_dcldcd09_.<br /> ctl<br /><span style="white-space: pre;"> </span><br /><br />Step 2. Lets find out what are the disks available in ask disk group along with the free space.<span style="white-space: pre;"> </span><br /><span style="white-space: pre;"> </span><br />SQL> select NAME,STATE,TOTAL_MB,PATH from v$asm_disk;<br />NAME STATE TOTAL_MB PATH<br />------------------------------ -------- ---------- -------------------------<br />VOL1 NORMAL 9209 ORCL:VOL1<br />VOL2 NORMAL 9209 ORCL:VOL2<br />VOL3 NORMAL 9209 ORCL:VOL3<br /><br />SQL> select NAME,GROUP_NUMBER,FREE_MB,TOTAL_MB from v$asm_diskgroup;<br /><br />NAME GROUP_NUMBER FREE_MB TOTAL_MB<br />------------------------------ ------------ ---------- ----------<br />DATA 1 23719 27627<br /><br /><br />Now set the control file to point the ASM disk group DATA.<br /><br />SQL> alter system set control_files='+DATA' scope=spfile;<br /><br />System altered.<br /><br /><br />Step 3. Since our database in running on archivelog mode, lets change the db_recovery_file_dest location to ASM diskgroup DATA.<br /><br />SQL> alter system set db_recovery_file_dest='+DATA' scope=spfile;<br /><br />System altered.<br /><br />SQL> alter system set db_recovery_file_dest_SIZE=200M scope=spfile;<br /><br />System altered.<br /><br /><br />Step 4. Shutdown and start the database in nomount stage.<br />SQL> shut immediate;<br />Database closed.<br />Database dismounted.<br />ORACLE instance shut down.<br /><br />SQL> startup nomount<br />ORACLE instance started.<br /><br />Total System Global Area 440401920 bytes<br />Fixed Size 2925360 bytes<br />Variable Size 360713424 bytes<br />Database Buffers 71303168 bytes<br />Redo Buffers 5459968 bytes<br />SQL><br /><br /><br /><br />Step 5.<br />Connect to RMAN and restore the controlfile from the file system to the disk group DATA.<br /><br />[oracle@server3 ~]$ rman target sys/redhat<br /><br />Recovery Manager: Release 12.1.0.2.0 - Production on Fri Mar 3 15:12:56 2017<br /><br />Copyright (c) 1982, 2014, Oracle and/or its affiliates. All rights reserved.<br /><br />connected to target database: ORCLNEW (not mounted)<br /><br />RMAN> restore controlfile from '/u01/app/oracle/oradata/ORCLNEW/controlfile/o1_mf_dcldcd09_.ctl';<br /><br />Starting restore at 03-MAR-17<br />using target database control file instead of recovery catalog<br />allocated channel: ORA_DISK_1<br />channel ORA_DISK_1: SID=26 device type=DISK<br /><br />channel ORA_DISK_1: copied control file copy<br />output file name=+DATA/ORCLNEW/CONTROLFILE/current.271.937667637<br />Finished restore at 03-MAR-17<br /><br /><br />Step 6. After restoring the controlfile mount the database from rman.<br /><br />RMAN> alter database mount;<br /><br />Statement processed<br />released channel: ORA_DISK_1<br /><br /><br />Step 7. Now take the backup of the database in the ASM disk group DATA.<br /><br />RMAN> BACKUP AS COPY DATABASE FORMAT '+DATA';<br /><br />Starting backup at 03-MAR-17<br />allocated channel: ORA_DISK_1<br />channel ORA_DISK_1: SID=28 device type=DISK<br />channel ORA_DISK_1: starting datafile copy<br />input datafile file number=00001 name=/u01/app/oracle/oradata/ORCLNEW/datafile/o1_mf_system_dcld7ty2_.dbf<br />output file name=+DATA/ORCLNEW/DATAFILE/system.272.937667983 tag=TAG20170303T151941 RECID=1 STAMP=937668020<br />channel ORA_DISK_1: datafile copy complete, elapsed time: 00:00:45<br />channel ORA_DISK_1: starting datafile copy<br />input datafile file number=00003 name=/u01/app/oracle/oradata/ORCLNEW/datafile/o1_mf_sysaux_dcld611r_.dbf<br />output file name=+DATA/ORCLNEW/DATAFILE/sysaux.273.937668029 tag=TAG20170303T151941 RECID=2 STAMP=937668059<br />channel ORA_DISK_1: datafile copy complete, elapsed time: 00:00:36<br />channel ORA_DISK_1: starting datafile copy<br />input datafile file number=00004 name=/u01/app/oracle/oradata/ORCLNEW/datafile/o1_mf_undotbs1_dcldbbm9_.dbf<br />output file name=+DATA/ORCLNEW/DATAFILE/undotbs1.274.937668065 tag=TAG20170303T151941 RECID=3 STAMP=937668068<br />channel ORA_DISK_1: datafile copy complete, elapsed time: 00:00:07<br />channel ORA_DISK_1: starting datafile copy<br />copying current control file<br />output file name=+DATA/ORCLNEW/CONTROLFILE/backup.275.937668073 tag=TAG20170303T151941 RECID=4 STAMP=937668074<br />channel ORA_DISK_1: datafile copy complete, elapsed time: 00:00:04<br />channel ORA_DISK_1: starting datafile copy<br />input datafile file number=00006 name=/u01/app/oracle/oradata/ORCLNEW/datafile/o1_mf_users_dcldb9g3_.dbf<br />output file name=+DATA/ORCLNEW/DATAFILE/users.276.937668075 tag=TAG20170303T151941 RECID=5 STAMP=937668075<br />channel ORA_DISK_1: datafile copy complete, elapsed time: 00:00:01<br />channel ORA_DISK_1: starting full datafile backup set<br />channel ORA_DISK_1: specifying datafile(s) in backup set<br />including current SPFILE in backup set<br />channel ORA_DISK_1: starting piece 1 at 03-MAR-17<br />channel ORA_DISK_1: finished piece 1 at 03-MAR-17<br />piece handle=+DATA/ORCLNEW/BACKUPSET/2017_03_03/nnsnf0_tag20170303t151941_0.277.937668077 tag=TAG20170303T151941 comment=NONE<br />channel ORA_DISK_1: backup set complete, elapsed time: 00:00:01<br />Finished backup at 03-MAR-17<br /><br /><br />Step 8. Now change the NON ASM database to ASM by running the below command.<br />RMAN> switch database to copy;<br /><br />datafile 1 switched to datafile copy "+DATA/ORCLNEW/DATAFILE/system.272.937667983"<br />datafile 3 switched to datafile copy "+DATA/ORCLNEW/DATAFILE/sysaux.273.937668029"<br />datafile 4 switched to datafile copy "+DATA/ORCLNEW/DATAFILE/undotbs1.274.937668065"<br />datafile 6 switched to datafile copy "+DATA/ORCLNEW/DATAFILE/users.276.937668075"<br />RMAN><br /><br /><br />Step 9. Now once the datafiles have been moved into ASM diskgroup we can open the database.<br />RMAN> alter database open;<br /><br />Statement processed<br /><br /><br />Step 10. Once database has been opened determine the datafiles location<br /><br />SQL> select file_name,tablespace_name from dba_data_files;<br /><br />FILE_NAME TABLESPACE_NAME<br />-------------------------------------------------------------------------------- ------------------------------<br />+DATA/ORCLNEW/DATAFILE/users.276.937668075 USERS<br />+DATA/ORCLNEW/DATAFILE/undotbs1.274.937668065 UNDOTBS1<br />+DATA/ORCLNEW/DATAFILE/system.272.937667983 SYSTEM<br />+DATA/ORCLNEW/DATAFILE/sysaux.273.937668029 SYSAUX<br /><br />SQL><br /><br /><br />Step 11.After moving the datafiles into ASM diskgroup , we still need to move the temp tablespace and redolog files into ASM diskgroup.<br />SQL> select file_name,tablespace_name from dba_Temp_Files;<br /><br />FILE_NAME TABLESPACE_NAME<br />-------------------------------------------------------------------------------- ------------------------------<br />/u01/app/oracle/oradata/ORCLNEW/datafile/o1_mf_temp_dcldd5h8_.tmp TEMP<br /><br /><br />SQL> select group#,member from v$logfile;<br /> GROUP# MEMBER<br />---------- ----------------------------------------------------------------------<br /> 3 /u01/app/oracle/oradata/ORCLNEW/onlinelog/o1_mf_3_dcldchys_.log<br /> 2 /u01/app/oracle/oradata/ORCLNEW/onlinelog/o1_mf_2_dcldcgk9_.log<br /> 1 /u01/app/oracle/oradata/ORCLNEW/onlinelog/o1_mf_1_dcldcfg7_.log<br /><br /><span style="white-space: pre;"> </span><br /><br />Step 11. To move the temp tablespace we need to drop the existing temp files first then recreate it into ASM diskgroup<br /><br />SQL> alter database tempfile '/u01/app/oracle/oradata/ORCLNEW/datafile/o1_mf_temp_dcldd5h8_.tmp' drop including datafiles;<br /><br />Database altered.<br /><br /><br />SQL> alter tablespace TEMP add tempfile '+DATA' size 150M autoextend on;<br /><br />Tablespace altered.<br /><br />SQL> select file_name,tablespace_name from dba_Temp_Files;<br /><br />FILE_NAME TABLESPACE_NAME<br />-------------------------------------------------------------------------------- ------------------------------<br />+DATA/ORCLNEW/TEMPFILE/temp.278.937669453 TEMP<br /><br />SQL><br /><br /><br /><br />Step 12. Now move the redolog group into ASM diskgroup<br /><br />For this first we will drop the inactive redo log group and then recreate it.<br />SQL> select group#,status from v$log;<br /><br /> GROUP# STATUS<br />---------- ----------------<br /> 1 CURRENT<br /> 2 INACTIVE<br /> 3 INACTIVE<br /><span style="white-space: pre;"> </span><br />Here log group 2 and log group 3 are INACTIVE. Hence, we can drop them and recreate the log groups 2 and 3.<span style="white-space: pre;"> </span><br /><span style="white-space: pre;"> </span><br />Change default location of online redo log files as +DATA disk group.<br /><br /><br />SQL> alter system set db_create_online_log_dest_1='+DATA' SCOPE=BOTH;<br /><br />System altered.<br /><span style="white-space: pre;"> </span><br /><span style="white-space: pre;"> </span><br />SQL> alter database drop logfile group 2;<br /><br />Database altered.<br /><br />SQL> alter database add logfile group 2;<br /><br />SQL> alter database drop logfile group 3;<br /><br />Database altered.<br /><br />SQL> alter database add logfile group 3;<br /><br /><br />SQL>alter system switch logfile;<br /><br />SQL> select group#,status from v$log;<br /><br /> GROUP# STATUS<br />---------- ----------------<br /> 1 INACTIVE<br /> 2 CURRENT<br /> 3 INACTIVE<br /><span style="white-space: pre;"> </span><br />SQL> alter database drop logfile group 1;<br /><br />Database altered.<br /><br />SQL> alter database add logfile group 1;<span style="white-space: pre;"> </span><br /><br />SQL> select * from v$logfile;<br /><br /> GROUP# STATUS TYPE MEMBER IS_ CON_ID<br />---------- ------- ------- ---------------------------------------------------------------------- --- ----------<br /> 3 ONLINE +DATA/ORCLNEW/ONLINELOG/group_3.280.937672657 NO 0<br /> 2 ONLINE +DATA/ORCLNEW/ONLINELOG/group_2.279.937672551 NO 0<br /> 1 ONLINE +DATA/ORCLNEW/ONLINELOG/group_1.285.937672783 NO 0<br /><br /><br />Now finally all physical datafiles/logfiles have been moved from NON ASM TO ASM.<span style="white-space: pre;"> </span><br /><br /></div>Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-3637740476610425777.post-40985029082786741562018-07-28T03:38:00.000-07:002018-09-02T12:59:27.748-07:00How to clone a database using cold backup and restore it with different SID on a new host server<div dir="ltr" style="text-align: left;" trbidi="on"><br /><br />Objective :-We are cloning a database running on target server and restoring it into clone server with a different sid.<br /><br />Note- Make sure oracle binary is already installed on target db server.In this case the directory structure of target server is different than source server.<br /><br />Database Version :- Oracle Enterprise Edition 11.2.0.1 on RHEL 6.4 on both server<br /><br />Source Server: 192.168.0.102<br />Database sid:- prim<br />Hostname:-server1.soumya.com<br /><br /><br />Destination Server: 192.168.0.104<br />database sid: newprim<br />Hostname:-server2.soumya.com<br /><br /><br />1.Take backup of controlfile as trace:[SOURCE DB]<br /><br />SQL> alter database backup controlfile to trace as '/u01/app/oracle/control01.sql';<br />Database altered.<br /><br />2. check the location of datafiles[SOURCE DB]<br /><br />SQL> select file_name from dba_data_files;<br /><br />FILE_NAME<br />--------------------------------------------------------------------------------<br />/u01/app/oracle/oradata/prim/users01.dbf<br />/u01/app/oracle/oradata/prim/undotbs01.dbf<br />/u01/app/oracle/oradata/prim/sysaux01.dbf<br />/u01/app/oracle/oradata/prim/system01.dbf<br />/u01/app/oracle/oradata/prim/example01.dbf<br /><br /><br />SQL> select file_name from dba_temp_files;<br /><br />FILE_NAME<br />--------------------------------------------------------------------------------<br />/u01/app/oracle/oradata/prim/temp01.dbf<br /><br /><br />3. Shutdown the database:[SOURCE DB]<br />SQL> shut immediate;<br />Database closed.<br />Database dismounted.<br />ORACLE instance shut down.<br /><br /><br />4. Copy the datafiles to the target db server<br />[oracle@server1 ]$cd /u01/app/oracle/oradata/prim<br /><br />[oracle@server1 backup]$ scp *.dbf oracle@server2:/u01/<br />The authenticity of host 'server2 (192.168.0.104)' can't be established.<br />RSA key fingerprint is 0b:59:e4:8b:b1:e6:12:3a:38:4f:ba:74:ef:8a:ad:46.<br />Are you sure you want to continue connecting (yes/no)? yes<br />Warning: Permanently added 'server2,192.168.0.104' (RSA) to the list of known hosts.<br />oracle@server2's password:<br />example01.dbf 100% 100MB 25.0MB/s 00:04 <br />sysaux01.dbf 100% 500MB 16.7MB/s 00:30 <br />system01.dbf 100% 670MB 19.7MB/s 00:34 <br />temp01.dbf 100% 20MB 6.7MB/s 00:03 <br />undotbs01.dbf 100% 55MB 27.5MB/s 00:02 <br />users01.dbf 100% 5128KB 5.0MB/s 00:00 <br /><br />Also copy the controlfile which we took backup at step 1 and transfer it into target server.<br /><br />5.Make changes in the init file for target db:[TARGET DB]<br />We can copy the pfile from source db and the change the required parameters like DB_NAME and control_file localtion,audit_file_dest location,diag location etc.<br /><br /><br />[oracle@server2 dbs]$ cat initnewprim.ora<br /><br />newprim.__db_cache_size=138412032<br />newprim.__java_pool_size=4194304<br />newprim.__large_pool_size=4194304<br />newprim.__oracle_base='/u01/newapp/oracle'#ORACLE_BASE set from environment<br />newprim.__pga_aggregate_target=167772160<br />newprim.__sga_target=247463936<br />newprim.__shared_io_pool_size=0<br />newprim.__shared_pool_size=92274688<br />newprim.__streams_pool_size=0<br />*.audit_file_dest='/u01/newapp/oracle/admin/newprim/adump'<br />*.audit_trail='db'<br />*.compatible='11.2.0.0.0'<br />*.control_files='/u01/newapp/oracle/oradata/newprim/control01.ctl','/u01/newapp/oracle/flash_recovery_area/newprim/control02.ctl'<br />*.db_block_size=8192<br />*.db_domain=''<br />*.db_name='newprim'<br />*.db_recovery_file_dest='/u01/newapp/oracle/flash_recovery_area'<br />*.db_recovery_file_dest_size=4070572032<br />*.diagnostic_dest='/u01/newapp/oracle'<br />*.dispatchers='(PROTOCOL=TCP) (SERVICE=newprimXDB)'<br />*.memory_target=414187520<br />*.open_cursors=300<br />*.processes=150<br />*.remote_login_passwordfile='EXCLUSIVE'<br />*.undo_tablespace='UNDOTBS1'<br /><br />Create necessary directories as per new sid<br /><br />[oracle@server2 dbs]$ mkdir -p /u01/newapp/oracle/admin/newprim/adump<br />[oracle@server2 dbs]$ mkdir -p /u01/newapp/oracle/oradata/newprim/<br />[oracle@server2 dbs]$ mkdir -p /u01/newapp/oracle/flash_recovery_area/newprim/<br /><br /><br /><br />6. Now Start the database in nomount stage:[TARGET DB]<br />[oracle@server2 dbs]$ export ORACLE_SID=newprim<br /><br />[oracle@server2 dbs]$sqlplus / as sysdba<br />SQL> startup nomount pfile='/u01/newapp/oracle/product/11.2.0/db_1/dbs/initnewprim.ora';<br />ORACLE instance started.<br /><br />Total System Global Area 413372416 bytes<br />Fixed Size 2213896 bytes<br />Variable Size 268437496 bytes<br />Database Buffers 138412032 bytes<br />Redo Buffers 4308992 bytes<br /><br /><br /><br />7. Re-recreate the controlfile [ TARGET DB ]<br /><br />Open the controlfile and remove word REUSE and make it SET<br />remove word NORESETLOGS and make it RESETLOGS<br />remove or keep the word ARCHIVELOG depending upon our requirement<br />change database name from "prim" to "newprim"<br />change directory name everywhere from 'prim' to 'newprim'<br />:wq<br /><br />The content should look like this<br /><br />[oracle@server2 u01]$ vi control01.sql<br /><br />CREATE CONTROLFILE SET DATABASE "NEWPRIM" RESETLOGS NOARCHIVELOG<br /> MAXLOGFILES 16<br /> MAXLOGMEMBERS 3<br /> MAXDATAFILES 100<br /> MAXINSTANCES 8<br /> MAXLOGHISTORY 292<br />LOGFILE<br /> GROUP 1 '/u01/app/oracle/oradata/newprim/redo01.log' SIZE 50M BLOCKSIZE 512,<br /> GROUP 2 '/u01/app/oracle/oradata/newprim/redo02.log' SIZE 50M BLOCKSIZE 512,<br /> GROUP 3 '/u01/app/oracle/oradata/newprim/redo03.log' SIZE 50M BLOCKSIZE 512<br />-- STANDBY LOGFILE<br />DATAFILE<br /> '/u01/app/oracle/oradata/newprim/system01.dbf',<br /> '/u01/app/oracle/oradata/newprim/sysaux01.dbf',<br /> '/u01/app/oracle/oradata/newprim/undotbs01.dbf',<br /> '/u01/app/oracle/oradata/newprim/users01.dbf',<br /> '/u01/app/oracle/oradata/newprim/example01.dbf'<br />CHARACTER SET WE8MSWIN1252<br />;<br /><br /><br />8.Create the controlfile at target db.<br /><br />SQL>@/u01/control01.sql<br />Control file created.<br /><br />9.Open the database in resetlog mode:<br /><br />SQL> ALTER DATABASE OPEN RESETLOGS;<br /><br />Database altered.<br /><br />10.Create the temp files.<br /><br />SQL> ALTER TABLESPACE TEMP ADD TEMPFILE '/u01/newapp/oracle/oradata/newprim/temp_01.dbf' SIZE 50m autoextend on next 10m maxsize unlimited;<br />Tablespace altered.<br /><br />SQL> select open_mode from v$database;<br /><br />OPEN_MODE<br />--------------------<br />READ WRITE<br /><br />SQL> select instance_name from v$instance;<br /><br />INSTANCE_NAME<br />----------------<br />newprim<br /><div><br /></div></div>Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-3637740476610425777.post-35109770035520449292018-05-20T19:39:00.000-07:002018-09-02T12:59:27.899-07:00Oracle Exadata Database Machine and Cloud Service 2017 Implementation Essentials Dump<div dir="ltr" style="text-align: left;" trbidi="on"><span style="background-color: white; color: #222222; font-family: "arial" , "tahoma" , "helvetica" , "freesans" , sans-serif; font-size: 13.2px; line-height: 18.48px;">Title:-</span><span style="background-color: white; color: #222222; font-family: "arial" , "tahoma" , "helvetica" , "freesans" , sans-serif; font-size: 13.2px; line-height: 18.48px;"> Oracle Exadata Database Machine and Cloud Service 2017 Implementation Essentials D</span><span style="background-color: white; color: #222222; font-family: "arial" , "tahoma" , "helvetica" , "freesans" , sans-serif;">ump</span><br /><br style="background-color: white; color: #222222; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13.2px; line-height: 18.48px;" /><span style="background-color: white; color: #222222; font-family: "arial" , "tahoma" , "helvetica" , "freesans" , sans-serif; font-size: 13.2px; line-height: 18.48px;">Exam Code:-1Z0-338</span><br /><span style="background-color: white; color: #222222; font-family: "arial" , "tahoma" , "helvetica" , "freesans" , sans-serif; font-size: 13.2px; line-height: 18.48px;"><br /></span><span style="background-color: white; color: #222222; font-family: "arial" , "tahoma" , "helvetica" , "freesans" , sans-serif; font-size: 13.2px; line-height: 18.48px;"></span><span style="background-color: white; color: #222222; font-family: "arial" , "tahoma" , "helvetica" , "freesans" , sans-serif; font-size: 13.2px; line-height: 18.48px;">Link:- <a href="https://1drv.ms/b/s!AojZQaghYsq5ggJuRwSIWZ9M2RPO">https://1drv.ms/b/s!AojZQaghYsq5ggJuRwSIWZ9M2RPO</a></span><br /><span style="background-color: white; color: #222222; font-family: "arial" , "tahoma" , "helvetica" , "freesans" , sans-serif; font-size: 13.2px; line-height: 18.48px;"><br /></span><span style="background-color: white; color: #222222; font-family: "arial" , "tahoma" , "helvetica" , "freesans" , sans-serif; font-size: 13.2px; line-height: 18.48px;"><br /></span><span style="background-color: white; color: #222222; font-family: "arial" , "tahoma" , "helvetica" , "freesans" , sans-serif; font-size: 13.2px; line-height: 18.48px;"></span><span style="background-color: white; color: #222222; font-family: "arial" , "tahoma" , "helvetica" , "freesans" , sans-serif; font-size: 13.2px; line-height: 18.48px;">P.S. Please keep in mind the dump is used only for practice purpose, one should not totally rely on it to clear a certification.</span></div>Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-3637740476610425777.post-64364160364239464422018-05-01T09:16:00.000-07:002018-09-02T12:59:28.048-07:00How to clone a database using user managed hot backup in oracle database 11g<div dir="ltr" style="text-align: left;" trbidi="on">How to clone a database using user managed hot backup in oracle database 11g<br /><br />Objective :-We are cloning a database running on target server and restoring it into clone server.<br /><br /><br />Database Version :- Oracle Enterprise Edition 11.2.0.1 on RHEL 6.4<br /><br />Target Server: 192.168.0.101<br />Database sid:- prim<br /><br />Clone Server: 192.168.0.104<br />database sid: newprim<br /><br /><br />****At target Database<br /><br />Take online backup of database<br /><br />Before taking the online backup we need to put the database into archivelog mode.<br /><br /><br />$ export ORACLE_SID=prim<br /><br />SQL> shut immediate;<br />Database closed.<br />Database dismounted.<br />ORACLE instance shut down.<br />SQL> startup mount<br />ORACLE instance started.<br /><br />Total System Global Area 413372416 bytes<br />Fixed Size 2213896 bytes<br />Variable Size 310380536 bytes<br />Database Buffers 96468992 bytes<br />Redo Buffers 4308992 bytes<br />Database mounted.<br />SQL> alter database archivelog;<br /><br />Database altered.<br /><br />SQL> alter database open;<br /><br />Database altered.<br /><br />SQL>alter database begin backup;<br />Database altered.<br /><br />SQL> create table test (id number);<br /><br />Table created.<br /><br />SQL> insert into test values(1);<br /><br />1 row created.<br /><br />SQL> /<br /><br />1 row created.<br /><br />SQL> /<br />SQL> commit;<br />SQL> select * from v$backup;<br /><br /> FILE# STATUS CHANGE# TIME<br />---------- ------------------ ---------- ---------<br /> 1 ACTIVE 1067890 01-MAY-18<br /> 2 ACTIVE 1067890 01-MAY-18<br /> 3 ACTIVE 1067890 01-MAY-18<br /> 4 ACTIVE 1067890 01-MAY-18<br /> 5 ACTIVE 1067890 01-MAY-18<br /><br />SQL> exit<br /><br /><br />Now switch into the datafile directory and copy all the .dbf and .log files into the backup directory<br /><br />[oracle@server1]$ cd /u01/app/oracle/oradata/prim<br />[oracle@server1 prim]$ cp -rpf *.log /home/oracle/bkup/<br />[oracle@server1 prim]$ cp -rpf *.dbf /home/oracle/bkup/<br /><br /><br />SQL> alter database end backup;<br /><br />Database altered.<br /><br />SQL> select * from v$backup;<br /><br /> FILE# STATUS CHANGE# TIME<br />---------- ------------------ ---------- ---------<br /> 1 NOT ACTIVE 1067890 01-MAY-18<br /> 2 NOT ACTIVE 1067890 01-MAY-18<br /> 3 NOT ACTIVE 1067890 01-MAY-18<br /> 4 NOT ACTIVE 1067890 01-MAY-18<br /> 5 NOT ACTIVE 1067890 01-MAY-18<br /><br />Now take backup of controlfile<br />SQL> alter database backup controlfile to trace as '/home/oracle/control.sql';<br /><br />Database altered.<br /><br />Now edit the content of control file as per below.<br /><br />[oracle@server1 ~]$vi /home/oracle/control.sql<br />Remove word REUSE and make it SET<br />remove word NORESETLOGS and make it RESETLOGS<br />remove or keep the word ARCHIVELOG depending upon our requirement<br />change database name from "prim" to "newprim"<br />change folder name everywhere from 'prim' to 'newprim'<br />:wq<br /><br />The content should look like this<br /><br /><br />CREATE CONTROLFILE SET DATABASE "NEWPRIM" RESETLOGS ARCHIVELOG<br /> MAXLOGFILES 16<br /> MAXLOGMEMBERS 3<br /> MAXDATAFILES 100<br /> MAXINSTANCES 8<br /> MAXLOGHISTORY 292<br />LOGFILE<br /> GROUP 1 '/u01/app/oracle/oradata/newprim/redo01.log' SIZE 50M BLOCKSIZE 512,<br /> GROUP 2 '/u01/app/oracle/oradata/newprim/redo02.log' SIZE 50M BLOCKSIZE 512,<br /> GROUP 3 '/u01/app/oracle/oradata/newprim/redo03.log' SIZE 50M BLOCKSIZE 512<br />DATAFILE<br /> '/u01/app/oracle/oradata/newprim/system01.dbf',<br /> '/u01/app/oracle/oradata/newprim/sysaux01.dbf',<br /> '/u01/app/oracle/oradata/newprim/undotbs01.dbf',<br /> '/u01/app/oracle/oradata/newprim/users01.dbf',<br /> '/u01/app/oracle/oradata/newprim/example01.dbf'<br />CHARACTER SET WE8MSWIN1252<br />;<br /><br /><br /><br />Now transfer all the datafiles, controlfile, redolog files into clone server using scp.<br /><br />[oracle@server1 ~]$ scp control.sql oracle@192.168.0.104:/u01/app/oracle/oradata/newprim/<br />The authenticity of host '192.168.0.104 (192.168.0.104)' can't be established.<br />RSA key fingerprint is 0b:59:e4:8b:b1:e6:12:3a:38:4f:ba:74:ef:8a:ad:46.<br />Are you sure you want to continue connecting (yes/no)? yes<br />Warning: Permanently added '192.168.0.104' (RSA) to the list of known hosts.<br />oracle@192.168.0.104's password:<br />control.sql 100% 698 0.7KB/s 00:00 <br />[oracle@server1 ~]$ cd bkup/<br />[oracle@server1 bkup]$ ll<br />total 1534024<br />-rw-r-----. 1 oracle oinstall 104865792 May 1 20:23 example01.dbf<br />-rw-r-----. 1 oracle oinstall 52429312 May 1 20:33 redo01.log<br />-rw-r-----. 1 oracle oinstall 52429312 May 1 20:23 redo02.log<br />-rw-r-----. 1 oracle oinstall 52429312 May 1 20:23 redo03.log<br />-rw-r-----. 1 oracle oinstall 524296192 May 1 20:29 sysaux01.dbf<br />-rw-r-----. 1 oracle oinstall 702554112 May 1 20:33 system01.dbf<br />-rw-r-----. 1 oracle oinstall 20979712 May 1 19:58 temp01.dbf<br />-rw-r-----. 1 oracle oinstall 57679872 May 1 20:31 undotbs01.dbf<br />-rw-r-----. 1 oracle oinstall 5251072 May 1 20:33 users01.dbf<br />[oracle@server1 bkup]$ scp * oracle@192.168.0.104:/u01/app/oracle/oradata/newprim/<br />oracle@192.168.0.104's password:<br />example01.dbf 100% 100MB 50.0MB/s 00:02 <br />redo01.log 100% 50MB 50.0MB/s 00:01 <br />redo02.log 100% 50MB 25.0MB/s 00:02 <br />redo03.log 100% 50MB 25.0MB/s 00:02 <br />sysaux01.dbf 100% 500MB 19.2MB/s 00:26 <br />system01.dbf 100% 670MB 12.6MB/s 00:53 <br />temp01.dbf 100% 20MB 20.0MB/s 00:01 <br />undotbs01.dbf 100% 55MB 55.0MB/s 00:00 <br />users01.dbf 100% 5128KB 5.0MB/s 00:00 <br />[oracle@server1 bkup]$ cd<br />[oracle@server1 ~]$ ll<br /><br /><br /><br />****At clone server<br /><br />Create necessary directory structure for clone database.<br />mkdir -p /u01/app/oracle/oradata/newprim/<br />mkdir -p /u01/app/oracle/admin/newprim/adump<br /><br /><br />export ORACLE_SID=newprim<br />SQL> startup nomount pfile='/u01/app/oracle/product/11.2.0/db_1/dbs/initnewprim.ora';<br />ORACLE instance started.<br /><br />Total System Global Area 413372416 bytes<br />Fixed Size 2213896 bytes<br />Variable Size 268437496 bytes<br />Database Buffers 138412032 bytes<br />Redo Buffers 4308992 bytes<br /><br />Now recreate control file.<br />SQL> @/u01/app/oracle/oradata/newprim/control.sql;<br /><br />Control file created.<br /><br /><br />Now recover the database.<br /><br />sql> recover database using backup controlfile until cancel;<br />here one by one apply all archivelog files<br />apply all 3 redo log files with full path until we get the msg that recovery is done.<br /><br />Here its better to notedown the current redo log file and the pending archivelogs from target db at the time of backup. We need to apply only those<br />archives and only one current redo log file.<br /><br /><br />SQL> recover database using backup controlfile until cancel;<br />ORA-00279: change 1067890 generated at 05/01/2018 20:23:49 needed for thread 1<br />ORA-00289: suggestion :<br />/u01/app/oracle/flash_recovery_area/NEWPRIM/archivelog/2014_12_28/o1_mf_1_7_%u_.<br />arc<br />ORA-00280: change 1067890 for thread 1 is in sequence #7<br /><br /><br />Specify log: {<RET>=suggested | filename | AUTO | CANCEL}<br />/u01/app/oracle/flash_recovery_area/NEWPRIM/archivelog/2014_12_28/o1_mf_1_7_%u_.arc<br />ORA-00308: cannot open archived log<br />'/u01/app/oracle/flash_recovery_area/NEWPRIM/archivelog/2014_12_28/o1_mf_1_7_%u_.arc'<br />ORA-27037: unable to obtain file status<br />Linux-x86_64 Error: 2: No such file or directory<br />Additional information: 3<br /><br /><br />Specify log: {<RET>=suggested | filename | AUTO | CANCEL}<br />/u01/app/oracle/oradata/newprim/redo01.log<br />Log applied.<br />Media recovery complete.<br /><br /><br />Open the database with resetlogs<br /><br />SQL> alter database open resetlogs;<br /><br />Database altered.<br /><br />SQL> select instance_name from v$instance;<br /><br />INSTANCE_NAME<br />----------------<br />newprim<br /><br />SQL> select open_mode from v$database;<br /><br />OPEN_MODE<br />--------------------<br />READ WRITE<br /><br />Now the process of cloning a database is complete into a new server using user managed backup.<br />Thanks<br /><div><br /></div></div>Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-3637740476610425777.post-75226541697611813232017-05-19T04:39:00.000-07:002018-09-02T12:59:28.195-07:00Oracle WebLogic Server (WLS) 11gR1 (10.3.6) Installation on RHEL 6<div dir="ltr" style="text-align: left;" trbidi="on"><br /><br />Download oracle weblogic server 10.3.6 from oracle site:-<br /># wget http://download.oracle.com/otn/nt/middleware/11g/wls/1036/wls1036_generic.jar<br /><br /><br />Also download java development kit(jdk):-<br /><br /># wget http://download.oracle.com/otn-pub/java/jdk/8u121-b13/e9e7ea248e2c4826b92b3f075a80e441/jdk-8u121-linux-i586.tar.gz<br /><br /><br />Create the directories in which the Oracle weblogic software will be installed.<br /><br /><br /><br />Add users and groups<br />groupadd -g 501 oinstall<br />groupadd -g 502 dba<br /><br /><br />useradd -u 502 -g oinstall -G dba oracle<br />passwd oracle<br /><br /><br /><br />mkdir -p /u01/app/oracle/product/fmw11g<br />mkdir -p /u01/app/oracle/config/domains<br />mkdir -p /u01/app/oracle/config/applications<br />chown -R oracle:oinstall /u01<br />chmod -R 775 /u01/<br /><br /><br />#yum -y install glibc-devel.i686<br />yum install libaio-devel -y<br />yum install sysstat -y<br />yum install openmotif -y<br />yum install openmotif22 -y<br /><br /><br /><br />[root@server1 mnt]# alternatives --config java<br /><br />There are 4 programs which provide 'java'.<br /><br /> Selection Command<br />-----------------------------------------------<br /> 1 /usr/lib/jvm/jre-1.5.0-gcj/bin/java<br /> 2 /usr/lib/jvm/jre-1.7.0-openjdk.x86_64/bin/java<br /> 3 /usr/lib/jvm/jre-1.6.0-openjdk.x86_64/bin/java<br />*+ 4 /usr/java/jdk1.8.0_121/jre/bin/java<br /><br />Enter to keep the current selection[+], or type selection number: 4<br /><br /><br />Now set the enviroments for oracle user:-<br />[root@server1 mnt]su - oracle<br />Add the following lines in .bash_profile<br /><br />[oracle@server1 ]vi .bash_profile<br /><br />export MW_HOME=/u01/app/oracle/product/fmw11g<br />export WLS_HOME=$MW_HOME/wlserver_10.3<br />export WL_HOME=$WLS_HOME<br /># Set to the appropriate JAVA_HOME.<br />export JAVA_HOME=/usr/java/jdk1.8.0_121<br />#export JAVA_HOME=/u01/app/oracle/jrockit-jdk1.6.0_45-R28.2.7-4.1.0<br />#export JAVA_HOME=/u01/app/oracle/jdk1.7.0_17<br />export PATH=$JAVA_HOME/bin:$PATH<br />:wq<br /><br />Change permission and ownership of web<br />[root@server1 ]chown -Rf oracle:oinstall wls1036_generic.jar<br />[root@server1 ]chmod 775 wls1036_generic.jar<br /><br />From oracle user:-<br /><br />[oracle@server1 ] cd /u01<br />[oracle@server1 u01]$ $JAVA_HOME/bin/java -Xmx1024m -jar wls1036_generic.jar<br /><br />The installation windown will start -> Provide middleware home directory "/u01/app/oracle/product/fmw11g" -> Uncheck the option to get oracle support via<br />email -> Select "i wish to remain uninformed option" -> continue "Typical installation" -> It should auto select the jdk installed home -> next -> next > finish.<br /><br /></div>Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-3637740476610425777.post-51156546522484684322017-03-31T22:02:00.000-07:002018-09-02T12:59:28.349-07:00How to migrate oracle users from one server to another<div dir="ltr" style="text-align: left;" trbidi="on"><br />1. First take all the information using dbm_metadata.<br /><br />set head off<br />set pages 0<br />set long 9999999<br /><br />select dbms_metadata.get_ddl('USER', username) || '/' usercreate<br />from dba_users;<br /><br /><br />ALTER USER "SYS" IDENTIFIED BY VALUES 'S:1CCB2C8B206B3D3BA9164214F3262051E4C0<br />D076179455300F8674EDBC85;E100B964899CDDDF'<br /> TEMPORARY TABLESPACE "TEMP"<br /> /<br /><br /><br /> ALTER USER "SYSTEM" IDENTIFIED BY VALUES 'S:DC73635359324A39D3636017D54F482E7<br />F3D7CC34D0426EA3C9628FFD120;970BAA5B81930A40'<br /> TEMPORARY TABLESPACE "TEMP"<br /> /<br /> CREATE USER "SOUMYA" IDENTIFIED BY VALUES 'S:3F6E037E8574BC8FB1F0CF44651E0DE9<br />7C8765DC0924224F19F7F43D583B;6673D7515E467AA4'<br /> DEFAULT TABLESPACE "USERS"<br /> TEMPORARY TABLESPACE "TEMP"<br /> PASSWORD EXPIRE<br /> /<br /><br />To get all their roles and grants:-<br /><br />SELECT DBMS_METADATA.GET_GRANTED_DDL('ROLE_GRANT','SYS') FROM DUAL;<br /><br />SELECT DBMS_METADATA.GET_GRANTED_DDL('SYSTEM_GRANT','SYS') FROM DUAL;<br /><br />SELECT DBMS_METADATA.GET_GRANTED_DDL('OBJECT_GRANT','SYS') FROM DUAL;<br /><br /><br /><br />To script it in a single command:-<br />spool '/u01/app/dbusersinfo.sql'<br /> select dbms_metadata.get_ddl( 'USER', 'HR' ) from dual<br /> UNION ALL<br /> select dbms_metadata.get_granted_ddl( 'SYSTEM_GRANT', 'HR' ) from dual<br /> UNION ALL<br /> select dbms_metadata.get_granted_ddl( 'OBJECT_GRANT', 'HR' ) from dual<br /> UNION ALL<br /> select dbms_metadata.get_granted_ddl( 'ROLE_GRANT', 'HR' ) from dual;<br />spool off<br /><br /><br /> GRANT SELECT ON "HR"."D01" TO "SCOTT" <br /> <br /> GRANT SELECT ON "HR"."FILOM" TO "SCOTT" <br /> <br /> GRANT SELECT ON "HR"."HD01" TO "SCOTT" <br /> <br /> GRANT SELECT ON "HR"."HSPRF" TO "SCOTT" <br /> <br /> GRANT SELECT ON "HR"."SPRF" TO "SCOTT" <br /> <br /> GRANT SELECT ON "HR"."HFILOM" TO "SCOTT" <br /> <br /> <br /> <br /> GRANT "CONNECT" TO "SCOTT" <br /> <br /> GRANT "RESOURCE" TO "SCOTT" <br /><br /><br /> Now run the above output into database server where you want to migrate the users.</div>Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-3637740476610425777.post-35395797972711979512017-03-15T08:23:00.000-07:002018-09-02T12:59:28.498-07:00How to setup Oracle ASM 12c on Linux<div dir="ltr" style="text-align: left;" trbidi="on">Software used:-<br />1.VMWARE 10<br />2.Redhat enterprise linux 6.5(64 bit)<br />3.Oracle database 12C (64 bit)<br />4.Oracle Grid infrastructure 12c(64 bit)<br /><br /><br />What to Setup:-<br /><br />1. Setup oracle grid infrastructure for standalone server "ASM"<span class="Apple-tab-span" style="white-space: pre;"> </span><br />2. Setup oracle Database <span class="Apple-tab-span" style="white-space: pre;"> </span><br /><br /><br />Update /etc/sysctl.conf<br />[root@server1]# vi /etc/sysctl.conf<br />Scroll to the bottom and add the following:<br /><br />fs.file-max = 6815744<br />kernel.sem = 250 32000 100 128<br />kernel.shmmni = 4096<br />kernel.shmall = 1073741824<br />kernel.shmmax = 4398046511104<br />net.core.rmem_default = 262144<br />net.core.rmem_max = 4194304<br />net.core.wmem_default = 262144<br />net.core.wmem_max = 1048576<br />fs.aio-max-nr = 1048576<br />net.ipv4.ip_local_port_range = 9000 65500<br />:wq<br /><br />Run the following command to change the current kernel parameters.<br />/sbin/sysctl -p<br /><br />Update /etc/security/limits.conf<br />[root@server1]# vi /etc/security/limits.conf<br />Scroll to the bottom and above the “# End of file” line, add:<br /><br />oracle soft nofile 1024<br />oracle hard nofile 65536<br />oracle soft nproc 16384<br />oracle hard nproc 16384<br />oracle soft stack 10240<br />oracle hard stack 32768<br /><br />:wq<br /><br />Amend the "/etc/security/limits.d/90-nproc.conf" file as described below.<br /># Change this<br />* soft nproc 1024<br /><br /># To this<br />* - soft nproc 16384<br /><br />**IMPORTANT: Make sure selinux is disabled.<br /><br />Packages required for oracle database installation:-<br /><br />[root@server1] yum -y install binutils-2.17.50.0.6<br />[root@server1] yum -y install compat-libstdc++-33-3.2.3 (*)<br />[root@server1] yum -y install elfutils-libelf-0.125<br />[root@server1] yum -y install elfutils-libelf-devel-0.125 (*)<br />[root@server1] yum -y install gcc-4.1.2<br />[root@server1] yum -y install gcc-c++-4.1.2 (*)<br />[root@server1] yum -y install glibc-2.5-24<br />[root@server1] yum -y install glibc-common-2.5<br />[root@server1] yum -y install glibc-devel-2.5<br />[root@server1] yum -y install glibc-headers-2.5<br />[root@server1] yum -y install ksh-20060214 (*)<br />[root@server1] yum -y install libaio-0.3.106<br />[root@server1] yum -y install libaio-devel-0.3.106<br />[root@server1] yum -y install libgcc-4.1.2<br />[root@server1] yum -y install libgomp-4.1.2<br />[root@server1] yum -y install libstdc++-4.1.2<br />[root@server1] yum -y install libstdc++-devel-4.1.2<br />[root@server1] yum -y install make-3.81<br />[root@server1] yum -y install numactl-devel-0.9.8.i386 (*)<br />[root@server1] yum -y install sysstat-7.0.2 (*)<br /><br /><br />Check the kernel version:-<br />[root@server1 var]# uname -r<br />2.6.32-358.el6.x86_64<br /><br />Now we would require to install the rpm's required for asm installation<br />these are the packages required for asm.<br /><br />--oracleasm<br />--oracleasm-support<br />--oracleasmlib<br />the last 2 packages can be found from the following link<br />http://www.oracle.com/technetwork/server-storage/linux/asmlib/rhel6-1940776.html<br /><br />oracle kmod-oracleasm rpm download link for el6<br />http://public-yum.oracle.com/repo/OracleLinux/OL6/latest/x86_64/getPackage/kmod-oracleasm-2.0.6.rh1-2.el6.x86_64.rpm<br /><br />[root@server3 ~]# rpm -Uvh oracleasm-support-2.1.8-1.el6.x86_64.rpm<br />[root@server3 ~]# rpm -Uvh kmod-oracleasm-2.0.6.rh1-2.el6.x86_64.rpm<br />[root@server3 ~]# rpm -Uvh oracleasmlib-2.0.4-1.el6.x86_64.rpm<br /><br /><br />Create groups:-<br />[root@server3 tmp]# groupadd -g 1000 oinstall<br />[root@server3 tmp]# groupadd -g 1200 dba<br />[root@server3 tmp]# useradd -g oinstall -G dba -d /home/oracle oracle<br /><br /><br />Create directory structures:-<br />[root@server3 u01]# mkdir -p /u01/app/oracle/product/12.1.0/grid<br />[root@server3 u01]# mkdir -p /u01/app/oracle/product/12.1.0/db_1<br /><br />Assigning proper permission:-<br />[root@server3 u01]# chown -Rf oracle:oinstall /u01/<br />[root@server3 u01]# chmod -Rf 775 /u01/<br /><br />Set up the oracle user environment<br />For oracle user:-<br />[root@server1 var]# su - oracle<br /><br />[oracle@server1]#vi .bash_profile<br />#export PATH<br /># Oracle Settings<br />TMP=/tmp; export TMP<br />TMPDIR=$TMP; export TMPDIR<br />ORACLE_HOSTNAME=server3.soumya.com; export ORACLE_HOSTNAME<br />ORACLE_UNQNAME=orcl; export ORACLE_UNQNAME<br />ORACLE_BASE=/u01/app/oracle; export ORACLE_BASE<br />GRID_HOME=/u01/app/oracle/product/12.1.0/grid; export GRID_HOME<br />DB_HOME=$ORACLE_BASE/product/12.1.0/db_1; export DB_HOME<br />ORACLE_HOME=$DB_HOME; export ORACLE_HOME<br />ORACLE_SID=orcl; export ORACLE_SID<br />ORACLE_TERM=xterm; export ORACLE_TERM<br />BASE_PATH=/usr/sbin:$PATH; export BASE_PATH<br />PATH=$ORACLE_HOME/bin:$BASE_PATH; export PATH<br />LD_LIBRARY_PATH=$ORACLE_HOME/lib:/lib:/usr/lib;<br />LD_LIBRARY_PATH=$ORACLE_HOME/lib:/lib:/usr/lib; export LD_LIBRARY_PATH<br />CLASSPATH=$ORACLE_HOME/JRE:$ORACLE_HOME/jlib:$ORACLE_HOME/rdbms/jlib; export CLASSPATHH<br />if [ $USER = "oracle" ]; then<br /> if [ $SHELL = "/bin/ksh" ]; then<br /> ulimit -p 16384<br /> ulimit -n 65536<br /> else<br /> ulimit -u 16384 -n 65536<br /> fi<br />fi<br /><br />alias grid_env='. /home/oracle/grid_env'<br />alias db_env='. /home/oracle/db_env'<br /><br />:wq(save & exit)<br /><br />[oracle@server1 ~]$ . .bash_profile<br /><br /><br />Create a file called "/home/oracle/db_env" with the following contents :-<br /><br />[oracle@server1 ~]$vi /home/oracle/db_env<br /><br />ORACLE_SID=orcl; export ORACLE_SID<br />ORACLE_HOME=$DB_HOME; export ORACLE_HOME<br />PATH=$ORACLE_HOME/bin:$BASE_PATH; export PATH<br />LD_LIBRARY_PATH=$ORACLE_HOME/lib:/lib:/usr/lib; export LD_LIBRARY_PATH<br />CLASSPATH=$ORACLE_HOME/JRE:$ORACLE_HOME/jlib:$ORACLE_HOME/rdbms/jlib; export CLASSPATH<br /><br />:wq(save & exit)<br /><br /><br />Create a file called "/home/oracle/grid_env" with the following contents:-<br /><br />[oracle@server1 ~]$vi /home/oracle/gid_env<br />ORACLE_SID=+ASM; export ORACLE_SID<br />ORACLE_HOME=$GRID_HOME; export ORACLE_HOME<br />PATH=$ORACLE_HOME/bin:$BASE_PATH; export PATH<br />LD_LIBRARY_PATH=$ORACLE_HOME/lib:/lib:/usr/lib; export LD_LIBRARY_PATH<br />CLASSPATH=$ORACLE_HOME/JRE:$ORACLE_HOME/jlib:$ORACLE_HOME/rdbms/jlib; export CLASSPATH<br /><br />:wq(save & exit)<br /><br /><br /><br />[oracle@server1 ~]$ chmod 775 /home/oracle/db_env<br />[oracle@server1 ~]$ chmod 775 /home/oracle/grid_env<br /><br />Now you will be able to switch environments between oracle and asm instance as follows.<br />[oracle@server3 ~]$ db_env<br />[oracle@server3 ~]$ echo $ORACLE_SID<br />orcl<br />[oracle@server3 ~]$ echo $ORACLE_HOME<br />/u01/app/oracle/product/12.1.0/db_1<br />[oracle@server3 ~]$ grid_env<br />[oracle@server3 ~]$ echo $ORACLE_HOME<br />/u01/app/oracle/product/12.1.0/grid<br />[oracle@server3 ~]$ echo $ORACLE_SID<br />+ASM<br /><br /><br />Now we will add 3 disks using vmware.<br />So open vmware workstation and go to settings and add hard disk from there,add 3 different disks size of atleast 10GB each.<br /><br />[root@server1]# echo "- - -"> /sys/class/scsi_host/host0/scan<br /><br />******<br />P.S. if the above command doesnt show the newly added disk try this<br />[root@server1]#grep mpt /sys/class/scsi_host/host?/proc_name<br />/sys/class/scsi_host/host2/proc_name:mptspi<br /><br /><br />then run this<br />[root@server1]# echo "- - -"> /sys/class/scsi_host/host2/scan<br />******<br /><br />using the above command we can avoid rebooting the machine to mount the hard disks.<br /><br />[root@server1 ~]# fdisk /dev/sdb<br />Device contains neither a valid DOS partition table, nor Sun, SGI or OSF disklabel<br />Building a new DOS disklabel with disk identifier 0xa4bd7fb9.<br />Changes will remain in memory only, until you decide to write them.<br />After that, of course, the previous content won't be recoverable.<br /><br />Warning: invalid flag 0x0000 of partition table 4 will be corrected by w(rite)<br /><br />WARNING: DOS-compatible mode is deprecated. It's strongly recommended to<br /> switch off the mode (command 'c') and change display units to<br /> sectors (command 'u').<br /><br />Command (m for help): n<br />Command action<br /> e extended<br /> p primary partition (1-4)<br />p<br />Partition number (1-4): 1<br />First cylinder (1-261, default 1):<br />Using default value 1<br />Last cylinder, +cylinders or +size{K,M,G} (1-261, default 261):<br />Using default value 261<br /><br />Command (m for help): w<br />The partition table has been altered!<br /><br />Calling ioctl() to re-read partition table.<br />Syncing disks.<br /><br /><br /><br />[root@server1 ~]# fdisk /dev/sdc<br />[root@server1 ~]# fdisk /dev/sdd<br /><br />[root@server1 dev]# fdisk -l<br />Disk /dev/sda: 64.4 GB, 64424509440 bytes<br />255 heads, 63 sectors/track, 7832 cylinders<br />Units = cylinders of 16065 * 512 = 8225280 bytes<br />Sector size (logical/physical): 512 bytes / 512 bytes<br />I/O size (minimum/optimal): 512 bytes / 512 bytes<br />Disk identifier: 0x0006f980<br /><br /> Device Boot Start End Blocks Id System<br />/dev/sda1 1 5737 46080000 83 Linux<br />/dev/sda2 * 5737 6885 9216000 83 Linux<br />/dev/sda3 6885 7458 4608000 83 Linux<br />/dev/sda4 7458 7833 3009536 5 Extended<br />/dev/sda5 7459 7731 2188288 82 Linux swap / Solaris<br />/dev/sda6 7731 7833 818176 83 Linux<br /><br />Disk /dev/sdb: 2147 MB, 2147483648 bytes<br />255 heads, 63 sectors/track, 261 cylinders<br />Units = cylinders of 16065 * 512 = 8225280 bytes<br />Sector size (logical/physical): 512 bytes / 512 bytes<br />I/O size (minimum/optimal): 512 bytes / 512 bytes<br />Disk identifier: 0x44ac96a0<br /><br /> Device Boot Start End Blocks Id System<br />/dev/sdb1 1 261 2096451 83 Linux<br /><br />Disk /dev/sdc: 2147 MB, 2147483648 bytes<br />255 heads, 63 sectors/track, 261 cylinders<br />Units = cylinders of 16065 * 512 = 8225280 bytes<br />Sector size (logical/physical): 512 bytes / 512 bytes<br />I/O size (minimum/optimal): 512 bytes / 512 bytes<br />Disk identifier: 0x004b1011<br /><br /> Device Boot Start End Blocks Id System<br />/dev/sdc1 1 261 2096451 83 Linux<br /><br />Disk /dev/sdd: 2147 MB, 2147483648 bytes<br />255 heads, 63 sectors/track, 261 cylinders<br />Units = cylinders of 16065 * 512 = 8225280 bytes<br />Sector size (logical/physical): 512 bytes / 512 bytes<br />I/O size (minimum/optimal): 512 bytes / 512 bytes<br />Disk identifier: 0xf5898159<br /><br /> Device Boot Start End Blocks Id System<br />/dev/sdd1 1 261 2096451 83 Linux<br /><br />Give proper ownership and permissions to the new partition:-<br />chown -Rf oracle:oinstall /dev/sdb1<br />chown -Rf oracle:oinstall /dev/sdc1<br />chown -Rf oracle:oinstall /dev/sdd1<br /><br />chmod -Rf 664 /dev/sdb1<br />chmod -Rf 664 /dev/sdc1<br />chmod -Rf 664 /dev/sdd1<br /><br />Now configure ASM and create ASM disks:-<br /><br />[root@server1 ~]# /etc/init.d/oracleasm configure<br />Configuring the Oracle ASM library driver.<br /><br />This will configure the on-boot properties of the Oracle ASM library<br />driver. The following questions will determine whether the driver is<br />loaded on boot and what permissions it will have. The current values<br />will be shown in brackets ('[]'). Hitting <ENTER> without typing an<br />answer will keep that current value. Ctrl-C will abort.<br /><br />Default user to own the driver interface []: oracle<br />Default group to own the driver interface []: oinstall<br />Start Oracle ASM library driver on boot (y/n) [n]: y<br />Scan for Oracle ASM disks on boot (y/n) [y]: y<br />Writing Oracle ASM library driver configuration: done<br />Initializing the Oracle ASMLib driver: [ OK ]<br />Scanning the system for Oracle ASMLib disks: [ OK ]<br /> <span class="Apple-tab-span" style="white-space: pre;"> </span><br /><span class="Apple-tab-span" style="white-space: pre;"> </span><br />To create ASM disks:-<br />[root@server1 ~]#/etc/init.d/oracleasm createdisk VOL1 /dev/sdb1<br />[root@server1 ~]#/etc/init.d/oracleasm createdisk VOL2 /dev/sdc1 <span class="Apple-tab-span" style="white-space: pre;"> </span><br />[root@server1 ~]#/etc/init.d/oracleasm createdisk VOL3 /dev/sdd1<br /><br />Now we will install grid infrastructure software.<br />Give proper permission to the software folder.<br /><br />[root@server1 ] chown -Rf oracle:oinstall /u01/linuxamd64_12102_grid_1of2.zip<br />root@server1 ] chown -Rf oracle:oinstall /u01/linuxamd64_12102_grid_2of2.zip<br /><br />[root@server1 u01]# unzip linuxamd64_12102_grid_1of2.zip<br />[root@server1 u01]# unzip linuxamd64_12102_grid_2of2.zip<br />[root@server1 u01]#su - oracle<br />[oracle@server1 u01]$ cd grid/<br />[oracle@server1 grid]$ sh runInstaller<br /><br /><br />Select "install and configure grid infrastructure for a standalone server" -> Next -> select 3 Disks from candidate disk option rest option will be unchanged -><br />select "use same password for these accounts " and provide password -> specify os groups OSDBA-oinstall,<br />OSOPER-oinstall, OSASM-oinstall -> Select Install location "oracle base- /u01/app/oracle " , "software location- /u01/app/oracle/product/12.1.0/grid" -> Next and<br />start the installation.> execute "/u01/app/oracle/product/12.1.0/grid/root.sh" script from root user from another terminal.<br /><br /><br />I got this error while installing grid infrastructure.To fix this steps are below:-<br />**INFO: Read: ORA-00845: MEMORY_TARGET not supported on this system<br /><br />To increase the size<br /># mount -o remount,size=3G /dev/shm<br />Verify the size<br /># df -h<br />To make permanent changes to your file system update your fstab<br /># vi /etc/fstab<br />tmpfs /dev/shm tmpfs defaults,size=3G 0 0<br /><br />[root@server1 u01]# <span class="Apple-tab-span" style="white-space: pre;"> </span><br /><br />[grid@server3 app]$ sqlplus / as sysasm<br />SQL> select instance_name from v$instance;<br /><br />INSTANCE_NAME<br />----------------<br />+ASM<br /><br /><br />Now we will setup oracle database .<br /><br />[oracle@server1 u01]$ cd /u01/database/<br />[oracle@server3 u01]$ sh runInstaller<br /><br />select "Create & configure a database" -> Server Class -> Single instance database installation -> Advanced Installa -> Next ->Enterprise edition -><br />Select "oracle base- /u01/app/oracle " , "software location- /u01/app/oracle/product/12.1.0/db_1" -> select "general purpose" -> Global database<br />name- orcl , SID name - orcl -> Next -> select " Oracle automatic storage management"-> Next ->Next ->Next-> select " use same password for all accounts"-><br />Next -> Next -> Install<br /><br />Done!!!...</div>Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-3637740476610425777.post-40157532053318180432017-02-06T04:25:00.000-08:002018-09-02T12:59:28.653-07:00How to take SQL server database backup without data?<div dir="ltr" style="text-align: left;" trbidi="on"><div class="MsoNormal"><span style="font-family: Arial, Helvetica, sans-serif;">How to take SQL server database backup without data?<o:p></o:p></span></div><div class="MsoNormal"><span style="font-family: Arial, Helvetica, sans-serif;"><br /></span></div><div class="MsoNormal"><span style="font-family: Arial, Helvetica, sans-serif;">Version: Sql server 2012<o:p></o:p></span></div><div class="MsoNormal"><span style="font-family: Arial, Helvetica, sans-serif;"><br /></span></div><div class="MsoNormal"><span style="font-family: Arial, Helvetica, sans-serif;">There are different method available to achieve this goal. Such as..</span><span style="background-color: white; color: #222222; font-family: Arial, Helvetica, sans-serif; text-indent: -0.25in;">Script out the source database and then run the script against an empty target database to create all database objects that are in the source database</span></div><div class="MsoNormal" style="background: white; text-indent: 0in;"><span style="font-family: Arial, Helvetica, sans-serif;"><br /></span></div><div class="MsoNormal" style="background: white; text-indent: 0in;"><span style="color: #222222; font-family: Arial, Helvetica, sans-serif; font-size: 12.0pt; mso-fareast-font-family: "Times New Roman";">Right click on the database -> select "tasks" -> "Generate scripts"-> Next -> Select script entire database and all database objects -> Save the sql file in location ->Next-> Next-> Finish.<o:p></o:p></span></div><div class="MsoNormal" style="background: white; text-indent: 0in;"><span style="color: #222222; font-family: Arial, Helvetica, sans-serif; font-size: 12.0pt; mso-fareast-font-family: "Times New Roman";">Now If you want to restore the database just execute the content of sql file and this will create a new database with only data structure .<o:p></o:p></span></div><div class="MsoNormal" style="background: white; text-indent: 0in;"><span style="font-family: Arial, Helvetica, sans-serif;"><br /></span></div><div class="MsoNormal" style="background: white; text-indent: 0in;"><span style="color: #222222; font-family: Arial, Helvetica, sans-serif; font-size: 12.0pt; mso-fareast-font-family: "Times New Roman";">This is the content of sql file.<o:p></o:p></span></div><div class="MsoNormal" style="background: white; text-indent: 0in;"><span style="font-family: Arial, Helvetica, sans-serif;"><br /></span></div><div class="MsoNormal" style="background: white; text-indent: 0in;"><span style="color: #222222; font-family: Arial, Helvetica, sans-serif; font-size: 12.0pt; mso-fareast-font-family: "Times New Roman";">USE [master]<o:p></o:p></span></div><div class="MsoNormal" style="background: white; text-indent: 0in;"><span style="color: #222222; font-family: Arial, Helvetica, sans-serif; font-size: 12.0pt; mso-fareast-font-family: "Times New Roman";">GO<o:p></o:p></span></div><div class="MsoNormal" style="background: white; text-indent: 0in;"><span style="color: #222222; font-family: Arial, Helvetica, sans-serif; font-size: 12.0pt; mso-fareast-font-family: "Times New Roman";">/****** Object: Database [newdb] Script Date: 2/3/2017 10:20:17 AM ******/<o:p></o:p></span></div><div class="MsoNormal" style="background: white; text-indent: 0in;"><span style="color: #222222; font-family: Arial, Helvetica, sans-serif; font-size: 12.0pt; mso-fareast-font-family: "Times New Roman";">CREATE DATABASE [newdb]<o:p></o:p></span></div><div class="MsoNormal" style="background: white; text-indent: 0in;"><span style="color: #222222; font-family: Arial, Helvetica, sans-serif; font-size: 12.0pt; mso-fareast-font-family: "Times New Roman";"> CONTAINMENT = NONE<o:p></o:p></span></div><div class="MsoNormal" style="background: white; text-indent: 0in;"><span style="color: #222222; font-family: Arial, Helvetica, sans-serif; font-size: 12.0pt; mso-fareast-font-family: "Times New Roman";"> ON PRIMARY <o:p></o:p></span></div><div class="MsoNormal" style="background: white; text-indent: 0in;"><span style="color: #222222; font-family: Arial, Helvetica, sans-serif; font-size: 12.0pt; mso-fareast-font-family: "Times New Roman";">( NAME = N'sourcedb', FILENAME = N'E:\MSSQLSERVER\MSSQL11.MSSQLSERVER\MSSQL\DATA\newdb.mdf' , SIZE = 3136KB , MAXSIZE = UNLIMITED, FILEGROWTH = 1024KB )<o:p></o:p></span></div><div class="MsoNormal" style="background: white; text-indent: 0in;"><span style="color: #222222; font-family: Arial, Helvetica, sans-serif; font-size: 12.0pt; mso-fareast-font-family: "Times New Roman";"> LOG ON <o:p></o:p></span></div><div class="MsoNormal" style="background: white; text-indent: 0in;"><span style="color: #222222; font-family: Arial, Helvetica, sans-serif; font-size: 12.0pt; mso-fareast-font-family: "Times New Roman";">( NAME = N'sourcedb_log', FILENAME = N'E:\MSSQLSERVER\MSSQL11.MSSQLSERVER\MSSQL\DATA\newdb_log.ldf' , SIZE = 768KB , MAXSIZE = UNLIMITED, FILEGROWTH = 10%)<o:p></o:p></span></div><div class="MsoNormal" style="background: white; text-indent: 0in;"><span style="color: #222222; font-family: Arial, Helvetica, sans-serif; font-size: 12.0pt; mso-fareast-font-family: "Times New Roman";">GO<o:p></o:p></span></div><div class="MsoNormal" style="background: white; text-indent: 0in;"><span style="color: #222222; font-family: Arial, Helvetica, sans-serif; font-size: 12.0pt; mso-fareast-font-family: "Times New Roman";">ALTER DATABASE [newdb] SET COMPATIBILITY_LEVEL = 110<o:p></o:p></span></div><div class="MsoNormal" style="background: white; text-indent: 0in;"><span style="color: #222222; font-family: Arial, Helvetica, sans-serif; font-size: 12.0pt; mso-fareast-font-family: "Times New Roman";">GO<o:p></o:p></span></div><div class="MsoNormal" style="background: white; text-indent: 0in;"><span style="color: #222222; font-family: Arial, Helvetica, sans-serif; font-size: 12.0pt; mso-fareast-font-family: "Times New Roman";">IF (1 = FULLTEXTSERVICEPROPERTY('IsFullTextInstalled'))<o:p></o:p></span></div><div class="MsoNormal" style="background: white; text-indent: 0in;"><span style="color: #222222; font-family: Arial, Helvetica, sans-serif; font-size: 12.0pt; mso-fareast-font-family: "Times New Roman";">begin<o:p></o:p></span></div><div class="MsoNormal" style="background: white; text-indent: 0in;"><span style="color: #222222; font-family: Arial, Helvetica, sans-serif; font-size: 12.0pt; mso-fareast-font-family: "Times New Roman";">EXEC [newdb].[dbo].[sp_fulltext_database] @action = 'enable'<o:p></o:p></span></div><div class="MsoNormal" style="background: white; text-indent: 0in;"><span style="color: #222222; font-family: Arial, Helvetica, sans-serif; font-size: 12.0pt; mso-fareast-font-family: "Times New Roman";">end<o:p></o:p></span></div><div class="MsoNormal" style="background: white; text-indent: 0in;"><span style="color: #222222; font-family: Arial, Helvetica, sans-serif; font-size: 12.0pt; mso-fareast-font-family: "Times New Roman";">GO<o:p></o:p></span></div><div class="MsoNormal" style="background: white; text-indent: 0in;"><span style="color: #222222; font-family: Arial, Helvetica, sans-serif; font-size: 12.0pt; mso-fareast-font-family: "Times New Roman";">ALTER DATABASE [newdb] SET ANSI_NULL_DEFAULT OFF <o:p></o:p></span></div><div class="MsoNormal" style="background: white; text-indent: 0in;"><span style="color: #222222; font-family: Arial, Helvetica, sans-serif; font-size: 12.0pt; mso-fareast-font-family: "Times New Roman";">GO<o:p></o:p></span></div><div class="MsoNormal" style="background: white; text-indent: 0in;"><span style="color: #222222; font-family: Arial, Helvetica, sans-serif; font-size: 12.0pt; mso-fareast-font-family: "Times New Roman";">ALTER DATABASE [newdb] SET ANSI_NULLS OFF <o:p></o:p></span></div><div class="MsoNormal" style="background: white; text-indent: 0in;"><span style="color: #222222; font-family: Arial, Helvetica, sans-serif; font-size: 12.0pt; mso-fareast-font-family: "Times New Roman";">GO<o:p></o:p></span></div><div class="MsoNormal" style="background: white; text-indent: 0in;"><span style="color: #222222; font-family: Arial, Helvetica, sans-serif; font-size: 12.0pt; mso-fareast-font-family: "Times New Roman";">ALTER DATABASE [newdb] SET ANSI_PADDING OFF <o:p></o:p></span></div><div class="MsoNormal" style="background: white; text-indent: 0in;"><span style="color: #222222; font-family: Arial, Helvetica, sans-serif; font-size: 12.0pt; mso-fareast-font-family: "Times New Roman";">GO<o:p></o:p></span></div><div class="MsoNormal" style="background: white; text-indent: 0in;"><span style="color: #222222; font-family: Arial, Helvetica, sans-serif; font-size: 12.0pt; mso-fareast-font-family: "Times New Roman";">ALTER DATABASE [newdb] SET ANSI_WARNINGS OFF <o:p></o:p></span></div><div class="MsoNormal" style="background: white; text-indent: 0in;"><span style="color: #222222; font-family: Arial, Helvetica, sans-serif; font-size: 12.0pt; mso-fareast-font-family: "Times New Roman";">GO<o:p></o:p></span></div><div class="MsoNormal" style="background: white; text-indent: 0in;"><span style="color: #222222; font-family: Arial, Helvetica, sans-serif; font-size: 12.0pt; mso-fareast-font-family: "Times New Roman";">ALTER DATABASE [newdb] SET ARITHABORT OFF <o:p></o:p></span></div><div class="MsoNormal" style="background: white; text-indent: 0in;"><span style="color: #222222; font-family: Arial, Helvetica, sans-serif; font-size: 12.0pt; mso-fareast-font-family: "Times New Roman";">GO<o:p></o:p></span></div><div class="MsoNormal" style="background: white; text-indent: 0in;"><span style="color: #222222; font-family: Arial, Helvetica, sans-serif; font-size: 12.0pt; mso-fareast-font-family: "Times New Roman";">ALTER DATABASE [newdb] SET AUTO_CLOSE OFF <o:p></o:p></span></div><div class="MsoNormal" style="background: white; text-indent: 0in;"><span style="color: #222222; font-family: Arial, Helvetica, sans-serif; font-size: 12.0pt; mso-fareast-font-family: "Times New Roman";">GO<o:p></o:p></span></div><div class="MsoNormal" style="background: white; text-indent: 0in;"><span style="color: #222222; font-family: Arial, Helvetica, sans-serif; font-size: 12.0pt; mso-fareast-font-family: "Times New Roman";">ALTER DATABASE [newdb] SET AUTO_CREATE_STATISTICS ON <o:p></o:p></span></div><div class="MsoNormal" style="background: white; text-indent: 0in;"><span style="color: #222222; font-family: Arial, Helvetica, sans-serif; font-size: 12.0pt; mso-fareast-font-family: "Times New Roman";">GO<o:p></o:p></span></div><div class="MsoNormal" style="background: white; text-indent: 0in;"><span style="color: #222222; font-family: Arial, Helvetica, sans-serif; font-size: 12.0pt; mso-fareast-font-family: "Times New Roman";">ALTER DATABASE [newdb] SET AUTO_SHRINK OFF <o:p></o:p></span></div><div class="MsoNormal" style="background: white; text-indent: 0in;"><span style="color: #222222; font-family: Arial, Helvetica, sans-serif; font-size: 12.0pt; mso-fareast-font-family: "Times New Roman";">GO<o:p></o:p></span></div><div class="MsoNormal" style="background: white; text-indent: 0in;"><span style="color: #222222; font-family: Arial, Helvetica, sans-serif; font-size: 12.0pt; mso-fareast-font-family: "Times New Roman";">ALTER DATABASE [newdb] SET AUTO_UPDATE_STATISTICS ON <o:p></o:p></span></div><div class="MsoNormal" style="background: white; text-indent: 0in;"><span style="color: #222222; font-family: Arial, Helvetica, sans-serif; font-size: 12.0pt; mso-fareast-font-family: "Times New Roman";">GO<o:p></o:p></span></div><div class="MsoNormal" style="background: white; text-indent: 0in;"><span style="color: #222222; font-family: Arial, Helvetica, sans-serif; font-size: 12.0pt; mso-fareast-font-family: "Times New Roman";">ALTER DATABASE [newdb] SET CURSOR_CLOSE_ON_COMMIT OFF <o:p></o:p></span></div><div class="MsoNormal" style="background: white; text-indent: 0in;"><span style="color: #222222; font-family: Arial, Helvetica, sans-serif; font-size: 12.0pt; mso-fareast-font-family: "Times New Roman";">GO<o:p></o:p></span></div><div class="MsoNormal" style="background: white; text-indent: 0in;"><span style="color: #222222; font-family: Arial, Helvetica, sans-serif; font-size: 12.0pt; mso-fareast-font-family: "Times New Roman";">ALTER DATABASE [newdb] SET CURSOR_DEFAULT GLOBAL <o:p></o:p></span></div><div class="MsoNormal" style="background: white; text-indent: 0in;"><span style="color: #222222; font-family: Arial, Helvetica, sans-serif; font-size: 12.0pt; mso-fareast-font-family: "Times New Roman";">GO<o:p></o:p></span></div><div class="MsoNormal" style="background: white; text-indent: 0in;"><span style="color: #222222; font-family: Arial, Helvetica, sans-serif; font-size: 12.0pt; mso-fareast-font-family: "Times New Roman";">ALTER DATABASE [newdb] SET CONCAT_NULL_YIELDS_NULL OFF <o:p></o:p></span></div><div class="MsoNormal" style="background: white; text-indent: 0in;"><span style="color: #222222; font-family: Arial, Helvetica, sans-serif; font-size: 12.0pt; mso-fareast-font-family: "Times New Roman";">GO<o:p></o:p></span></div><div class="MsoNormal" style="background: white; text-indent: 0in;"><span style="color: #222222; font-family: Arial, Helvetica, sans-serif; font-size: 12.0pt; mso-fareast-font-family: "Times New Roman";">ALTER DATABASE [newdb] SET NUMERIC_ROUNDABORT OFF <o:p></o:p></span></div><div class="MsoNormal" style="background: white; text-indent: 0in;"><span style="color: #222222; font-family: Arial, Helvetica, sans-serif; font-size: 12.0pt; mso-fareast-font-family: "Times New Roman";">GO<o:p></o:p></span></div><div class="MsoNormal" style="background: white; text-indent: 0in;"><span style="color: #222222; font-family: Arial, Helvetica, sans-serif; font-size: 12.0pt; mso-fareast-font-family: "Times New Roman";">ALTER DATABASE [newdb] SET QUOTED_IDENTIFIER OFF <o:p></o:p></span></div><div class="MsoNormal" style="background: white; text-indent: 0in;"><span style="color: #222222; font-family: Arial, Helvetica, sans-serif; font-size: 12.0pt; mso-fareast-font-family: "Times New Roman";">GO<o:p></o:p></span></div><div class="MsoNormal" style="background: white; text-indent: 0in;"><span style="color: #222222; font-family: Arial, Helvetica, sans-serif; font-size: 12.0pt; mso-fareast-font-family: "Times New Roman";">ALTER DATABASE [newdb] SET RECURSIVE_TRIGGERS OFF <o:p></o:p></span></div><div class="MsoNormal" style="background: white; text-indent: 0in;"><span style="color: #222222; font-family: Arial, Helvetica, sans-serif; font-size: 12.0pt; mso-fareast-font-family: "Times New Roman";">GO<o:p></o:p></span></div><div class="MsoNormal" style="background: white; text-indent: 0in;"><span style="color: #222222; font-family: Arial, Helvetica, sans-serif; font-size: 12.0pt; mso-fareast-font-family: "Times New Roman";">ALTER DATABASE [newdb] SET DISABLE_BROKER <o:p></o:p></span></div><div class="MsoNormal" style="background: white; text-indent: 0in;"><span style="color: #222222; font-family: Arial, Helvetica, sans-serif; font-size: 12.0pt; mso-fareast-font-family: "Times New Roman";">GO<o:p></o:p></span></div><div class="MsoNormal" style="background: white; text-indent: 0in;"><span style="color: #222222; font-family: Arial, Helvetica, sans-serif; font-size: 12.0pt; mso-fareast-font-family: "Times New Roman";">ALTER DATABASE [newdb] SET AUTO_UPDATE_STATISTICS_ASYNC OFF <o:p></o:p></span></div><div class="MsoNormal" style="background: white; text-indent: 0in;"><span style="color: #222222; font-family: Arial, Helvetica, sans-serif; font-size: 12.0pt; mso-fareast-font-family: "Times New Roman";">GO<o:p></o:p></span></div><div class="MsoNormal" style="background: white; text-indent: 0in;"><span style="color: #222222; font-family: Arial, Helvetica, sans-serif; font-size: 12.0pt; mso-fareast-font-family: "Times New Roman";">ALTER DATABASE [newdb] SET DATE_CORRELATION_OPTIMIZATION OFF <o:p></o:p></span></div><div class="MsoNormal" style="background: white; text-indent: 0in;"><span style="color: #222222; font-family: Arial, Helvetica, sans-serif; font-size: 12.0pt; mso-fareast-font-family: "Times New Roman";">GO<o:p></o:p></span></div><div class="MsoNormal" style="background: white; text-indent: 0in;"><span style="color: #222222; font-family: Arial, Helvetica, sans-serif; font-size: 12.0pt; mso-fareast-font-family: "Times New Roman";">ALTER DATABASE [newdb] SET TRUSTWORTHY OFF <o:p></o:p></span></div><div class="MsoNormal" style="background: white; text-indent: 0in;"><span style="color: #222222; font-family: Arial, Helvetica, sans-serif; font-size: 12.0pt; mso-fareast-font-family: "Times New Roman";">GO<o:p></o:p></span></div><div class="MsoNormal" style="background: white; text-indent: 0in;"><span style="color: #222222; font-family: Arial, Helvetica, sans-serif; font-size: 12.0pt; mso-fareast-font-family: "Times New Roman";">ALTER DATABASE [newdb] SET ALLOW_SNAPSHOT_ISOLATION OFF <o:p></o:p></span></div><div class="MsoNormal" style="background: white; text-indent: 0in;"><span style="color: #222222; font-family: Arial, Helvetica, sans-serif; font-size: 12.0pt; mso-fareast-font-family: "Times New Roman";">GO<o:p></o:p></span></div><div class="MsoNormal" style="background: white; text-indent: 0in;"><span style="color: #222222; font-family: Arial, Helvetica, sans-serif; font-size: 12.0pt; mso-fareast-font-family: "Times New Roman";">ALTER DATABASE [newdb] SET PARAMETERIZATION SIMPLE <o:p></o:p></span></div><div class="MsoNormal" style="background: white; text-indent: 0in;"><span style="color: #222222; font-family: Arial, Helvetica, sans-serif; font-size: 12.0pt; mso-fareast-font-family: "Times New Roman";">GO<o:p></o:p></span></div><div class="MsoNormal" style="background: white; text-indent: 0in;"><span style="color: #222222; font-family: Arial, Helvetica, sans-serif; font-size: 12.0pt; mso-fareast-font-family: "Times New Roman";">ALTER DATABASE [newdb] SET READ_COMMITTED_SNAPSHOT OFF <o:p></o:p></span></div><div class="MsoNormal" style="background: white; text-indent: 0in;"><span style="color: #222222; font-family: Arial, Helvetica, sans-serif; font-size: 12.0pt; mso-fareast-font-family: "Times New Roman";">GO<o:p></o:p></span></div><div class="MsoNormal" style="background: white; text-indent: 0in;"><span style="color: #222222; font-family: Arial, Helvetica, sans-serif; font-size: 12.0pt; mso-fareast-font-family: "Times New Roman";">ALTER DATABASE [newdb] SET HONOR_BROKER_PRIORITY OFF <o:p></o:p></span></div><div class="MsoNormal" style="background: white; text-indent: 0in;"><span style="color: #222222; font-family: Arial, Helvetica, sans-serif; font-size: 12.0pt; mso-fareast-font-family: "Times New Roman";">GO<o:p></o:p></span></div><div class="MsoNormal" style="background: white; text-indent: 0in;"><span style="color: #222222; font-family: Arial, Helvetica, sans-serif; font-size: 12.0pt; mso-fareast-font-family: "Times New Roman";">ALTER DATABASE [newdb] SET RECOVERY FULL <o:p></o:p></span></div><div class="MsoNormal" style="background: white; text-indent: 0in;"><span style="color: #222222; font-family: Arial, Helvetica, sans-serif; font-size: 12.0pt; mso-fareast-font-family: "Times New Roman";">GO<o:p></o:p></span></div><div class="MsoNormal" style="background: white; text-indent: 0in;"><span style="color: #222222; font-family: Arial, Helvetica, sans-serif; font-size: 12.0pt; mso-fareast-font-family: "Times New Roman";">ALTER DATABASE [newdb] SET MULTI_USER <o:p></o:p></span></div><div class="MsoNormal" style="background: white; text-indent: 0in;"><span style="color: #222222; font-family: Arial, Helvetica, sans-serif; font-size: 12.0pt; mso-fareast-font-family: "Times New Roman";">GO<o:p></o:p></span></div><div class="MsoNormal" style="background: white; text-indent: 0in;"><span style="color: #222222; font-family: Arial, Helvetica, sans-serif; font-size: 12.0pt; mso-fareast-font-family: "Times New Roman";">ALTER DATABASE [newdb] SET PAGE_VERIFY CHECKSUM <o:p></o:p></span></div><div class="MsoNormal" style="background: white; text-indent: 0in;"><span style="color: #222222; font-family: Arial, Helvetica, sans-serif; font-size: 12.0pt; mso-fareast-font-family: "Times New Roman";">GO<o:p></o:p></span></div><div class="MsoNormal" style="background: white; text-indent: 0in;"><span style="color: #222222; font-family: Arial, Helvetica, sans-serif; font-size: 12.0pt; mso-fareast-font-family: "Times New Roman";">ALTER DATABASE [newdb] SET DB_CHAINING OFF <o:p></o:p></span></div><div class="MsoNormal" style="background: white; text-indent: 0in;"><span style="color: #222222; font-family: Arial, Helvetica, sans-serif; font-size: 12.0pt; mso-fareast-font-family: "Times New Roman";">GO<o:p></o:p></span></div><div class="MsoNormal" style="background: white; text-indent: 0in;"><span style="color: #222222; font-family: Arial, Helvetica, sans-serif; font-size: 12.0pt; mso-fareast-font-family: "Times New Roman";">ALTER DATABASE [newdb] SET FILESTREAM( NON_TRANSACTED_ACCESS = OFF ) <o:p></o:p></span></div><div class="MsoNormal" style="background: white; text-indent: 0in;"><span style="color: #222222; font-family: Arial, Helvetica, sans-serif; font-size: 12.0pt; mso-fareast-font-family: "Times New Roman";">GO<o:p></o:p></span></div><div class="MsoNormal" style="background: white; text-indent: 0in;"><span style="color: #222222; font-family: Arial, Helvetica, sans-serif; font-size: 12.0pt; mso-fareast-font-family: "Times New Roman";">ALTER DATABASE [newdb] SET TARGET_RECOVERY_TIME = 0 SECONDS <o:p></o:p></span></div><div class="MsoNormal" style="background: white; text-indent: 0in;"><span style="color: #222222; font-family: Arial, Helvetica, sans-serif; font-size: 12.0pt; mso-fareast-font-family: "Times New Roman";">GO<o:p></o:p></span></div><div class="MsoNormal" style="background: white; text-indent: 0in;"><span style="color: #222222; font-family: Arial, Helvetica, sans-serif; font-size: 12.0pt; mso-fareast-font-family: "Times New Roman";">EXEC sys.sp_db_vardecimal_storage_format N'newdb', N'ON'<o:p></o:p></span></div><div class="MsoNormal" style="background: white; text-indent: 0in;"><span style="color: #222222; font-family: Arial, Helvetica, sans-serif; font-size: 12.0pt; mso-fareast-font-family: "Times New Roman";">GO<o:p></o:p></span></div><div class="MsoNormal" style="background: white; text-indent: 0in;"><span style="color: #222222; font-family: Arial, Helvetica, sans-serif; font-size: 12.0pt; mso-fareast-font-family: "Times New Roman";">USE [newdb]<o:p></o:p></span></div><div class="MsoNormal" style="background: white; text-indent: 0in;"><span style="color: #222222; font-family: Arial, Helvetica, sans-serif; font-size: 12.0pt; mso-fareast-font-family: "Times New Roman";">GO<o:p></o:p></span></div><div class="MsoNormal" style="background: white; text-indent: 0in;"><span style="color: #222222; font-family: Arial, Helvetica, sans-serif; font-size: 12.0pt; mso-fareast-font-family: "Times New Roman";">/****** Object: User [test1] Script Date: 2/3/2017 10:20:17 AM ******/<o:p></o:p></span></div><div class="MsoNormal" style="background: white; text-indent: 0in;"><span style="color: #222222; font-family: Arial, Helvetica, sans-serif; font-size: 12.0pt; mso-fareast-font-family: "Times New Roman";">CREATE USER [test1] FOR LOGIN [test1] WITH DEFAULT_SCHEMA=[dbo]<o:p></o:p></span></div><div class="MsoNormal" style="background: white; text-indent: 0in;"><span style="color: #222222; font-family: Arial, Helvetica, sans-serif; font-size: 12.0pt; mso-fareast-font-family: "Times New Roman";">GO<o:p></o:p></span></div><div class="MsoNormal" style="background: white; text-indent: 0in;"><span style="color: #222222; font-family: Arial, Helvetica, sans-serif; font-size: 12.0pt; mso-fareast-font-family: "Times New Roman";">/****** Object: User [som] Script Date: 2/3/2017 10:20:17 AM ******/<o:p></o:p></span></div><div class="MsoNormal" style="background: white; text-indent: 0in;"><span style="color: #222222; font-family: Arial, Helvetica, sans-serif; font-size: 12.0pt; mso-fareast-font-family: "Times New Roman";">CREATE USER [som] FOR LOGIN [som] WITH DEFAULT_SCHEMA=[dbo]<o:p></o:p></span></div><div class="MsoNormal" style="background: white; text-indent: 0in;"><span style="color: #222222; font-family: Arial, Helvetica, sans-serif; font-size: 12.0pt; mso-fareast-font-family: "Times New Roman";">GO<o:p></o:p></span></div><div class="MsoNormal" style="background: white; text-indent: 0in;"><span style="color: #222222; font-family: Arial, Helvetica, sans-serif; font-size: 12.0pt; mso-fareast-font-family: "Times New Roman";">/****** Object: User [readonly] Script Date: 2/3/2017 10:20:17 AM ******/<o:p></o:p></span></div><div class="MsoNormal" style="background: white; text-indent: 0in;"><span style="color: #222222; font-family: Arial, Helvetica, sans-serif; font-size: 12.0pt; mso-fareast-font-family: "Times New Roman";">CREATE USER [readonly] FOR LOGIN [readonly] WITH DEFAULT_SCHEMA=[db_datareader]<o:p></o:p></span></div><div class="MsoNormal" style="background: white; text-indent: 0in;"><span style="color: #222222; font-family: Arial, Helvetica, sans-serif; font-size: 12.0pt; mso-fareast-font-family: "Times New Roman";">GO<o:p></o:p></span></div><div class="MsoNormal" style="background: white; text-indent: 0in;"><span style="color: #222222; font-family: Arial, Helvetica, sans-serif; font-size: 12.0pt; mso-fareast-font-family: "Times New Roman";">ALTER ROLE [db_owner] ADD MEMBER [test1]<o:p></o:p></span></div><div class="MsoNormal" style="background: white; text-indent: 0in;"><span style="color: #222222; font-family: Arial, Helvetica, sans-serif; font-size: 12.0pt; mso-fareast-font-family: "Times New Roman";">GO<o:p></o:p></span></div><div class="MsoNormal" style="background: white; text-indent: 0in;"><span style="color: #222222; font-family: Arial, Helvetica, sans-serif; font-size: 12.0pt; mso-fareast-font-family: "Times New Roman";">ALTER ROLE [db_owner] ADD MEMBER [som]<o:p></o:p></span></div><div class="MsoNormal" style="background: white; text-indent: 0in;"><span style="color: #222222; font-family: Arial, Helvetica, sans-serif; font-size: 12.0pt; mso-fareast-font-family: "Times New Roman";">GO<o:p></o:p></span></div><div class="MsoNormal" style="background: white; text-indent: 0in;"><span style="color: #222222; font-family: Arial, Helvetica, sans-serif; font-size: 12.0pt; mso-fareast-font-family: "Times New Roman";">ALTER ROLE [db_datareader] ADD MEMBER [readonly]<o:p></o:p></span></div><div class="MsoNormal" style="background: white; text-indent: 0in;"><span style="color: #222222; font-family: Arial, Helvetica, sans-serif; font-size: 12.0pt; mso-fareast-font-family: "Times New Roman";">GO<o:p></o:p></span></div><div class="MsoNormal" style="background: white; text-indent: 0in;"><span style="color: #222222; font-family: Arial, Helvetica, sans-serif; font-size: 12.0pt; mso-fareast-font-family: "Times New Roman";">/****** Object: Table [dbo].[Employee] Script Date: 2/3/2017 10:20:17 AM ******/<o:p></o:p></span></div><div class="MsoNormal" style="background: white; text-indent: 0in;"><span style="color: #222222; font-family: Arial, Helvetica, sans-serif; font-size: 12.0pt; mso-fareast-font-family: "Times New Roman";">SET ANSI_NULLS ON<o:p></o:p></span></div><div class="MsoNormal" style="background: white; text-indent: 0in;"><span style="color: #222222; font-family: Arial, Helvetica, sans-serif; font-size: 12.0pt; mso-fareast-font-family: "Times New Roman";">GO<o:p></o:p></span></div><div class="MsoNormal" style="background: white; text-indent: 0in;"><span style="color: #222222; font-family: Arial, Helvetica, sans-serif; font-size: 12.0pt; mso-fareast-font-family: "Times New Roman";">SET QUOTED_IDENTIFIER ON<o:p></o:p></span></div><div class="MsoNormal" style="background: white; text-indent: 0in;"><span style="color: #222222; font-family: Arial, Helvetica, sans-serif; font-size: 12.0pt; mso-fareast-font-family: "Times New Roman";">GO<o:p></o:p></span></div><div class="MsoNormal" style="background: white; text-indent: 0in;"><span style="color: #222222; font-family: Arial, Helvetica, sans-serif; font-size: 12.0pt; mso-fareast-font-family: "Times New Roman";">SET ANSI_PADDING ON<o:p></o:p></span></div><div class="MsoNormal" style="background: white; text-indent: 0in;"><span style="color: #222222; font-family: Arial, Helvetica, sans-serif; font-size: 12.0pt; mso-fareast-font-family: "Times New Roman";">GO<o:p></o:p></span></div><div class="MsoNormal" style="background: white; text-indent: 0in;"><span style="color: #222222; font-family: Arial, Helvetica, sans-serif; font-size: 12.0pt; mso-fareast-font-family: "Times New Roman";">CREATE TABLE [dbo].[Employee](<o:p></o:p></span></div><div class="MsoNormal" style="background: white; text-indent: 0in;"><span style="color: #222222; font-family: Arial, Helvetica, sans-serif; font-size: 12.0pt; mso-fareast-font-family: "Times New Roman";"> [ID] [int] NULL,<o:p></o:p></span></div><div class="MsoNormal" style="background: white; text-indent: 0in;"><span style="color: #222222; font-family: Arial, Helvetica, sans-serif; font-size: 12.0pt; mso-fareast-font-family: "Times New Roman";"> [Value] [varchar](10) NULL<o:p></o:p></span></div><div class="MsoNormal" style="background: white; text-indent: 0in;"><span style="color: #222222; font-family: Arial, Helvetica, sans-serif; font-size: 12.0pt; mso-fareast-font-family: "Times New Roman";">) ON [PRIMARY]<o:p></o:p></span></div><div class="MsoNormal" style="background: white; text-indent: 0in;"><span style="font-family: Arial, Helvetica, sans-serif;"><br /></span></div><div class="MsoNormal" style="background: white; text-indent: 0in;"><span style="color: #222222; font-family: Arial, Helvetica, sans-serif; font-size: 12.0pt; mso-fareast-font-family: "Times New Roman";">GO<o:p></o:p></span></div><div class="MsoNormal" style="background: white; text-indent: 0in;"><span style="color: #222222; font-family: Arial, Helvetica, sans-serif; font-size: 12.0pt; mso-fareast-font-family: "Times New Roman";">SET ANSI_PADDING OFF<o:p></o:p></span></div><div class="MsoNormal" style="background: white; text-indent: 0in;"><span style="color: #222222; font-family: Arial, Helvetica, sans-serif; font-size: 12.0pt; mso-fareast-font-family: "Times New Roman";">GO<o:p></o:p></span></div><div class="MsoNormal" style="background: white; text-indent: 0in;"><span style="color: #222222; font-family: Arial, Helvetica, sans-serif; font-size: 12.0pt; mso-fareast-font-family: "Times New Roman";">/****** Object: Table [dbo].[t1] Script Date: 2/3/2017 10:20:17 AM ******/<o:p></o:p></span></div><div class="MsoNormal" style="background: white; text-indent: 0in;"><span style="color: #222222; font-family: Arial, Helvetica, sans-serif; font-size: 12.0pt; mso-fareast-font-family: "Times New Roman";">SET ANSI_NULLS ON<o:p></o:p></span></div><div class="MsoNormal" style="background: white; text-indent: 0in;"><span style="color: #222222; font-family: Arial, Helvetica, sans-serif; font-size: 12.0pt; mso-fareast-font-family: "Times New Roman";">GO<o:p></o:p></span></div><div class="MsoNormal" style="background: white; text-indent: 0in;"><span style="color: #222222; font-family: Arial, Helvetica, sans-serif; font-size: 12.0pt; mso-fareast-font-family: "Times New Roman";">SET QUOTED_IDENTIFIER ON<o:p></o:p></span></div><div class="MsoNormal" style="background: white; text-indent: 0in;"><span style="color: #222222; font-family: Arial, Helvetica, sans-serif; font-size: 12.0pt; mso-fareast-font-family: "Times New Roman";">GO<o:p></o:p></span></div><div class="MsoNormal" style="background: white; text-indent: 0in;"><span style="color: #222222; font-family: Arial, Helvetica, sans-serif; font-size: 12.0pt; mso-fareast-font-family: "Times New Roman";">SET ANSI_PADDING ON<o:p></o:p></span></div><div class="MsoNormal" style="background: white; text-indent: 0in;"><span style="color: #222222; font-family: Arial, Helvetica, sans-serif; font-size: 12.0pt; mso-fareast-font-family: "Times New Roman";">GO<o:p></o:p></span></div><div class="MsoNormal" style="background: white; text-indent: 0in;"><span style="color: #222222; font-family: Arial, Helvetica, sans-serif; font-size: 12.0pt; mso-fareast-font-family: "Times New Roman";">CREATE TABLE [dbo].[t1](<o:p></o:p></span></div><div class="MsoNormal" style="background: white; text-indent: 0in;"><span style="color: #222222; font-family: Arial, Helvetica, sans-serif; font-size: 12.0pt; mso-fareast-font-family: "Times New Roman";"> [id] [varchar](255) NULL<o:p></o:p></span></div><div class="MsoNormal" style="background: white; text-indent: 0in;"><span style="color: #222222; font-family: Arial, Helvetica, sans-serif; font-size: 12.0pt; mso-fareast-font-family: "Times New Roman";">) ON [PRIMARY]<o:p></o:p></span></div><div class="MsoNormal" style="background: white; text-indent: 0in;"><span style="font-family: Arial, Helvetica, sans-serif;"><br /></span></div><div class="MsoNormal" style="background: white; text-indent: 0in;"><span style="color: #222222; font-family: Arial, Helvetica, sans-serif; font-size: 12.0pt; mso-fareast-font-family: "Times New Roman";">GO<o:p></o:p></span></div><div class="MsoNormal" style="background: white; text-indent: 0in;"><span style="color: #222222; font-family: Arial, Helvetica, sans-serif; font-size: 12.0pt; mso-fareast-font-family: "Times New Roman";">SET ANSI_PADDING OFF<o:p></o:p></span></div><div class="MsoNormal" style="background: white; text-indent: 0in;"><span style="color: #222222; font-family: Arial, Helvetica, sans-serif; font-size: 12.0pt; mso-fareast-font-family: "Times New Roman";">GO<o:p></o:p></span></div><div class="MsoNormal" style="background: white; text-indent: 0in;"><span style="color: #222222; font-family: Arial, Helvetica, sans-serif; font-size: 12.0pt; mso-fareast-font-family: "Times New Roman";">/****** Object: Table [dbo].[t2] Script Date: 2/3/2017 10:20:17 AM ******/<o:p></o:p></span></div><div class="MsoNormal" style="background: white; text-indent: 0in;"><span style="color: #222222; font-family: Arial, Helvetica, sans-serif; font-size: 12.0pt; mso-fareast-font-family: "Times New Roman";">SET ANSI_NULLS ON<o:p></o:p></span></div><div class="MsoNormal" style="background: white; text-indent: 0in;"><span style="color: #222222; font-family: Arial, Helvetica, sans-serif; font-size: 12.0pt; mso-fareast-font-family: "Times New Roman";">GO<o:p></o:p></span></div><div class="MsoNormal" style="background: white; text-indent: 0in;"><span style="color: #222222; font-family: Arial, Helvetica, sans-serif; font-size: 12.0pt; mso-fareast-font-family: "Times New Roman";">SET QUOTED_IDENTIFIER ON<o:p></o:p></span></div><div class="MsoNormal" style="background: white; text-indent: 0in;"><span style="color: #222222; font-family: Arial, Helvetica, sans-serif; font-size: 12.0pt; mso-fareast-font-family: "Times New Roman";">GO<o:p></o:p></span></div><div class="MsoNormal" style="background: white; text-indent: 0in;"><span style="color: #222222; font-family: Arial, Helvetica, sans-serif; font-size: 12.0pt; mso-fareast-font-family: "Times New Roman";">SET ANSI_PADDING ON<o:p></o:p></span></div><div class="MsoNormal" style="background: white; text-indent: 0in;"><span style="color: #222222; font-family: Arial, Helvetica, sans-serif; font-size: 12.0pt; mso-fareast-font-family: "Times New Roman";">GO<o:p></o:p></span></div><div class="MsoNormal" style="background: white; text-indent: 0in;"><span style="color: #222222; font-family: Arial, Helvetica, sans-serif; font-size: 12.0pt; mso-fareast-font-family: "Times New Roman";">CREATE TABLE [dbo].[t2](<o:p></o:p></span></div><div class="MsoNormal" style="background: white; text-indent: 0in;"><span style="color: #222222; font-family: Arial, Helvetica, sans-serif; font-size: 12.0pt; mso-fareast-font-family: "Times New Roman";"> [id] [varchar](255) NULL<o:p></o:p></span></div><div class="MsoNormal" style="background: white; text-indent: 0in;"><span style="color: #222222; font-family: Arial, Helvetica, sans-serif; font-size: 12.0pt; mso-fareast-font-family: "Times New Roman";">) ON [PRIMARY]<o:p></o:p></span></div><div class="MsoNormal" style="background: white; text-indent: 0in;"><span style="font-family: Arial, Helvetica, sans-serif;"><br /></span></div><div class="MsoNormal" style="background: white; text-indent: 0in;"><span style="color: #222222; font-family: Arial, Helvetica, sans-serif; font-size: 12.0pt; mso-fareast-font-family: "Times New Roman";">GO<o:p></o:p></span></div><div class="MsoNormal" style="background: white; text-indent: 0in;"><span style="color: #222222; font-family: Arial, Helvetica, sans-serif; font-size: 12.0pt; mso-fareast-font-family: "Times New Roman";">SET ANSI_PADDING OFF<o:p></o:p></span></div><div class="MsoNormal" style="background: white; text-indent: 0in;"><span style="color: #222222; font-family: Arial, Helvetica, sans-serif; font-size: 12.0pt; mso-fareast-font-family: "Times New Roman";">GO<o:p></o:p></span></div><div class="MsoNormal" style="background: white; text-indent: 0in;"><span style="color: #222222; font-family: Arial, Helvetica, sans-serif; font-size: 12.0pt; mso-fareast-font-family: "Times New Roman";">USE [master]<o:p></o:p></span></div><div class="MsoNormal" style="background: white; text-indent: 0in;"><span style="color: #222222; font-family: Arial, Helvetica, sans-serif; font-size: 12.0pt; mso-fareast-font-family: "Times New Roman";">GO<o:p></o:p></span></div><div class="MsoNormal" style="background: white; text-indent: 0in;"><span style="color: #222222; font-family: Arial, Helvetica, sans-serif; font-size: 12.0pt; mso-fareast-font-family: "Times New Roman";">ALTER DATABASE [newdb] SET READ_WRITE <o:p></o:p></span></div><div class="MsoNormal" style="background: white; text-indent: 0in;"><span style="color: #222222; font-family: Arial, Helvetica, sans-serif; font-size: 12.0pt; mso-fareast-font-family: "Times New Roman";">GO<o:p></o:p></span></div><div class="MsoNormal" style="background: white; text-indent: 0in;"><span style="font-family: Arial, Helvetica, sans-serif;"><br /></span></div><div class="MsoNormal" style="background: white; text-indent: 0in;"><span style="font-family: Arial, Helvetica, sans-serif;"><br /></span></div><div class="MsoNormal" style="background: white; text-indent: 0in;"><span style="font-family: Arial, Helvetica, sans-serif;"><br /></span></div><div class="MsoNormal" style="background: white; text-indent: 0in;"><span style="color: #222222; font-family: Arial, Helvetica, sans-serif; font-size: 12.0pt; mso-fareast-font-family: "Times New Roman";">Incase if you want to restore the database with different name then we would require to modify the sql file with the new database name .<o:p></o:p></span></div><div class="MsoNormal" style="background: white; text-indent: 0in;"><span style="font-family: Arial, Helvetica, sans-serif;"><br /></span></div><div class="MsoNormal" style="background: white; margin-left: .25in; text-indent: 0in;"><span style="font-family: Arial, Helvetica, sans-serif;"><span style="color: #222222; font-family: "Helvetica","sans-serif"; font-size: 12.0pt; mso-fareast-font-family: "Times New Roman";"> </span><span style="color: #222222; text-indent: -0.25in;">Another method is: Backup the source database and restore to the destination database and then delete all table data.</span></span></div><div class="MsoNormal"><span style="font-family: Arial, Helvetica, sans-serif;"><br /></span></div><div class="MsoNormal"><span style="font-family: Arial, Helvetica, sans-serif;">Now we will show you another method which also serve our purpose.<o:p></o:p></span></div><div class="MsoNormal"><span style="font-family: Arial, Helvetica, sans-serif;"><br /></span></div><div class="MsoNormal" style="text-indent: 0in;"><span style="font-family: Arial, Helvetica, sans-serif;">Backup the database without data.<o:p></o:p></span></div><div class="MsoNormal"><span style="font-family: Arial, Helvetica, sans-serif;"><br /></span></div><div class="MsoNormal"></div><div class="MsoNormal" style="background: white; text-indent: 0in;"><span style="color: #222222; font-family: Arial, Helvetica, sans-serif; font-size: 12.0pt; mso-fareast-font-family: "Times New Roman";">In the SSMS Object Explorer Window, right click on the "newdb" database and choose "Tasks" > "Extract Data-tier Application..."<o:p></o:p></span></div><div class="MsoNormal" style="background: white; text-indent: 0in;"><span style="color: #222222; font-family: Arial, Helvetica, sans-serif; font-size: 12.0pt; mso-fareast-font-family: "Times New Roman";"><br /></span></div><div class="MsoNormal" style="background: white; text-indent: 0in;"><div class="separator" style="clear: both; text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi0A1o7DEeqD6NrYJcnwU4IvXO3-H845SUrgaTKGnwgbXl4T-G32SlJW5F08RNZn91i_L5ijL2a_1P_2jdBCUu20aP1GtGD9UZ_cFrkg-lb4Js4JQ43vvd4eFgfA3GJAyu9R3SbWbytskc/s1600/1.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><span style="font-family: Arial, Helvetica, sans-serif;"><img border="0" height="400" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi0A1o7DEeqD6NrYJcnwU4IvXO3-H845SUrgaTKGnwgbXl4T-G32SlJW5F08RNZn91i_L5ijL2a_1P_2jdBCUu20aP1GtGD9UZ_cFrkg-lb4Js4JQ43vvd4eFgfA3GJAyu9R3SbWbytskc/s400/1.png" width="288" /></span></a></div><div class="separator" style="clear: both; text-align: center;"><span style="font-family: Arial, Helvetica, sans-serif;"><br /></span></div><div class="separator" style="clear: both; text-align: center;"><span style="font-family: Arial, Helvetica, sans-serif;"><br /></span></div><div class="separator" style="clear: both; text-align: center;"><span style="font-family: Arial, Helvetica, sans-serif;"><br /></span></div><div class="MsoNormal" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; margin-left: 0.25in; text-indent: 0in;"><span style="color: #222222;"><span style="font-family: Arial, Helvetica, sans-serif;">The [Extract Data-tier Application] wizard will start. </span></span></div><div class="MsoNormal" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; margin-left: 0.25in; text-indent: 0in;"><span style="color: #222222;"><span style="font-family: Arial, Helvetica, sans-serif;"><br /></span></span></div><div class="separator" style="clear: both; text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhd78N-ILppn1dksGfCHwqdlLUl-mMe-wFVdVpn9af1p4IaSNqm8b2bq38l6ciR0fgwArod04fHVhR-NgT3Jo74ROikmUFpOsSdfcvewhe97NF733jFczsxmwGdqyTUpaS39VR9Z7olkcY/s1600/2.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><span style="font-family: Arial, Helvetica, sans-serif;"><img border="0" height="434" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhd78N-ILppn1dksGfCHwqdlLUl-mMe-wFVdVpn9af1p4IaSNqm8b2bq38l6ciR0fgwArod04fHVhR-NgT3Jo74ROikmUFpOsSdfcvewhe97NF733jFczsxmwGdqyTUpaS39VR9Z7olkcY/s640/2.png" width="640" /></span></a></div><div class="separator" style="clear: both; text-align: center;"><span style="font-family: Arial, Helvetica, sans-serif;"><br /></span></div><div class="separator" style="clear: both; text-align: center;"><span style="font-family: Arial, Helvetica, sans-serif;"><br /></span></div><div class="separator" style="clear: both; text-align: center;"><span style="font-family: Arial, Helvetica, sans-serif;"><br /></span></div><div class="separator" style="clear: both; text-align: center;"><span style="font-family: Arial, Helvetica, sans-serif;"><br /></span></div><div class="separator" style="clear: both; text-align: left;"><span style="font-family: Arial, Helvetica, sans-serif;">Provide the DAC package file location </span></div><div class="MsoNormal" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; margin-left: 0.25in; text-indent: 0in;"><br /></div><span style="color: #222222; font-family: Arial, Helvetica, sans-serif; font-size: 12.0pt; mso-fareast-font-family: "Times New Roman";"><br /></span><div class="separator" style="clear: both; text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjwpn0AmIUDH6gXf9uI-9lwpZ8c6_fBPjUdqm25eFf_5pOC4oJjshnAPREKqc_AvKune9sgx4oqJUvp49t-jxElHIhOg0QQaOW6dRniW56rJW99-vWisNe2gmQoBz0Z7rgurka6xiwF3ZQ/s1600/3.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><span style="font-family: Arial, Helvetica, sans-serif;"><img border="0" height="430" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjwpn0AmIUDH6gXf9uI-9lwpZ8c6_fBPjUdqm25eFf_5pOC4oJjshnAPREKqc_AvKune9sgx4oqJUvp49t-jxElHIhOg0QQaOW6dRniW56rJW99-vWisNe2gmQoBz0Z7rgurka6xiwF3ZQ/s640/3.png" width="640" /></span></a></div><div class="separator" style="clear: both; text-align: center;"><span style="font-family: Arial, Helvetica, sans-serif;"><br /></span></div><div class="separator" style="clear: both; text-align: center;"><span style="font-family: Arial, Helvetica, sans-serif;"><br /></span></div><div class="separator" style="clear: both; text-align: left;"><span style="font-family: Arial, Helvetica, sans-serif;"><br /></span></div><div class="separator" style="clear: both; text-align: left;"><span style="font-family: Arial, Helvetica, sans-serif;">click "Next"</span></div><div class="separator" style="clear: both; text-align: left;"><span style="font-family: Arial, Helvetica, sans-serif;"><br /></span></div><div class="separator" style="clear: both; text-align: left;"><span style="font-family: Arial, Helvetica, sans-serif;"><br /></span></div><div class="separator" style="clear: both; text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg4uavvlwGHhze21Kb91C-n-1PCBbYEqfbbimJ6FTttpIWEDnGC2M8-jLpuCfZtnO0K1VgJTDcFvZXd_-DT1C249IyDFLPNgf-Zqrk7ButKO7E1KNlPmd4asTi8S_oahgYtQH9SW_g0q1I/s1600/5.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><span style="font-family: Arial, Helvetica, sans-serif;"><img border="0" height="430" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg4uavvlwGHhze21Kb91C-n-1PCBbYEqfbbimJ6FTttpIWEDnGC2M8-jLpuCfZtnO0K1VgJTDcFvZXd_-DT1C249IyDFLPNgf-Zqrk7ButKO7E1KNlPmd4asTi8S_oahgYtQH9SW_g0q1I/s640/5.png" width="640" /></span></a></div><div class="separator" style="clear: both; text-align: left;"><span style="font-family: Arial, Helvetica, sans-serif;"><br /></span></div><div class="separator" style="clear: both; text-align: left;"><span style="font-family: Arial, Helvetica, sans-serif;"><br /></span></div><div class="separator" style="clear: both; text-align: left;"><span style="font-family: Arial, Helvetica, sans-serif;"><br /></span></div><div class="separator" style="clear: both; text-align: left;"><span style="font-family: Arial, Helvetica, sans-serif;"><br /></span></div><div class="MsoNormal"><span style="font-family: Arial, Helvetica, sans-serif;"><span style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; color: #222222;">click "Next"</span><o:p></o:p></span></div><div class="MsoNormal"><span style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; color: #222222;"><span style="font-family: Arial, Helvetica, sans-serif;"><br /></span></span></div><div class="MsoNormal"><span style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; color: #222222;"><span style="font-family: Arial, Helvetica, sans-serif;"><br /></span></span></div><div class="separator" style="clear: both; text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhOLXEOYhMkFn4w5XIzyI14uU-HlXyGP4dmtKa2odeqbNurC6d-70MVhDCg05BWkAO2N0NgB4JwirFhKHN1coa-W1jRJl2arjb4o2ZkKBZ9UTBJVS4D4vd9j61P_9TGwkd7oIoCjnY4-zo/s1600/6.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><span style="font-family: Arial, Helvetica, sans-serif;"><img border="0" height="606" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhOLXEOYhMkFn4w5XIzyI14uU-HlXyGP4dmtKa2odeqbNurC6d-70MVhDCg05BWkAO2N0NgB4JwirFhKHN1coa-W1jRJl2arjb4o2ZkKBZ9UTBJVS4D4vd9j61P_9TGwkd7oIoCjnY4-zo/s640/6.png" width="640" /></span></a></div><div class="separator" style="clear: both; text-align: center;"><span style="font-family: Arial, Helvetica, sans-serif;"><br /></span></div><div class="separator" style="clear: both; text-align: center;"><span style="font-family: Arial, Helvetica, sans-serif;"><br /></span></div><div class="MsoNormal"><span style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; color: #222222;"><span style="font-family: Arial, Helvetica, sans-serif;">Now we have newdb.dacpac file generated.<o:p></o:p></span></span></div><div class="MsoNormal"><br /></div><div class="MsoNormal"><br /></div><div class="MsoNormal"><span style="font-family: Arial, Helvetica, sans-serif;">Restore a SQL Server Database from a DAC package<o:p></o:p></span></div><div class="MsoNormal"><br /></div><div style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial;"><span style="color: #222222; font-family: Arial, Helvetica, sans-serif;">The DAC package can be restored to a target SQL Server instance whose version is equal to or higher than that of the source SQL Server instance.</span></div><div style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial;"><span style="color: #222222; font-family: Arial, Helvetica, sans-serif;"> SSMS Window, right click [Databases] , and choose "Deploy Data-tier Application...", as shown below</span></div><div style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial;"><br /></div><div style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial;"><span style="color: #222222; font-family: Arial, Helvetica, sans-serif;">The [Deploy Data-tier Application] wizard will start, Click next in the first [Introduction] screen, and in the [Select Package] screen, click the Browse button to find the DAC package file location</span></div><div style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial;"><span style="font-family: Arial, Helvetica, sans-serif;"><br /></span></div><div class="separator" style="clear: both; text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhE1X2tnwW5BeRGG5z-Bz-Q_rUPrMpAx6QV6WZ9W7v6_se0Fs_CYF4ftCxD2mTPSqU-6osccUuEBWrw6ucduN0tv5173-ve8CfRL-Bjh3CnT2W5SaOMXqV_WCW9z7II2EjsZFHqzzyOQxo/s1600/7.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><span style="font-family: Arial, Helvetica, sans-serif;"><img border="0" height="400" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhE1X2tnwW5BeRGG5z-Bz-Q_rUPrMpAx6QV6WZ9W7v6_se0Fs_CYF4ftCxD2mTPSqU-6osccUuEBWrw6ucduN0tv5173-ve8CfRL-Bjh3CnT2W5SaOMXqV_WCW9z7II2EjsZFHqzzyOQxo/s400/7.png" width="218" /></span></a></div><div class="separator" style="clear: both; text-align: center;"><span style="font-family: Arial, Helvetica, sans-serif;"><br /></span></div><div class="MsoNormal" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; margin-left: 0.25in; text-indent: 0in;"><span style="font-family: Arial, Helvetica, sans-serif;"><span style="color: #222222;">The [Deploy Data-tier Application] wizard will start, Click next and</span><span style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; color: #222222;"> Browse button to find the DAC package file location.</span><span style="color: #222222;"><o:p></o:p></span></span></div><div class="MsoNormal" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; margin-left: 0.25in; text-indent: 0in;"><span style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; color: #222222;"><span style="font-family: Arial, Helvetica, sans-serif;"><br /></span></span></div><div class="separator" style="clear: both; text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjxpmdju-arNmBymT6QZT_ClvwQfknKFuxpyqD4fqs1EEruN1b2dC4FGAJK8VvftrNyXPtKlzrBABZ2wuvBDgiYpxuMRwIXpm7ucdZIoaAZzf5DYn-7Labab7PYsg820K4i1T5p4BtZG0g/s1600/8.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><span style="font-family: Arial, Helvetica, sans-serif;"><img border="0" height="593" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjxpmdju-arNmBymT6QZT_ClvwQfknKFuxpyqD4fqs1EEruN1b2dC4FGAJK8VvftrNyXPtKlzrBABZ2wuvBDgiYpxuMRwIXpm7ucdZIoaAZzf5DYn-7Labab7PYsg820K4i1T5p4BtZG0g/s640/8.png" width="640" /></span></a></div><div class="separator" style="clear: both; text-align: center;"><span style="font-family: Arial, Helvetica, sans-serif;"><br /></span></div><div class="separator" style="clear: both; text-align: center;"><span style="font-family: Arial, Helvetica, sans-serif;"><br /></span></div><div class="separator" style="clear: both; text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEij6wt3nroz5UExv-mKhMdNYf5k-ZEbn2-_SVeF3jCeoTSPnsNcNSEJQCnQJQ4-WjhKnypoJ8KrDwP1yumIrBOAZEe5eTfakq4v86eJjr4UB6k7QLIeCCkzjbjcIOXqSm6AK1vHuLTABz4/s1600/9.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><span style="font-family: Arial, Helvetica, sans-serif;"><img border="0" height="631" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEij6wt3nroz5UExv-mKhMdNYf5k-ZEbn2-_SVeF3jCeoTSPnsNcNSEJQCnQJQ4-WjhKnypoJ8KrDwP1yumIrBOAZEe5eTfakq4v86eJjr4UB6k7QLIeCCkzjbjcIOXqSm6AK1vHuLTABz4/s640/9.png" width="640" /></span></a></div><div class="separator" style="clear: both; text-align: center;"><span style="font-family: Arial, Helvetica, sans-serif;"><br /></span></div><div class="separator" style="clear: both; text-align: left;"><span style="color: #222222;"><span style="font-family: Arial, Helvetica, sans-serif;"><br /></span></span></div><div class="separator" style="clear: both; text-align: left;"><span style="color: #222222;"><span style="font-family: Arial, Helvetica, sans-serif;">Click Next, and in the [Update Configuration] screen, input the required destination database name or leave it as if you don’t want to change the db name.</span></span></div><div class="separator" style="clear: both; text-align: left;"><span style="font-family: Arial, Helvetica, sans-serif;"><br /></span></div><div class="separator" style="clear: both; text-align: left;"><span style="font-family: Arial, Helvetica, sans-serif;"><br /></span></div><div class="separator" style="clear: both; text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj1W6IrKZnXEegYVHft7Iu_nsX1CLqCbTk5xMiQ7cd03M7whYnwEAheob43zct7NlBYYfuvXY3YJCfKxuSYCHYWWWAJzLT2iFyZf0XIzrNU8fV6r2P26lHqNv3PiKA3pLkaneD4Bh0aGMU/s1600/10.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><span style="font-family: Arial, Helvetica, sans-serif;"><img border="0" height="361" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj1W6IrKZnXEegYVHft7Iu_nsX1CLqCbTk5xMiQ7cd03M7whYnwEAheob43zct7NlBYYfuvXY3YJCfKxuSYCHYWWWAJzLT2iFyZf0XIzrNU8fV6r2P26lHqNv3PiKA3pLkaneD4Bh0aGMU/s640/10.png" width="640" /></span></a></div><div class="separator" style="clear: both; text-align: center;"><span style="font-family: Arial, Helvetica, sans-serif;"><br /></span></div><div class="separator" style="clear: both; text-align: center;"><span style="font-family: Arial, Helvetica, sans-serif;"><br /></span></div><div class="MsoNormal"><span style="font-family: Arial, Helvetica, sans-serif;">That’s it. We have successfully restored the database with only data structure.<o:p></o:p></span></div><div class="separator" style="clear: both; text-align: left;"><span style="font-family: Arial, Helvetica, sans-serif;"><br /></span></div><div class="MsoNormal" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; margin-left: 0.25in; text-indent: 0in;"><span style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; color: #222222;"><span style="font-family: Arial, Helvetica, sans-serif;"><br /></span></span></div><div class="separator" style="clear: both; text-align: center;"><span style="font-family: Arial, Helvetica, sans-serif;"><br /></span></div><div class="separator" style="clear: both; text-align: center;"><span style="font-family: Arial, Helvetica, sans-serif;"><br /></span></div><div style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial;"><span style="font-family: Arial, Helvetica, sans-serif;"><br /></span></div><div style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial;"><span style="font-family: Arial, Helvetica, sans-serif;"><br /></span></div><div><span style="font-family: Arial, Helvetica, sans-serif;"><br /></span></div><ol start="1" style="margin-top: 0in;" type="1"></ol><div class="MsoNormal"><span style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; color: #222222;"><span style="font-family: Arial, Helvetica, sans-serif;"><br /></span></span></div><div style="text-align: center;"><span style="font-family: Arial, Helvetica, sans-serif;"><br /></span></div><span style="color: #222222; font-family: "helvetica" , "sans-serif"; font-size: 12.0pt;"><br /></span></div></div>Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-3637740476610425777.post-33065110334729426842017-02-02T06:55:00.000-08:002018-09-02T12:59:28.811-07:00How to create linked server in SQL Server using TSQL ?<div dir="ltr" style="text-align: left;" trbidi="on">What is linked server?<br />Linked Servers allows you to connect to other database instances on the same server or on another machine or remote servers.<br />It allows SQL Server to execute SQL scripts against OLE DB data sources on remote servers using OLE DB providers.<br />The remote servers can be SQL Server, Oracle, Mysql etc. which means those databases that support OLE DB can be used for linking servers.<br /><br />First create a user in mysql which will have permission for atleast select command.<br /><br />In mysql Server:-<br />mysql> grant select ON `koopkrachtdb `.* TO 'koopreport'@'192.168.2.100' identified by 'Rghdwf4324Fvxg';<br />Query OK, 0 rows affected (0.00 sec)<br /><br /><br /><br />In SQL Server:-<br />Change the fields accordingly to your server settings.<br /><br /><br /><br />/****** Object: LinkedServer [KOOPKRATCHMYSQL] Script Date: 11/04/2016 08:13:54 ******/<br />EXEC master.dbo.sp_addlinkedserver @server = N'KOOPKRATCHMYSQL', @srvproduct=N'MySQL', @provider=N'MSDASQL', @provstr=N'DRIVER={MySQL ODBC 5.3 ANSI Driver}; SERVER=52.71.55.125;DATABASE=koopkrachtdb; USER=koopreport; PASSWORD=Rghdwf4324Fvxg;option=3'<br /> /* For security reasons the linked server remote logins password is changed with ######## */<br />EXEC master.dbo.sp_addlinkedsrvlogin @rmtsrvname=N'KOOPKRATCHMYSQL',@useself=N'True',@locallogin=NULL,@rmtuser=NULL,@rmtpassword=NULL<br /><br />GO<br /><br />EXEC master.dbo.sp_serveroption @server=N'KOOPKRATCHMYSQL', @optname=N'collation compatible', @optvalue=N'false'<br />GO<br /><br />EXEC master.dbo.sp_serveroption @server=N'KOOPKRATCHMYSQL', @optname=N'data access', @optvalue=N'true'<br />GO<br /><br />EXEC master.dbo.sp_serveroption @server=N'KOOPKRATCHMYSQL', @optname=N'dist', @optvalue=N'false'<br />GO<br /><br />EXEC master.dbo.sp_serveroption @server=N'KOOPKRATCHMYSQL', @optname=N'pub', @optvalue=N'false'<br />GO<br /><br />EXEC master.dbo.sp_serveroption @server=N'KOOPKRATCHMYSQL', @optname=N'rpc', @optvalue=N'false'<br />GO<br /><br />EXEC master.dbo.sp_serveroption @server=N'KOOPKRATCHMYSQL', @optname=N'rpc out', @optvalue=N'false'<br />GO<br /><br />EXEC master.dbo.sp_serveroption @server=N'KOOPKRATCHMYSQL', @optname=N'sub', @optvalue=N'false'<br />GO<br /><br />EXEC master.dbo.sp_serveroption @server=N'KOOPKRATCHMYSQL', @optname=N'connect timeout', @optvalue=N'0'<br />GO<br /><br />EXEC master.dbo.sp_serveroption @server=N'KOOPKRATCHMYSQL', @optname=N'collation name', @optvalue=null<br />GO<br /><br />EXEC master.dbo.sp_serveroption @server=N'KOOPKRATCHMYSQL', @optname=N'lazy schema validation', @optvalue=N'false'<br />GO<br /><br />EXEC master.dbo.sp_serveroption @server=N'KOOPKRATCHMYSQL', @optname=N'query timeout', @optvalue=N'0'<br />GO<br /><br />EXEC master.dbo.sp_serveroption @server=N'KOOPKRATCHMYSQL', @optname=N'use remote collation', @optvalue=N'true'<br />GO<br /><br />EXEC master.dbo.sp_serveroption @server=N'KOOPKRATCHMYSQL', @optname=N'remote proc transaction promotion', @optvalue=N'true'<br />GO<br /><br /><br /></div>Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-3637740476610425777.post-68083622086213952762017-01-31T02:32:00.000-08:002018-09-02T12:59:28.957-07:00Restore SQL Server MDF Database File Without LDF File<p>SQL Server is a relational database management system designed for large-scale transactions, e-commerce applications, data mining, and so on. Moreover, it is widely used on Business platforms for data analysis, data integration and processing components as it keeps all records fast, flexible and secure. The SQL server database contains three files i.e.</p><ul><li>Primary Database File (MDF file)</li><li>Secondary Database File (NDF file)</li><li>Log file (LDF file)</li></ul><p>First, database file is Primary File amongst the three, which consists all the data and schema and also has the file format as .mdf. The second data file is Log File that maintains all the database transactions logs so the desired information can be accessed later to recover SQL server database. There must exist a single log file for each database and it is possible that many log files can be created for an individual database. The file extension for saving the transaction log is .ldf format.</p><h2>Why to Restore MDF File Without Log file</h2><p>If there is any corruption happens in LDF file, users unable to take the backup of Log file. According to this case, users need to restore SQL Server database without LDF file and need to recreate the Log file as well. </p><h2>Solutions to Recover SQL database from MDF file </h2><p>There are two methods to restore .mdf database file without .ldf file those are mentioned below:</p><ul><li>Using SQL Server Management Studio</li><li>Using Transaction-SQL Script</li></ul><h3>By Utilizing SQL Server Management Studio (SSMS)</h3><p>Take a look at the steps mentioned below to restore the SQL .mdf file without Log file:</p><ul><li>First of all, open SQL Server Management Studio.</li><li>Then, right-click on the databases > click on <strong>Attach</strong> from the drop-down list.</li><li>Now, click on <strong>Add</strong> button > browse the location of database file (MDF) file > choose the file and click on <strong>OK</strong> button.</li><li>Finally, display the details in attach dialog box and select LDf file and press Remove button. After that, click on <strong>OK</strong> button for restoring the MDF file without LDF file. During the restoration of database, SQL server will create a new Log file.</li><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgKVRmTF4TAspjAHVHZaM-4SK1OrCv-1JMUK2RpNG9hcC7n1uYdIr4Mv0M7XeiSpeJh6qwW2kH78Id7EL9OwQCAYyy2_R9ErKRBaoKraGRXw3tynUQ5Z4tvhuYkgwx7h6pfZSDaquggXWc/s1600/restore-mdf-without-ldf.png" imageanchor="1" ><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgKVRmTF4TAspjAHVHZaM-4SK1OrCv-1JMUK2RpNG9hcC7n1uYdIr4Mv0M7XeiSpeJh6qwW2kH78Id7EL9OwQCAYyy2_R9ErKRBaoKraGRXw3tynUQ5Z4tvhuYkgwx7h6pfZSDaquggXWc/s1600/restore-mdf-without-ldf.png" /></a><li>At last, check the database in desired databases folder.</li></ul><h3>By Utilizing Transact-SQL Script </h3><p>Restore SQL Server MDF file without LDF file using Transact SQL script:</p><ul><li>Click on “<strong>New Query</strong>” from the Server Management Studio toolbar</li><li><strong>Execute</strong> the following query</li></ul><p><code>CREATE DATABASE DatabaseName ON <br />(FILENAME = 'C:\Program Files\Microsoft SQL Server\MSSQL12.MSSQLSERVER\MSSQL\DATA\DatabaseName.mdf') <br />FOR ATTACH_REBUILD_LOG <br /> GO </code></p><h3>Conclusion</h3><p>Here, we end up with the procedure to restore SQL Server database from MDF file only (without LDF file) using SQL Server Management Studio and Transact-SQL script. </p>Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-3637740476610425777.post-45728178084476355972016-11-30T00:39:00.000-08:002018-09-02T12:59:29.105-07:00SQL Server Warning Fatal Error 7105: Reasons And Solutions<p>MS SQL Server supports Large Object (LOB) data types for storing a large amount of data. Such data types includes Binary LOB (BLOB), Character LOB (CLOB) and Double-byte Character LOB (DBCCLOB) as well. They use a unique structure which is distinct from normal data types. In certain situations, Microsoft SQL server unable to access LOB data that is provided by database page. Users will receive SQL error 7105 while accessing these type of data and the process terminates. It creates critical situations and data loss necessitates MS SQL repairs to be sorted out.</p><h2>Consequences of SQL Server Error 7105</h2><p>Users may get “MSG 7105” when LOB referenced through the SQL database page row may not be accessed. At this end, SQL server application encounters an error message, which resembles the following as:</p><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg5_J3I0bVAnyr8euPkjyCZqxmNukzC0CezaRdUhh9oyrMfBGUmE9tMXEUYeOjxdc7pdWgkhzv7EkSnN8VpqiYOgZyuSEc3-OW3ri-hSPCPgAU81hu3D-SnqqJxvq-I38zn_m_hfqEAFRg/s1600/7105-1.png" imageanchor="1" ><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg5_J3I0bVAnyr8euPkjyCZqxmNukzC0CezaRdUhh9oyrMfBGUmE9tMXEUYeOjxdc7pdWgkhzv7EkSnN8VpqiYOgZyuSEc3-OW3ri-hSPCPgAU81hu3D-SnqqJxvq-I38zn_m_hfqEAFRg/s640/7105-1.png" width="640" height="71" /></a><p>Because of the high severity of errors, SQL server ends the connection. The same error message appears in Windows Application Event Log and SQL ERRORLOG with EventID.</p><h2>Causes Behind Error 7105 in SQL Server</h2><p>There are following reasons those are mentioned below:</p><ul><li>The corruption problem may occurs inside the LOB page structure that is given by the database.</li><li>The query that is failed with NOLOCK or READ UNCOMMITTED ISOLATION query hint.</li><li>Most probably the error is coming inside the SQL Server Engine leading to the failure of the database query.</li></ul><h3>Solutions to Resolve Error Message </h3><p>Hence, the following workarounds are discussed as a solution for the respective error:</p><ul><li><strong>Run DBCC CHECKDB on the SQL Server database </strong></li><p>It is an inbuilt utility that must be executed to restore or repair the SQL Server database file. Still, in the beginning, it must be run without any repair clause thus, to verify the damage level. After that run DBCC CHECKDB with recommended repair clause to fix SQL Server fatal error 7105. It it possible then, it can fix the error but the problem is that it justifies the data loss which is not suitable.</p><li><strong>Restore from backup file </strong></li><p>If the above mentioned method is unable to resolve the error, then users must use the different solution to eliminate the issues. Hence, if a clean and healthy backup is available then, restore the database from backup file for regaining the availability of the data items which is stored in SQL database. It must be possible, only if the backup is available. The steps for restoring procedure are mentioned below:</p><ul><li>Restore the selected database by clicking on <strong>database >> Tasks >> Restore >> Database</strong>. </li><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgCdlCAOEAlhN0V-xzIMlS8CUWlf9RCUd7RlB20T54sE_HYFOTQ8B8Rd8gKWmnEvsG8dR-1Akq90WBKZ1i_hyQ70UbSQ8oVPnvS8zYf2Bz3SuQYOHlWzvqZ_pgvj0tRVGqhfnjH67GrRQs/s1600/7105-2.png" imageanchor="1" ><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgCdlCAOEAlhN0V-xzIMlS8CUWlf9RCUd7RlB20T54sE_HYFOTQ8B8Rd8gKWmnEvsG8dR-1Akq90WBKZ1i_hyQ70UbSQ8oVPnvS8zYf2Bz3SuQYOHlWzvqZ_pgvj0tRVGqhfnjH67GrRQs/s640/7105-2.png" width="640" height="506" /></a><li>After that, select the <strong>backup file</strong> and then, click <strong>OK</strong> button.</li><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjZIRb7cIV6nCfzscI7Vp4fVYtaHisOxPum2R19wbxcV-ZqZ6zEex6kWRwCvsryjECUFXlU1xjiTGsx8ETVRLlEp8bTdFX76b5auaN9sRjjLpCwX1vs2AHY4iPBDubf5X4k2pIF2RaEMhc/s1600/7105-3.png" imageanchor="1" ><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjZIRb7cIV6nCfzscI7Vp4fVYtaHisOxPum2R19wbxcV-ZqZ6zEex6kWRwCvsryjECUFXlU1xjiTGsx8ETVRLlEp8bTdFX76b5auaN9sRjjLpCwX1vs2AHY4iPBDubf5X4k2pIF2RaEMhc/s640/7105-3.png" width="640" height="484" /></a><li>Now, the screen will display the <strong>Execution Process</strong> and you will have to wait for some time until the process has been completed. </li><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgFoMecvQLpIbb0V59FVOlC4Gp8T3qHlc6HwP1Cr8nRKr5Br6Flai9BqcmEixJ-cbwGtI5c6oIooY4Utt9lv0LCihpTqPS6LVM7zxroF24SptwJ8VGnZryV-MJLoCo493_FQIAWWs3B3qw/s1600/7105-4.png" imageanchor="1" ><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgFoMecvQLpIbb0V59FVOlC4Gp8T3qHlc6HwP1Cr8nRKr5Br6Flai9BqcmEixJ-cbwGtI5c6oIooY4Utt9lv0LCihpTqPS6LVM7zxroF24SptwJ8VGnZryV-MJLoCo493_FQIAWWs3B3qw/s640/7105-4.png" width="640" height="537" /></a><li>After finishing the execution process, a restore database message will be shown on the screen successfully. Click on <strong>OK</strong>. </li><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhO0w9yyMIFO_YuYGby9pYFD022hyphenhyphenQekvl0oiI6bb9JuM_T-wlQG9T3MBa8EmJfXWPxdQk0y_0rG2c06wYQSc73IVgbps6CbTsfs090-WcWE18aiJ_Cz4B8iwSuiuKhGhCPDMc0lDUtlQc/s1600/7105-5.png" imageanchor="1" ><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhO0w9yyMIFO_YuYGby9pYFD022hyphenhyphenQekvl0oiI6bb9JuM_T-wlQG9T3MBa8EmJfXWPxdQk0y_0rG2c06wYQSc73IVgbps6CbTsfs090-WcWE18aiJ_Cz4B8iwSuiuKhGhCPDMc0lDUtlQc/s640/7105-5.png" width="640" height="118" /></a></ul></ul><p>Performing above manual steps, users will be able to restore SQL server database. But if the backup is not available then users can go for third party solution to fix SQL fatal error 7105.</p><h3>Effortless Solution to Resolve SQL Server Error 7105</h3><p>The most suitable solution for fixing this error code is <a href="http://www.repair-sql.net/" target="_blank">MS SQL data recovery</a>. It is safe and secure style to troubleshoot the error with the help of below steps:</p><p><strong>Step1:</strong> First, launch the software, select the <strong>MDF file </strong>and then, press <strong>Open</strong> option.</p><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjP9mslVKtAVjDAZfEIRU-M3LUNIKkiJ75riEZOWvEx-CGhTZ1WlS4mif-bJVJ3W3LFG2rEUt5QbJ4tTeUl-ht9cFBNFc-5q0Z8tZD60YYQuYILZnRxU701Mo4GF0mdg7mDKQAOMNppQOU/s1600/7105-6.png" imageanchor="1" ><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjP9mslVKtAVjDAZfEIRU-M3LUNIKkiJ75riEZOWvEx-CGhTZ1WlS4mif-bJVJ3W3LFG2rEUt5QbJ4tTeUl-ht9cFBNFc-5q0Z8tZD60YYQuYILZnRxU701Mo4GF0mdg7mDKQAOMNppQOU/s640/7105-6.png" width="640" height="397" /></a><p><strong>Step 2:</strong> Once the files are added, the application will <strong>Preview</strong> the complete recovered database of MDF and NDF files like tables, stored procedures, triggers, and views and so on.</p><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiLQO7GQQRSc14i4rpVbYON0e_NoBMNVwjEoiDOf0PRPoGkPiOylo6Ty5QdCIBJs5C4EnlWqtECywx7e05nbOWWN9pjnDQ-qT0p3n_4ycU_U2nKHeHSBjm_JF1fX3rGI2ICGZn370Ud9EM/s1600/7105-7.png" imageanchor="1" ><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiLQO7GQQRSc14i4rpVbYON0e_NoBMNVwjEoiDOf0PRPoGkPiOylo6Ty5QdCIBJs5C4EnlWqtECywx7e05nbOWWN9pjnDQ-qT0p3n_4ycU_U2nKHeHSBjm_JF1fX3rGI2ICGZn370Ud9EM/s640/7105-7.png" width="640" height="396" /></a><p><strong>Step 3:</strong> Finally, select an option between two i.e., <strong>SQL Server Database</strong> and <strong>SQL Server Compatible Scripts</strong> to export/save the database.</p><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgRf1_-Bfq8aOawwTf4ybvHPRxWMUpU5gceoFOgosA5GSSM8eSxwhmj42Lap_Jj1HmyM_872DN8reaMtOuYIgwFPr_clY-3E9zUTnre7n_Utbehjb7y3lHF3CuXZOZRPruIrYvNnNkBrzg/s1600/7105-8.png" imageanchor="1" ><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgRf1_-Bfq8aOawwTf4ybvHPRxWMUpU5gceoFOgosA5GSSM8eSxwhmj42Lap_Jj1HmyM_872DN8reaMtOuYIgwFPr_clY-3E9zUTnre7n_Utbehjb7y3lHF3CuXZOZRPruIrYvNnNkBrzg/s640/7105-8.png" width="640" height="385" /></a><p>In the end, a user will be able to get database file without SQL error 7105.</p><h3>Conclusion</h3><p>While working, various server errors may occur which creates obstacle while accessing the SQL Server database. However, error 7105 in SQL Server is faced due to inaccessibility of large object data that was referenced by a database. We have covered a best possible solution which helps to overcome this issue. Initially, it is suggested to restore the backup of the SQL database, if a user is already having it. Meanwhile, a user can go for another solutions to resolve SQL server 7105.</p> Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-3637740476610425777.post-1094919355316672422016-11-28T02:16:00.000-08:002018-09-02T12:59:29.251-07:00How to drop all tables in mysql database using a single command<div dir="ltr" style="text-align: left;" trbidi="on">Command:-<br />mysqldump -u[user] -p[password] --add-drop-table --no-data [DATABASE] | grep ^DROP | mysql -u[user] -p[password] [DATABASE]<br /><br />Here test is the database name. I'm going to drop all the tables from this database.<br />Example:-<br />mysqldump -uroot -predhat --add-drop-table --no-data test | grep ^DROP | mysql -uroot -predhat test<br /><br /></div>Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-3637740476610425777.post-35550271765261369412016-11-20T22:42:00.000-08:002018-09-02T12:59:29.398-07:00Know How To Resolve SQL Server Error 3271?<p>When a user is backing up a database or restoration procedure is in process, most of the SQL users faces an error i.e. SQL error 3271. This a type of error encounters when a system is performing an I/O operation.</p><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEizfZARZPvP2ARWaWwMNRu8DbatZfOSBD3OLXY0W206rznVEQTkyeq9bhowU-gwwnODqJ99ZrlR2QWA0ct5922KiNCMbwx60l4kPFOwoxYVlHGXq0KyN-0EoFVJowfwqIemHWcvWxCUEho/s1600/error-3271.png" imageanchor="1" ><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEizfZARZPvP2ARWaWwMNRu8DbatZfOSBD3OLXY0W206rznVEQTkyeq9bhowU-gwwnODqJ99ZrlR2QWA0ct5922KiNCMbwx60l4kPFOwoxYVlHGXq0KyN-0EoFVJowfwqIemHWcvWxCUEho/s640/error-3271.png" width="640" height="121" /></a><p>The main reason behind this error message is related to I/O operation that displays a message of nonrecoverable I/O error. Therefore, in this article, we have discussed the all the major causes of occurrence of this error and what all are the possible solution to fix this error.</p><h2>Causes of Microsoft SQL Server Error 3271</h2><p>There are various major causes that are responsible for this error. Therefore, in this section, all the major reasons of occurrence of this error are discussed: </p><ul><li><strong>Lack of Storage Space</strong></li><p>The error occurs mainly because of unavailability of space in the storage media. Therefore, it is impossible to fit backup created on the disk. This error message also has some additional text that determines the storage device memory is full, which leads to this I/O error like:</p><p><strong><i>“A nonrecoverable I/O error occurred on file ‘%ab:’ %ab”</i></strong></p><li><strong>VSS Writer of SQL Server</strong></li><p>The another major reason of the error is an issue with VSS. Volume Shadow Copy Snapshot (VSS) is a replica that is backed up via Window server. Therefore, it can also be possible that an error encountered due to any of the VSS writer that results in failure of the backup operation and further leads to entire backup process failure. Moreover, any error any problem, which is created by VSS writer results an SQL server error 3271.</p><li><strong>SQL Database Corruption</strong></li><p>One of the reasons that cause the error is corruption in the SQL database for which user was trying to create a backup. If the user tries to backup the corrupted SQL database then it is more likely to be possible that an I/O error occurs that further leads to error 3271. </p></ul><p>A user must run a check through the SQL error logs to determine the exact reason of the error. After identifying the exact reason, a correct measure or solution can be used to fix the error message and prevent the SQL database from this error in future. </p><h2>How To Fix SQL Server Error 3271? </h2><p>If the reason of the error message is one of the above mentioned, then a user must follow the measures discussed below:</p><ul><li><strong>Increase Space On Disk</strong></li><ol><li>If the reason of the error is a lack of storage space, then first, a user needs to check the amount of storage space available on the disk on which backup needs to be created.</li><li>If there is no space available, first a user needs to free up some space on the storage disk or can use some external storage to save the created backup.</li></ol><li><strong>Resolve VSS Writer Issue</strong></li><ol><li>If the reason of Microsoft SQL error 3271 is VSS writer then, a user must review the instances by running the SQL instance check because the error is due to problematic SQL instance that prevents from taking a snapshot of the database. </li><li>After identifying the instance, a user needs to stop that instance and run the backup process without that instance. </li><li>If the backup process is completed successfully then it is clear that this particular instance is responsible the error. A user can again check SQL error log to determines the reason behind the inappropriate functionality of that particular instance.</li><li>If the user is not able to identify the instance that causing problem on a server, then one needs to stop all the instances on the server to run the backup process.</li></ol></ul><p><strong>Note:</strong> When you stop all the available instances then, always keep in mind SQL VSS writer is not in use while taking backup.</p><p>With the help of these above mentioned manual procedures, a user is able to avoid and fix the error and run the backup process successfully.</p><h3>Conclusion</h3><p>While taking backup of SQL database, a user faces an I/O error generally known as Microsoft SQL Server error 3271. Therefore, all the causes of this error need to determined first, then depending upon the cause of error a respective measure should be taken to resolve it. Hence, in this post manual solutions to resolve these issues are discussed with respect to the cause of the error that a user can use to overcome this issue. However, if the error message occurs while restoring backup then there may be possibility of backup file corruption. In such situation you can take the help of third party <a href="http://www.backup.repair-sql.net/" target="_blank">SQL backup recovery tool</a> to repair corrupt SQL backup file and fix the error message. </p> Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-3637740476610425777.post-52194622552201940542016-11-17T03:26:00.000-08:002018-09-02T12:59:29.547-07:00Steps to Rename Physical Database Files in SQL Server<p>The users can manually rename the physical files according to choice using the Transact-SQL commands in the following manner:</p><p>Firstly, we will create a database “new_db” using SQL query. Naturally, the physical files will be named as “new_db.mdf”. Our main aim is to rename SQL Server physical files from “new_db.mdf” to “old_db.mdf”. Follow the below mentioned steps to manually rename the files:</p><ol><li>Firstly, run the following command to create a new database with name ”new_db”.</li><code><blockquote>CREATE DATABASE [new_db] <br /> CONTAINMENT = NONE <br /> ON PRIMARY <br />( NAME = 'name', FILENAME = 'C:\Program Files\Microsoft SQL Server\MSSQL.1\MSSQL\DATA\new_db.mdf',SIZE = 5MB , MAXSIZE = UNLIMITED, FILEGROWTH = 10MB )</blockquote></code><p>Thus, a new database is created with physical file “new_db”. The following steps can be used to rename SQL Server physical files name.</p><li>Now, locate the physical location of file on your system using the following command:</li><code><blockquote>USE new_db <br />GO <br />SELECT file_id, name as [logical_file_name], physical_name <br />FROM sys.database_files</blockquote></code><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiNhzDgG0XvFtaJzJZWODQSncdbA6OSXX2mo1k8D15dGGcvbbCcLNwPgEKRB2XDN_iPbCLbyvjWKkTKFSfVE956Kqhz26O7Opmm69GkgkGj3lL18HGrp9YzaJJ-p6_dBRz6TQtPDnuv5PU/s1600/sql1.png" imageanchor="1" ><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiNhzDgG0XvFtaJzJZWODQSncdbA6OSXX2mo1k8D15dGGcvbbCcLNwPgEKRB2XDN_iPbCLbyvjWKkTKFSfVE956Kqhz26O7Opmm69GkgkGj3lL18HGrp9YzaJJ-p6_dBRz6TQtPDnuv5PU/s640/sql1.png" width="640" height="232" /></a><li>Also, the database should be brought to OFFLINE state because the files cannot be renamed in the online mode. Run the following command to bring database to offline state:</li><code><blockquote>USE [master]; <br />GO <br />--Disconnect all existing session. <br />ALTER DATABASE new_db SET SINGLE_USER WITH ROLLBACK IMMEDIATE <br />GO <br />--Change database in to OFFLINE mode. <br />ALTER DATABASE new_db SET OFFLINE</blockquote></code><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjYbjwBz-cKwmMZXc7pXBj_OZS6_VflUUweXhm_JpVpN_ivHvmrBT22tED4gp4y-KS8jNVsMtR-HRx9YSfICkxezaUPlrCI4WX5ZD7ditI1oRNpklEBcgGe7bsG_wjJMruK2OIcUG1-4Qk/s1600/sql2.png" imageanchor="1" ><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjYbjwBz-cKwmMZXc7pXBj_OZS6_VflUUweXhm_JpVpN_ivHvmrBT22tED4gp4y-KS8jNVsMtR-HRx9YSfICkxezaUPlrCI4WX5ZD7ditI1oRNpklEBcgGe7bsG_wjJMruK2OIcUG1-4Qk/s640/sql2.png" width="640" height="231" /></a><li>Since the database is offline now, so browse to the location of the file as found from Step(1). Rename the file to desired name e.g., old_db.mdf.</li><li>Now, update the system catalog for updating the new name of the physical file.</li><code><blockquote>ALTER DATABASE new_db MODIFY FILE (Name='new_db', FILENAME='C:\Program Files\Microsoft SQL Server\MSSQL.1\MSSQL\DATA\old_db.mdf') GO</blockquote></code><p>This updates the physical file name in system catalog file.</p><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEifm3n5JTEGcNzaT8p9XTpMO6QVqcLXrPCY8hybF5ETXpzJFcDLxGosczkGNp6ddasOYZm6aPMj2is9YemxwC8ECr469uTIkzYihSO1ydOkYPS5istJz6FLpHH-iFf1lEQ9vf7XCL8jIpE/s1600/sql3.png" imageanchor="1" ><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEifm3n5JTEGcNzaT8p9XTpMO6QVqcLXrPCY8hybF5ETXpzJFcDLxGosczkGNp6ddasOYZm6aPMj2is9YemxwC8ECr469uTIkzYihSO1ydOkYPS5istJz6FLpHH-iFf1lEQ9vf7XCL8jIpE/s640/sql3.png" width="640" height="217" /></a><li>Run the following command to bring the database in ONLINE mode:</li><code><blockquote>ALTER DATABASE new_db SET ONLINE <br />Go <br />ALTER DATABASE new_db SET MULTI_USER <br />Go</blockquote></code><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgev8MxCVjbwgrxTrt8Tq1bJrdWt_vK-nn43a63-AFxoLuA-FmVT84YsDjt6ltQPYmdIFJFjGnJHnUUjHn-1Wa3AkOGA1bMMUnKZnBvAAMhZdZ7lbu3x0Adeh_KyyrGg4F9RqbeQjFdURQ/s1600/sql4.png" imageanchor="1" ><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgev8MxCVjbwgrxTrt8Tq1bJrdWt_vK-nn43a63-AFxoLuA-FmVT84YsDjt6ltQPYmdIFJFjGnJHnUUjHn-1Wa3AkOGA1bMMUnKZnBvAAMhZdZ7lbu3x0Adeh_KyyrGg4F9RqbeQjFdURQ/s640/sql4.png" width="640" height="232" /></a><p>So, the database physical file name has been renamed to “old_db.mdf” and the database is also in the Online mode. The users can now work normally on the database to perform any operation.</p></ol><h2>Conclusion</h2><p>The user may feel it necessary to rename physical file name in SQL Server due to any reason. However, to avoid confusion between the physical files and database, the users are always advised to rename SQL Server physical database files using T-SQL. All the detailed steps have been mentioned in the above section.</p> Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-3637740476610425777.post-88841627748801399162016-11-15T23:19:00.000-08:002018-09-02T12:59:29.695-07:00Queries regarding Mysql Proceduers <div dir="ltr" style="text-align: left;" trbidi="on"><br />To find out all the procedures of a database:-<br /><br />SHOW PROCEDURE STATUS WHERE Db = 'thirstydb';<br /><br /><br />To set a new definer:-<br />mysql> UPDATE `mysql`.`proc` p SET definer = 'thirstydev@%' WHERE definer='thirstylive@localhost' AND db='devthirstydb';<br />Query OK, 0 rows affected (0.02 sec)<br />Rows matched: 0 Changed: 0 Warnings: 0<br /><br />mysql> UPDATE `mysql`.`proc` p SET definer = 'thirstydev@%' WHERE definer='thirstylive@%' AND db='devthirstydb';<br />Query OK, 85 rows affected (0.04 sec)<br />Rows matched: 85 Changed: 85 Warnings: 0<br /><br />To select all the procdure of a particular db:-<br />select name FROM mysql.proc WHERE db = 'devthirstydb' AND type = 'PROCEDURE';<br /><br />select name FROM mysql.proc WHERE db = 'devthirstydb' AND type = 'FUNCTION';<br /><br /><br />To delete all the procdure of a particular db:-<br />DELETE FROM mysql.proc WHERE db = 'devthirstydb' AND type = 'PROCEDURE';<br /><br />DELETE FROM mysql.proc WHERE db = 'devthirstydb' AND type = 'FUNCTION';<br /><br /><br /><br /><br />Mysql procedures:-<br /><br />To find out all the procedures:-<br /><br />mysql> show procedure status;<br />+--------------+---------------------------------------+-----------+---------------+---------------------+---------------------+---------------+---------+----------------------+----------------------+--------------------+<br />| Db | Name | Type | Definer | Modified | Created | Security_type | Comment | character_set_client | collation_connection | Database Collation |<br />+--------------+---------------------------------------+-----------+---------------+---------------------+---------------------+---------------+---------+----------------------+----------------------+--------------------+<br />| thirstydb | advanced_vendor_filtering | PROCEDURE | thirstylive@% | 2016-08-12 05:13:27 | 2016-08-12 05:13:27 | DEFINER | | utf8 | utf8_general_ci | latin1_swedish_ci |<br />| thirstydb | advanced_vendor_filtering_my_bookings | PROCEDURE | thirstylive@% | 2016-08-12 05:22:29 | 2016-08-12 05:22:29 | DEFINER | | utf8 | utf8_general_ci | latin1_swedish_ci |<br />| thirstydb | advanced_vendor_filtering_temp | PROCEDURE | thirstylive@% | 2016-08-08 08:29:11 | 2016-08-08 08:29:11 | DEFINER | | utf8 | utf8_general_ci | latin1_swedish_ci |<br />| thirstydb | all_food_categories | PROCEDURE | thirstylive@% | 2016-08-08 08:29:20 | 2016-08-08 08:29:20 | DEFINER | | utf8 | utf8_general_ci | latin1_swedish_ci |<br />| thirstydb | apikeyValidity | PROCEDURE | thirstylive@% | 2016-08-08 08:29:29 | 2016-08-08 08:29:29 | DEFINER | | utf8 | utf8_general_ci | latin1_swedish_ci |<br />| thirstydb | apikeyValidity_vendor | PROCEDURE | thirstylive@% | 2016-08-08 08:29:41 | 2016-08-08 08:29:41 | DEFINER | | utf8 | utf8_general_ci | latin1_swedish_ci |<br />| thirstydb | directory | PROCEDURE | thirstylive@% | 2016-08-19 03:00:51 | 2016-08-19 03:00:51 | DEFINER | | utf8 <br /><br /><br />To find out a procedure by a certain definer name and dbname:-<br />mysq> use mysql<br />mysql> select name from proc where definer = 'thirstydev@%' AND db='devthirstydb';<br /><br />+---------------------------------------+<br />| name |<br />+---------------------------------------+<br />| advanced_vendor_filtering |<br />| advanced_vendor_filtering_my_bookings |<br />| advanced_vendor_filtering_temp |<br />| all_food_categories |<br />| apikeyValidity |<br />| apikeyValidity_vendor |<br />| base_url |<br />| directory |<br />| facebook_login <br /><br /><br />To call a procedure:-<br />mysql> call search_result(1);<br />Empty set (0.02 sec)<br /><br />Query OK, 0 rows affected (0.02 sec)<br /><br /><br />To view a procedure:-<br /><br />mysql> show create procedure user_login;<br />+------------+----------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+----------------------+----------------------+--------------------+<br />| Procedure | sql_mode | Create Procedure | character_set_client | collation_connection | Database Collation |<br />+------------+----------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+----------------------+----------------------+--------------------+<br />| user_login | | CREATE DEFINER=`thirstylive`@`%` PROCEDURE `user_login`(email_in VARCHAR(255), password_in VARCHAR(255),<br />api_key_in VARCHAR(50), base_url_in TEXT)<br />BEGIN<br /><br /> DECLARE email_verified_declared INT(2);<br /> DECLARE user_id_declared BIGINT;<br /><br /> SELECT email_verified INTO email_verified_declared FROM user_profile WHERE email = email_in AND `password` = password_in;<br /> SELECT user_id INTO user_id_declared FROM user_profile WHERE email = email_in AND `password` = password_in;<br /><br /> IF email_verified_declared = 0 THEN<br /><br /> SELECT 'unverified_email' AS col_name;<br /><br /> ELSEIF user_id_declared IS NULL THEN<br /><br /> SELECT 'invalid_credentials' AS col_name;<br /><br /> ELSE<br /><br /> UPDATE user_profile SET api_key = api_key_in WHERE user_id = user_id_declared;<br /> CALL user_profile(user_id_declared, base_url_in);<br /><br /> END IF;<br /><br /><br />END | utf8 | utf8_general_ci | latin1_swedish_ci |<br />+------------+----------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+----------------------+-------------------<br /><div><br /></div></div>Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-3637740476610425777.post-3114426637755636482016-11-07T19:26:00.000-08:002018-09-02T12:59:29.848-07:00How to find out highest table size in sql server 2014 ?<div dir="ltr" style="text-align: left;" trbidi="on">SELECT<br /> t.NAME AS TableName,<br /> i.name as indexName,<br /> sum(p.rows) as RowCounts,<br /> sum(a.total_pages) as TotalPages,<br /> sum(a.used_pages) as UsedPages,<br /> sum(a.data_pages) as DataPages,<br /> (sum(a.total_pages) * 8) / 1024 as TotalSpaceMB,<br /> (sum(a.used_pages) * 8) / 1024 as UsedSpaceMB,<br /> (sum(a.data_pages) * 8) / 1024 as DataSpaceMB<br />FROM<br /> sys.tables t<br />INNER JOIN <br /> sys.indexes i ON t.OBJECT_ID = i.object_id<br />INNER JOIN<br /> sys.partitions p ON i.object_id = p.OBJECT_ID AND i.index_id = p.index_id<br />INNER JOIN<br /> sys.allocation_units a ON p.partition_id = a.container_id<br />WHERE<br /> t.NAME NOT LIKE 'dt%' AND<br /> i.OBJECT_ID > 255 AND <br /> i.index_id <= 1<br />GROUP BY<br /> t.NAME, i.object_id, i.index_id, i.name<br />ORDER BY<br /> TotalSpaceMB desc</div>Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-3637740476610425777.post-82266219187885972992016-09-28T01:52:00.000-07:002018-09-02T12:59:29.999-07:00Mysql error-log monitoring using Shell script with mail alert<div dir="ltr" style="text-align: left;" trbidi="on">#!/bin/bash<br />SERNAME=xyz.kmi.com<br />SERPUBIP=192.168.72.50<br />SERVER=`hostname`<br />WEEKDAY=`date '+%w%H%M'`<br />DATE_VAR=`date '+%Y_%m_%d'`<br /><br />Error_log_loc=/var/log<br />egrep 'Error' $Error_log_loc/mysqld.log |sort -u > $Error_log_loc/mysqld_ALERTLOG.txt<br />cat $Error_log_loc/mysqld.log >> $Error_log_loc/mysqld_archived.log<br /><br />cat /dev/null > $Error_log_loc/mysqld.log<br /><br />if [ -s "$Error_log_loc/mysqld.log" ] ; then<br />cat $Error_log_loc/mysqld_ALERTLOG.txt | mail -s "URGENT -ERROR in Oracle Alert Log File for $SERNAME ($SERPUBIP) at `date` " ssdas@gmail.com<br />fi<br /><br /># Weekly alert log datestamp and compress (Sunday 00:15)<br /><br />sysdate=`date | awk '{ print $3}'`<br />if [[ $sysdate -eq 4 || $sysdate -eq 11 || $sysdate -eq 18 || $sysdate -eq 25 ]] ; then<br />mv $Error_log_loc/mysqld_archived.log $Error_log_loc/mysqld_archived_ALERTLOG_${DATE_VAR}.log<br />gzip $Error_log_loc/mysqld_archived_ALERTLOG_${DATE_VAR}.log<br />fi<br />exit 0</div>Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-3637740476610425777.post-34313296674072727762016-09-16T23:04:00.000-07:002018-09-02T12:59:30.147-07:00Batch script to take database users backup in sql server<div dir="ltr" style="text-align: left;" trbidi="on">SQL Server Version:- SQL 2014<br /><br />Create a batch file which will be scheduled on task scheduler.<br /><br />set backuplogfilename=%date:~-7,2%-%date:~-10,2%-%date:~-4,4%-0%time:~1,1%%time:~3,2%%time:~6,2%<br />SQLCMD.EXE -S localhost -U sa -P "sa@123" -i "E:\users.sql" >> "E:\users_%backuplogfilename%.log"<br />-- save and exit<br /><br />Now schedule the above .bat file in task scheduler<br /><br /><br />Create a sql file lets say users.sql<br />Content of users.sql<br /><br />USE master<br />GO<br />IF OBJECT_ID ('sp_hexadecimal') IS NOT NULL<br /> DROP PROCEDURE sp_hexadecimal<br />GO<br />CREATE PROCEDURE sp_hexadecimal<br /> @binvalue varbinary(256),<br /> @hexvalue varchar (514) OUTPUT<br />AS<br />DECLARE @charvalue varchar (514)<br />DECLARE @i int<br />DECLARE @length int<br />DECLARE @hexstring char(16)<br />SELECT @charvalue = '0x'<br />SELECT @i = 1<br />SELECT @length = DATALENGTH (@binvalue)<br />SELECT @hexstring = '0123456789ABCDEF'<br />WHILE (@i <= @length)<br />BEGIN<br /> DECLARE @tempint int<br /> DECLARE @firstint int<br /> DECLARE @secondint int<br /> SELECT @tempint = CONVERT(int, SUBSTRING(@binvalue,@i,1))<br /> SELECT @firstint = FLOOR(@tempint/16)<br /> SELECT @secondint = @tempint - (@firstint*16)<br /> SELECT @charvalue = @charvalue +<br /> SUBSTRING(@hexstring, @firstint+1, 1) +<br /> SUBSTRING(@hexstring, @secondint+1, 1)<br /> SELECT @i = @i + 1<br />END<br /><br />SELECT @hexvalue = @charvalue<br />GO<br /><br />IF OBJECT_ID ('sp_help_revlogin') IS NOT NULL<br /> DROP PROCEDURE sp_help_revlogin<br />GO<br />CREATE PROCEDURE sp_help_revlogin @login_name sysname = NULL AS<br />DECLARE @name sysname<br />DECLARE @type varchar (1)<br />DECLARE @hasaccess int<br />DECLARE @denylogin int<br />DECLARE @is_disabled int<br />DECLARE @PWD_varbinary varbinary (256)<br />DECLARE @PWD_string varchar (514)<br />DECLARE @SID_varbinary varbinary (85)<br />DECLARE @SID_string varchar (514)<br />DECLARE @tmpstr varchar (1024)<br />DECLARE @is_policy_checked varchar (3)<br />DECLARE @is_expiration_checked varchar (3)<br /><br />DECLARE @defaultdb sysname<br /><br />IF (@login_name IS NULL)<br /> DECLARE login_curs CURSOR FOR<br /><br /> SELECT p.sid, p.name, p.type, p.is_disabled, p.default_database_name, l.hasaccess, l.denylogin FROM<br />sys.server_principals p LEFT JOIN sys.syslogins l<br /> ON ( l.name = p.name ) WHERE p.type IN ( 'S', 'G', 'U' ) AND p.name <> 'sa'<br />ELSE<br /> DECLARE login_curs CURSOR FOR<br /><br /><br /> SELECT p.sid, p.name, p.type, p.is_disabled, p.default_database_name, l.hasaccess, l.denylogin FROM<br />sys.server_principals p LEFT JOIN sys.syslogins l<br /> ON ( l.name = p.name ) WHERE p.type IN ( 'S', 'G', 'U' ) AND p.name = @login_name<br />OPEN login_curs<br /><br />FETCH NEXT FROM login_curs INTO @SID_varbinary, @name, @type, @is_disabled, @defaultdb, @hasaccess, @denylogin<br />IF (@@fetch_status = -1)<br />BEGIN<br /> PRINT 'No login(s) found.'<br /> CLOSE login_curs<br /> DEALLOCATE login_curs<br /> RETURN -1<br />END<br />SET @tmpstr = '/* sp_help_revlogin script '<br />PRINT @tmpstr<br />SET @tmpstr = '** Generated ' + CONVERT (varchar, GETDATE()) + ' on ' + @@SERVERNAME + ' */'<br />PRINT @tmpstr<br />PRINT ''<br />WHILE (@@fetch_status <> -1)<br />BEGIN<br /> IF (@@fetch_status <> -2)<br /> BEGIN<br /> PRINT ''<br /> SET @tmpstr = '-- Login: ' + @name<br /> PRINT @tmpstr<br /> IF (@type IN ( 'G', 'U'))<br /> BEGIN -- NT authenticated account/group<br /><br /> SET @tmpstr = 'CREATE LOGIN ' + QUOTENAME( @name ) + ' FROM WINDOWS WITH DEFAULT_DATABASE = [' + @defaultdb + ']'<br /> END<br /> ELSE BEGIN -- SQL Server authentication<br /> -- obtain password and sid<br /> SET @PWD_varbinary = CAST( LOGINPROPERTY( @name, 'PasswordHash' ) AS varbinary (256) )<br /> EXEC sp_hexadecimal @PWD_varbinary, @PWD_string OUT<br /> EXEC sp_hexadecimal @SID_varbinary,@SID_string OUT<br /><br /> -- obtain password policy state<br /> SELECT @is_policy_checked = CASE is_policy_checked WHEN 1 THEN 'ON' WHEN 0 THEN 'OFF' ELSE NULL END FROM sys.sql_logins WHERE name = @name<br /> SELECT @is_expiration_checked = CASE is_expiration_checked WHEN 1 THEN 'ON' WHEN 0 THEN 'OFF' ELSE NULL END FROM sys.sql_logins WHERE name = @name<br /><br /> SET @tmpstr = 'CREATE LOGIN ' + QUOTENAME( @name ) + ' WITH PASSWORD = ' + @PWD_string + ' HASHED, SID = ' + @SID_string + ', DEFAULT_DATABASE = [' + @defaultdb + ']'<br /><br /> IF ( @is_policy_checked IS NOT NULL )<br /> BEGIN<br /> SET @tmpstr = @tmpstr + ', CHECK_POLICY = ' + @is_policy_checked<br /> END<br /> IF ( @is_expiration_checked IS NOT NULL )<br /> BEGIN<br /> SET @tmpstr = @tmpstr + ', CHECK_EXPIRATION = ' + @is_expiration_checked<br /> END<br /> END<br /> IF (@denylogin = 1)<br /> BEGIN -- login is denied access<br /> SET @tmpstr = @tmpstr + '; DENY CONNECT SQL TO ' + QUOTENAME( @name )<br /> END<br /> ELSE IF (@hasaccess = 0)<br /> BEGIN -- login exists but does not have access<br /> SET @tmpstr = @tmpstr + '; REVOKE CONNECT SQL TO ' + QUOTENAME( @name )<br /> END<br /> IF (@is_disabled = 1)<br /> BEGIN -- login is disabled<br /> SET @tmpstr = @tmpstr + '; ALTER LOGIN ' + QUOTENAME( @name ) + ' DISABLE'<br /> END<br /> PRINT @tmpstr<br /> END<br /><br /> FETCH NEXT FROM login_curs INTO @SID_varbinary, @name, @type, @is_disabled, @defaultdb, @hasaccess, @denylogin<br /> END<br />CLOSE login_curs<br />DEALLOCATE login_curs<br />RETURN 0<br />GO<br /><br />exec dbo.sp_help_revlogin<br />go<br /><div><br /></div></div>Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-3637740476610425777.post-86857905919672453202016-08-12T03:27:00.000-07:002018-09-02T12:59:30.454-07:00Monitoring percona Error-log using shell script<div dir="ltr" style="text-align: left;" trbidi="on">vi /backups/alertlog_monotor.sh<br /><br /><br />#!/bin/bash<br />SERNAME=srv1.xyz.com<br />SERPUBIP=192.168.72.50<br />SERVER=`hostname` #### Sets the server name for the email<br />WEEKDAY=`date '+%w%H%M'` #### Sets the number value of the day of the week<br />DATE_VAR=`date '+%Y_%m_%d'`<br /><br />Error_log_loc=/data/mysql<br />egrep 'Error' $Error_log_loc/$SERNAME.err |sort -u > $Error_log_loc/$SERNAME_ALERTLOG.txt <br />cat $Error_log_loc/$SERNAME.err >> $Error_log_loc/$SERNAME_Archived_ALERTLOG.txt<br /><span class="Apple-tab-span" style="white-space: pre;"> </span><br />cat /dev/null > $Error_log_loc/$SERNAME.err<br /><br />if [ -s "$Error_log_loc/$SERNAME_ALERTLOG.txt" ] ; then<br />cat $Error_log_loc/$SERNAME_ALERTLOG.txt | mail -s "URGENT -ERROR in Alert Log File for $SERNAME ($SERPUBIP) at `date` " ssdas@24x7-itsupport.com<br />fi<br /><br /># Weekly alert log datestamp and compress (Sunday 00:15)<br /><br />if [[ $WEEKDAY -eq 00015 ]]; then<br /> mv $Error_log_loc/$SERNAME_Archived_ALERTLOG.txt $Error_log_loc/$SERNAME_Archived_ALERTLOG_${DATE_VAR}.log<br /> gzip $Error_log_loc/$SERNAME_Archived_ALERTLOG_${DATE_VAR}.log<br />fi<br /><br />exit 0<br /><br />:wq (save & exit)<br /><br />Now Schedule the above script in crontab for every 15mins.<br /><br />crontab -l<br /><br />*/15 * * * * /backups/alertlog_monotor.sh</div>Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-3637740476610425777.post-45525080160731204232016-08-08T04:51:00.000-07:002018-09-02T12:59:30.602-07:00Oracle Alert log monitoring using shell script<div dir="ltr" style="text-align: left;" trbidi="on">Vi /backups/alertlog_monotor.sh<br /><br />#!/bin/bash<br />export ORACLE_SID=kmioradb<br />export ORAENV_ASK=NO<br />. /home/oracle/.bash_profile<br />SERNAME=oradb.kminfosystems.com<br />SERPUBIP=192.168.72.50<br />SERVER=`hostname` #### Sets the server name for the email<br />WEEKDAY=`date '+%w%H%M'` #### Sets the number value of the day of the week<br />DATE_VAR=`date '+%Y_%m_%d'`<br /><br />Alert_log_loc=/u01/app/oracle/diag/rdbms/kmioradb/kmioradb/trace/<br /># Check for the existence of ORA- in the alert log and email/page on error<br />egrep 'ORA-|error|TNS' $Alert_log_loc/alert_$ORACLE_SID.log |sort -u > $Alert_log_loc/$ORACLE_SID_OUT_ALERTLOG.txt #### Output file with ORA- errors<br />cat $Alert_log_loc/alert_$ORACLE_SID.log >> $Alert_log_loc/archived_alert_$ORACLE_SID.log<br />cat /dev/null > $Alert_log_loc/alert_$ORACLE_SID.log<br /><br />if [ -s "$Alert_log_loc/$ORACLE_SID_OUT_ALERTLOG.txt" ] ; then<br />cat $Alert_log_loc/$ORACLE_SID_OUT_ALERTLOG.txt | mail -s "URGENT -ERROR in Oracle Alert Log File for $SERNAME ($SERPUBIP) at `date` " soumya@gmail.com<br />fi<br /><br /># Weekly alert log datestamp and compress (Sunday 00:15)<br /><br />if [[ $WEEKDAY -eq 00015 ]]; then<br /> mv $Alert_log_loc/archived_alert_${ORACLE_SID}.log $Alert_log_loc/archived_alert_${ORACLE_SID}_${DATE_VAR}.log<br /> gzip $Alert_log_loc/archived_alert_${ORACLE_SID}_${DATE_VAR}.log<br />fi<br /><br />exit 0<br /><br />:wq (save & exit)<br /><br /><br />Now Schedule the above script in crontab for every 15mins.<br /><br />crontab -l<br /><br />*/15 * * * * /backups/alertlog_monotor.sh</div>Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-3637740476610425777.post-2473844360859994892016-08-05T00:32:00.000-07:002018-09-02T12:59:30.762-07:00How to migrate mysql users from one server to another?<div dir="ltr" style="text-align: left;" trbidi="on">Step 1: Get a List of MySQL Users from the source server<br /><br />[root@db01 tmp]# mysql -B -N -uroot -p -e "SELECT CONCAT('\'', user,'\'@\'', host, '\'') FROM user WHERE user != 'debian-sys-maint' AND user != 'root' AND user != ''" mysql > /tmp/mysql_all_users.txt<br />Enter password: redhat<br />[root@db01 tmp]# cat /tmp/mysql_all_users.txt<br />'CitLivehappy'@'%'<br />'brightonlands'@'%'<br />'brochure'@'%'<br />'carver'@'%'<br />'CitLivehappy'@'localhost'<br />'brightonlands'@'localhost'<br />'brochure'@'localhost'<br />'carver'@'localhost'<br /><br /><br />Step 2:- Obtain a List of User Privileges<br /><br />Fire the next command in the terminal to get the privileges:<br />[root@db01 tmp]# cd /tmp/<br />[root@db01 tmp]# while read line; do mysql -B -N -uroot -predhat -e "SHOW GRANTS FOR $line"; done < mysql_all_users.txt > mysql_all_users_sql.sql<br /><br />Basically, the above command reads every individual line in mysql_all_users.txt and tries to get privileges for each user and paste it on mysql_all_users_sql.sql file.<br />This file will contain the SQL queries to obtain users along with their privileges.<br /><br />[root@db01 tmp]# cat mysql_all_users_sql.sql<br />GRANT USAGE ON *.* TO 'CitLivehappy'@'%' IDENTIFIED BY PASSWORD '*1983DE33EA67561F7C46D591CC6F15FD7BF1E'<br />GRANT ALL PRIVILEGES ON `Cit-Live-bewealthynhappy`.* TO 'CitLivehappy'@'%'<br />GRANT ALL PRIVILEGES ON `cit_cvbflive`.* TO 'CitLivehappy'@'%'<br />GRANT USAGE ON *.* TO 'brightonlands'@'%' IDENTIFIED BY PASSWORD '*69DA4F2138FA03F66C29ACDCD7FED678FA'<br />GRANT ALL PRIVILEGES ON `Cit-Live-brightonlandscaping`.* TO 'brightonlands'@'%'<br />GRANT USAGE ON *.* TO 'brochure'@'%' IDENTIFIED BY PASSWORD '*EABF42F3B310313FD230662388030CA895BEB'<br />GRANT ALL PRIVILEGES ON `Cit-Sub-e-brochure`.* TO 'brochure'@'%'<br />GRANT USAGE ON *.* TO 'carver'@'%' IDENTIFIED BY PASSWORD '*682687FC5D596EB5B7CF4002EDC1ADBE3'<br />GRANT ALL PRIVILEGES ON `Cit-Live-carverwelding-blog`.* TO 'carver'@'%'<br />GRANT ALL PRIVILEGES ON `Cit-Live-carverwelding`.* TO 'carver'@'%'<br />GRANT ALL PRIVILEGES ON `Cit-Live-carverengindia-blog`.* TO 'carver'@'%'<br />GRANT ALL PRIVILEGES ON `Cit-Live-carverengindia`.* TO 'carver'@'%'<br /><br />We can see from mysql_all_users_sql.sql that all the users information along with the privileges and the script is almost ready.<br />Only thing the above script missing is a ";" at the end of every sql command.<br /><br />We will add ";" at the end of each sql command<br />[root@db01 tmp]# sed -i 's/$/;/' mysql_all_users_sql.sql<br /><br />[root@db01 tmp]# cat mysql_all_users_sql.sql<br />GRANT USAGE ON *.* TO 'CitLivehappy'@'%' IDENTIFIED BY PASSWORD '*1983DE33EA6756C9BE6591CC6F15FD7BF1E';<br />GRANT ALL PRIVILEGES ON `Cit-Live-bewealthynhappy`.* TO 'CitLivehappy'@'%';<br />GRANT ALL PRIVILEGES ON `cit_cvbflive`.* TO 'CitLivehappy'@'%';<br />GRANT USAGE ON *.* TO 'brightonlands'@'%' IDENTIFIED BY PASSWORD '*69DA4F2138FA03F66C29ACDCD6E99678FA';<br />GRANT ALL PRIVILEGES ON `Cit-Live-brightonlandscaping`.* TO 'brightonlands'@'%';<br />GRANT USAGE ON *.* TO 'brochure'@'%' IDENTIFIED BY PASSWORD '*EABF42F3B310313FD23CA750C895BEB';<br />GRANT ALL PRIVILEGES ON `Cit-Sub-e-brochure`.* TO 'brochure'@'%';<br />GRANT USAGE ON *.* TO 'carver'@'%' IDENTIFIED BY PASSWORD '*682687FC5D596EB5B7CF4002EDC1BBE3';<br />GRANT ALL PRIVILEGES ON `Cit-Live-carverwelding-blog`.* TO 'carver'@'%';<br />GRANT ALL PRIVILEGES ON `Cit-Live-carverwelding`.* TO 'carver'@'%';<br />GRANT ALL PRIVILEGES ON `Cit-Live-carverengindia-blog`.* TO 'carver'@'%';<br />GRANT ALL PRIVILEGES ON `Cit-Live-carverengindia`.* TO 'carver'@'%';<br /><br />Now add "flush privileges" to reload the grant tables.<br />[root@server1 tmp]# echo "flush privileges;" >> mysql_all_users_sql.sql<br /><br />Step 3: Now lets import the sql file into new server.<br /><br />Transfer this sql file into destination(new) server and fire up the below command.<br /><br />[root@db02 tmp]# mysql -u root -ppassword < mysql_all_users_sql.sql<br /><br /><br /></div>Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-3637740476610425777.post-22097413543874924192016-07-29T23:05:00.000-07:002018-09-02T12:59:30.914-07:00How to Install MongoDB on Ubuntu 14.04 ?<div dir="ltr" style="text-align: left;" trbidi="on">How to Install MongoDB on Ubuntu 14.04?<br /><br />Step #1: Setup a the Package Database<br />First we’ll import the MongoDB public key used by the package management system:<br /><br /># sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv 7F0CEB10<br /><br />Then we’ll create a list file for MongoDB:<br /><br /># echo 'deb http://downloads-distro.mongodb.org/repo/ubuntu-upstart dist 10gen' | sudo tee /etc/apt/sources.list.d/mongodb.list<br /><br />Now reload the package database:<br /><br /># sudo apt-get update<br /><br />Step #2: Install Latest Stable Version MongoDB<br />At this point, installing MongoDB is as simple as running just one command:<br /><br />sudo apt-get install -y mongodb-org<br /><br />If you’d like MongoDB to auto-update with apt-get than you’re done with the installation. But, it’s possible to ‘pin’ the version of MongoDB you just installed to prevent apt-get from auto-updating.<br /><br />Step #3: Get MongoDB Running<br /><br />Start-Up MongoDB:-<br /># sudo service mongod start<br /><br />Check MongoDB Service Status<br />#sudo service mongod status<br /><br />Summary List of Status Statistics (Continuous)<br /><br />#mongostat<br /><br />Summary List of Status Statistics (5 Rows, Summarized Every 2 Seconds)<br /><br />#mongostat --rowcount 5 2<br /><br />Enter the MongoDB Command Line<br /><br />#mongo<br /><br />Step 4:-<br />Now we can configure and basic setting in Mongodb Database Server<br /># vi /etc/mongod.conf<br />logappend=true<br />logpath=logpath=/var/log/mongodb/mongod.log<br />port=27017<br />dbpath=/var/lib/mongo<br />smallfiles = true<br />bind_ip = 127.0.0.1,159.203.180.48 [To change and open a certain ip's access for mongodb ]<br />:wq</div>Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-3637740476610425777.post-58627949136041069962016-07-25T21:17:00.000-07:002018-09-02T12:59:31.063-07:00Register a Connected Server using 2012 SQL Server Management Studio<div dir="ltr" style="text-align: left;" trbidi="on">Register a Connected Server using 2012 SQL Server Management Studio :-<br /><br />By registering the server, you can save the connection information for servers that we access frequently. A server can be registered before connecting, or at the time of connection<br />from Object Explorer.<br /><br /><br />To register a connected server:-<br />Open up sql server management studio 2012.<br />In Object Explorer, right-click a server to which you already are connected, and then click Register.<br /><br />* Server name<br />Enter the name you want to use for the registered server. Registering a local or remote server using SQL Server Management Studio lets you store the server connection information<br />for future connections. This field defaults to the server name entered when you were connecting to the server. You can retain this server name or enter another easy-to-use<br />name for the server.<br /><br />* Authentication<br />There are two type of authentication available .<br />a.Windows authentication<br />b.Sql server authentication<br /><br />Choose anyone of above for the authentication method.<br /><br />* Server description<br />Enter an optional description of the server. The maximum number of characters allowed is 250.<br /><br />* Save<br />Click to save the information you have entered and create a registered server.<br /><br /><br /><br /><br /><br /></div>Unknownnoreply@blogger.com0