Please see my other blog for Oracle EBusiness Suite Posts - EBMentors

Search This Blog

Note: All the posts are based on practical approach avoiding lengthy theory. All have been tested on some development servers. Please don’t test any post on production servers until you are sure.

Monday, November 29, 2010

Using ASMCMD Utility

After creating you will want to manage your asm disksgroups , the task can be done with the help of sql connecting through ASM instance, but it will be good to know about the asmcmd utility also to do the asm managment.

Step1: set ORACLE_HOME on prompt
C:\Documents and Settings\inam>set ORACLE_HOME=D:\oracle\product\10.2.0\db_1

Step 2: set ORACLE_SID
C:\Documents and Settings\inam>set ORACLE_SID=+ASM

Step 3: Run the utility and use some commands
C:\Documents and Settings\inam>asmcmd
ASMCMD>
ASMCMD> pwd
+DB_DATA
ASMCMD> ls
ASMDB/
ASMCMD> pwd
+DB_DATA
ASMCMD> cd asmdb
ASMCMD> pwd
+DB_DATA/asmdb
ASMCMD> ls
CONTROLFILE/
DATAFILE/
ONLINELOG/
TEMPFILE/
ASMCMD> cd datafile
ASMCMD> pwd
+DB_DATA/asmdb/datafile
ASMCMD> ls
SYSAUX.261.733408851
SYSTEM.259.733408841
UNDOTBS1.260.733408851

Copying files from ASM to file system (11g)
ASMCMD> ls -lt
State    Type    Rebal  Name
MOUNTED  EXTERN  N      DBDATA/
MOUNTED  EXTERN  N      DBFLASH/
ASMCMD> pwd
+dbdata/dbrac/datafile
ASMCMD> ls -lt
Type      Redund  Striped  Time             Sys  Name
                                            N    db_ts04.dbf => +DBDATA/DBRAC/DATAFILE/DB.272.766401017
                                            N    db_ts03.dbf => +DBDATA/DBRAC/DATAFILE/DB.271.766400995
                                            N    db_ts02.dbf => +DBDATA/DBRAC/DATAFILE/DB.270.766400973
                                            N    db_ts01.dbf => +DBDATA/DBRAC/DATAFILE/DB.269.766400951
DATAFILE  UNPROT  COARSE   APR 07 13:00:00  Y    USERS.259.766393285
DATAFILE  UNPROT  COARSE   APR 07 13:00:00  Y    UNDOTBS2.265.766393499
DATAFILE  UNPROT  COARSE   APR 07 13:00:00  Y    UNDOTBS1.280.767361619
DATAFILE  UNPROT  COARSE   APR 07 13:00:00  Y    UNDOTBS1.258.766393285
DATAFILE  UNPROT  COARSE   APR 07 13:00:00  Y    SYSTEM.256.766393283
DATAFILE  UNPROT  COARSE   APR 07 13:00:00  Y    SYSAUX.257.766393285
DATAFILE  UNPROT  COARSE   APR 07 13:00:00  Y    DB.272.766401017
DATAFILE  UNPROT  COARSE   APR 07 13:00:00  Y    DB.271.766400995
DATAFILE  UNPROT  COARSE   APR 07 13:00:00  Y    DB.270.766400973
DATAFILE  UNPROT  COARSE   APR 07 13:00:00  Y    DB.269.766400951
                                            N    test_netbkup.dbf => +DBDATA/DBRAC/DATAFILE/TESTT_NETBKUP.279.76640125
3
                                            N    recop1.dbf => +DBDATA/DBRAC/DATAFILE/RECOP1.278.766401249
                                            N    dblog02.dbf => +DBDATA/DBRAC/DATAFILE/DBLOG.274.766632369
                                            N    dblog01.dbf => +DBDATA/DBRAC/DATAFILE/DBLOG.275.766632361
                                            N    examcont01.dbf => +DBDATA/DBRAC/DATAFILE/EXAMCONT.276.766401211
                                            N    exam1425_01.dbf => +DBDATA/DBRAC/DATAFILE/EXAM14251426.277.766401221
DATAFILE  UNPROT  COARSE   APR 07 12:00:00  Y    UNDOTBS2.281.767362637
DATAFILE  UNPROT  COARSE   APR 07 12:00:00  Y    TESTT_NETBKUP.279.766401253
DATAFILE  UNPROT  COARSE   APR 07 12:00:00  Y    RECOP1.278.766401249
DATAFILE  UNPROT  COARSE   APR 07 12:00:00  Y    DBLOG.275.766632361
DATAFILE  UNPROT  COARSE   APR 07 12:00:00  Y    DBLOG.274.766632369
DATAFILE  UNPROT  COARSE   APR 07 12:00:00  Y    DB.273.766401039
DATAFILE  UNPROT  COARSE   APR 07 12:00:00  Y    EXAMPLE.264.766393395
DATAFILE  UNPROT  COARSE   APR 07 12:00:00  Y    EXAMCONT.276.766401211
DATAFILE  UNPROT  COARSE   APR 07 12:00:00  Y    EXAM14251426.277.766401221
ASMCMD>
ASMCMD> cp test_netbkup.dbf d:\temp
copying +dbdata/dbrac/datafile/test_netbkup.dbf -> d:\temp/test_netbkup.dbf



lsct: Lists information about current Oracle ASM clients from the V$ASM_CLIENT view.
ASMCMD> lsct
ASMCMD> lsct
DB_Name  Status     Software_Version  Compatible_version  Instance_Name  Disk_Group
+ASM     CONNECTED        11.2.0.3.0          11.2.0.3.0  +asm1          DBDATA
+ASM     CONNECTED        11.2.0.3.0          11.2.0.3.0  +asm1          DBFLASH
TESTDB   CONNECTED        11.2.0.3.0          11.2.0.0.0  homedb         DBDATA

du: Total space in MB used by files – particular directory can also be specified
ASMCMD> du
Used_MB      Mirror_used_MB
  63576               63576
 
find: we can use the wildcard or can specify a particular file type by using 
the ‘–type’ clause
ASMCMD> find --type ONLINELOG +DATA *
ASMCMD> find +DATA example*

iostat: Uses the V$ASM_DISK_IOSTAT view to display I/O statistics of disks in mounted ASM disk groups
ASMCMD> iostat -G DATA

lsdg: Uses V$ASM_DISKGROUP_STAT view to list information about a particular disk group
ASMCMD> lsdg DATA

lsattr: List attributes of a disk group
ASMCMD> lsattr -l -G DATA

Use the setattr command to change an attribute
ASMCMD> setattr -G data compatible.rdbms 11.2.0.0.0
ASMCMD> lsattr -l -G DATA


 

Create database (10gR2) manually on Windows based on ASM instance

Step 1: set ORACLE_SID on dos prompt
C:\Documents and Settings\inam>set ORACLE_SID=ASMDB

Step 2: Create parameter for the database instance to be created
D:\ASMTEST\ASMDB\pfile\initASMDB.ora
control_files = +DB_DATA
undo_management = AUTO
db_name = ASMDB
db_block_size = 8192
sga_max_size = 1073741824
sga_target = 1073741824
db_create_file_dest = +DB_DATA
db_create_online_log_dest_1 = +DB_DATA

Step 3: Create a password file
C:\Documents and Settings\inam>orapwd file=D:\ASMTEST\ASMDB\pwdASMDB.ora password=oracle entries=5

Step 4: create/Start the instance
C:\Documents and Settings\inam>oradim -new -sid ASMDB -syspwd asmdb123 -pfile D:\ASMTEST\ASMDB\pfile\initASMDB.ora -startmode a
Instance created.


C:\Documents and Settings\inam>sqlplus / as sysdba

SQL*Plus: Release 10.2.0.1.0 - Production on Tue Oct 26 12:37:05 2010

Copyright (c) 1982, 2005, Oracle.  All rights reserved.

Connected to:
Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - Production
With the Partitioning, OLAP and Data Mining options

 SQL> shutdown immediate
 SQL> startup nomount pfile=D:\ASMTEST\ASMDB\pfile\initASMDB.ora
ORACLE instance started.

Total System Global Area 1073741824 bytes
Fixed Size                  1253124 bytes
Variable Size             264241404 bytes
Database Buffers          801112064 bytes
Redo Buffers                7135232 bytes
SQL>


Step 5: Create the database

SQL> create database ASMDB
  2  character set WE8ISO8859P1
  3  national character set utf8
  4  undo tablespace undotbs1
  5  default temporary tablespace temp;

Database created.

Step 6: Run following scripts
SQL> @D:\oracle\product\10.2.0\db_1\RDBMS\ADMIN\catalog.sql
SQL> @D:\oracle\product\10.2.0\db_1\RDBMS\ADMIN\catproc.sql
SQL> @D:\oracle\product\10.2.0\db_1\sqlplus\admin\pupbld.sql


Step 7: Test DB ( some admin task)
Create the service for your newly created db in tnsnames.ora and access via toad or sqlplus for your testing.
SQL> create tablespace myts_on_ASM datafile '+DB_DATA' size 200M

Note: if you are on linux skip step 4 as there is no oradim for linux , other steps are same.

Create ASM Instance(Manually) on Windows

Automatic Storage Management (ASM) is an integrated file system and volume manager expressly built for Oracle database files. ASM provides the performance of raw I/O with the easy management of a file system. It simplifies database administration by eliminating the need for you to directly manage potentially thousands of Oracle database files. It does this by enabling you to divide all available storage into disk groups. You manage a small set of disk groups and ASM automates the placement of the database files within those disk groups.

Resetting Listener Log without stopping Database

Often it is required to reset the listener log when it grows too much like more than 2G, as this log is being used by the instance all the time you can not delete. By doing the following you can achieve your purpose to reset the listener log.

C:\Documents and Settings\inam>lsnrctl

LSNRCTL for 32-bit Windows: Version 10.2.0.1.0 - Production on 01-AUG-2010 10:33:31

Copyright (c) 1991, 2005, Oracle.  All rights reserved.

Welcome to LSNRCTL, type "help" for information.

LSNRCTL> SET CURRENT_LISTENER LISTENER
Current Listener is LISTENER

LSNRCTL> SET LOG_FILE TEMP_LISTENER.LOG
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=srv2.domain)(PORT=1521)))
LISTENER parameter "log_file" set to temp_listener.log
The command completed successfully

LSNRCTL> SET LOG_FILE LISTENER.LOG
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=srv2.domain)(PORT=1521)))
LISTENER parameter "log_file" set to listener.log
The command completed successfully
LSNRCTL>

Map a FTP site to a Drive letter in Windows


The easiest way to access files and folders on a FTP server as windows drive letter, is to install the NetDrive and configure it for your FTP server.  Now you can view your folder and files on FTP as normal windows folders.
NetDrive can be downloaded from here



Sunday, November 28, 2010

Remove the local Streams configuration

Connect as sysadmin on the source and capture site eg; HOMEDEV & ASMDB and execute the following.

SELECT propagation_name FROM dba_propagation; -- get propagation if existing

exec dbms_propagation_adm.drop_propagation('PROPAGATION$_61'); -- parameter value from query above.

exec dbms_streams_adm.remove_streams_configuration;

Related Posts:
Streams 10gR2 - How to
One-Way SCHEMA Level Streams Replication

One-Way SCHEMA Level Streams Replication

In a nutshell, replication using Oracle Streams is implemented in the following way:
1.-A background capture process is configured to capture changes made to tables,schemas, or the entire database. The capture process captures changes from the redo log and formats each captured change into a logical change record (LCR). The capture process uses logminer to mine the redo/archive logs to format LCRs.
2.-The capture process enqueues LCR events into a queue that is specified.
3.-This queue is scheduled to Propagate events from one queue to another in a different database.
4.-A background apply process dequeues the events and applies them at the destination database.
For Streams overview & required configurations before using it please see Streams 10gR2 - How to

Please setup you environment , I've setup my environment as following, keep this info in your mind while doing the steps:
 HOMEDEV Global Database name of the Source (capture) Site
 ASMDB   Global Database name of the Target (apply) Site


 On HOMEDEV  (SOURCE/CAPTURE)
Create the user for stream administration
       conn sys/homedev@homedev as sysdba
       create user STRMADMIN identified by STRMADMIN
       ALTER USER STRMADMIN DEFAULT TABLESPACE USERS
       TEMPORARY TABLESPACE TEMP
       QUOTA UNLIMITED ON USERS;
      GRANT CONNECT, RESOURCE, AQ_ADMINISTRATOR_ROLE,DBA to STRMADMIN;
      execute DBMS_STREAMS_AUTH.GRANT_ADMIN_PRIVILEGE('STRMADMIN');

      SELECT * FROM global_name;
      HOMEDEV.REGRESS.RDBMS.DEV.US.ORACLE.COM

 On ASMDB  (TARGET/APPLY)
   create user STRMADMIN identified by STRMADMIN

    create tablespace users datafile '+DB_DATA/asmdb/datafile/USERS.dbf' size 200M

    create tablespace EXAMPLE datafile '+DB_DATA/asmdb/datafile/EXAMPLE.dbf' size 200M

    ALTER USER STRMADMIN DEFAULT TABLESPACE USERS
    TEMPORARY TABLESPACE TEMP
    QUOTA UNLIMITED ON USERS;

    GRANT CONNECT, RESOURCE, AQ_ADMINISTRATOR_ROLE,DBA to STRMADMIN;

    execute DBMS_STREAMS_AUTH.GRANT_ADMIN_PRIVILEGE('STRMADMIN');
    
    ALTER DATABASE RENAME GLOBAL_NAME TO   
    ASMDB.REGRESS.RDBMS.DEV.US.ORACLE.COM


/* STEP 1.- Create the streams queue and the database links that will be used for propagation. */
        connect STRMADMIN/STRMADMIN@HOMEDEV

        BEGIN
            DBMS_STREAMS_ADM.SET_UP_QUEUE(
            queue_table => 'STREAMS_QUEUE_TABLE',
            queue_name  => 'STREAMS_QUEUE',
            queue_user  => 'STRMADMIN');
       END;
      /

     conn sys/homedev@homedev as sysdba 

     create public database link ASMDB.REGRESS.RDBMS.DEV.US.ORACLE.COM using 'ASMDB';

    connect STRMADMIN/STRMADMIN@HOMEDEV

    create database link ASMDB.REGRESS.RDBMS.DEV.US.ORACLE.COM connect to strmadmin
     identified by strmadmin;
/* STEP 2.- Connect as the Streams Administrator in the target site strm2.net and create the streams queue */
    connect STRMADMIN/STRMADMIN@ASMDB
   BEGIN
     DBMS_STREAMS_ADM.SET_UP_QUEUE(
     queue_table => 'STREAMS_QUEUE_TABLE',
     queue_name  => 'STREAMS_QUEUE',
     queue_user  => 'STRMADMIN');
  END;
  /

/* STEP 3.- Add apply rules for the Schema at the destination database  */
BEGIN
   DBMS_STREAMS_ADM.ADD_SCHEMA_RULES(
     schema_name     => 'HR',
     streams_type    => 'APPLY ',
     streams_name    => 'STREAM_APPLY',
     queue_name      => 'STRMADMIN.STREAMS_QUEUE',
     include_dml     => true,
     include_ddl     => true,
     source_database => 'HOMEDEV.REGRESS.RDBMS.DEV.US.ORACLE.COM');
END;

/* STEP 4.- Add capture rules for the schema HR at the source database */
CONN STRMADMIN/STRMADMIN@HOMEDEV
BEGIN
  DBMS_STREAMS_ADM.ADD_SCHEMA_RULES(
    schema_name     => 'HR',
    streams_type    => 'CAPTURE',
    streams_name    => 'STREAM_CAPTURE',
    queue_name      => 'STRMADMIN.STREAMS_QUEUE',
    include_dml     => true,
    include_ddl     => true,
    source_database => 'HOMEDEV.REGRESS.RDBMS.DEV.US.ORACLE.COM');
END;

/* STEP 5.- Add propagation rules for the schema HR at the source database. This step will also create a propagation job to the destination database */
BEGIN
   DBMS_STREAMS_ADM.ADD_SCHEMA_PROPAGATION_RULES(
     schema_name            => 'HR',
     streams_name           => 'STREAM_PROPAGATE',
     source_queue_name      => 'STRMADMIN.STREAMS_QUEUE',
     destination_queue_name => 'STRMADMIN.STREAMS_QUEUE@ASMDB.REGRESS.RDBMS.DEV.US.ORACLE.COM',
     include_dml            => true,
     include_ddl            => true,
     source_database        => 'HOMEDEV.REGRESS.RDBMS.DEV.US.ORACLE.COM');
END;

/* STEP 6.- Export, import and instantiation of tables from Source to Destination Database; if the objects are not present in the destination database, perform an export of the objects from the source database and import them into the destination database
Export from the Source Database:
Specify the OBJECT_CONSISTENT=Y clause on the export command.
By doing this, an export is performed that is consistent for each individual object at a particular system change number (SCN).  */
D:\Home_Backup\STREAMTEST_EXP>exp userid=system/manager@homedev owner=HR file=hr.dmp log=hr_exp.log object_consistent=Y statisti
=NONE

/* Import into the Destination Database:
Specify STREAMS_INSTANTIATION=Y clause in the import command.
By doing this, the streams metadata is updated with the appropriate information in the destination database corresponding to the SCN that is recorded in the export file  */
D:\Home_Backup\STREAMTEST_EXP>imp userid=system/manager@asmdb full=Y constraints=Y file=hr.dmp ignore=y commit=y log=hr_imp.log st
reams_instantiation=y

/* STEP 7.- Specify an 'APPLY USER' at the destination database.
This is the user who would apply all statements and DDL statements.
The user specified in the APPLY_USER parameter must have the necessary privileges to perform DML and DDL changes on the apply objects. */
conn strmadmin/strmadmin@asmdb

BEGIN
  DBMS_APPLY_ADM.ALTER_APPLY(
    apply_name => 'STREAM_APPLY',
    apply_user => 'HR');
END;

/
/* STEP 8.- Set stop_on_error to false so apply does not abort for every error; then, start the Apply process on the destination */
conn strmadmin/strmadmin@asmdb
 

BEGIN
  DBMS_APPLY_ADM.SET_PARAMETER(
    apply_name => 'STREAM_APPLY',
    parameter  => 'disable_on_error',
    value      => 'n');
END;
/
DECLARE
   v_started number;
BEGIN
   SELECT decode(status, 'ENABLED', 1, 0) INTO v_started
   FROM DBA_APPLY WHERE APPLY_NAME = 'STREAM_APPLY';
   if (v_started = 0) then
      DBMS_APPLY_ADM.START_APPLY(apply_name => 'STREAM_APPLY');
   end if;
END;
/

/* STEP 9.- Set up capture to retain 7 days worth of logminer checkpoint information, then start the Capture process on the source */

conn strmadmin/strmadmin@homedev

BEGIN
  DBMS_CAPTURE_ADM.ALTER_CAPTURE(
    capture_name              => 'STREAM_CAPTURE',
    checkpoint_retention_time => 7);
END;
/

begin
  DBMS_CAPTURE_ADM.START_CAPTURE(capture_name => 'STREAM_CAPTURE');
end;
/
/* Perform changes in tables belonging to HR on the source site and check that these are applied on the destination */

conn HR/HR@homedev
insert into HR.DEPARTMENTS values (991,'OTHER',205,1700);
commit;
alter table HR.EMPLOYEES add (NEWCOL VARCHAR2(10));
create table hr.t(id number)

Related Posts:
Streams 10gR2 - How to
Remove the local Streams configuration 

Access ASM Disk files through FTP and HTTP (Oracle Databse10g/11g)

XDB configurations enable the possibility to use FTP/HTTP from an ftp and HTTP session on unix or through a browser on Windows.
Files can be easily moved in/out from ASM in this way.
Step 1: Install XDB Schema
        1.1 Connect as sysdba and run the catqm.sql script. Maintain a spool of the script running:
              UNIX: $ORACLE_HOME/rdbms/admin subdirectory
              WINDOWS: $ORACLE_HOME\rdbms\admin subdirectory
             The catqm.sql script requires the following parameters be passed to it when run:
             A. XDB user password
             B. XDB user default tablespace (You can use any tablespace other than system undo and
             temp. This   tablespace has to exist prior to running the script.)
            C. XDB user temporary tablespace
            Therefore the syntax to run catqm.sql will be:
            SQL>@catqm.sql A B C

            For Example:
            SQL> set echo on
            SQL>spool xdb_install.log
            SQL>;@?/rdbms/admin/catqm.sql XDB XDB TEMP
       1.2 If the following line is not already apart of the database system parameters (init.ora/spfile).
            NOTE: PLEASE REPLACE ,instanceid1,2 etc with your actual values
            a. Non-RAC
           dispatchers="(PROTOCOL=TCP) (SERVICE=XDB)" eg; "(PROTOCOL=TCP)
           (SERVICE=ASMDBXDB)" for my testing
            b. RAC
            instanceid1.dispatchers="(PROTOCOL=TCP) (SERVICE=XDB)"
             instanceid2.dispatchers="(PROTOCOL=TCP) (SERVICE=XDB)"
            c.If you are not using the default Listener ensure you have set LOCAL_LISTENER in the
              (init.ora/spfile)
            as prescribed for RAC/NON-RAC instances or the end points will not register.

       1.3 Check for any invalid XDB owned objects:
            SQL> select count(*) from dba_objects
                       where owner='XDB' and status='INVALID';
                       COUNT(*)
                        ----------
                         0
       1.4 Check DBA_REGISTRY for XDB status:
             SQL> select comp_name, status, version from DBA_REGISTRY where comp_name='Oracle
                        XML Database'
              The results should indicate the correct version and patch in a valid status.

              Note: If something goes bad see the Note:243554.1 for details.
Step 2: Configure the FTP and HTTP ports of XDB :
        connect / as sysdba
        execute dbms_xdb.sethttpport(8080);
        execute dbms_xdb.setftpport(2100);
        commit;

Step 3: Restart the database and the listener:
        sqlplus '/ as sysdba'
        shutdown immediate
        startup
        lsnrctl stop
        lsnrctl start

Step 4: Check the listener status, you will notice that the following listening endpoints were automatically registered with your listener
        (DESCRIPTION =(ADDRESS = (PROTOCOL = tcp)(HOST = SRV2)(PORT = 2100))
        (Presentation = FTP)(Session = RAW))
        (DESCRIPTION = (ADDRESS = (PROTOCOL = tcp)(HOST = SRV2)(PORT = 8080))
        (Presentation = HTTP)(Session = RAW))

Step 5: Connect to the ftp as follows:
        C:\Documents and Settings\inam> ftp -n
        C:\Documents and Settings\inam>open SRV2 2100
        C:\Documents and Settings\inam>user system
        C:\Documents and Settings\inam>cd sys
        C:\Documents and Settings\inam>cd asm
        Note: SRV2 is the machine where Oracle DB is running, system is the database user, sys and asm are folder which you are accessing.
        You can access via browser also by hitting like ftp://srv2:2100/. If you click on files you will get the option to save it on your
        desired location. Try any ftp client like FileZilla and you will be able to navigate through ASM directories and drag and drop files
        in and out of ASM.

Step 6: Connect via HTTP
        In IE hit http://srv2:8080/sys/asm, you will be prompted for the user and password , provide system as username with its password. 


Using Windows XP
To use the Add Network Place Wizard to add a shortcut to your computer that allows you to upload and access files in Resources or Drop Box using WebDAV:
  1. On the desktop, double-click My Network Places.

  2. In the "Network Tasks" pane, click Add a network place.

  3. On the welcome screen, click Next.

  4. Select Choose another network location, and then click Next.

  5. In the "Internet or network address:" field, enter a URL that points to the destination Resources or Drop Box tool. For example ftp://srv2:2100/sys/asm/DB_DATA/ASMDB
You will see the files in explorer and you can use the standard copy/paste operations.
FileZilla client is being shown to see asm diskgroups with files copied on local drive.

Accessing asm diskgroups using IE through FTP



Accessing asm diskgroups by WebFolder (WebDav)
Accessing asm diskgroups using IE through HTTP

For 11g
XDB is by default available but you need to set the HTTP and FTP ports

  1* select comp_name, status, version from DBA_REGISTRY where comp_name='Oracle XML Database'
SQL> /

COMP_NAME
--------------------------------------------------------------------------------
STATUS      VERSION
----------- ------------------------------
Oracle XML Database
VALID       11.2.0.3.0
SQL> select DBMS_XDB.GETHTTPPORT from dual;
GETHTTPPORT
-----------
          0
SQL> select DBMS_XDB.GETFTPPORT from dual;
GETFTPPORT
----------
         0
SQL> execute dbms_xdb.sethttpport(8080);
PL/SQL procedure successfully completed.
SQL> execute dbms_xdb.setftpport(2100);
PL/SQL procedure successfully completed.
SQL> commit;
Commit complete.
SQL>


Check the listener status after setting ports


Perform other steps to work with XDB as mentioned above. 
Note: If you face any issue while connecting throgh Filezilla then try Active connection instead of Passive using Edit->Settings in Filezilla